Package org.eclipse.gef.ui.palette
Interface PaletteViewerPreferences
- All Known Implementing Classes:
DefaultPaletteViewerPreferences
public interface PaletteViewerPreferences
PaletteViewerPreferences
is used to store/persist the various
settings of a GEF palette.
IMPORTANT: This interface is not intended to be implemented
by clients. Clients should inherit from
DefaultPaletteViewerPreferences
. New methods may be added in the
future.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
This is a constant for one of the auto-collapse options.static final int
This is a constant for one of the auto-collapse options.static final int
This is a constant for one of the auto-collapse options.static final int
This is a constant for one of the layout options.static final int
This is a constant for one of the layout options.static final int
Deprecated.Use LAYOUT_COLUMNS instead.static final int
This is a constant for one of the layout options.static final int
This is a constant for one of the layout options.static final String
Property name for the auto-collapse setting.static final String
Property name for the large icon setting for columns layout.static final String
Property name for the large icon setting for details layout.static final String
Deprecated.Use PREFERENCE_COLUMNS_ICON_SIZE instead.static final String
Property name for the palette font setting.static final String
Property name for the large icon setting for icons only layout.static final String
Property name for the layout setting.static final String
Property name for the large icon setting for list layout. -
Method Summary
Modifier and TypeMethodDescriptionvoid
int
Returns the current auto-collapse setting.int
Returns the current layout setting.int[]
Returns the layout modes that are supported.boolean
isSupportedLayoutMode
(int layout) This is a convenience method.void
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) The client can restrict the modes that the palette supports using this method.void
setUseLargeIcons
(int layout, boolean newVal) Sets the "Use Large Icons" option for the given layout.boolean
boolean
useLargeIcons
(int layout) Indicated whether large icons should be used with the given layout mode.
-
Field Details
-
COLLAPSE_ALWAYS
static final int COLLAPSE_ALWAYSThis is a constant for one of the auto-collapse options.
Indicates that containers should always auto-collapse.- See Also:
-
COLLAPSE_NEVER
static final int COLLAPSE_NEVERThis is a constant for one of the auto-collapse options.
Indicates that containers should never auto-collapse.- See Also:
-
COLLAPSE_AS_NEEDED
static final int COLLAPSE_AS_NEEDEDThis is a constant for one of the auto-collapse options.
Indicates that containers should auto-collapse only when there is not enough room on the palette. This is the default auto-collapse setting.- See Also:
-
LAYOUT_COLUMNS
static final int LAYOUT_COLUMNSThis is a constant for one of the layout options.
Indicates that the palette should be displayed in the columns mode.- See Also:
-
LAYOUT_FOLDER
static final int LAYOUT_FOLDERDeprecated.Use LAYOUT_COLUMNS instead.- See Also:
-
LAYOUT_LIST
static final int LAYOUT_LISTThis is a constant for one of the layout options.
Indicates that the palette should be displayed in the list mode. This is the default layout setting.- See Also:
-
LAYOUT_ICONS
static final int LAYOUT_ICONSThis is a constant for one of the layout options.
Indicates that the palette should be displayed in the icons only mode.- See Also:
-
LAYOUT_DETAILS
static final int LAYOUT_DETAILSThis is a constant for one of the layout options.
Indicates that the palette should be displayed in the details mode.- See Also:
-
PREFERENCE_LAYOUT
Property name for the layout setting. If the PropertyChangeEvent fired has this property name, it means that the layout setting was changed.- See Also:
-
PREFERENCE_AUTO_COLLAPSE
Property name for the auto-collapse setting. If the PropertyChangeEvent fired has this property name, it means that the auto-collapse setting was changed.- See Also:
-
PREFERENCE_COLUMNS_ICON_SIZE
Property name for the large icon setting for columns layout. If the PropertyChangeEvent fired has this property name, it means that the large icon setting was changed for columns layout. Large icons are default.- See Also:
-
PREFERENCE_FOLDER_ICON_SIZE
Deprecated.Use PREFERENCE_COLUMNS_ICON_SIZE instead.- See Also:
-
PREFERENCE_LIST_ICON_SIZE
Property name for the large icon setting for list layout. If the PropertyChangeEvent fired has this property name, it means that the large icon setting was changed for list layout. Small icons are default.- See Also:
-
PREFERENCE_ICONS_ICON_SIZE
Property name for the large icon setting for icons only layout. If the PropertyChangeEvent fired has this property name, it means that the large icon setting was changed for icons only layout. Large icons are default.- See Also:
-
PREFERENCE_DETAILS_ICON_SIZE
Property name for the large icon setting for details layout. If the PropertyChangeEvent fired has this property name, it means that the large icon setting was changed for details layout. Small icons are default.- See Also:
-
PREFERENCE_FONT
Property name for the palette font setting. If the PropertyChangeEvent fired has this property name, it means that the palette font was changed.- See Also:
-
-
Method Details
-
addPropertyChangeListener
- Parameters:
listener
- the PropertyChangeListener to be notified of changes- See Also:
-
getAutoCollapseSetting
int getAutoCollapseSetting()Returns the current auto-collapse setting.Possible values returned:
- COLLAPSE_ALWAYS (Always collapse)
- COLLAPSE_AS_NEEDED (Collapse when needed)
- COLLAPSE_NEVER (Never collapse)
- Returns:
- One of the above-mentioned constants
-
getFontData
FontData getFontData()- Returns:
- The FontData for the font to be used in the palette.
-
getLayoutSetting
int getLayoutSetting()Returns the current layout setting.Possible values returned:
- LAYOUT_COLUMNS (columns View)
- LAYOUT_LIST (List View)
- LAYOUT_ICONS (Icons Only View)
- LAYOUT_DETAILS (Details View)
- Returns:
- One of the above-mentioned constants
-
getSupportedLayoutModes
int[] getSupportedLayoutModes()Returns the layout modes that are supported. All four layout modes -- LAYOUT_COLUMNS, LAYOUT_LIST, LAYOUT_ICONS, LAYOUT_DETAILS -- are supported by default.- Returns:
- The layout modes that are supported
- See Also:
-
isSupportedLayoutMode
boolean isSupportedLayoutMode(int layout) This 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.- Parameters:
layout
- LAYOUT_COLUMNS, LAYOUT_LIST, LAYOUT_ICONS, or LAYOUT_DETAILS- Returns:
true
if the given layout is a supported mode
-
removePropertyChangeListener
- Parameters:
listener
- the PropertyChangeListener that should not be notified hereafter- See Also:
-
setAutoCollapseSetting
void setAutoCollapseSetting(int newVal) Sets the auto-collapse setting.Possible values:
- COLLAPSE_ALWAYS (Always collapse)
- COLLAPSE_AS_NEEDED (Collapse when needed)
- COLLAPSE_NEVER (Never collapse)
- Parameters:
newVal
- One of the above-mentioned constants
-
setFontData
Sets the FontData for the palette.- Parameters:
data
- The FontData for the font to be used in the palette
-
setLayoutSetting
void setLayoutSetting(int newVal) Sets 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)
- Parameters:
newVal
- One of the above-mentioned constants
-
setCurrentUseLargeIcons
void setCurrentUseLargeIcons(boolean newVal) Sets the "Use Large Icons" option for the currently active layout.- Parameters:
newVal
-true
if large icons are to be used with the current layout setting
-
setSupportedLayoutModes
void setSupportedLayoutModes(int[] modes) The client can restrict the modes that the palette supports using this method. By default, the palette will support all layout modes: LAYOUT_ICONS, LAYOUT_DETAILS, LAYOUT_COLUMNS, LAYOUT_LIST. Should the client wish to not support all these modes, they can call this method with an array of the desired modes. This method should be called during set-up as soon as the preferences are created, and not later.If the default layout mode and/or the current layout mode are not in the given array, the first layout mode in the given array will be set to be the default/current layout.
NOTE: The given array of layout modes should have at least one, and is recommended to have at least two, of the recognized layout modes.
- Parameters:
modes
- an array of layout modes desired
-
setUseLargeIcons
void setUseLargeIcons(int layout, boolean newVal) Sets 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
- Parameters:
layout
- any of the above-mentioned constantsnewVal
-true
if large icons are to be used with the given layout
- LAYOUT_COLUMNS -
-
useLargeIcons
boolean useLargeIcons(int layout) Indicated 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
- Parameters:
layout
- any of the above-mentioned constants- Returns:
true
if large icons are to be used with the given layout
- LAYOUT_COLUMNS -
-
useLargeIcons
boolean useLargeIcons()- Returns:
true
if large icons are to be used with the currently active layout
-