|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectComposite
org.eclipse.graphiti.ui.editor.GraphicalComposite
public abstract class GraphicalComposite
Based on the original GEF GraphicalEditor class, this is a composite that supports graphical editing.
Nested Class Summary | |
---|---|
private static class |
GraphicalComposite.ActionIDList
|
Field Summary | |
---|---|
private ActionRegistry |
actionRegistry
|
private DefaultEditDomain |
editDomain
|
private GraphicalViewer |
graphicalViewer
|
private List |
propertyActions
|
private List |
selectionActions
|
private List |
stackActions
|
private SelectionSynchronizer |
synchronizer
|
Constructor Summary | |
---|---|
GraphicalComposite(Composite parent,
int style)
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. |
void |
createControl()
Realizes the Editor by creating it's Control. |
protected void |
createGraphicalViewer()
Creates the GraphicalViewer on the specified Composite . |
void |
dispose()
|
protected void |
firePropertyChange(int property)
|
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. |
DefaultEditDomain |
getEditDomain()
Returns the edit domain. |
GraphicalViewer |
getGraphicalViewer()
Returns the graphical viewer. |
protected List |
getPropertyActions()
Returns the list of IActions dependant on property changes in the Editor. |
List |
getSelectionActions()
Returns the list of IDs of Actions that are dependant on changes in the workbench's ISelectionService . |
protected SelectionSynchronizer |
getSelectionSynchronizer()
Returns the selection syncronizer object. |
protected List |
getStackActions()
Returns the list of IDs of Actions that are dependant on the CommmandStack's state. |
protected abstract IWorkbenchPart |
getWorkbenchPart()
|
void |
hookGraphicalViewer()
Hooks the GraphicalViewer to the rest of the Editor. |
protected void |
init()
|
protected void |
initializeActionRegistry()
Initializes the ActionRegistry. |
protected void |
initializeGraphicalViewer()
Override to set the contents of the GraphicalViewer after it has been created. |
boolean |
isDirty()
Returns true if the command stack is dirty |
void |
selectionChanged(IWorkbenchPart part,
ISelection selection)
|
protected void |
setActionRegistry(ActionRegistry registry)
Sets the ActionRegistry for this EditorPart. |
void |
setEditDomain(DefaultEditDomain editDomain)
Sets the EditDomain for this EditorPart. |
boolean |
setFocus()
|
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 java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private DefaultEditDomain editDomain
private GraphicalViewer graphicalViewer
private ActionRegistry actionRegistry
private SelectionSynchronizer synchronizer
private List selectionActions
private List stackActions
private List propertyActions
Constructor Detail |
---|
public GraphicalComposite(Composite parent, int style)
Method Detail |
---|
public void commandStackChanged(EventObject event)
event
- the change eventprotected void configureGraphicalViewer()
protected void createActions()
ActionRegistry
.
protected void createGraphicalViewer()
Composite
.
parent
- the parent compositepublic void createControl()
WARNING: This method may or may not be called by the workbench prior to dispose()
.
parent
- the parent compositepublic void dispose()
org.eclipse.ui.IWorkbenchPart#dispose()
protected void firePropertyChange(int property)
org.eclipse.ui.part.WorkbenchPart#firePropertyChange(int)
public 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.
org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
protected CommandStack getCommandStack()
public DefaultEditDomain getEditDomain()
public 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.
public List getSelectionActions()
ISelectionService
. The associated Actions can be found in the action registry. Such
actions should implement the UpdateAction
interface so that they can be updated in
response to selection changes.
updateActions(List)
protected SelectionSynchronizer getSelectionSynchronizer()
protected List getStackActions()
UpdateAction
interface so that they can be updated in response to command stack
changes. An example is the "undo" action.
public void hookGraphicalViewer()
protected void init()
protected void initializeActionRegistry()
ActionBarContributors
and/or ContextMenuProviders
.
This method may be called on Editor creation, or lazily the first time
getActionRegistry()
is called.
protected void initializeGraphicalViewer()
#createGraphicalViewer(Composite)
public boolean isDirty()
true
if the command stack is dirty
org.eclipse.ui.ISaveablePart#isDirty()
public void selectionChanged(IWorkbenchPart part, ISelection selection)
org.eclipse.ui.ISelectionListener#selectionChanged(IWorkbenchPart, ISelection)
protected void setActionRegistry(ActionRegistry registry)
registry
- the registrypublic void setEditDomain(DefaultEditDomain editDomain)
ed
- the domainpublic boolean setFocus()
public 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 updateprotected abstract IWorkbenchPart getWorkbenchPart()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |