|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.core.commands.common.EventManager
org.eclipse.ui.part.WorkbenchPart
org.eclipse.ui.part.EditorPart
org.eclipse.datatools.sqltools.common.ui.helpsystem.HelpSystemEditorPart
org.eclipse.datatools.sqltools.schemaobjecteditor.ui.core.SchemaObjectEditorPage
public class SchemaObjectEditorPage
Copied from FormPage
since some fields are private and can not be set. To add a page to an editor, the
consumer need to extend this class to create the controls in the page.
Nested Class Summary | |
---|---|
static class |
SchemaObjectEditorPage.PageForm
|
Field Summary |
---|
Fields inherited from interface org.eclipse.datatools.sqltools.schemaobjecteditor.ui.ISchemaObjectEditorPage |
---|
UNKNOWN_ITEM_TYPE |
Fields inherited from interface org.eclipse.ui.IEditorPart |
---|
PROP_DIRTY, PROP_INPUT |
Fields inherited from interface org.eclipse.ui.IWorkbenchPart |
---|
PROP_TITLE |
Fields inherited from interface org.eclipse.help.IContextProvider |
---|
NONE, SELECTION |
Constructor Summary | |
---|---|
SchemaObjectEditorPage()
|
|
SchemaObjectEditorPage(org.eclipse.ui.forms.editor.FormEditor editor,
java.lang.String id,
java.lang.String title)
A constructor that creates the page and initializes it with the editor. |
|
SchemaObjectEditorPage(java.lang.String id,
java.lang.String title)
The constructor. |
Method Summary | |
---|---|
boolean |
aboutToSave(org.eclipse.core.runtime.IProgressMonitor monitor)
Notifies this page that the editor is about to save, subclass should update the model if necessary |
boolean |
canLeaveThePage()
By default, editor will be allowed to flip the 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()
|
void |
enable(boolean enabled)
|
org.eclipse.datatools.sqltools.core.DatabaseIdentifier |
getDatabaseIdentifier()
Returns the database identifier |
org.eclipse.ui.forms.editor.FormEditor |
getEditor()
Returns the parent editor. |
IEditorDescriptor |
getEditorDescriptor()
Returns an instance of IEditorDescriptor which is used to describe some static information of the
scheme object editor in which this page is contained |
java.lang.String |
getErrorMsg()
Returns the error message in this page which prevent to flip to other pages |
java.lang.String |
getId()
Returns the unique identifier that can be used to reference this page. |
int |
getIndex()
Returns the saved page index. |
org.eclipse.ui.forms.IManagedForm |
getManagedForm()
Returns the managed form owned by this page. |
IEditorPageDescriptor |
getPageDescriptor()
Returns an instance of IEditorPageDescriptor which is used to describe some static information of
this page |
org.eclipse.swt.widgets.Control |
getPartControl()
Returns the form page control. |
java.lang.String[] |
getPreferencePageIds()
Returns the preference pages ids related to this editor page. The returns preference pages will be displayed if user click "Preferences..." in the editor page's context menu |
org.eclipse.swt.graphics.Image |
getTitleImage()
Returns null - form page has no title image. |
void |
init(org.eclipse.ui.IEditorSite site,
org.eclipse.ui.IEditorInput input)
Initializes the form page. |
void |
initialize(org.eclipse.ui.forms.editor.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 |
isPageOpened()
Checks if the page is opened (Controls are created) |
boolean |
isSaveAsAllowed()
|
void |
markDirty()
Mark the dirty status |
void |
menuAboutToShow(org.eclipse.jface.action.IMenuManager manager)
Adds menu items for this page |
void |
modelRegenerated()
Do something when the model is re-generated, for example, after successfully saving the dirty editor, the edit model will be re-cloned from the refreshed database model, in this case, page should be refreshed to keep it synchronized with database |
void |
populateSQLObjects(org.eclipse.swt.events.TypedEvent event)
Sub class should override this method to populate the SQL objects belong to this page |
void |
refresh()
Sub class should override this method to refresh the page according to the model and if this page is not opened, should not refresh it |
void |
revert()
Revert this page to the original model |
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 |
setEditor(org.eclipse.ui.forms.editor.FormEditor editor)
Sets the editor in which this paged is contained, this will be called after the schema object is opened. |
void |
setEditorDescriptor(IEditorDescriptor editor)
Sets the editor descriptor for this page |
void |
setFocus()
Sets the focus by delegating to the managed form. |
void |
setFocus(int itemType,
java.lang.Object item)
The default implementation sets the current page active |
void |
setId(java.lang.String id)
Sets the id for this page |
void |
setIndex(int index)
Preserves the page index. |
void |
setPageDescriptor(IEditorPageDescriptor page)
Sets the page descriptor for this page |
void |
setPartName(java.lang.String title)
Sets the title for this page |
IErrorItem[] |
validate(org.eclipse.swt.events.TypedEvent event)
The default implementation of this method validate all the objects belong to this page and return the error items |
void |
validateAndShowErrors(org.eclipse.swt.events.TypedEvent event)
Validates this page and show errors accordingly |
IErrorItem[] |
validateOnline(org.eclipse.swt.events.TypedEvent event)
Online check if the page is valid |
Methods inherited from class org.eclipse.datatools.sqltools.common.ui.helpsystem.HelpSystemEditorPart |
---|
getContext, getContextChangeMask, getSearchExpression |
Methods inherited from class org.eclipse.ui.part.EditorPart |
---|
getEditorInput, getEditorSite, getTitleToolTip, isSaveOnCloseNeeded, setInitializationData |
Methods inherited from class org.eclipse.ui.part.WorkbenchPart |
---|
addPartPropertyListener, addPropertyListener, getAdapter, getContentDescription, getOrientation, getPartName, getPartProperties, getPartProperty, getSite, getTitle, removePartPropertyListener, removePropertyListener, setPartProperty, showBusy |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.eclipse.ui.IEditorPart |
---|
getEditorInput, getEditorSite |
Methods inherited from interface org.eclipse.ui.IWorkbenchPart |
---|
addPropertyListener, getSite, getTitle, getTitleToolTip, removePropertyListener |
Methods inherited from interface org.eclipse.core.runtime.IAdaptable |
---|
getAdapter |
Methods inherited from interface org.eclipse.ui.ISaveablePart |
---|
isSaveOnCloseNeeded |
Constructor Detail |
---|
public SchemaObjectEditorPage()
public SchemaObjectEditorPage(org.eclipse.ui.forms.editor.FormEditor editor, java.lang.String id, java.lang.String title)
editor
- the parent editorid
- the unique identifiertitle
- the page titlepublic SchemaObjectEditorPage(java.lang.String id, java.lang.String title)
initialize
method if this constructor is
used.
id
- a unique page identifiertitle
- a user-friendly page titleMethod Detail |
---|
public void init(org.eclipse.ui.IEditorSite site, org.eclipse.ui.IEditorInput input) throws org.eclipse.ui.PartInitException
init
in interface org.eclipse.ui.IEditorPart
init
in class HelpSystemEditorPart
org.eclipse.ui.PartInitException
IEditorPart.init(org.eclipse.ui.IEditorSite, org.eclipse.ui.IEditorInput)
public void initialize(org.eclipse.ui.forms.editor.FormEditor editor)
initialize
in interface org.eclipse.ui.forms.editor.IFormPage
editor
- the parent editorpublic org.eclipse.ui.forms.editor.FormEditor getEditor()
getEditor
in interface org.eclipse.ui.forms.editor.IFormPage
public org.eclipse.ui.forms.IManagedForm getManagedForm()
getManagedForm
in interface org.eclipse.ui.forms.editor.IFormPage
public void setActive(boolean active)
setActive
in interface org.eclipse.ui.forms.editor.IFormPage
public boolean isActive()
isActive
in interface org.eclipse.ui.forms.editor.IFormPage
true
if the page is currently active, false
otherwise.public void createPartControl(org.eclipse.swt.widgets.Composite parent)
createFormContent(IManagedForm)
to populate the form with content.
createPartControl
in interface org.eclipse.ui.IWorkbenchPart
createPartControl
in class HelpSystemEditorPart
parent
- the page parent compositepublic org.eclipse.swt.widgets.Control getPartControl()
getPartControl
in interface org.eclipse.ui.forms.editor.IFormPage
public void dispose()
dispose
in interface org.eclipse.ui.IWorkbenchPart
dispose
in class org.eclipse.ui.part.WorkbenchPart
public java.lang.String getId()
getId
in interface org.eclipse.ui.forms.editor.IFormPage
public org.eclipse.swt.graphics.Image getTitleImage()
null
- form page has no title image. Subclasses may override.
getTitleImage
in interface org.eclipse.ui.IWorkbenchPart
getTitleImage
in class org.eclipse.ui.part.WorkbenchPart
null
public void setFocus()
setFocus
in interface org.eclipse.ui.IWorkbenchPart
setFocus
in class HelpSystemEditorPart
public void doSave(org.eclipse.core.runtime.IProgressMonitor monitor)
doSave
in interface org.eclipse.ui.ISaveablePart
doSave
in class HelpSystemEditorPart
ISaveablePart.doSave(org.eclipse.core.runtime.IProgressMonitor)
public void doSaveAs()
doSaveAs
in interface org.eclipse.ui.ISaveablePart
doSaveAs
in class HelpSystemEditorPart
ISaveablePart.doSaveAs()
public boolean isSaveAsAllowed()
isSaveAsAllowed
in interface org.eclipse.ui.ISaveablePart
isSaveAsAllowed
in class HelpSystemEditorPart
ISaveablePart.isSaveAsAllowed()
public boolean isDirty()
isDirty
in interface org.eclipse.ui.ISaveablePart
isDirty
in class HelpSystemEditorPart
true
if the managed form is dirty, false
otherwise.ISaveablePart.isDirty()
public void setIndex(int index)
setIndex
in interface org.eclipse.ui.forms.editor.IFormPage
index
- the assigned page indexpublic int getIndex()
getIndex
in interface org.eclipse.ui.forms.editor.IFormPage
public boolean isEditor()
isEditor
in interface org.eclipse.ui.forms.editor.IFormPage
false
public boolean selectReveal(java.lang.Object object)
selectReveal
in interface org.eclipse.ui.forms.editor.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 org.eclipse.ui.forms.editor.IFormPage
true
public void setEditor(org.eclipse.ui.forms.editor.FormEditor editor)
ISchemaObjectEditorPage
SchemaObjectPage
should not override this method
setEditor
in interface ISchemaObjectEditorPage
public void setId(java.lang.String id)
ISchemaObjectEditorPage
setId
in interface ISchemaObjectEditorPage
public void setPartName(java.lang.String title)
ISchemaObjectEditorPage
setPartName
in interface ISchemaObjectEditorPage
setPartName
in class org.eclipse.ui.part.EditorPart
public java.lang.String getErrorMsg()
ISchemaObjectEditorPage
getErrorMsg
in interface ISchemaObjectEditorPage
public IEditorDescriptor getEditorDescriptor()
ISchemaObjectEditorPage
IEditorDescriptor
which is used to describe some static information of the
scheme object editor in which this page is contained
getEditorDescriptor
in interface ISchemaObjectEditorPage
public IEditorPageDescriptor getPageDescriptor()
ISchemaObjectEditorPage
IEditorPageDescriptor
which is used to describe some static information of
this page
getPageDescriptor
in interface ISchemaObjectEditorPage
public void setEditorDescriptor(IEditorDescriptor editor)
ISchemaObjectEditorPage
setEditorDescriptor
in interface ISchemaObjectEditorPage
public void setPageDescriptor(IEditorPageDescriptor page)
ISchemaObjectEditorPage
setPageDescriptor
in interface ISchemaObjectEditorPage
public void refresh()
refresh
in interface ISchemaObjectEditorPage
public void revert()
ISchemaObjectEditorPage
revert
in interface ISchemaObjectEditorPage
public org.eclipse.datatools.sqltools.core.DatabaseIdentifier getDatabaseIdentifier()
getDatabaseIdentifier
in interface ISchemaObjectEditorPage
public void markDirty()
markDirty
in interface ISchemaObjectEditorPage
public IErrorItem[] validate(org.eclipse.swt.events.TypedEvent event)
validate
in interface ISchemaObjectEditorPage
event
-
null
public void populateSQLObjects(org.eclipse.swt.events.TypedEvent event)
populateSQLObjects
in interface ISchemaObjectEditorPage
event
- public void validateAndShowErrors(org.eclipse.swt.events.TypedEvent event)
validateAndShowErrors
in interface ISchemaObjectEditorPage
event
- public boolean isPageOpened()
ISchemaObjectEditorPage
isPageOpened
in interface ISchemaObjectEditorPage
public void modelRegenerated()
ISchemaObjectEditorPage
modelRegenerated
in interface ISchemaObjectEditorPage
public boolean aboutToSave(org.eclipse.core.runtime.IProgressMonitor monitor)
ISchemaObjectEditorPage
aboutToSave
in interface ISchemaObjectEditorPage
public IErrorItem[] validateOnline(org.eclipse.swt.events.TypedEvent event)
ISchemaObjectEditorPage
validateOnline
in interface ISchemaObjectEditorPage
null
public void menuAboutToShow(org.eclipse.jface.action.IMenuManager manager)
ISchemaObjectEditorPage
menuAboutToShow
in interface ISchemaObjectEditorPage
public java.lang.String[] getPreferencePageIds()
ISchemaObjectEditorPage
getPreferencePageIds
in interface ISchemaObjectEditorPage
public void setFocus(int itemType, java.lang.Object item)
setFocus
in interface ISchemaObjectEditorPage
itemType
- the type of the item, each page can define its own typesitem
- the object of the type, it can be null
if the item type provides enough informationpublic void enable(boolean enabled)
enable
in interface IDisablementPart
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |