roneditor.objectnetview
Class ObjectNetPage

java.lang.Object
  extended by org.eclipse.ui.part.Page
      extended by roneditor.AbstractMultiViewerPage
          extended by roneditor.objectnetview.ObjectNetPage
All Implemented Interfaces:
org.eclipse.core.runtime.IAdaptable, org.eclipse.emf.common.notify.Adapter, org.eclipse.gef.commands.CommandStackListener, org.eclipse.jface.viewers.ISelectionChangedListener, org.eclipse.ui.part.IPage, org.eclipse.ui.part.IPageBookViewPage

public class ObjectNetPage
extends AbstractMultiViewerPage

This is an implementation of AbstractPageBookView to display ObjectNets.

It uses ObjectNetViewEditPartFactory and ObjectNetPageContextMenuProvider, configures the keyhandler and creates actions to move ONNodes by pressing keys.

On model change nothing is done.

Author:
Tony Modica

Nested Class Summary
 
Nested classes/interfaces inherited from class roneditor.AbstractMultiViewerPage
AbstractMultiViewerPage.MultiViewerPageViewer
 
Nested classes/interfaces inherited from interface org.eclipse.emf.common.notify.Adapter
org.eclipse.emf.common.notify.Adapter.Internal
 
Constructor Summary
ObjectNetPage(ronmodel.ObjectNet objectNet, org.eclipse.ui.IEditorPart editor)
           
 
Method Summary
protected  void createActions()
          To be implemented by subclasses.
protected  ContextMenuProviderWithActionRegistry createContextMenuProvider(org.eclipse.gef.EditPartViewer viewer)
          Subclasses must implement to specify the ContextMenuProviderWithActionRegistry that should be used by this page's GraphicalViewers and is responsible to show the created actions in the context menu.
protected  org.eclipse.gef.EditPartFactory createEditPartFactory()
          Subclasses must implement to specify the EditPartFactory that should be used by this page's GraphicalViewers.
protected  org.eclipse.gef.palette.PaletteRoot createPaletteRoot()
          Subclasses must implement to specify the PaletteRoot that should be used by this page's EditDomain and which defines the contents of the palette.
 int getNumberOfViewers()
           
 ronmodel.ObjectNet getObjectNet()
           
protected  int[] getThumbSashWeights()
          The two values in the returned array specify how the flyout composite's space is being divided between the palette entries and the thumbnail in the palette.
 org.eclipse.emf.ecore.EObject[] getViewerContents()
          The viewer's are arranged horizontal and will be showing these objects in the order of the returned array from left to right.
 void notifyChanged(org.eclipse.emf.common.notify.Notification notification)
           
protected  void setupKeyHandler(org.eclipse.gef.KeyHandler kh)
          Subclasses must implement to associate KeyStrokes with Actions in the passed KeyHandler} which is the one used for the GraphicalViewers.
 
Methods inherited from class roneditor.AbstractMultiViewerPage
commandStackChanged, createControl, dispose, getActionRegistry, getAdapter, getControl, getEditor, getKeyHandler, getModel, getStatusLineManager, getTarget, getToolBarManager, getViewers, getViewersContents, init, isAdapterForType, registerHandleForEditorAction, selectionChanged, setCurrentViewer, setFocus, setTarget, setViewersContents, switchViewerVisibility, updateActions
 
Methods inherited from class org.eclipse.ui.part.Page
getSite, makeContributions, setActionBars
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ObjectNetPage

public ObjectNetPage(ronmodel.ObjectNet objectNet,
                     org.eclipse.ui.IEditorPart editor)
Method Detail

createActions

protected void createActions()
Description copied from class: AbstractMultiViewerPage
To be implemented by subclasses. Actions have to be registered via AbstractMultiViewerPage.getActionRegistry().
WorkbenchPartActions should get the editor (AbstractMultiViewerPage.getEditor()) as workbench part in their constructor.
To register actions as handles for RetargetActions you may use AbstractMultiViewerPage.registerHandleForEditorAction(String) with a string that matches both the RetargetAction's and the handle's ID.

In AbstractMultiViewerPage.setCurrentViewer(roneditor.AbstractMultiViewerPage.MultiViewerPageViewer) the AbstractMultiViewerPage.currentViewer will be set with SelectionAction.setSelectionProvider(ISelectionProvider) for SelectionActions.

