Class PaletteSettingsDialog
java.lang.Object
org.eclipse.jface.window.Window
org.eclipse.jface.dialogs.Dialog
org.eclipse.gef.ui.palette.customize.PaletteSettingsDialog
- All Implemented Interfaces:
- IShellProvider
- 
Nested Class SummaryNested classes/interfaces inherited from class org.eclipse.jface.window.WindowWindow.IExceptionHandler
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprotected static final intprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final StringHashMap keys used for caching the various settings displayed in this dialog.protected static final Stringprotected static final intSub - classes that need to create their own unique IDs should do so by adding to this ID.protected static final intprotected static final intprotected static final intprotected static final intprotected static final intprotected static final intprotected static final intThe unique IDs for the various widgets.protected static final intprotected static final intprotected static final intprotected static final intprotected static final intprotected static final intA HashMap to cache the various settings displayed in this dialogFields inherited from class org.eclipse.jface.dialogs.DialogblockedHandler, buttonBar, DIALOG_DEFAULT_BOUNDS, DIALOG_PERSISTLOCATION, DIALOG_PERSISTSIZE, dialogArea, DLG_IMG_ERROR, DLG_IMG_HELP, DLG_IMG_INFO, DLG_IMG_MESSAGE_ERROR, DLG_IMG_MESSAGE_INFO, DLG_IMG_MESSAGE_WARNING, DLG_IMG_QUESTION, DLG_IMG_WARNING, ELLIPSISFields inherited from class org.eclipse.jface.window.WindowCANCEL, OK, resizeHasOccurred
- 
Constructor SummaryConstructorsConstructorDescriptionPaletteSettingsDialog(Shell parentShell, PaletteViewerPreferences prefs) Constructor
- 
Method SummaryModifier and TypeMethodDescriptionprotected voidbuttonPressed(int buttonId) This method will be invoked whenever anyButtoncreated usingcreateButton(Composite, int, String, int, ImageDescriptor)orDialog.createButton(Composite, int, String, boolean)is selected.protected voidThis method saves the various settings in this dialog, so that they can be restored later on if "Cancel" is pressed.booleanclose()protected voidconfigureShell(Shell newShell) protected ButtoncreateButton(Composite parent, int id, String label, int stylebits, ImageDescriptor descriptor) This method should not be used to create buttons for the button bar.protected ControlcreateColumnsOptions(Composite parent) Creates and initializes (i.e. loads the current settings from PaletteViewerPreferences) the options for columns layout.protected ControlcreateDetailsOptions(Composite parent) Creates and initializes (i.e. loads the current settings from PaletteViewerPreferences) the options for details layout.protected ControlcreateDialogArea(Composite parent) protected ControlcreateDrawerCollapseOptions(Composite container) Creates and initializes (i.e., loads the current value from the PaletteViewerPreferences) the part of the dialog where the options to close drawers will be displayed.protected ControlcreateFontSettings(Composite parent) Creates and initializes (i.e. loads the current settings from PaletteViewerPreferences) the part of the dialog that displays the font settings.protected ControlcreateIconsOnlyOptions(Composite parent) Creates and initializes (i.e. loads the current settings from PaletteViewerPreferences) the options for icons layout.protected ControlcreateLayoutOptions(Composite parent) Creates the part of the dialog that displays the various options for the selected layout.protected ControlcreateLayoutSettings(Composite parent) Creates the part of the dialog that displays the lists the available layout modes.protected ControlcreateListOptions(Composite parent) Creates and initializes (i.e. loads the current settings from PaletteViewerPreferences) the options for list layout.protected ControlcreateOptionsPage(Composite parent, String title, int buttonId) This helper method is a result of code-factoring.protected ButtongetButton(int id) Returns the Button with the given id; ornullif none was found.protected WidgetgetWidget(int id) TheWidgets that were created with a unique ID and added to this class' internal map can be retrieved through this method.protected voidhandleAutoCollapseSettingChanged(int newSetting) Called when any one of the "Auto - Collapse" radio buttons is clicked.protected voidThis method is invoked when "Cancel" is invoked on the dialog.protected voidThis method is invoked when the user selects the "Change" font button.protected voidThis method is invoked when the user selects the "Restore Default" font button.protected voidhandleIconSizeChanged(boolean selection) This method is invoked when the "Use Large Icons" checkbox is selected/deselected for the currently active layout mode.protected voidhandleLayoutSettingChanged(int newSetting) This method is called when any one of the "Layout" radio buttons is clicked.protected voidRestores the cached settings, thus undoing any changes made since the last caching of settings.protected voidshowLayoutOptionsPage(Control page) This helper method is mainly a result of code-factoring.protected voidUpdates the label showing the font's name to show the name of the current font.Methods inherited from class org.eclipse.jface.dialogs.DialogapplyDialogFont, cancelPressed, convertHeightInCharsToPixels, convertHeightInCharsToPixels, convertHorizontalDLUsToPixels, convertHorizontalDLUsToPixels, convertVerticalDLUsToPixels, convertVerticalDLUsToPixels, convertWidthInCharsToPixels, convertWidthInCharsToPixels, create, createButton, createButtonBar, createButtonsForButtonBar, createContents, dialogFontIsDefault, getBlockedHandler, getButtonBar, getCancelButton, getDialogArea, getDialogBoundsSettings, getDialogBoundsStrategy, getImage, getInitialLocation, getInitialSize, getOKButton, initializeBounds, initializeDialogUnits, isResizable, okPressed, setBlockedHandler, setButtonLayoutData, setButtonLayoutFormData, shortenTextMethods inherited from class org.eclipse.jface.window.WindowcanHandleShellCloseEvent, constrainShellSize, createShell, getConstrainedShellBounds, getContents, getDefaultImage, getDefaultImages, getDefaultOrientation, getLayout, getParentShell, getReturnCode, getShell, getShellListener, getShellStyle, getWindowManager, handleFontChange, handleShellCloseEvent, open, setBlockOnOpen, setDefaultImage, setDefaultImages, setDefaultModalParent, setDefaultOrientation, setExceptionHandler, setParentShell, setReturnCode, setShellStyle, setWindowManager
- 
Field Details- 
settingsA HashMap to cache the various settings displayed in this dialog
- 
CACHE_LAYOUTHashMap keys used for caching the various settings displayed in this dialog.- See Also:
 
