SAM

org.topcased.modeler.sam.editor.outline
Class SamOutlineNavigator

java.lang.Object
  extended by ModelNavigator
      extended by org.topcased.modeler.sam.editor.outline.SamOutlineNavigator

public class SamOutlineNavigator
extends ModelNavigator

Added this class to initialize the tree viewer with our customized content/label providers (models library section) and customize the context menu to forbid unsupported actions on external models.


Constructor Summary
SamOutlineNavigator(org.eclipse.swt.widgets.Composite parent, Modeler modeler, org.eclipse.ui.part.IPageSite pageSite)
          Constructor.
 
Method Summary
protected  void createMultiSelectionMenu(org.eclipse.jface.action.IMenuManager manager, org.eclipse.jface.viewers.IStructuredSelection selection)
          By default, this adds a delete action and a load additionnal resources action.
protected  void createSingleSelectionMenu(org.eclipse.jface.action.IMenuManager manager, java.lang.Object selection)
           
protected  void hookKeyListeners()
          Overriden to forbid deleting of a port or multiport in an instance of a system/automaton in the Outline.
protected  void initProviders()
          Overriden so as to provide custom content/label provider for the outline : adds items of type ModelLibrary and InstanciableModel for the 'Possible imports' section.
protected  boolean isControlActionEnabledFor(EObject selectedObject)
           
protected  boolean isDiagramsMenuEnabledFor(EObject selectedObject)
           
protected  boolean isEMFMenuEnabledFor(EObject selectedObject)
           
 void menuAboutToShow(org.eclipse.jface.action.IMenuManager menuManager)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SamOutlineNavigator

public SamOutlineNavigator(org.eclipse.swt.widgets.Composite parent,
                           Modeler modeler,
                           org.eclipse.ui.part.IPageSite pageSite)
Constructor. Nothing special added.

Parameters:
parent -
modeler -
pageSite -
See Also:
ModelNavigator
Method Detail

initProviders

protected void initProviders()
Overriden so as to provide custom content/label provider for the outline : adds items of type ModelLibrary and InstanciableModel for the 'Possible imports' section.

See Also:
org.topcased.modeler.editor.outline.ModelNavigator#initProviders()

createMultiSelectionMenu

protected void createMultiSelectionMenu(org.eclipse.jface.action.IMenuManager manager,
                                        org.eclipse.jface.viewers.IStructuredSelection selection)
By default, this adds a delete action and a load additionnal resources action. We don't want the additionnal resources action, and we need to control the delete (eg SamOutlineContentProvider.FilteredAdditionalResources selection shouldn't be deleted).

See Also:
org.topcased.modeler.editor.outline.ModelNavigator#createMultiSelectionMenu(org.eclipse.jface.action.IMenuManager, org.eclipse.jface.viewers.IStructuredSelection)

createSingleSelectionMenu

protected void createSingleSelectionMenu(org.eclipse.jface.action.IMenuManager manager,
                                         java.lang.Object selection)

isControlActionEnabledFor

protected boolean isControlActionEnabledFor(EObject selectedObject)

isDiagramsMenuEnabledFor

protected boolean isDiagramsMenuEnabledFor(EObject selectedObject)

isEMFMenuEnabledFor

protected boolean isEMFMenuEnabledFor(EObject selectedObject)

hookKeyListeners

protected void hookKeyListeners()
Overriden to forbid deleting of a port or multiport in an instance of a system/automaton in the Outline.

See Also:
org.topcased.modeler.editor.outline.ModelNavigator#hookKeyListeners()

menuAboutToShow

public void menuAboutToShow(org.eclipse.jface.action.IMenuManager menuManager)

SAM

Copyright (c) 2005 TOPCASED Contributors 2005 - 2007. All rights reserved.