Class DefaultPaletteViewerPreferences
- All Implemented Interfaces:
- PaletteViewerPreferences
 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 SummaryFields inherited from interface org.eclipse.gef.ui.palette.PaletteViewerPreferencesCOLLAPSE_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, PREFERENCE_SCROLLBARS_MODE
- 
Constructor SummaryConstructorsConstructorDescriptionDefault ConstructorConstructor
- 
Method SummaryModifier and TypeMethodDescriptionvoidNOTE: TheoldValuefield of thePropertyChangeEventused to notify listeners will always benull.static StringconvertLayoutToPreferenceName(int layout) This is a convenience method that converts the given layout mode to the matching preference name.static intconvertPreferenceNameToLayout(String preference) This convenience method converts the given preference to the matching layout mode.protected voidfirePropertyChanged(String property, Object newVal) The oldValue of the PropertyChangeEvent that is fired will always benull.intReturns the current auto-collapse setting.intReturns the current layout setting.protected IPreferenceStoreintReturns whether overlay scrolling is enabled for the palette viewer .int[]Returns the layout modes that are supported.protected voidhandlePreferenceStorePropertyChanged(String property) This method is invoked when the preference store fires a property change.booleanisSupportedLayoutMode(int layout) This is a convenience method.voidvoidsetAutoCollapseSetting(int newVal) Sets the auto-collapse setting.voidsetCurrentUseLargeIcons(boolean newVal) Sets the "Use Large Icons" option for the currently active layout.voidsetFontData(FontData data) Sets the FontData for the palette.voidsetLayoutSetting(int newVal) Sets the given setting as the current layout.voidsetScrollbarsMode(int mode) Enables or disables overlay scrolling for the palette viewer.voidsetSupportedLayoutModes(int[] modes) NOTE: Restricting the layout modes here does not in any way restrict those values from being stored in the preference store.voidsetUseLargeIcons(int layout, boolean newVal) Sets the "Use Large Icons" option for the given layout.booleanbooleanuseLargeIcons(int layout) Indicated whether large icons should be used with the given layout mode.
- 
Constructor Details- 
DefaultPaletteViewerPreferencespublic DefaultPaletteViewerPreferences()Default ConstructorUses the GEF Plugin's IPreferenceStore to store the preferences. 
- 
DefaultPaletteViewerPreferencesConstructor- Parameters:
- store- The IPreferenceStore where the settings are to be saved.
 
 
- 
- 
Method Details- 
addPropertyChangeListenerNOTE: TheoldValuefield of thePropertyChangeEventused to notify listeners will always benull.- Specified by:
- addPropertyChangeListenerin interface- PaletteViewerPreferences
- Parameters:
- listener- the PropertyChangeListener to be notified of changes
- See Also:
 
- 
convertLayoutToPreferenceNameThis is a convenience method that converts the given layout mode to the matching preference name.- int ↔ String
- LAYOUT_LIST ↔ PREFERENCE_LIST_ICON_SIZE
- LAYOUT_COLUMNS ↔ PREFERENCE_COLUMNS_ICON_SIZE
- LAYOUT_ICONS ↔ PREFERENCE_ICONS_ICON_SIZE
- LAYOUT_DETAILS ↔ PREFERENCE_DETAILS_ICON_SIZE
 - Parameters:
- layout- LAYOUT_LIST, LAYOUT_DETAILS, LAYOUT_COLUMNS, or LAYOUT_ICONS
- Returns:
- The corresponding preference String
 
- 
convertPreferenceNameToLayoutThis convenience method converts the given preference to the matching layout mode.- int ↔ String
- LAYOUT_LIST ↔ PREFERENCE_LIST_ICON_SIZE
- LAYOUT_COLUMNS ↔ PREFERENCE_COLUMNS_ICON_SIZE
- LAYOUT_ICONS ↔ PREFERENCE_ICONS_ICON_SIZE
- LAYOUT_DETAILS ↔ PREFERENCE_DETAILS_ICON_SIZE
 - Parameters:
- preference- PREFERENCE_DETAILS_ICON_SIZE, PREFERENCE_COLUMNS_ICON_SIZE, PREFERENCE_ICONS_ICON_SIZE or PREFERENCE_LIST_ICON_SIZE
- Returns:
- The corresponding layout code
 
- 
firePropertyChangedThe oldValue of the PropertyChangeEvent that is fired will always benull.- Parameters:
- property- The programmatic name of the property that was changed
- newVal- The new value of the property
- See Also:
 
- 
getAutoCollapseSettingpublic int getAutoCollapseSetting()Description copied from interface:PaletteViewerPreferencesReturns the current auto-collapse setting.Possible values returned: - COLLAPSE_ALWAYS (Always collapse)
- COLLAPSE_AS_NEEDED (Collapse when needed)
- COLLAPSE_NEVER (Never collapse)
 - Specified by:
- getAutoCollapseSettingin interface- PaletteViewerPreferences
- Returns:
- One of the above-mentioned constants
- See Also:
 
- 
getFontData- Specified by:
- getFontDatain interface- PaletteViewerPreferences
- Returns:
- The FontData for the font to be used in the palette.
- See Also:
 
- 
getLayoutSettingpublic int getLayoutSetting()Description copied from interface:PaletteViewerPreferencesReturns the current layout setting.Possible values returned: - LAYOUT_COLUMNS (columns View)
- LAYOUT_LIST (List View)
- LAYOUT_ICONS (Icons Only View)
- LAYOUT_DETAILS (Details View)
 - Specified by:
- getLayoutSettingin interface- PaletteViewerPreferences
- Returns:
- One of the above-mentioned constants
- See Also:
 