- 
CACHE_COLUMNS_ICON_SIZE- See Also:
 
- 
CACHE_LIST_ICON_SIZE- See Also:
 
- 
CACHE_ICONS_ICON_SIZE- See Also:
 
- 
CACHE_DETAILS_ICON_SIZE- See Also:
 
- 
CACHE_FONT- See Also:
 
- 
CACHE_COLLAPSE- See Also:
 
- 
LAYOUT_COLUMNS_VIEW_IDprotected static final int LAYOUT_COLUMNS_VIEW_IDThe unique IDs for the various widgets. These IDs can be used to retrieve these widgets from the internal map (usinggetWidget(int)), or to identify widgets inbuttonPressed(int).- See Also:
 
- 
LAYOUT_LIST_VIEW_IDprotected static final int LAYOUT_LIST_VIEW_ID- See Also:
 
- 
LAYOUT_ICONS_VIEW_IDprotected static final int LAYOUT_ICONS_VIEW_ID- See Also:
 
- 
LAYOUT_COLUMNS_ICON_SIZE_IDprotected static final int LAYOUT_COLUMNS_ICON_SIZE_ID- See Also:
 
- 
LAYOUT_LIST_ICON_SIZE_IDprotected static final int LAYOUT_LIST_ICON_SIZE_ID- See Also:
 
- 
LAYOUT_ICONS_ICON_SIZE_IDprotected static final int LAYOUT_ICONS_ICON_SIZE_ID- See Also:
 
- 
LAYOUT_DETAILS_ICON_SIZE_IDprotected static final int LAYOUT_DETAILS_ICON_SIZE_ID- See Also:
 
- 
COLLAPSE_NEVER_IDprotected static final int COLLAPSE_NEVER_ID- See Also:
 
- 
COLLAPSE_ALWAYS_IDprotected static final int COLLAPSE_ALWAYS_ID- See Also:
 
- 
COLLAPSE_NEEDED_IDprotected static final int COLLAPSE_NEEDED_ID- See Also:
 
- 
APPLY_IDprotected static final int APPLY_ID- See Also:
 
- 
LAYOUT_DETAILS_VIEW_IDprotected static final int LAYOUT_DETAILS_VIEW_ID- See Also:
 
- 
FONT_CHANGE_IDprotected static final int FONT_CHANGE_ID- See Also:
 
- 
DEFAULT_FONT_IDprotected static final int DEFAULT_FONT_ID- See Also:
 
- 
CLIENT_IDprotected static final int CLIENT_IDSub - classes that need to create their own unique IDs should do so by adding to this ID.- See Also:
 
 
- 
- 
Constructor Details- 
PaletteSettingsDialogConstructor- Parameters:
- parentShell- The parent shell, or- nullto create a top - level shell
- prefs- The PaletteViewerPreferences object that can provide access to and allow modification of the palette's settings. It cannot be- null.
 
 
- 
- 
Method Details- 
buttonPressedprotected void buttonPressed(int buttonId) This method will be invoked whenever anyButtoncreated usingcreateButton(Composite, int, String, int, ImageDescriptor)orDialog.createButton(Composite, int, String, boolean)is selected.- Overrides:
- buttonPressedin class- Dialog
- See Also:
 
- 
cacheSettingsprotected void cacheSettings()This method saves the various settings in this dialog, so that they can be restored later on if "Cancel" is pressed.- See Also:
 
- 
closepublic boolean close()
- 
configureShell- Overrides:
- configureShellin class- Window
- See Also:
 
