public abstract class TelesalesEditorPage extends EditorPage
This class implementation assumes all behavior from the EditorPage, except for the following additions:
Modifier and Type | Field and Description |
---|---|
static int | BUTTON_HEIGHT
Button height in dialog units (value 14).
|
static int | BUTTON_WIDTH
Button width in dialog units (value 61).
|
protected org.eclipse.swt.widgets.Control | buttonBar_
The button bar; null until page is layed out.
|
protected java.util.Map | buttons_
Collection of buttons created by the createButton method.
|
static int | CANCEL_ID
Button ID for a Cancel button (value 0).
|
static java.lang.String | CANCEL_LABEL
Button label for a Cancel button.
|
static java.lang.String | COPYRIGHT
IBM copyright notice field
|
static int | HORIZONTAL_MARGIN
Horizontal margin in page units (value 7).
|
static int | HORIZONTAL_SPACING
Horizontal spacing in page units (value 4).
|
static int | OK_ID
Button id for an OK button (value 1).
|
static java.lang.String | OK_LABEL
Button label for an OK button.
|
static int | VERTICAL_MARGIN
Vertical margin in page units (value 7).
|
static int | VERTICAL_SPACING
Vertical spacing in page units (value 4).
|
Constructor and Description |
---|
TelesalesEditorPage()
Creates an editor page instance.
|
Modifier and Type | Method and Description |
---|---|
protected void | addScrollListener(org.eclipse.swt.widgets.Composite composite)
This method adds the scroll listener to the composite and all its children controls.
|
protected void | buttonPressed(int id)
This method notifies that this page's button with the given ID has been pressed.
|
protected void | cancelPressed()
This method notifies that the Cancel button of this page has been pressed.
|
protected void | createActionsForToolBar(org.eclipse.jface.action.IToolBarManager manager)
This method adds actions to this pages's toolbar.
|
protected org.eclipse.jface.action.Action | createBackwardAction(org.eclipse.jface.action.IToolBarManager manager)
This method creates a backward action for use within the title area's toolbar.
|
protected org.eclipse.swt.widgets.Button | createButton(org.eclipse.swt.widgets.Composite buttonBarComp, int id, java.lang.String label)
This method creates a new button with the given ID for the button bar.
|
protected org.eclipse.swt.widgets.Control | createButtonBar(org.eclipse.swt.widgets.Composite parent)
This method creates and returns the contents of the button bar.
|
protected void | createButtonsForButtonBar(org.eclipse.swt.widgets.Composite parent)
This method adds buttons to this panel's button bar.
|
protected void | createButtonsForTopButtonBar(org.eclipse.swt.widgets.Composite parent)
This method adds buttons to this panel's top button bar.
|
protected org.eclipse.jface.action.Action | createForwardAction(org.eclipse.jface.action.IToolBarManager manager)
This method creates a Forward action for use within the title area's toolbar.
|
protected org.eclipse.jface.action.Action | createHelpAction(org.eclipse.jface.action.IToolBarManager manager)
This method creates a Help action from the getHelpResource for use within the title area's toolbar.
|
protected org.eclipse.swt.widgets.Control | createPageContent(org.eclipse.swt.widgets.Composite parent)
This method creates the page content as a child of the parent.
|
void | createPartControl(org.eclipse.swt.widgets.Composite parent)
This method creates the controls for this workbench part.
|
protected org.eclipse.swt.widgets.Control | createSeparator(org.eclipse.swt.widgets.Composite parent)
This method adds a separator to the composite.
|
protected org.eclipse.swt.widgets.Composite | createTitleArea(org.eclipse.swt.widgets.Composite parent)
This method creates the page's common look-and-feel title area.
|
protected org.eclipse.jface.action.IToolBarManager | createToolBarManager(org.eclipse.swt.widgets.Composite parent)
This method creates a toolbar to be used for adding action buttons to the title area of the page.
|
protected org.eclipse.swt.widgets.Control | createTopButtonBar(org.eclipse.swt.widgets.Composite parent)
This method creates and returns the contents of the top button bar.
|
protected org.eclipse.swt.graphics.Color | getBackgroundColor()
This method returns the background color.
|
protected org.eclipse.jface.action.Action | getBackwardAction()
This method returns the action created when createBackwardAction is called.
|
org.eclipse.swt.widgets.Button | getButton(int id)
This method returns the button created by the method createButton for the specified ID as defined.
|
protected org.eclipse.swt.widgets.Control | getButtonBar()
This method returns the button bar control.
|
protected int | getButtonHeight()
This method returns the height used by setButtonLayoutData for all buttons found in the button bar.
|
protected int | getButtonWidth()
This method returns the width used by setButtonLayoutData for all buttons found in the button bar.
|
protected org.eclipse.swt.widgets.Button | getCancelButton()
This method returns the button created when createButton is called with an ID of CANCEL_ID.
|
protected org.eclipse.jface.action.Action | getForwardAction()
This method returns the action created when createForwardAction is called.
|
protected org.eclipse.jface.action.Action | getHelpAction()
This method returns the action created when createHelpAction is called with a valid HREF returned from getHelpResource.
|
abstract java.lang.String | getHelpContextId()
This method retrieves the page's help context ID.
|
java.lang.String | getHelpResource()
This method returns a help HREF for linking a Help action within the title area's toolbar.
|
protected org.eclipse.swt.widgets.Button | getOkButton()
This method returns the button created when createButton is called with an ID of OK_ID.
|
protected org.eclipse.swt.widgets.Control | getPageContent()
This method gets the page content control.
|
org.eclipse.swt.widgets.Control | getPartControl()
This method returns the part control.
|
protected org.eclipse.swt.graphics.Color | getRequiredFieldForegroundColor()
This method returns the foreground color for required fields' asterisk indicator.
|
protected org.eclipse.swt.custom.ScrolledComposite | getScrollBars()
This method will return ScrollComposite.
|
protected org.eclipse.swt.widgets.Composite | getTitleAreaControl()
This method returns the title area control from this page.
|
protected org.eclipse.swt.graphics.Color | getTitleForegroundColor()
This method returns the foreground color for page's title.
|
org.eclipse.jface.action.IToolBarManager | getToolBarManager()
This method returns the tool bar manager that is used to manage tool items in the page's title area.
|
protected void | okPressed()
This method notifies that the OK button of this page has been pressed.
|
void | recreatePageContent()
This method dispose of the current page content control and recreate the a new instance of the page content control.
|
protected void | setButtonLayoutData(org.eclipse.swt.widgets.Composite control, org.eclipse.swt.widgets.Button button, int indent)
This method sets the layout data of the button to a GridData with appropriate heights and widths so that all buttons have the same size.
|
void | updateToolBar()
This method updates the local tool bar manager if used.
|
protected boolean | useButtonBar()
This method indicates whether to build and use the button bar.
|
protected boolean | useTopButtonBar()
This method indicates whether to build and use the top button bar.
|
public static final java.lang.String COPYRIGHT
public static final int VERTICAL_MARGIN
public static final int VERTICAL_SPACING
public static final int HORIZONTAL_MARGIN
public static final int HORIZONTAL_SPACING
public static final int BUTTON_HEIGHT
public static final int BUTTON_WIDTH
public static final int CANCEL_ID
public static final int OK_ID
public static final java.lang.String CANCEL_LABEL
public static final java.lang.String OK_LABEL
protected org.eclipse.swt.widgets.Control buttonBar_
protected java.util.Map buttons_
public TelesalesEditorPage()
protected void buttonPressed(int id)
This method calls okPressed if the OK button is pressed and cancelPressed if the Cancel button is pressed. All other button presses are ignored.
Subclasses may override to handle other buttons but should call super.buttonPressed if the default handling is desired.
protected void cancelPressed()
The TelesalesEditorPage implementation of this framework method does nothing.
Subclasses may override.
protected void createActionsForToolBar(org.eclipse.jface.action.IToolBarManager manager)
This method adds standard Help, Forward, and Backward actions using the createHelpAction, createForwardAction, and createBackwardAction methods. This standard actions will be accessible from getHelpAction, getForwardAction, and getBackwardAction.
Subclasses should override to add or replace actions.
protected org.eclipse.jface.action.Action createBackwardAction(org.eclipse.jface.action.IToolBarManager manager)
protected org.eclipse.swt.widgets.Button createButton(org.eclipse.swt.widgets.Composite buttonBarComp, int id, java.lang.String label)
This method creates a standard push button, registers it for selection events including button presses, and registers default buttons with its shell. The button ID is stored as the button's client data. If the button ID is OK_ID, the OK button will be accessible from getOkButton(). Note that the parent's layout is assumed to be a GridLayout and the number of columns in this layout is incremented.
Subclasses may override.
protected org.eclipse.swt.widgets.Control createButtonBar(org.eclipse.swt.widgets.Composite parent)
Subclasses may override.
protected org.eclipse.swt.widgets.Control createTopButtonBar(org.eclipse.swt.widgets.Composite parent)
Subclasses may override.
protected void createButtonsForButtonBar(org.eclipse.swt.widgets.Composite parent)
This method adds standard OK and Cancel buttons using the createButton method. This standard buttons will be accessible from getOkButton and getCancelButton.
Subclasses should override to add or replace buttons.
protected void createButtonsForTopButtonBar(org.eclipse.swt.widgets.Composite parent)
This implementation does nothing.
Subclasses should override to add buttons.
protected org.eclipse.jface.action.Action createForwardAction(org.eclipse.jface.action.IToolBarManager manager)
protected org.eclipse.jface.action.Action createHelpAction(org.eclipse.jface.action.IToolBarManager manager)
If getHelpResource returns an invalid HREF, null is returned.
protected org.eclipse.swt.widgets.Control createPageContent(org.eclipse.swt.widgets.Composite parent)
public void recreatePageContent()
public abstract java.lang.String getHelpContextId()
public void createPartControl(org.eclipse.swt.widgets.Composite parent)
protected void addScrollListener(org.eclipse.swt.widgets.Composite composite)
protected org.eclipse.swt.widgets.Control createSeparator(org.eclipse.swt.widgets.Composite parent)
This method adds a horizontal separator to the composite dividing the two sections.
Subclasses may override.
protected org.eclipse.swt.widgets.Composite createTitleArea(org.eclipse.swt.widgets.Composite parent)
protected org.eclipse.jface.action.IToolBarManager createToolBarManager(org.eclipse.swt.widgets.Composite parent)
Subclasses may override.
protected org.eclipse.swt.graphics.Color getBackgroundColor()
Checks for high-contrast mode being enabled.
protected org.eclipse.jface.action.Action getBackwardAction()
public org.eclipse.swt.widgets.Button getButton(int id)
protected org.eclipse.swt.widgets.Control getButtonBar()
Clients may call this framework method but should not override it.
protected int getButtonHeight()
The default implementation returns BUTTON_HEIGHT.
protected int getButtonWidth()
The default implementation returns BUTTON_WIDTH.
protected org.eclipse.swt.widgets.Button getCancelButton()
protected org.eclipse.jface.action.Action getForwardAction()
protected org.eclipse.jface.action.Action getHelpAction()
public java.lang.String getHelpResource()
Help action will not added if this value is null.
Subclasses should override.
protected org.eclipse.swt.widgets.Button getOkButton()
protected org.eclipse.swt.widgets.Control getPageContent()
public org.eclipse.swt.widgets.Control getPartControl()
protected org.eclipse.swt.graphics.Color getRequiredFieldForegroundColor()
Checks for high contrast mode being enabled.
protected org.eclipse.swt.widgets.Composite getTitleAreaControl()
protected org.eclipse.swt.graphics.Color getTitleForegroundColor()
Checks for high-contrast mode being enabled.
public org.eclipse.jface.action.IToolBarManager getToolBarManager()
protected void okPressed()
The TelesalesEditorPage implementation of this framework method sets fires a property event to the parent editor notifying the editor to save and close.
Subclasses may override.
protected void setButtonLayoutData(org.eclipse.swt.widgets.Composite control, org.eclipse.swt.widgets.Button button, int indent)
To change the default size of the buttons, subclasses should override the getButtonHeight and getButtonWidth methods.
protected boolean useButtonBar()
Subclasses should override to remove the use of the button bar.
protected boolean useTopButtonBar()
Subclasses should override to add the use of the top button bar.
protected org.eclipse.swt.custom.ScrolledComposite getScrollBars()
Clients may call this method but should not override it
public void updateToolBar()