org.eclipse.gmf.runtime.lite.parts
Class DiagramViewPart

java.lang.Object
  extended by org.eclipse.core.commands.common.EventManager
      extended by org.eclipse.ui.part.WorkbenchPart
          extended by org.eclipse.ui.part.ViewPart
              extended by org.eclipse.gmf.runtime.lite.parts.DiagramViewPart
All Implemented Interfaces:
org.eclipse.core.runtime.IAdaptable, org.eclipse.core.runtime.IExecutableExtension, org.eclipse.ui.IPersistable, org.eclipse.ui.IViewPart, org.eclipse.ui.IWorkbenchPart, org.eclipse.ui.IWorkbenchPart2, org.eclipse.ui.IWorkbenchPart3, org.eclipse.ui.part.IWorkbenchPartOrientation

public abstract class DiagramViewPart
extends org.eclipse.ui.part.ViewPart

This class serves as the base class for the generated diagram view parts.

Author:
bblajer

Field Summary
 
Fields inherited from interface org.eclipse.ui.IWorkbenchPart
PROP_TITLE
 
Constructor Summary
DiagramViewPart()
           
 
Method Summary
protected  void addAction(org.eclipse.jface.action.IAction action)
          Adds an action to this editor's ActionRegistry.
protected  void addEditorAction(org.eclipse.gef.ui.actions.WorkbenchPartAction action)
          Adds an editor action to this editor.
protected  void addEditPartAction(org.eclipse.gef.ui.actions.SelectionAction action)
          Adds an EditPart action to this editor.
protected  void addStackAction(org.eclipse.gef.ui.actions.StackAction action)
          Adds an CommandStack action to this editor.
 void configureGraphicalViewer()
           
abstract  void configurePalette(org.eclipse.gef.palette.PaletteRoot paletteRoot)
           
protected abstract  void createActions()
           
protected  org.eclipse.gef.EditDomain createEditDomain()
          Creates edit domain that will be used for this viewer.
protected  org.eclipse.emf.transaction.TransactionalEditingDomain createEditingDomain()
          Returns the editing domain to be used for the new diagram if no editing domain was specified in showDiagram(TransactionalEditingDomain, URI).
 void createPartControl(org.eclipse.swt.widgets.Composite parent)
           
protected  org.eclipse.swt.widgets.Control createUninitializedControl(org.eclipse.swt.widgets.Composite parent)
          Returns the control this viewer displays when no input has been set.
 void dispose()
           
protected  void disposeDisplayer(DiagramDisplayer diagramDisplayer)
           
protected  org.eclipse.gef.ui.actions.ActionRegistry getActionRegistry()
           
 Object getAdapter(Class type)
           
protected  org.eclipse.gef.commands.CommandStack getCommandStack()
           
protected  IDiagramLayouter getDiagramLayouter()
           
abstract  org.eclipse.emf.common.notify.AdapterFactory getDomainAdapterFactory()
           
protected  org.eclipse.gef.EditDomain getEditDomain()
           
 org.eclipse.emf.transaction.TransactionalEditingDomain getEditingDomain()
           
protected  org.eclipse.gef.GraphicalViewer getGraphicalViewer()
           
protected  org.eclipse.ui.views.properties.IPropertySheetPage getPropertySheetPage()
           
protected  Map<?,?> getSaveOptions()
          Returns the options with which the resources will be saved.
 org.eclipse.ui.IWorkbenchPartSite getSite()
           
protected  double[] getZoomLevels()
           
protected  org.eclipse.gef.editparts.ZoomManager getZoomManager()
           
 void init(org.eclipse.ui.IViewSite site)
           
protected  void initDisplayer(DiagramDisplayer diagramDisplayer)
           
abstract  void initializeGraphicalViewer()
           
abstract  boolean isFlyoutPalette()
           
 void setFocus()
           
protected abstract  void setInput(org.eclipse.emf.common.util.URI diagramURI)
          Sets the input for the diagram.
 boolean showDiagram(org.eclipse.emf.transaction.TransactionalEditingDomain editingDomain, org.eclipse.emf.common.util.URI diagramURI)
          Shows the given diagram in the viewer.
protected abstract  void updateActionBars()
           
 
Methods inherited from class org.eclipse.ui.part.ViewPart
checkSite, getViewSite, init, saveState, setContentDescription, setInitializationData, setPartName
 
Methods inherited from class org.eclipse.ui.part.WorkbenchPart
addPartPropertyListener, addPropertyListener, firePartPropertyChanged, firePropertyChange, getConfigurationElement, getContentDescription, getDefaultImage, getOrientation, getPartName, getPartProperties, getPartProperty, getSite, getTitle, getTitleImage, getTitleToolTip, removePartPropertyListener, removePropertyListener, setPartProperty, setSite, setTitle, setTitleImage, setTitleToolTip, showBusy
 
Methods inherited from class org.eclipse.core.commands.common.EventManager
addListenerObject, clearListeners, getListeners, isListenerAttached, removeListenerObject
 
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, getTitleToolTip, removePropertyListener
 

Constructor Detail

DiagramViewPart

public DiagramViewPart()
Method Detail

init

public void init(org.eclipse.ui.IViewSite site)
          throws org.eclipse.ui.PartInitException
Specified by:
init in interface org.eclipse.ui.IViewPart
Overrides:
init in class org.eclipse.ui.part.ViewPart
Throws:
org.eclipse.ui.PartInitException

getSaveOptions

protected Map<?,?> getSaveOptions()
Returns the options with which the resources will be saved. Subclasses should override.


dispose

public void dispose()
Specified by:
dispose in interface org.eclipse.ui.IWorkbenchPart
Overrides:
dispose in class org.eclipse.ui.part.WorkbenchPart

createPartControl

public void createPartControl(org.eclipse.swt.widgets.Composite parent)
Specified by:
createPartControl in interface org.eclipse.ui.IWorkbenchPart
Specified by:
createPartControl in class org.eclipse.ui.part.WorkbenchPart

setFocus

public void setFocus()
Specified by:
setFocus in interface org.eclipse.ui.IWorkbenchPart
Specified by:
setFocus in class org.eclipse.ui.part.WorkbenchPart

createEditingDomain

protected org.eclipse.emf.transaction.TransactionalEditingDomain createEditingDomain()
Returns the editing domain to be used for the new diagram if no editing domain was specified in showDiagram(TransactionalEditingDomain, URI). Subclasses may reimplement or extend.


createActions

protected abstract void createActions()

showDiagram

public final boolean showDiagram(org.eclipse.emf.transaction.TransactionalEditingDomain editingDomain,
                                 org.eclipse.emf.common.util.URI diagramURI)
Shows the given diagram in the viewer.

Parameters:
editingDomain - the editing domain that should be used for loading the diagram or null if the viewer should create a default instance.
diagramURI - the URI to load the diagram from.

initDisplayer

protected void initDisplayer(DiagramDisplayer diagramDisplayer)

disposeDisplayer

protected void disposeDisplayer(DiagramDisplayer diagramDisplayer)

updateActionBars

protected abstract void updateActionBars()

configureGraphicalViewer

public void configureGraphicalViewer()

getZoomLevels

protected double[] getZoomLevels()

configurePalette

public abstract void configurePalette(org.eclipse.gef.palette.PaletteRoot paletteRoot)

setInput

protected abstract void setInput(org.eclipse.emf.common.util.URI diagramURI)
                          throws org.eclipse.core.runtime.CoreException
Sets the input for the diagram. Implementors should load the contents from the given URI and initialize the diagram.

Throws:
org.eclipse.core.runtime.CoreException - if the diagram with the specified URI cannot be loaded for any reason.

createEditDomain

protected org.eclipse.gef.EditDomain createEditDomain()
Creates edit domain that will be used for this viewer. This method is called once for each diagram being displayed in the editor. Subclasses may extend.


getEditingDomain

public final org.eclipse.emf.transaction.TransactionalEditingDomain getEditingDomain()

getEditDomain

protected final org.eclipse.gef.EditDomain getEditDomain()

getCommandStack

protected final org.eclipse.gef.commands.CommandStack getCommandStack()

getZoomManager

protected final org.eclipse.gef.editparts.ZoomManager getZoomManager()

getActionRegistry

protected final org.eclipse.gef.ui.actions.ActionRegistry getActionRegistry()

getGraphicalViewer

protected final org.eclipse.gef.GraphicalViewer getGraphicalViewer()

getPropertySheetPage

protected org.eclipse.ui.views.properties.IPropertySheetPage getPropertySheetPage()

getDiagramLayouter

protected IDiagramLayouter getDiagramLayouter()

getAdapter

public Object getAdapter(Class type)
Specified by:
getAdapter in interface org.eclipse.core.runtime.IAdaptable
Overrides:
getAdapter in class org.eclipse.ui.part.WorkbenchPart

addAction

protected void addAction(org.eclipse.jface.action.IAction action)
Adds an action to this editor's ActionRegistry.

Parameters:
action - the action to add.

addEditorAction

protected void addEditorAction(org.eclipse.gef.ui.actions.WorkbenchPartAction action)
Adds an editor action to this editor.

Editor actions are actions that depend and work on the editor.

Parameters:
action - the editor action

addEditPartAction

protected void addEditPartAction(org.eclipse.gef.ui.actions.SelectionAction action)
Adds an EditPart action to this editor.

EditPart actions are actions that depend and work on the selected EditParts.

Parameters:
action - the EditPart action

addStackAction

protected void addStackAction(org.eclipse.gef.ui.actions.StackAction action)
Adds an CommandStack action to this editor.

CommandStack actions are actions that depend and work on the CommandStack.

Parameters:
action - the CommandStack action

createUninitializedControl

protected org.eclipse.swt.widgets.Control createUninitializedControl(org.eclipse.swt.widgets.Composite parent)
Returns the control this viewer displays when no input has been set. Subclasses may reimplement.


getDomainAdapterFactory

public abstract org.eclipse.emf.common.notify.AdapterFactory getDomainAdapterFactory()

initializeGraphicalViewer

public abstract void initializeGraphicalViewer()

isFlyoutPalette

public abstract boolean isFlyoutPalette()

getSite

public org.eclipse.ui.IWorkbenchPartSite getSite()


Copyright © 2012. All Rights Reserved.