Specified by:
createActions in class AbstractMultiViewerPage
See Also:
roneditor.objectnetview.AbstractPageWithFlyoutPalette#createActions()

setupKeyHandler

protected void setupKeyHandler(org.eclipse.gef.KeyHandler kh)
Description copied from class: AbstractMultiViewerPage
Subclasses must implement to associate KeyStrokes with Actions in the passed KeyHandler} which is the one used for the GraphicalViewers.

Specified by:
setupKeyHandler in class AbstractMultiViewerPage
See Also:
roneditor.objectnetview.AbstractPageWithFlyoutPalette#setupKeyHandler(org.eclipse.gef.KeyHandler)

createEditPartFactory

protected org.eclipse.gef.EditPartFactory createEditPartFactory()
Description copied from class: AbstractMultiViewerPage
Subclasses must implement to specify the EditPartFactory that should be used by this page's GraphicalViewers.

Specified by:
createEditPartFactory in class AbstractMultiViewerPage
Returns:
The EditPartFactory for the GraphicalViewers of this page.
See Also:
roneditor.objectnetview.AbstractPageWithFlyoutPalette#createEditPartFactory()

createContextMenuProvider

protected ContextMenuProviderWithActionRegistry createContextMenuProvider(org.eclipse.gef.EditPartViewer viewer)
Description copied from class: AbstractMultiViewerPage
Subclasses must implement to specify the ContextMenuProviderWithActionRegistry that should be used by this page's GraphicalViewers and is responsible to show the created actions in the context menu.

Specified by:
createContextMenuProvider in class AbstractMultiViewerPage
Parameters:
viewer - The graphical viewer for context menu provider
Returns:
The ContextMenuProviderWithActionRegistry for the specified GraphicalViewer.
See Also:
roneditor.objectnetview.AbstractPageWithFlyoutPalette#getContextMenuProvider()

createPaletteRoot

protected org.eclipse.gef.palette.PaletteRoot createPaletteRoot()
Description copied from class: AbstractMultiViewerPage
Subclasses must implement to specify the PaletteRoot that should be used by this page's EditDomain and which defines the contents of the palette.

Specified by:
createPaletteRoot in class AbstractMultiViewerPage
Returns:
The PaletteRoot for the EditDomain of this page.
See Also:
roneditor.objectnetview.AbstractPageWithFlyoutPalette#createPaletteRoot()

getThumbSashWeights

protected int[] getThumbSashWeights()
Description copied from class: AbstractMultiViewerPage
The two values in the returned array specify how the flyout composite's space is being divided between the palette entries and the thumbnail in the palette. When implementing this template should be used:
return new int[] { Palette_Weight, Thumb_Weight };

Specified by:
getThumbSashWeights in class AbstractMultiViewerPage
Returns:
An array of 2 integers describing the ratio of the palette to the thumbnail.
See Also:
roneditor.objectnetview.AbstractPageWithFlyoutPalette#getThumbSashWeights()

notifyChanged

public void notifyChanged(org.eclipse.emf.common.notify.Notification notification)
See Also:
Adapter.notifyChanged(org.eclipse.emf.common.notify.Notification)

getNumberOfViewers

public int getNumberOfViewers()
Specified by:
getNumberOfViewers in class AbstractMultiViewerPage
Returns:
The number of viewers that shall be created on this page.
See Also:
roneditor.ruleview.AbstractMultiViewerPage#getNumberOfViewers()

getViewerContents

public org.eclipse.emf.ecore.EObject[] getViewerContents()
Description copied from class: AbstractMultiViewerPage
The viewer's are arranged horizontal and will be showing these objects in the order of the returned array from left to right. The length of the array has to be exactly the value of AbstractMultiViewerPage.getNumberOfViewers()!

Specified by:
getViewerContents in class AbstractMultiViewerPage
Returns:
The objects that will be set as contents in each of AbstractMultiViewerPage.viewers.
See Also:
roneditor.ruleview.AbstractMultiViewerPage#getViewerContents()

getObjectNet

public ronmodel.ObjectNet getObjectNet()
Returns:
the ObjectNet