|
Eclipse GEF 3.2 |
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.eclipse.gef.ui.palette.DefaultPaletteViewerPreferences
This is the default implementation for PaletteViewerPreferences. It uses a single IPreferenceStore to load and save the palette viewer settings.
It is recommended that the default constructor be used (which will use the preference
store in the GEF plugin) as that will cause the preferences to be shared across
different types of editors. If the client does not wish to share one of the existing
preferences for their editor (say the auto-collapse setting), they will have to
sub-class this class and override the necessary methods (in this case, getAutoCollapseSetting() and setAutoCollapseSetting(int)) and save that
preference in some other preference store. Sub-classes can add newer preferences to
the store by using getPreferenceStore().
| Field Summary |
| Fields inherited from interface org.eclipse.gef.ui.palette.PaletteViewerPreferences |
COLLAPSE_ALWAYS, COLLAPSE_AS_NEEDED, COLLAPSE_NEVER, LAYOUT_COLUMNS, LAYOUT_DETAILS, LAYOUT_FOLDER, LAYOUT_ICONS, LAYOUT_LIST, PREFERENCE_AUTO_COLLAPSE, PREFERENCE_COLUMNS_ICON_SIZE, PREFERENCE_DETAILS_ICON_SIZE, PREFERENCE_FOLDER_ICON_SIZE, PREFERENCE_FONT, PREFERENCE_ICONS_ICON_SIZE, PREFERENCE_LAYOUT, PREFERENCE_LIST_ICON_SIZE |
| Constructor Summary | |
DefaultPaletteViewerPreferences()
Default Constructor Uses the GEF Plugin's IPreferenceStore to store the preferences. |
|
DefaultPaletteViewerPreferences(IPreferenceStore store)
Constructor |
|
| Method Summary | |
void |
addPropertyChangeListener(PropertyChangeListener listener)
NOTE: The oldValue field of the PropertyChangeEvent used to
notify listeners will always be null. |
static String |
convertLayoutToPreferenceName(int layout)
This is a convenience method that converts the given layout mode to the matching preference name. |
static int |
convertPreferenceNameToLayout(String preference)
This convenience method converts the given preference to the matching layout mode. |
protected void |
firePropertyChanged(String property,
Object newVal)
The oldValue of the PropertyChangeEvent that is fired will always be null. |
int |
getAutoCollapseSetting()
Returns the current auto-collapse setting. |
FontData |
getFontData()
|
int |
getLayoutSetting()
Returns the current layout setting. |
protected IPreferenceStore |
getPreferenceStore()
|
int[] |
getSupportedLayoutModes()
Returns the layout modes that are supported. |
protected void |
handlePreferenceStorePropertyChanged(String property)
This method is invoked when the preference store fires a property change. |
boolean |
isSupportedLayoutMode(int layout)
This is a convenience method. |
void |
removePropertyChangeListener(PropertyChangeListener listener)
|
void |
setAutoCollapseSetting(int newVal)
Sets the auto-collapse setting. |
void |
setCurrentUseLargeIcons(boolean newVal)
Sets the "Use Large Icons" option for the currently active layout. |
void |
setFontData(FontData data)
Sets the FontData for the palette. |
void |
setLayoutSetting(int newVal)
Sets the given setting as the current layout. |
void |
setSupportedLayoutModes(int[] modes)
NOTE: Restricting the layout modes here does not in any way restrict those values from being stored in the preference store. |
void |
setUseLargeIcons(int layout,
boolean newVal)
Sets the "Use Large Icons" option for the given layout. |
boolean |
useLargeIcons()
|
boolean |
useLargeIcons(int layout)
Indicated whether large icons should be used with the given layout mode. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public DefaultPaletteViewerPreferences()
Uses the GEF Plugin's IPreferenceStore to store the preferences.
public DefaultPaletteViewerPreferences(IPreferenceStore store)
store - The IPreferenceStore where the settings are to be saved.| Method Detail |
public void addPropertyChangeListener(PropertyChangeListener listener)
oldValue field of the PropertyChangeEvent used to
notify listeners will always be null.
addPropertyChangeListener in interface PaletteViewerPreferenceslistener - the PropertyChangeListener to be notified of changesPaletteViewerPreferences.addPropertyChangeListener(
PropertyChangeListener)public static String convertLayoutToPreferenceName(int layout)
layout - LAYOUT_LIST, LAYOUT_DETAILS, LAYOUT_COLUMNS, or LAYOUT_ICONS
public static int convertPreferenceNameToLayout(String preference)
preference - PREFERENCE_DETAILS_ICON_SIZE, PREFERENCE_COLUMNS_ICON_SIZE,
PREFERENCE_ICONS_ICON_SIZE or PREFERENCE_LIST_ICON_SIZE
protected void firePropertyChanged(String property,
Object newVal)
null.
property - The programmatic name of the property that was changednewVal - The new value of the propertyPropertyChangeSupport.firePropertyChange(java.lang.String,
java.lang.Object,
java.lang.Object)public int getAutoCollapseSetting()
PaletteViewerPreferencesPossible values returned:
getAutoCollapseSetting in interface PaletteViewerPreferencesPaletteViewerPreferences.getAutoCollapseSetting()public FontData getFontData()
getFontData in interface PaletteViewerPreferencesPaletteViewerPreferences.getFontData()public int getLayoutSetting()
PaletteViewerPreferencesPossible values returned:
getLayoutSetting in interface PaletteViewerPreferencesPaletteViewerPreferences.getLayoutSetting()public int[] getSupportedLayoutModes()
PaletteViewerPreferences
getSupportedLayoutModes in interface PaletteViewerPreferencesPaletteViewerPreferences.getSupportedLayoutModes()protected void handlePreferenceStorePropertyChanged(String property)
property - The property String used for the change fired by the preference
storeprotected IPreferenceStore getPreferenceStore()
public boolean isSupportedLayoutMode(int layout)
PaletteViewerPreferences
isSupportedLayoutMode in interface PaletteViewerPreferenceslayout - LAYOUT_COLUMNS, LAYOUT_LIST, LAYOUT_ICONS, or LAYOUT_DETAILS
true if the given layout is a supported modePaletteViewerPreferences.isSupportedLayoutMode(int)public void removePropertyChangeListener(PropertyChangeListener listener)
removePropertyChangeListener in interface PaletteViewerPreferenceslistener - the PropertyChangeListener that should not be notified hereafterPaletteViewerPreferences.removePropertyChangeListener(
PropertyChangeListener)public void setAutoCollapseSetting(int newVal)
PaletteViewerPreferencesPossible values:
setAutoCollapseSetting in interface PaletteViewerPreferencesnewVal - One of the above-mentioned constantsPaletteViewerPreferences.setAutoCollapseSetting(int)public void setFontData(FontData data)
PaletteViewerPreferences
setFontData in interface PaletteViewerPreferencesdata - The FontData for the font to be used in the palettePaletteViewerPreferences.setFontData(FontData)public void setLayoutSetting(int newVal)
PaletteViewerPreferencesPossible values:
setLayoutSetting in interface PaletteViewerPreferencesnewVal - One of the above-mentioned constantsPaletteViewerPreferences.setLayoutSetting(int)public void setCurrentUseLargeIcons(boolean newVal)
PaletteViewerPreferences
setCurrentUseLargeIcons in interface PaletteViewerPreferencesnewVal - true if large icons are to be used with the current layout
settingPaletteViewerPreferences.setCurrentUseLargeIcons(
boolean)public void setSupportedLayoutModes(int[] modes)
setSupportedLayoutModes in interface PaletteViewerPreferencesmodes - an array of layout modes desiredPaletteViewerPreferences.setSupportedLayoutModes(int[])
public void setUseLargeIcons(int layout,
boolean newVal)
PaletteViewerPreferencestruefalsetruefalse
setUseLargeIcons in interface PaletteViewerPreferenceslayout - any of the above-mentioned constantsnewVal - true if large icons are to be used with the given layoutPaletteViewerPreferences.setUseLargeIcons(int, boolean)public boolean useLargeIcons(int layout)
PaletteViewerPreferencestruefalsetruefalse
useLargeIcons in interface PaletteViewerPreferenceslayout - any of the above-mentioned constants
true if large icons are to be used with the given layoutPaletteViewerPreferences.useLargeIcons(int)public boolean useLargeIcons()
useLargeIcons in interface PaletteViewerPreferencestrue if large icons are to be used with the currently active
layoutPaletteViewerPreferences.useLargeIcons()
|
Eclipse GEF 3.2 |
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||