public class FormPage extends java.lang.Object implements IFormPage
Constructor and Description |
---|
FormPage(FormEditor editor,
java.lang.String id,
java.lang.String title)
A constructor that creates the page and initializes it with the editor.
|
FormPage(java.lang.String id,
java.lang.String title)
The constructor.
|
Modifier and Type | Method and Description |
---|---|
boolean |
canLeaveThePage()
By default, editor will be allowed to flip the page.
|
protected void |
createFormContent(IManagedForm managedForm)
Subclasses should override this method to create content in the form
hosted in this page.
|
void |
createPartControl(org.eclipse.swt.widgets.Composite parent)
Creates the part control by creating the managed form using the parent
editor's toolkit.
|
void |
dispose()
Disposes the managed form.
|
void |
doSave(org.eclipse.core.runtime.IProgressMonitor monitor) |
void |
doSaveAs() |
FormEditor |
getEditor()
Returns the parent editor.
|
java.lang.String |
getId()
Returns the unique identifier that can be used to reference this page.
|
int |
getIndex()
Returns the saved page index.
|
IManagedForm |
getManagedForm()
Returns the managed form owned by this page.
|
org.eclipse.swt.widgets.Control |
getPartControl()
Returns the form page control.
|
org.eclipse.swt.graphics.Image |
getTitleImage()
Returns
null - form page has no title image. |
void |
initialize(FormEditor editor)
Primes the form page with the parent editor instance.
|
boolean |
isActive()
Tests if the page is active by asking the parent editor if this page is
the currently active page.
|
boolean |
isDirty()
Implemented by testing if the managed form is dirty.
|
boolean |
isEditor()
Form pages are not editors.
|
boolean |
isSaveAsAllowed() |
boolean |
selectReveal(java.lang.Object object)
Attempts to select and reveal the given object by passing the request to
the managed form.
|
void |
setActive(boolean active)
Implements the required method by refreshing the form when set active.
|
void |
setFocus()
Sets the focus by delegating to the managed form.
|
void |
setIndex(int index)
Preserves the page index.
|
void |
setPartName(java.lang.String partName) |
public FormPage(FormEditor editor, java.lang.String id, java.lang.String title)
editor
- the parent editorid
- the unique identifiertitle
- the page titlepublic FormPage(java.lang.String id, java.lang.String title)
initialize
method if this constructor is used.id
- a unique page identifiertitle
- a user-friendly page titlepublic void setPartName(java.lang.String partName)
public void initialize(FormEditor editor)
initialize
in interface IFormPage
editor
- the parent editorpublic FormEditor getEditor()
public IManagedForm getManagedForm()
getManagedForm
in interface IFormPage
public void setActive(boolean active)
public boolean isActive()
public void createPartControl(org.eclipse.swt.widgets.Composite parent)
createFormContent(IManagedForm)
to populate the form with
content.parent
- the page parent compositeprotected void createFormContent(IManagedForm managedForm)
managedForm
- the form hosted in this page.public org.eclipse.swt.widgets.Control getPartControl()
getPartControl
in interface IFormPage
public void dispose()
public java.lang.String getId()
public org.eclipse.swt.graphics.Image getTitleImage()
null
- form page has no title image. Subclasses
may override.null
public void setFocus()
public void doSave(org.eclipse.core.runtime.IProgressMonitor monitor)
org.eclipse.ui.ISaveablePart#doSave(org.eclipse.core.runtime.IProgressMonitor)
public void doSaveAs()
org.eclipse.ui.ISaveablePart#doSaveAs()
public boolean isSaveAsAllowed()
org.eclipse.ui.ISaveablePart#isSaveAsAllowed()
public boolean isDirty()
true
if the managed form is dirty,
false
otherwise.org.eclipse.ui.ISaveablePart#isDirty()
public void setIndex(int index)
public int getIndex()
public boolean isEditor()
public boolean selectReveal(java.lang.Object object)
selectReveal
in interface IFormPage
object
- the object to select and reveal in the page if possible.true
if the page has been successfully selected
and revealed by one of the managed form parts, false
otherwise.public boolean canLeaveThePage()
canLeaveThePage
in interface IFormPage
true
Copyright © 2007–2020. All rights reserved.