Class ModifyDialogTabPage.Preference
java.lang.Object
java.util.Observable
org.eclipse.m2m.atl.adt.ui.preferences.ModifyDialogTabPage.Preference
- Direct Known Subclasses:
ModifyDialogTabPage.ButtonPreference
,ModifyDialogTabPage.ComboPreference
,ModifyDialogTabPage.NumberPreference
,ModifyDialogTabPage.StringPreference
- Enclosing class:
- ModifyDialogTabPage
The base class of all Preference classes. A preference class provides a wrapper around one or more SWT
widgets and handles the input of values for some key. On each change, the new value is written to the
map and the listeners are notified.
-
Constructor Summary
ConstructorDescriptionPreference
(Map<String, String> preferences, String key) Create a new Preference. -
Method Summary
Modifier and TypeMethodDescriptionabstract org.eclipse.swt.widgets.Control
Returns the main control of a preference, which is mainly used to manage the focus.final boolean
final String
getKey()
final void
setEnabled
(boolean enabled) Set the enabled state of all SWT widgets of this preference.final void
Set the key which is used to store the value.protected abstract void
To be implemented in subclasses.Methods inherited from class java.util.Observable
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged
-
Constructor Details
-
Preference
Create a new Preference.- Parameters:
preferences
- The map where the value is written.key
- The key for which a value is managed.
-
-
Method Details
-
getPreferences
- Returns:
- Gets the map of this Preference.
-
setEnabled
public final void setEnabled(boolean enabled) Set the enabled state of all SWT widgets of this preference.- Parameters:
enabled
- new value
-
getEnabled
public final boolean getEnabled()- Returns:
- Gets the enabled state of all SWT widgets of this Preference.
-
setKey
Set the key which is used to store the value.- Parameters:
key
- New value
-
getKey
- Returns:
- Gets the currently used key which is used to store the value.
-
getControl
public abstract org.eclipse.swt.widgets.Control getControl()Returns the main control of a preference, which is mainly used to manage the focus. This may benull
if the preference doesn't have a control which is able to have the focus.- Returns:
- The main control
-
updateWidget
protected abstract void updateWidget()To be implemented in subclasses. Update the SWT widgets when the state of this object has changed (enabled, key, ...).
-