|
||||||||||
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.ui.part.MultiPageEditorPart
org.eclipse.ui.forms.editor.FormEditor
org.eclipse.datatools.sqltools.schemaobjecteditor.ui.core.SchemaObjectEditor
public class SchemaObjectEditor
The base editor, which is responsible for loading the pages defined by the consumers according to the end-user's setting (visibility & order). Through this class, consumer can get the run-time page and static page instance.
To define the run-time behaviour of the multi-page eidtor, the consumer need to extend
DefaultSchemaObjectEditorHandler
and set it in the extension accordingly.
The editor input of this base editor is defined as SchemeObjectEditorInput
, which contains a model
object, the consumer can use that field to store the domain model, for example the Table object.
Some methods defined in the parent classes are overrided to emplify the visibility since the consumer can not extend and override this class.
Field Summary | |
---|---|
java.lang.Object |
_data
The consumer can store application data in this field |
java.lang.Object |
_editModel
The edit model of this editor, this is always a "dirty" one compared with the orginal model |
Fields inherited from interface org.eclipse.ui.IEditorPart |
---|
PROP_DIRTY, PROP_INPUT |
Fields inherited from interface org.eclipse.ui.IWorkbenchPart |
---|
PROP_TITLE |
Constructor Summary | |
---|---|
SchemaObjectEditor()
|
Method Summary | |
---|---|
void |
addPage(int index,
NestedEditorPage page)
Creates and adds a new page containing the given editor to this multi-page editor. |
void |
clearDirty()
Clear the dirty status of the editor |
void |
dispose()
|
void |
doSave(org.eclipse.core.runtime.IProgressMonitor monitor)
|
void |
doSaveAs()
|
void |
fireDirtyPropertyChange()
A short-cut method |
void |
fireSchemaEditorProperChanged(int propertyId)
|
ISchemaObjectEditorPage |
getActiveEditorPage()
Returns the active page instance |
java.lang.Object |
getAdapter(java.lang.Class adapter)
|
ISchemaObjectEditorPage[] |
getAllPages()
Returns all pages loaded |
int |
getCurrentPageIndex()
Returns the current page's index |
java.lang.Object |
getData()
Returns the application data |
java.lang.String |
getDisplayName()
Tries to return a meaningful name |
java.lang.Object |
getEditModel()
Returns the edit model |
org.eclipse.swt.widgets.Composite |
getEditorContainer()
|
IEditorDescriptor |
getEditorDescriptor()
Returns the static editor instance |
ISchemaObjectEditorHandler |
getEditorHandler()
Returns the handler |
org.eclipse.swt.widgets.Control |
getEditorPageControl(int pageIndex)
|
int |
getEditorPageCount()
|
ISchemaObjectEditorPage |
getPageById(java.lang.String id)
Returns the page by id |
ISchemaObjectEditorPage |
getPageByName(java.lang.String name)
Returns the page by name |
void |
init(org.eclipse.ui.IEditorSite site,
org.eclipse.ui.IEditorInput input)
|
boolean |
isDirty()
|
boolean |
isSaveAsAllowed()
|
boolean |
isSyncSave()
Checks if current save mode is sync save |
void |
markDirty()
Mark the editor as dirty status |
boolean |
needRefreshAfterSave()
|
void |
resouceChanged(IResourceChangeEvent event)
The consumer need to call this method when the resouce is changed outside of the schema editor's scope |
void |
setActivePage(int pageIndex)
Widen the visibility |
org.eclipse.ui.forms.editor.IFormPage |
setActivePage(java.lang.String pageId)
|
void |
setData(java.lang.Object _data)
Sets the application data |
void |
setEditModel(java.lang.Object model)
Sets the edit model |
void |
setEditorPageImage(int pageIndex,
org.eclipse.swt.graphics.Image image)
|
void |
setEditorPageText(int pageIndex,
java.lang.String text)
|
void |
setEditorPartName(java.lang.String name)
Sets the part name for the schema object editor |
void |
setNeedRefreshAfterSave(boolean needRefresh)
Sets if the editor needs to be refreshed after it is saved |
void |
setSyncSaveMode()
Sets sync save mode for the next save process |
java.util.Map |
validate()
Validates the editor to see if there are errors |
Methods inherited from class org.eclipse.ui.forms.editor.FormEditor |
---|
addPage, addPage, addPage, addPage, addPage, addPage, addPageChangedListener, close, editorDirtyStateChanged, findPage, getActiveEditor, getActivePageInstance, getSelectedPage, getToolkit, removePage, removePageChangedListener, selectReveal, setActivePage |
Methods inherited from class org.eclipse.ui.part.MultiPageEditorPart |
---|
createPartControl, findEditors, setActiveEditor, setFocus |
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, getContentDescription, getOrientation, getPartName, getPartProperties, getPartProperty, getSite, getTitle, getTitleImage, 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, createPartControl, getSite, getTitle, getTitleImage, getTitleToolTip, removePropertyListener, setFocus |
Methods inherited from interface org.eclipse.ui.ISaveablePart |
---|
isSaveOnCloseNeeded |
Field Detail |
---|
public java.lang.Object _data
public java.lang.Object _editModel
Constructor Detail |
---|
public SchemaObjectEditor()
Method Detail |
---|
public void clearDirty()
ISchemaObjectEditor
clearDirty
in interface ISchemaObjectEditor
public void dispose()
dispose
in interface org.eclipse.ui.IWorkbenchPart
dispose
in class org.eclipse.ui.forms.editor.FormEditor
public void doSave(org.eclipse.core.runtime.IProgressMonitor monitor)
doSave
in interface org.eclipse.ui.ISaveablePart
doSave
in class org.eclipse.ui.part.EditorPart
public void doSaveAs()
doSaveAs
in interface org.eclipse.ui.ISaveablePart
doSaveAs
in class org.eclipse.ui.part.EditorPart
public void fireDirtyPropertyChange()
fireDirtyPropertyChange
in interface ISchemaObjectEditor
public void fireSchemaEditorProperChanged(int propertyId)
public ISchemaObjectEditorPage getActiveEditorPage()
getActiveEditorPage
in interface ISchemaObjectEditor
public java.lang.Object getAdapter(java.lang.Class adapter)
getAdapter
in interface org.eclipse.core.runtime.IAdaptable
getAdapter
in class org.eclipse.ui.part.MultiPageEditorPart
public ISchemaObjectEditorPage[] getAllPages()
getAllPages
in interface ISchemaObjectEditor
public int getCurrentPageIndex()
ISchemaObjectEditor
getCurrentPageIndex
in interface ISchemaObjectEditor
public java.lang.Object getData()
ISchemaObjectEditor
getData
in interface ISchemaObjectEditor
public java.lang.Object getEditModel()
ISchemaObjectEditor
getEditModel
in interface ISchemaObjectEditor
public org.eclipse.swt.widgets.Composite getEditorContainer()
public ISchemaObjectEditorHandler getEditorHandler()
ISchemaObjectEditor
getEditorHandler
in interface ISchemaObjectEditor
public org.eclipse.swt.widgets.Control getEditorPageControl(int pageIndex)
public int getEditorPageCount()
public ISchemaObjectEditorPage getPageById(java.lang.String id)
getPageById
in interface ISchemaObjectEditor
id
- the id of a page, should be unique for an editor
public ISchemaObjectEditorPage getPageByName(java.lang.String name)
getPageByName
in interface ISchemaObjectEditor
name
- name of editor pages, we suggest that the name is also unique for an editor, otherwise this method
will only return the first one
public IEditorDescriptor getEditorDescriptor()
getEditorDescriptor
in interface ISchemaObjectEditor
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 org.eclipse.ui.forms.editor.FormEditor
org.eclipse.ui.PartInitException
public boolean isDirty()
isDirty
in interface org.eclipse.ui.ISaveablePart
isDirty
in class org.eclipse.ui.forms.editor.FormEditor
public boolean isSaveAsAllowed()
isSaveAsAllowed
in interface org.eclipse.ui.ISaveablePart
isSaveAsAllowed
in class org.eclipse.ui.part.EditorPart
public void markDirty()
ISchemaObjectEditor
markDirty
in interface ISchemaObjectEditor
public void resouceChanged(IResourceChangeEvent event)
IResourceChangeHandler
resouceChanged
in interface IResourceChangeHandler
public void setData(java.lang.Object _data)
ISchemaObjectEditor
setData
in interface ISchemaObjectEditor
public void setEditModel(java.lang.Object model)
ISchemaObjectEditor
setEditModel
in interface ISchemaObjectEditor
public void setEditorPageImage(int pageIndex, org.eclipse.swt.graphics.Image image)
public void setEditorPageText(int pageIndex, java.lang.String text)
public void setEditorPartName(java.lang.String name)
ISchemaObjectEditor
setEditorPartName
in interface ISchemaObjectEditor
public void addPage(int index, NestedEditorPage page) throws org.eclipse.ui.PartInitException
index
- the index at which to add the page (0-based)editor
- the nested editorinput
- the input for the nested editor
org.eclipse.ui.PartInitException
- if a new page could not be createdthe handler for property change events from the nested editor
public java.util.Map validate()
ISchemaObjectEditor
validate
in interface ISchemaObjectEditor
public java.lang.String getDisplayName()
getDisplayName
in interface ISchemaObjectEditor
public org.eclipse.ui.forms.editor.IFormPage setActivePage(java.lang.String pageId)
setActivePage
in class org.eclipse.ui.forms.editor.FormEditor
public void setActivePage(int pageIndex)
setActivePage
in class org.eclipse.ui.forms.editor.FormEditor
public void setSyncSaveMode()
ISchemaObjectEditor
setSyncSaveMode
in interface ISchemaObjectEditor
public boolean isSyncSave()
ISchemaObjectEditor
isSyncSave
in interface ISchemaObjectEditor
public boolean needRefreshAfterSave()
needRefreshAfterSave
in interface ISchemaObjectEditor
public void setNeedRefreshAfterSave(boolean needRefresh)
ISchemaObjectEditor
setNeedRefreshAfterSave
in interface ISchemaObjectEditor
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |