Eclipse GEF
2.1

org.eclipse.gef.ui.parts
Class GraphicalEditor

java.lang.Object
  |
  +--org.eclipse.ui.part.WorkbenchPart
        |
        +--org.eclipse.ui.part.EditorPart
              |
              +--org.eclipse.gef.ui.parts.GraphicalEditor
All Implemented Interfaces:
CommandStackListener, IAdaptable, IEditorPart, IExecutableExtension, ISaveablePart, ISelectionListener, IWorkbenchPart
Direct Known Subclasses:
GraphicalEditorWithPalette

public abstract class GraphicalEditor
extends EditorPart
implements CommandStackListener, ISelectionListener


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()
           
 
Method Summary
 void commandStackChanged(EventObject event)
          Called when the CommandStack's state has changed.
protected  void configureGraphicalViewer()
           
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()
           
 Object getAdapter(Class type)
          Returns the adapter for the specified key.
protected  CommandStack getCommandStack()
           
protected  DefaultEditDomain getEditDomain()
           
protected  GraphicalViewer getGraphicalViewer()
           
protected  List getPropertyActions()
           
protected  List getSelectionActions()
           
protected  SelectionSynchronizer getSelectionSynchronizer()
           
protected  List getStackActions()
           
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)
           
 
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

GraphicalEditor

public GraphicalEditor()
Method Detail

commandStackChanged

public void commandStackChanged(EventObject event)
Description copied from interface: CommandStackListener
Called when the CommandStack's state has changed.

Specified by:
commandStackChanged in interface CommandStackListener
Parameters:
event - the event

configureGraphicalViewer

protected void configureGraphicalViewer()

createActions

protected void createActions()
Creates actions for this editor. Subclasses should override this method to create and register actions with the ActionRegistry.


createGraphicalViewer

protected void createGraphicalViewer(Composite parent)
Creates the GraphicalViewer on the specified Composite.


createPartControl

public void createPartControl(Composite parent)
Realizes the Editor by creating it's Control.

WARNING: This method may or may not be called by Eclipse prior to dispose().

Specified by:
createPartControl in interface IWorkbenchPart
Specified by:
createPartControl in class WorkbenchPart

dispose

public void dispose()
Specified by:
dispose in interface IWorkbenchPart
Overrides:
dispose in class WorkbenchPart

firePropertyChange

protected void firePropertyChange(int property)
Overrides:
firePropertyChange in class WorkbenchPart
See Also:
WorkbenchPart.firePropertyChange(int)

getActionRegistry

protected ActionRegistry getActionRegistry()

getAdapter

public Object getAdapter(Class type)
Returns the adapter for the specified key.

getAdapter may be called before createPartControl(Composite). The order is unspecified in JFace.

Specified by:
getAdapter in interface IAdaptable
Overrides:
getAdapter in class WorkbenchPart

getCommandStack

protected CommandStack getCommandStack()

getEditDomain

protected DefaultEditDomain getEditDomain()

getGraphicalViewer

protected GraphicalViewer getGraphicalViewer()

getPropertyActions

protected List getPropertyActions()

getSelectionActions

protected List getSelectionActions()

getSelectionSynchronizer

protected SelectionSynchronizer getSelectionSynchronizer()

getStackActions

protected List getStackActions()

hookGraphicalViewer

protected void hookGraphicalViewer()
Hooks the GraphicalViewer to the rest of the Editor. By default, the viewer is added to the SelectionSynchronizer, which can be used to keep 2 or more EditPartViewers in sync. The viewer is also registered as the ISelectionProvider for the Editor's PartSite.


init

public void init(IEditorSite site,
                 IEditorInput input)
          throws PartInitException
Sets the site and input for this editor then creates and initializes the actions. Subclasses may override this method, but must call super.init(site, input) .

Specified by:
init in interface IEditorPart
Specified by:
init in class EditorPart
PartInitException
See Also:
IEditorPart.init(IEditorSite, IEditorInput)

initializeActionRegistry

protected void initializeActionRegistry()
Initializes the ActionRegistry. This registry may be used by ActionBarContributors and/or ContextMenuProviders.

This method may be called on Editor creation, or lazily the first time getActionRegistry() is called.


initializeGraphicalViewer

protected abstract void initializeGraphicalViewer()
Override to set the contents of the GraphicalViewer after it has been created.

See Also:
createGraphicalViewer(Composite)

selectionChanged

public void selectionChanged(IWorkbenchPart part,
                             ISelection selection)
Specified by:
selectionChanged in interface ISelectionListener
See Also:
ISelectionListener.selectionChanged(IWorkbenchPart, ISelection)

setActionRegistry

protected void setActionRegistry(ActionRegistry registry)
Sets the ActionRegistry for this EditorPart.


setEditDomain

protected void setEditDomain(DefaultEditDomain ed)
Sets the EditDomain for this EditorPart.


setFocus

public void setFocus()
Specified by:
setFocus in interface IWorkbenchPart
Specified by:
setFocus in class WorkbenchPart

setGraphicalViewer

protected void setGraphicalViewer(GraphicalViewer viewer)
Sets the graphicalViewer for this EditorPart.


updateActions

protected void updateActions(List actionIds)

Eclipse GEF
2.1

Copyright (c) IBM Corp. and others 2000, 2003. All Rights Reserved.