|
Eclipse GEF 2.1 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.eclipse.ui.part.WorkbenchPart | +--org.eclipse.ui.part.EditorPart | +--org.eclipse.gef.ui.parts.GraphicalEditor
This class serves as a quick starting point for clients who are new to GEF. It will create an Editor containing a single GraphicalViewer as its control.
IMPORTANTThis class should only be used as a reference for creating your own EditorPart implementation. This class will not suit everyone's needs, and may change in the future. Clients may copy the implementation.
Field Summary |
Fields inherited from interface org.eclipse.ui.IEditorPart |
PROP_DIRTY, PROP_INPUT |
Fields inherited from interface org.eclipse.ui.IWorkbenchPart |
PROP_TITLE |
Constructor Summary | |
GraphicalEditor()
Constructs the editor part |
Method Summary | |
void |
commandStackChanged(EventObject event)
When the command stack changes, the actions interested in the command stack are updated. |
protected void |
configureGraphicalViewer()
Called to configure the graphical viewer before it receives its contents. |
protected void |
createActions()
Creates actions for this editor. |
protected void |
createGraphicalViewer(Composite parent)
Creates the GraphicalViewer on the specified Composite . |
void |
createPartControl(Composite parent)
Realizes the Editor by creating it's Control. |
void |
dispose()
|
protected void |
firePropertyChange(int property)
|
protected ActionRegistry |
getActionRegistry()
Lazily creates and returns the action registry. |
Object |
getAdapter(Class type)
Returns the adapter for the specified key. |
protected CommandStack |
getCommandStack()
Returns the command stack. |
protected DefaultEditDomain |
getEditDomain()
Returns the edit domain. |
protected GraphicalViewer |
getGraphicalViewer()
Returns the graphical viewer. |
protected List |
getPropertyActions()
Returns the list of IActions dependant on property changes in the
Editor. |
protected List |
getSelectionActions()
Returns the list of IActions dependant on changes in the workbench's
ISelectionService . |
protected SelectionSynchronizer |
getSelectionSynchronizer()
Returns the selection syncronizer object. |
protected List |
getStackActions()
Returns the list of IActions dependant on the CommmandStack's state.
|
protected void |
hookGraphicalViewer()
Hooks the GraphicalViewer to the rest of the Editor. |
void |
init(IEditorSite site,
IEditorInput input)
Sets the site and input for this editor then creates and initializes the actions. |
protected void |
initializeActionRegistry()
Initializes the ActionRegistry. |
protected abstract void |
initializeGraphicalViewer()
Override to set the contents of the GraphicalViewer after it has been created. |
void |
selectionChanged(IWorkbenchPart part,
ISelection selection)
|
protected void |
setActionRegistry(ActionRegistry registry)
Sets the ActionRegistry for this EditorPart. |
protected void |
setEditDomain(DefaultEditDomain ed)
Sets the EditDomain for this EditorPart. |
void |
setFocus()
|
protected void |
setGraphicalViewer(GraphicalViewer viewer)
Sets the graphicalViewer for this EditorPart. |
protected void |
updateActions(List actionIds)
A convenience method for updating a set of actions defined by the given List of action IDs. |
Methods inherited from class org.eclipse.ui.part.EditorPart |
doSave, doSaveAs, getEditorInput, getEditorSite, getTitleToolTip, gotoMarker, isDirty, isSaveAsAllowed, isSaveOnCloseNeeded, setInput |
Methods inherited from class org.eclipse.ui.part.WorkbenchPart |
addPropertyListener, getConfigurationElement, getDefaultImage, getSite, getTitle, getTitleImage, removePropertyListener, setInitializationData, setSite, setTitle, setTitleImage, setTitleToolTip |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.eclipse.ui.IWorkbenchPart |
addPropertyListener, getSite, getTitle, getTitleImage, removePropertyListener |
Constructor Detail |
public GraphicalEditor()
Method Detail |
public void commandStackChanged(EventObject event)
commandStackChanged
in interface CommandStackListener
event
- the change eventprotected void configureGraphicalViewer()
protected void createActions()
ActionRegistry
.
protected void createGraphicalViewer(Composite parent)
Composite
.
parent
- the parent compositepublic void createPartControl(Composite parent)
WARNING: This method may or may not be called by the workbench prior to dispose()
.
createPartControl
in interface IWorkbenchPart
createPartControl
in class WorkbenchPart
parent
- the parent compositepublic void dispose()
dispose
in interface IWorkbenchPart
dispose
in class WorkbenchPart
IWorkbenchPart.dispose()
protected void firePropertyChange(int property)
firePropertyChange
in class WorkbenchPart
WorkbenchPart.firePropertyChange(int)
protected ActionRegistry getActionRegistry()
public Object getAdapter(Class type)
IMPORTANT certain requests, such as the property sheet, may be made before
or after createPartControl(Composite)
is called. The order is unspecified by
the Workbench.
getAdapter
in interface IAdaptable
getAdapter
in class WorkbenchPart
IAdaptable.getAdapter(java.lang.Class)
protected CommandStack getCommandStack()
protected DefaultEditDomain getEditDomain()
protected GraphicalViewer getGraphicalViewer()
protected List getPropertyActions()
IActions
dependant on property changes in the
Editor. These actions should implement the UpdateAction
interface so that they
can be updated in response to property changes. An example is the "Save" action.
protected List getSelectionActions()
IActions
dependant on changes in the workbench's
ISelectionService
. These actions should implement the UpdateAction
interface so that they can be updated in response to selection changes. An example is
the Delete action.
protected SelectionSynchronizer getSelectionSynchronizer()
protected List getStackActions()
IActions
dependant on the CommmandStack's state.
These actions should implement the UpdateAction
interface so that they can be
updated in response to command stack changes. An example is the "undo" action.
protected void hookGraphicalViewer()
public void init(IEditorSite site, IEditorInput input) throws PartInitException
super.init(site, input)
.
init
in interface IEditorPart
init
in class EditorPart
PartInitException
IEditorPart.init(IEditorSite, IEditorInput)
protected void initializeActionRegistry()
ActionBarContributors
and/or ContextMenuProviders
.
This method may be called on Editor creation, or lazily the first time getActionRegistry()
is called.
protected abstract void initializeGraphicalViewer()
createGraphicalViewer(Composite)
public void selectionChanged(IWorkbenchPart part, ISelection selection)
selectionChanged
in interface ISelectionListener
ISelectionListener.selectionChanged(IWorkbenchPart, ISelection)
protected void setActionRegistry(ActionRegistry registry)
registry
- the registryprotected void setEditDomain(DefaultEditDomain ed)
ed
- the domainpublic void setFocus()
setFocus
in interface IWorkbenchPart
setFocus
in class WorkbenchPart
IWorkbenchPart.setFocus()
protected void setGraphicalViewer(GraphicalViewer viewer)
viewer
- the graphical viewerprotected void updateActions(List actionIds)
action registry
. If the corresponding action is an UpdateAction
, it will have
its update()
method called.
actionIds
- the list of IDs to update
|
Eclipse GEF 2.1 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |