public abstract class TelesalesMultiPageEditor extends org.eclipse.ui.part.MultiPageEditorPart implements IModelListener
Pages are added lazily by adding a page reserves a tab, but does not cause the page control to be created. Page control is created when an attempt is made to select the page in question. This allows editors with several tabs and complex pages to open quickly.
Multipage editors have a single action bar contributor that manages contributions for all the pages. The contributor must be a subclass of AbstractMultiPageEditorActionBarContributor. Note that since any nested editors are created directly in code by callers of addPage(IEditorPart,IEditorInput), nested editors do not have their own contributors.
Modifier and Type | Field and Description |
---|---|
static java.lang.String | COPYRIGHT
IBM copyright notice field
|
static int | PROP_BACKWARD
The property ID for backward.
|
static int | PROP_FORWARD
The property ID for forward.
|
Constructor and Description |
---|
TelesalesMultiPageEditor()
Creates a multipage editor instance.
|
Modifier and Type | Method and Description |
---|---|
int | addPage(org.eclipse.swt.widgets.Control control)
This method adds a page to the multipage editor.
|
int | addPage(IEditorPage page)
This method adds the editor page to this editor.
|
int | addPage(org.eclipse.ui.IEditorPart editor, org.eclipse.ui.IEditorInput input)
This method adds a page to the multipage editor.
|
void | backward()
This method moves the active page index to one backward.
|
protected void | configurePage(int index, IEditorPage page)
This method configures the editor page.
|
protected void | createPages()
This method creates the pages of the multipage editor.
|
void | dispose()
This dispose method calls on the dispose method of every child page.
|
void | doSave(org.eclipse.core.runtime.IProgressMonitor monitor)
This method is called when the editor is required to do a save.
|
void | doSaveAs()
This implementation does nothing.
|
IEditorPage | findPage(java.lang.String pageId)
This method finds the page instance that has the provided ID.
|
void | firePropertyChange(int propertyId)
This method widens the visibility of firePropertyChange(int) in the superclass.
|
void | forward()
This method moves the active page index to one forward.
|
org.eclipse.ui.IEditorPart | getActiveEditor()
This method widens the visibility of getActiveEditor() in the superclass.
|
IEditorPage | getActivePageInstance()
This method returns active page instance if the currently selected page index is not -1 (null if -1).
|
protected int | getCurrentPage()
This method returns the current page index.
|
IEditorPage | getCurrentPageInstance()
This method returns the current page.
|
abstract java.lang.String | getEditorPagesId()
This method returns the editor pages ID.
|
java.lang.String | getId()
This method returns the editor's unique identifier.
|
protected int | getNewPage()
This method returns the new page index.
|
int | getPageCount()
This method widens the visibility of getPageCount() in the superclass.
|
java.lang.Object[] | getPages()
This method returns an array of registered pages.
|
org.eclipse.jface.action.IStatusLineManager | getStatusLineManager()
This method returns a handle to the status line.
|
WidgetManagerInputProperties | getWidgetManagerInputProperties()
This method returns the widget manager input properties.
|
protected void | handlePropertyChange(int propertyId)
This method handles primary multipage property change events like page forward and page backward.
|
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)
The init method.
|
boolean | isDirty()
This method indicates whether changes exist that have yet to be saved.
|
boolean | isSaveAsAllowed()
This method return false by default.
|
void | modelChanged(ModelObjectChangedEvent event)
This method handles ModelObjectChangedEvent of type IWorkbenchPartConstants.PROP_INPUT to update the title bar.
|
protected void | pageChange(int newPageIndex)
This method listens for when a page has changed.
|
void | removePage(int pageIndex)
This method called to remove a page by index.
|
IEditorPage | selectReveal(java.lang.Object pageInput)
This method iterates through the pages calling similar method until a page is found that contains the desired page input.
|
protected void | setActivePage(int pageIndex)
This method sets the page at the given index as the active page of the editor.
|
IEditorPage | setActivePage(java.lang.String pageId)
This method sets the active page using the unique page identifier.
|
IEditorPage | setActivePage(java.lang.String pageId, java.lang.Object pageInput)
This method sets the active page using the unique page identifier and sets its input to the provided object.
|
void | setFocus()
This method gets the active page and calls its setFocus method.
|
void | setStatusMessage(org.eclipse.swt.graphics.Image image, java.lang.String message)
This method shows message in status-line message area.
|
void | setStatusMessage(java.lang.String message)
This method shows message in status-line message area.
|
protected void | updateActionBarContributor(int pageIndex)
This method notifies action bar contributor about page change.
|
void | updateTitle()
This method sends a PROP_TITLE notification to update the title.
|
public static final java.lang.String COPYRIGHT
public static final int PROP_BACKWARD
public static final int PROP_FORWARD
public TelesalesMultiPageEditor()
public int addPage(IEditorPage page) throws org.eclipse.ui.PartInitException
public int addPage(org.eclipse.swt.widgets.Control control)
public int addPage(org.eclipse.ui.IEditorPart editor, org.eclipse.ui.IEditorInput input) throws org.eclipse.ui.PartInitException
public void backward()
protected void configurePage(int index, IEditorPage page) throws org.eclipse.ui.PartInitException
public abstract java.lang.String getEditorPagesId()
protected void createPages()
public void dispose()
public void doSave(org.eclipse.core.runtime.IProgressMonitor monitor)
public void doSaveAs()
public boolean isDirty()
public boolean hasRequiredInput()
public IEditorPage findPage(java.lang.String pageId)
public void firePropertyChange(int propertyId)
public void forward()
public org.eclipse.ui.IEditorPart getActiveEditor()
public IEditorPage getActivePageInstance()
public IEditorPage getCurrentPageInstance()
protected int getCurrentPage()
Another important difference is during the editor closing. When the tab folder is disposed, getActivePage() will return -1, while this method will still return the last active page.
protected int getNewPage()
public java.lang.String getId()
public int getPageCount()
public java.lang.Object[] getPages()
public org.eclipse.jface.action.IStatusLineManager getStatusLineManager()
protected void handlePropertyChange(int propertyId)
public void init(org.eclipse.ui.IEditorSite site, org.eclipse.ui.IEditorInput input) throws org.eclipse.ui.PartInitException
public boolean isSaveAsAllowed()
public void modelChanged(ModelObjectChangedEvent event)
protected void pageChange(int newPageIndex)
public void removePage(int pageIndex)
public IEditorPage selectReveal(java.lang.Object pageInput)
protected void setActivePage(int pageIndex)
public IEditorPage setActivePage(java.lang.String pageId)
public IEditorPage setActivePage(java.lang.String pageId, java.lang.Object pageInput)
public void setFocus()
public void setStatusMessage(java.lang.String message)
public void setStatusMessage(org.eclipse.swt.graphics.Image image, java.lang.String message)
protected void updateActionBarContributor(int pageIndex)
public void updateTitle()
public WidgetManagerInputProperties getWidgetManagerInputProperties()