Class DefaultEntryPage
- java.lang.Object
-
- org.eclipse.gef.ui.palette.customize.DefaultEntryPage
-
- All Implemented Interfaces:
EntryPage
- Direct Known Subclasses:
DrawerEntryPage
public class DefaultEntryPage extends java.lang.Object implements EntryPage
This is a default implementation of theEntryPage
interface. It displays the entry's label, description and visible fields (and allows for their modification). It is live in the sense that the model is updated with the changes immediately (on every keystroke).
-
-
Constructor Summary
Constructors Constructor Description DefaultEntryPage()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
apply()
Being live, this method is completely ignored.void
createControl(Composite parent, PaletteEntry entry)
Creates the Control that displays the properties of the given entry.protected Text
createDescText(Composite panel)
Creates theText
where the description of the entry is to be displayed.protected Button
createHiddenCheckBox(Composite panel)
Creates theButton
(CheckBox) for indicating the hidden status of the entry.protected Label
createLabel(Composite panel, int style, java.lang.String text)
Creates a labelprotected Text
createNameText(Composite panel)
Creates the Text where the name of the entry is to be displayed.protected Text
createText(Composite panel, int style, java.lang.String text)
Creates aText
.Control
getControl()
Returns the Panel (Control) that displays the properties of the entry.protected PaletteEntry
getEntry()
Provides sub-classes with access to the entry this class is monitoring.protected java.lang.String
getMessage()
Sub-classes should override this method to provide appropriate error notification messages.protected EntryPageContainer
getPageContainer()
protected int
getPermission()
protected void
handleDescriptionChanged(java.lang.String text)
Updates the model with the change in the entry's description, and updates the state of the page.protected void
handleHiddenSelected(boolean isChecked)
Updates the model with the change in the entry's hidden state, and updates the state of the page.protected void
handleNameChanged(java.lang.String text)
Updates the model with the change in the entry's name, and updates the state of the page.void
setPageContainer(EntryPageContainer pageContainer)
Sets the page container for this page.
-
-
-
Method Detail
-
apply
public final void apply()
Being live, this method is completely ignored. Model is updated with every keystroke. So, there is no need to wait for this method to be called to actually make the changes to the model.
-
createControl
public void createControl(Composite parent, PaletteEntry entry)
Description copied from interface:EntryPage
Creates the Control that displays the properties of the given entry. This method will only be called once. The parent Composite's Font is set to the Workbench Dialog Font. The page's Controls should use the Workbench Dialog Font where appropriate.- Specified by:
createControl
in interfaceEntryPage
- Parameters:
parent
- The Composite in which the Control has to be createdentry
- The entry whose properties have to be displayed- See Also:
EntryPage.createControl(Composite, PaletteEntry)
-
createDescText
protected Text createDescText(Composite panel)
Creates theText
where the description of the entry is to be displayed.- Parameters:
panel
- The Composite in which theText
is to be created- Returns:
- The newly created
Text
-
createHiddenCheckBox
protected Button createHiddenCheckBox(Composite panel)
Creates theButton
(CheckBox) for indicating the hidden status of the entry. It initializes it with the current hidden state of entry.- Parameters:
panel
- The Composite in which the Button is to be created- Returns:
- The newly created Button
-
createLabel
protected Label createLabel(Composite panel, int style, java.lang.String text)
Creates a label- Parameters:
panel
- The Composite in which the Label is to be createdstyle
- The stylebits for the Labeltext
- The Label's text- Returns:
- Label - The newly created Label
-
createNameText
protected Text createNameText(Composite panel)
Creates the Text where the name of the entry is to be displayed.- Parameters:
panel
- The Composite in which the Text is to be created- Returns:
- Text - The newly created Text
-
createText
protected Text createText(Composite panel, int style, java.lang.String text)
Creates aText
. This method is mainly a result of code-factoring.- Parameters:
panel
- The Composite in which the Text is to be createdstyle
- The stylebits for the Texttext
- The text to be displayed in the Text- Returns:
- a text widget with griddata constraint
-
getControl
public Control getControl()
Description copied from interface:EntryPage
Returns the Panel (Control) that displays the properties of the entry. This is the same Control that was created inEntryPage.createControl(Composite,PaletteEntry)
.- Specified by:
getControl
in interfaceEntryPage
- Returns:
- the Control that displays the properties of the entry
- See Also:
EntryPage.getControl()
-
getEntry
protected PaletteEntry getEntry()
Provides sub-classes with access to the entry this class is monitoring.- Returns:
- PaletteEntry - The entry this class is monitoring
-
getMessage
protected java.lang.String getMessage()
Sub-classes should override this method to provide appropriate error notification messages.- Returns:
- The message to be used when notifying listeners about a state change
-
getPageContainer
protected EntryPageContainer getPageContainer()
- Returns:
- The
EntryPageContainer
to which this page can report errors.
-
handleDescriptionChanged
protected void handleDescriptionChanged(java.lang.String text)
Updates the model with the change in the entry's description, and updates the state of the page.
This method is invoked on every keystroke in the Text displaying the description of the entry.
- Parameters:
text
- The new description
-
handleHiddenSelected
protected void handleHiddenSelected(boolean isChecked)
Updates the model with the change in the entry's hidden state, and updates the state of the page.
This method is invokes whenever the "Hidden" checkbox is selected.
- Parameters:
isChecked
- The new selection value
-
handleNameChanged
protected void handleNameChanged(java.lang.String text)
Updates the model with the change in the entry's name, and updates the state of the page.
This method is invoked on every keystroke in the Text displaying the entry's name.
- Parameters:
text
- The new name
-
getPermission
protected int getPermission()
- Returns:
- the user permission on the entry
-
setPageContainer
public void setPageContainer(EntryPageContainer pageContainer)
Description copied from interface:EntryPage
Sets the page container for this page. This page will report its errors to the given page container.- Specified by:
setPageContainer
in interfaceEntryPage
- Parameters:
pageContainer
- TheEntryPageContainer
to which this page can report errors- See Also:
EntryPage.setPageContainer(EntryPageContainer)
-
-