- 
createButtonprotected Button createButton(Composite parent, int id, String label, int stylebits, ImageDescriptor descriptor) This method should not be used to create buttons for the button bar. UseDialog.createButton(Composite, int, String, boolean)for that. This method can be used to create any other button in the dialog. The parentCompositemust have a GridLayout. These buttons will be available throughgetButton(int)andgetWidget(int). Ensure that the various buttons created by this method are given unique IDs. Pass in a null image descriptor if you don't want the button to have an icon. This method will take care of disposing the images that it creates.buttonPressed(int)will be called when any of the buttons created by this method are clicked (selected).- Parameters:
- parent- The composite in which the button is to be created
- id- The button's unique ID
- label- The button's text
- stylebits- The style bits for creating the button (eg.,- SWT.PUSH) or- SWT.CHECK)
- descriptor- The ImageDescriptor from which the image/icon for this button should be created
- Returns:
- The newly created button for convenience
 
- 
createDrawerCollapseOptionsCreates and initializes (i.e., loads the current value from the PaletteViewerPreferences) the part of the dialog where the options to close drawers will be displayed.- Parameters:
- container- The parent composite
- Returns:
- The newly created Control which has the drawer collapse options
 
- 
createDetailsOptionsCreates and initializes (i.e. loads the current settings from PaletteViewerPreferences) the options for details layout.- Parameters:
- parent- the parent composite
- Returns:
- the newly created Control
 
- 
createDialogArea- Overrides:
- createDialogAreain class- Dialog
- See Also:
 
- 
createColumnsOptionsCreates and initializes (i.e. loads the current settings from PaletteViewerPreferences) the options for columns layout.- Parameters:
- parent- the parent composite
- Returns:
- the newly created Control
 
- 
createFontSettingsCreates and initializes (i.e. loads the current settings from PaletteViewerPreferences) the part of the dialog that displays the font settings.- Parameters:
- parent- the parent composite
- Returns:
- the newly created Control
 
- 
createIconsOnlyOptionsCreates and initializes (i.e. loads the current settings from PaletteViewerPreferences) the options for icons layout.- Parameters:
- parent- the parent composite
- Returns:
- the newly created Control
 
- 
createLayoutOptionsCreates the part of the dialog that displays the various options for the selected layout.- Parameters:
- parent- the parent composite
- Returns:
- the newly created Control
 
- 
createLayoutSettingsCreates the part of the dialog that displays the lists the available layout modes.- Parameters:
- parent- the parent composite
- Returns:
- the newly created Control
 
- 
createListOptionsCreates and initializes (i.e. loads the current settings from PaletteViewerPreferences) the options for list layout.- Parameters:
- parent- the parent composite
- Returns:
- the newly created Control
 
- 
createOptionsPageThis helper method is a result of code-factoring. It creates a Group displaying the given title and creates a "Use Large Icons" checkbox with the given buttonId in it. This method is used to create the options for the different layout modes.- Parameters:
- parent- the parent composite
- title- The title for the group to be created.
- buttonId- The ID for the "Use Large Icons" checkbox to be created in the group.
- Returns:
- the newly created Group
 
- 
getButtonReturns the Button with the given id; ornullif none was found.
- 
getWidgetTheWidgets that were created with a unique ID and added to this class' internal map can be retrieved through this method.- Parameters:
- id- The unique ID of the Widget that you wish to retrieve
- Returns:
- The Widget, if one with the given id exists. nullotherwise.
 
- 
handleAutoCollapseSettingChangedprotected void handleAutoCollapseSettingChanged(int newSetting) Called when any one of the "Auto - Collapse" radio buttons is clicked. It changes the setting in thePaletteViewerPreferencesobject.- Parameters:
- newSetting- The flag for the new setting
 
- 
handleCancelPressedprotected void handleCancelPressed()This method is invoked when "Cancel" is invoked on the dialog. It simply restores the settings, thus undoing any changes made in this Dialog.
- 
handleChangeFontPressedprotected void handleChangeFontPressed()This method is invoked when the user selects the "Change" font button. It opens the FontDialog to allow the user to change the font.
- 
handleDefaultFontRequestedprotected void handleDefaultFontRequested()This method is invoked when the user selects the "Restore Default" font button. It changes the font, in case it was different, to the default one, which is the Workbench Dialog font.
- 
handleIconSizeChangedprotected void handleIconSizeChanged(boolean selection) This method is invoked when the "Use Large Icons" checkbox is selected/deselected for the currently active layout mode.- Parameters:
- selection- indicates whether large icons are to be used or not.
 
- 
handleLayoutSettingChangedprotected void handleLayoutSettingChanged(int newSetting) This method is called when any one of the "Layout" radio buttons is clicked. It changes the setting in thePaletteViewerPreferencesobject.- Parameters:
- newSetting- The flag for the new setting
 
- 
restoreSettingsprotected void restoreSettings()Restores the cached settings, thus undoing any changes made since the last caching of settings.- See Also:
 
- 
showLayoutOptionsPageThis helper method is mainly a result of code-factoring. It shows the given page (which should be one of the controls showing the layout options) in the PageBook and grows the dialog if necessary.- Parameters:
- page- One of the controls showing the layout options that already belongs to the PageBook book.
 
- 
updateFontNameprotected void updateFontName()Updates the label showing the font's name to show the name of the current font.
 
-