Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 2f7e9d3d1fb570a686a42dfe7722aa6cd60f81b7 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
/*******************************************************************************
 * Copyright (c) 2011, 2013 Wind River Systems, Inc. and others. All rights reserved.
 * This program and the accompanying materials are made available under the terms
 * of the Eclipse Public License v1.0 which accompanies this distribution, and is
 * available at http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 * Wind River Systems - initial API and implementation
 *******************************************************************************/
package org.eclipse.tcf.te.ui.terminals.interfaces;

import java.util.Map;

import org.eclipse.jface.dialogs.IDialogSettings;
import org.eclipse.jface.dialogs.IMessageProvider;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.ui.forms.widgets.FormToolkit;

/**
 * Terminal launcher configuration panel.
 */
public interface IConfigurationPanel extends IMessageProvider {

	/**
	 * Returns the configuration panel container.
	 *
	 * @return The configuration panel container or <code>null</code>.
	 */
	public IConfigurationPanelContainer getContainer();

	/**
	 * Creates the terminal launcher configuration panel UI elements within the
	 * given parent composite. Terminal launcher configuration panels should always
	 * create another composite within the given composite, which is the panel top
	 * control. The top control is queried later from the stack layout to show the
	 * different panels if the selected terminal launcher changed.
	 *
	 * @param parent The parent composite to create the UI elements in. Must not be <code>null</code>.
	 * @param toolkit The form toolkit. Must not be <code>null</code>.
	 */
	public void setupPanel(Composite parent, FormToolkit toolkit);

	/**
	 * Cleanup all resources the wizard configuration panel might have been created.
	 */
	public void dispose();

	/**
	 * Returns the terminal launcher configuration panels top control, typically a
	 * composite control. This control is requested every time the stack layout is
	 * required to set a new top control because the selected terminal launcher changed.
	 *
	 * @return The top control or <code>null</code> if the configuration panel has been not setup yet.
	 */
	public Composite getControl();

	/**
	 * Validates the control and sets the message text and type so the parent
	 * page or control is able to display validation result informations.
	 * The default implementation of this method does nothing.
	 *
	 * @return Result of validation.
	 */
	public boolean isValid();

	/**
	 * Restore the widget values plain from the given dialog settings. This method should
	 * not fragment the given dialog settings any further.
	 *
	 * @param settings The dialog settings to restore the widget values from. Must not be <code>null</code>!
	 * @param idPrefix The prefix to use for every dialog settings slot keys. If <code>null</code>, the dialog settings slot keys are not to prefix.
	 */
	public void doRestoreWidgetValues(IDialogSettings settings, String idPrefix);

	/**
	 * Save the widget values plain to the given dialog settings. This method should
	 * not fragment the given dialog settings any further.
	 *
	 * @param settings The dialog settings to save the widget values to. Must not be <code>null</code>!
	 * @param idPrefix The prefix to use for every dialog settings slot keys. If <code>null</code>, the dialog settings slot keys are not to prefix.
	 */
	public void doSaveWidgetValues(IDialogSettings settings, String idPrefix);

	/**
	 * Enables or disables all UI elements belonging to the wizard configuration panel.
	 *
	 * @param enabled <code>True</code> to enable the UI elements, <code>false</code> otherwise.
	 */
	public void setEnabled(boolean enabled);

	/**
	 * Called when the panel gets the active panel.
	 */
	public void activate();

	/**
	 * Initialize the widgets based of the data from the given map.
	 * <p>
	 * This method may called multiple times during the lifetime of the panel and the given
	 * map might be even <code>null</code>.
	 *
	 * @param data The map or <code>null</code>.
	 */
	public void setupData(Map<String, Object> data);

	/**
	 * Extract the data from the widgets and write it back to the given map.
	 * <p>
	 * This method may called multiple times during the lifetime of the panel and the given
	 * map might be even <code>null</code>.
	 *
	 * @param data The map or <code>null</code>.
	 */
	public void extractData(Map<String, Object> data);

	/**
	 * Update the data from the given properties container which contains the current
	 * working data.
	 * <p>
	 * This method may called multiple times during the lifetime of the panel and the given
	 * map might be even <code>null</code>.
	 *
	 * @param data The map or <code>null</code>.
	 */
	public void updateData(Map<String, Object> data);

	/**
	 * Set the selection to the terminal launcher configuration panel.
	 *
	 * @param selection The selection or <code>null</code>.
	 */
	public void setSelection(ISelection selection);

	/**
	 * Returns the selection associated with the terminal launcher configuration panel.
	 *
	 * @return The selection or <code>null</code>.
	 */
	public ISelection getSelection();
}

Back to the top