g-Eclipse
Release 1.0.0

eu.geclipse.ui.widgets
Class StoredCombo

java.lang.Object
  extended by Combo
      extended by eu.geclipse.ui.widgets.StoredCombo

public class StoredCombo
extends Combo

The StoredCombo is a extension of the org.eclipse.swt.widgets.Combo that provides functionality for storing the entered values in a preference store and restoring these values the next time a StoredCombo is initialized with the same preference ID.


Constructor Summary
StoredCombo(Composite parent, int style)
          Construct a new StoredCombo.
 
Method Summary
 void addUnique(java.lang.String newEntry)
          Adds the given entry to the combo list if it doesn't exist yet.
 void purgeAll()
          Removes all entries form the combo list and empties the IPreferenceStore.
 boolean setDefaultItem(java.lang.String defaultItem)
          Set the item that is displayed as default.
 void setPreferences(IPreferenceStore preferenceStore, java.lang.String preferenceID)
          Set the preferences of this StoredCombo.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StoredCombo

public StoredCombo(Composite parent,
                   int style)
Construct a new StoredCombo.

Parameters:
parent - The parent of this StoredCombo.
style - The style of this StoredCombo.
Method Detail

setPreferences

public void setPreferences(IPreferenceStore preferenceStore,
                           java.lang.String preferenceID)
Set the preferences of this StoredCombo. This method initialises the Combo with the values that were found in the specified preference store with the help of the specified ID.

Parameters:
preferenceStore - The preference store to query for the initial settings. This preference store is also used to store the values when the combo is disposed.
preferenceID -

setDefaultItem

public boolean setDefaultItem(java.lang.String defaultItem)
Set the item that is displayed as default. The item is tested for validity (with the isValidItem() method), and if invalid it is ignored and not set as default. This method returns true if the item was set successfully as default.

Parameters:
defaultItem - The item that should be set as default.
Returns:
true if the item is valid and could be set as default, false otherwise.

addUnique

public void addUnique(java.lang.String newEntry)
Adds the given entry to the combo list if it doesn't exist yet. No changes are performed if the entry is already in the list.

Parameters:
newEntry - the new entry to add to the combo list.

purgeAll

public void purgeAll()
Removes all entries form the combo list and empties the IPreferenceStore.


g-Eclipse
Release 1.0.0