- 
getSupportedLayoutModespublic int[] getSupportedLayoutModes()Description copied from interface:PaletteViewerPreferencesReturns the layout modes that are supported. All four layout modes -- LAYOUT_COLUMNS, LAYOUT_LIST, LAYOUT_ICONS, LAYOUT_DETAILS -- are supported by default.- Specified by:
- getSupportedLayoutModesin interface- PaletteViewerPreferences
- Returns:
- The layout modes that are supported
- See Also:
 
- 
handlePreferenceStorePropertyChangedThis method is invoked when the preference store fires a property change.- Parameters:
- property- The property String used for the change fired by the preference store
 
- 
getPreferenceStore- Returns:
- The IPreferenceStore used by this class to store the preferences.
 
- 
isSupportedLayoutModepublic boolean isSupportedLayoutMode(int layout) Description copied from interface:PaletteViewerPreferencesThis is a convenience method. Instead of getting the supported layout modes and checking to see if a certain layout is supported, you can call this method.- Specified by:
- isSupportedLayoutModein interface- PaletteViewerPreferences
- Parameters:
- layout- LAYOUT_COLUMNS, LAYOUT_LIST, LAYOUT_ICONS, or LAYOUT_DETAILS
- Returns:
- trueif the given layout is a supported mode
- See Also:
 
- 
removePropertyChangeListener- Specified by:
- removePropertyChangeListenerin interface- PaletteViewerPreferences
- Parameters:
- listener- the PropertyChangeListener that should not be notified hereafter
- See Also:
 
- 
setAutoCollapseSettingpublic void setAutoCollapseSetting(int newVal) Description copied from interface:PaletteViewerPreferencesSets the auto-collapse setting.Possible values: - COLLAPSE_ALWAYS (Always collapse)
- COLLAPSE_AS_NEEDED (Collapse when needed)
- COLLAPSE_NEVER (Never collapse)
 - Specified by:
- setAutoCollapseSettingin interface- PaletteViewerPreferences
- Parameters:
- newVal- One of the above-mentioned constants
- See Also:
 
- 
setFontDataDescription copied from interface:PaletteViewerPreferencesSets the FontData for the palette.- Specified by:
- setFontDatain interface- PaletteViewerPreferences
- Parameters:
- data- The FontData for the font to be used in the palette
- See Also:
 
- 
setLayoutSettingpublic void setLayoutSetting(int newVal) Description copied from interface:PaletteViewerPreferencesSets the given setting as the current layout.Possible values: - LAYOUT_COLUMNS (Columns View)
- LAYOUT_LIST (List View)
- LAYOUT_ICONS (Icons Only View)
- LAYOUT_DETAILS (Details View)
 - Specified by:
- setLayoutSettingin interface- PaletteViewerPreferences
- Parameters:
- newVal- One of the above-mentioned constants
- See Also:
 
- 
setCurrentUseLargeIconspublic void setCurrentUseLargeIcons(boolean newVal) Description copied from interface:PaletteViewerPreferencesSets the "Use Large Icons" option for the currently active layout.- Specified by:
- setCurrentUseLargeIconsin interface- PaletteViewerPreferences
- Parameters:
- newVal-- trueif large icons are to be used with the current layout setting
- See Also:
 
- 
setSupportedLayoutModespublic 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. Instead, it is the responsibility of all clients manipulating the layout settings to check to see if a particular layout mode is supported before manipulating it, or allowing the end user to manipulate it.- Specified by:
- setSupportedLayoutModesin interface- PaletteViewerPreferences
- Parameters:
- modes- an array of layout modes desired
- See Also:
 
- 
setUseLargeIconspublic void setUseLargeIcons(int layout, boolean newVal) Description copied from interface:PaletteViewerPreferencesSets the "Use Large Icons" option for the given layout.
 The defaults are as follows:- LAYOUT_COLUMNS - true
- LAYOUT_LIST - false
- LAYOUT_ICONS - true
- LAYOUT_DETAILS - false
 - Specified by:
- setUseLargeIconsin interface- PaletteViewerPreferences
- Parameters:
- layout- any of the above-mentioned constants
- newVal-- trueif large icons are to be used with the given layout
- See Also:
 
- LAYOUT_COLUMNS - 
- 
useLargeIconspublic boolean useLargeIcons(int layout) Description copied from interface:PaletteViewerPreferencesIndicated whether large icons should be used with the given layout mode.
 The defaults are as follows:- LAYOUT_COLUMNS - true
- LAYOUT_LIST - false
- LAYOUT_ICONS - true
- LAYOUT_DETAILS - false
 - Specified by:
- useLargeIconsin interface- PaletteViewerPreferences
- Parameters:
- layout- any of the above-mentioned constants
- Returns:
- trueif large icons are to be used with the given layout
- See Also:
 
- LAYOUT_COLUMNS - 
- 
useLargeIconspublic boolean useLargeIcons()- Specified by:
- useLargeIconsin interface- PaletteViewerPreferences
- Returns:
- trueif large icons are to be used with the currently active layout
- See Also:
 
- 
setScrollbarsModepublic void setScrollbarsMode(int mode) Description copied from interface:PaletteViewerPreferencesEnables or disables overlay scrolling for the palette viewer. Supported values are: Overlay scrollbars are only supported onLinux.- Specified by:
- setScrollbarsModein interface- PaletteViewerPreferences
 
- 
getScrollbarsModepublic int getScrollbarsMode()Description copied from interface:PaletteViewerPreferencesReturns whether overlay scrolling is enabled for the palette viewer . Overlay scrollbars are only supported onLinux.- Specified by:
- getScrollbarsModein interface- PaletteViewerPreferences
- Returns:
- One of SWT.SCROLLBAR_OVERLAYorSWT.NONE.
 
 
-