public abstract class TelesalesEditorPart extends org.eclipse.ui.part.EditorPart implements IModelListener
This class implements the following features.
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).
|
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 |
---|
TelesalesEditorPart() |
Modifier and Type | Method and Description |
---|---|
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.swt.widgets.Button | createButton(org.eclipse.swt.widgets.Composite buttonBarComp, int id, java.lang.String label, boolean defaultButton)
This method creates a new button with the given ID for the button bar.
|
protected org.eclipse.swt.widgets.Button | createButton(org.eclipse.swt.widgets.Composite buttonBarComp, int id, java.lang.String label, boolean defaultButton, int style)
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 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)
Subclasses should override this method to create content in the form hosted in this page.
|
void | createPartControl(org.eclipse.swt.widgets.Composite parent)
This method creates the part control.
|
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.
|
void | dispose()
This method cleans up before disposal.
|
void | doSave(org.eclipse.core.runtime.IProgressMonitor monitor)
Saves the contents of this part.
|
void | doSaveAs()
Saves the contents of this part to another object.
|
void | editorDirtyStateChanged()
This method called to indicate that the editor has been made dirty or the changes have been saved.
|
protected org.eclipse.swt.graphics.Color | getBackgroundColor()
This method returns the background color.
|
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 int | getButtonHeight()
This method returns the height used by setButtonLayoutData for all buttons found in the button bar.
|
java.util.Map | getButtons_()
This method gets the Buttons.
|
protected int | getButtonWidth()
This method returns the width used by setButtonLayoutData for all buttons found in the button bar.
|
boolean | getFocusInvalid()
This method gets the current setting of the focus invalid flag.
|
protected abstract java.lang.String | getHelpContextId()
Subclasses must override this abstract method to return the (F1) help context ID so that their EditorPart has information popups.
|
protected java.lang.String | getHelpResource()
This method returns a help HREF for linking a Help action within the title area's toolbar.
|
int | getHorizontalScrollIncrement()
This method returns the vertical scroll increment.
|
org.eclipse.swt.widgets.Control | getPartControl()
This method returns the editor's 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 | getScrolledComposite()
Accessor for the scroll bar composite - may used for resizing
|
protected org.eclipse.swt.graphics.Color | getTitleForegroundColor()
This method returns the foreground color for page's title.
|
protected org.eclipse.swt.widgets.Label | getTitleLabel()
This method returns the title area label.
|
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.
|
int | getVerticalScrollIncrement()
This method returns the vertical scroll increment.
|
boolean | hasRequiredInput()
This method returns whether the required input for all pages has been entered.
|
void | init(org.eclipse.ui.IEditorSite site, org.eclipse.ui.IEditorInput input)
This method initializes this editor with the given editor site and input.
|
boolean | isDirty()
This method checks if the contents of this part have been changed.
|
boolean | isSaveAsAllowed()
This method checks if save is allowed.
|
void | modelChanged(ModelObjectChangedEvent event)
This method handles model change event.
|
protected void | okPressed()
This method notifies that the OK button of this page has been pressed.
|
void | recreatePageContent()
This method disposes 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 | setButtons_(java.util.Map buttons_in)
This method sets the Buttons.
|
void | setDirty(boolean dirty)
This method sets whether the contents of this part have been changed since the last save operation.
|
void | setFocus()
This method sets focus to this editor part.
|
void | setFocusInvalid(boolean focusInvalid)
This method sets a flag to indicate that the focus should be recalculated.
|
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.
|
void | validateFocus()
This method checks the focus invalid flag and calls setFocus to recalculate the focus for this page.
|
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
public void doSave(org.eclipse.core.runtime.IProgressMonitor monitor)
public void doSaveAs()
public void init(org.eclipse.ui.IEditorSite site, org.eclipse.ui.IEditorInput input) throws org.eclipse.ui.PartInitException
public void dispose()
public boolean isSaveAsAllowed()
public void createPartControl(org.eclipse.swt.widgets.Composite parent)
public void recreatePageContent()
protected abstract java.lang.String getHelpContextId()
public void setFocus()
public void editorDirtyStateChanged()
public void modelChanged(ModelObjectChangedEvent event)
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.
public org.eclipse.jface.action.IToolBarManager getToolBarManager()
public void updateToolBar()
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 createHelpAction(org.eclipse.jface.action.IToolBarManager manager)
If getHelpResource returns an invalid HREF, null is returned.
protected java.lang.String getHelpResource()
Help action will not added if this value is null.
Subclasses should override.
protected org.eclipse.swt.widgets.Composite createTitleArea(org.eclipse.swt.widgets.Composite parent)
protected org.eclipse.swt.graphics.Color getTitleForegroundColor()
Checks for high contrast mode being enabled.
protected org.eclipse.swt.widgets.Label getTitleLabel()
protected org.eclipse.swt.widgets.Control createPageContent(org.eclipse.swt.widgets.Composite parent)
protected boolean useButtonBar()
Subclasses should override to remove the use of the button bar.
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.Control createButtonBar(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 org.eclipse.swt.widgets.Button createButton(org.eclipse.swt.widgets.Composite buttonBarComp, int id, java.lang.String label, boolean defaultButton)
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.Button createButton(org.eclipse.swt.widgets.Composite buttonBarComp, int id, java.lang.String label, boolean defaultButton, int style)
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 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 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 sets fires a property event to the parent editor notifying the editor to cancel and close.
Subclasses may override.
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 int getButtonHeight()
The default implementation returns BUTTON_HEIGHT.
protected int getButtonWidth()
The default implementation returns BUTTON_WIDTH.
public int getVerticalScrollIncrement()
public int getHorizontalScrollIncrement()
public org.eclipse.swt.widgets.Button getButton(int id)
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.custom.ScrolledComposite getScrolledComposite()
public java.util.Map getButtons_()
public void setButtons_(java.util.Map buttons_in)
public boolean isDirty()
public void setDirty(boolean dirty)
public void setFocusInvalid(boolean focusInvalid)
public boolean getFocusInvalid()
public void validateFocus()
public boolean hasRequiredInput()