com.pnp.xfeature.editor
Class FeatureDiagramEditor

java.lang.Object
  extended by GraphicalEditor
      extended by com.pnp.xfeature.editor.FeatureDiagramEditor

public class FeatureDiagramEditor
extends GraphicalEditor

The main class. Referenced from plugin.xml. Called by internal Eclipse mechanism when a .xmf file opening is requested.

Author:
Kamil Ekstein and Ondrej Rohlik, created on 21.9.2004, the inner class on 27.1.2005

Constructor Summary
FeatureDiagramEditor()
          constructs the editor and initialize it with a new edit domain
 
Method Summary
 void commandStackChanged(java.util.EventObject event)
          fires the property change event if the feature model was edited since the last save operation or save was already requested by the user
 void createPartControl(Composite parent)
          calls superclass and creates the context menu
 void doSave(IProgressMonitor monitor)
          saves the feature model
 void doSaveAs()
          saves a copy of feature model to the specified location
 void exportContextMenu(IMenuManager manager)
           
 java.lang.Object getAdapter(java.lang.Class type)
          returns a reference to an outline view
 FeatureDiagramModel getContents()
          Returns the contents of the editor, i.e. the currently edited feature model diagram model (as a wrapper class to the DOM tree containing the whole model)
 DefaultEditDomain getEditDomain()
          getter method for the editDomain property
 MetaModelEditorOutlinePage getOutlinePage()
          Returns the overview for the outline view.
 GraphicalViewer getViewer()
           
 void init(IEditorSite site, IEditorInput input)
          just calls superclass implementation
 boolean isDirty()
          returns true if the feature model was edited since the last save operation
 boolean isSaveAsAllowed()
          returns true as it is allways allowed to save a model
 void selectionChanged(IWorkbenchPart part, ISelection selection)
          calls superclass implementation
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FeatureDiagramEditor

public FeatureDiagramEditor()
constructs the editor and initialize it with a new edit domain

Method Detail

getEditDomain

public DefaultEditDomain getEditDomain()
getter method for the editDomain property


init

public void init(IEditorSite site,
                 IEditorInput input)
          throws PartInitException
just calls superclass implementation

Throws:
PartInitException
See Also:
org.eclipse.ui.IEditorPart#init(org.eclipse.ui.IEditorSite, org.eclipse.ui.IEditorInput)

doSave

public void doSave(IProgressMonitor monitor)
saves the feature model

See Also:
org.eclipse.ui.part.EditorPart#doSave(org.eclipse.core.runtime.IProgressMonitor)

doSaveAs

public void doSaveAs()
saves a copy of feature model to the specified location

See Also:
org.eclipse.ui.part.EditorPart#doSaveAs()

isDirty

public boolean isDirty()
returns true if the feature model was edited since the last save operation

See Also:
org.eclipse.ui.part.EditorPart#isDirty()

isSaveAsAllowed

public boolean isSaveAsAllowed()
returns true as it is allways allowed to save a model

See Also:
org.eclipse.ui.part.EditorPart#isSaveAsAllowed()

commandStackChanged

public void commandStackChanged(java.util.EventObject event)
fires the property change event if the feature model was edited since the last save operation or save was already requested by the user

See Also:
org.eclipse.gef.ui.parts.GraphicalEditor#commandStackChanged(java.util.EventObject)

selectionChanged

public void selectionChanged(IWorkbenchPart part,
                             ISelection selection)
calls superclass implementation

See Also:
org.eclipse.ui.ISelectionListener#selectionChanged(org.eclipse.ui.IWorkbenchPart, org.eclipse.jface.viewers.ISelection)

createPartControl

public void createPartControl(Composite parent)
calls superclass and creates the context menu

See Also:
org.eclipse.ui.IWorkbenchPart#createPartControl(org.eclipse.swt.widgets.Composite)

exportContextMenu

public void exportContextMenu(IMenuManager manager)

getContents

public FeatureDiagramModel getContents()
Returns the contents of the editor, i.e. the currently edited feature model diagram model (as a wrapper class to the DOM tree containing the whole model)


getOutlinePage

public MetaModelEditorOutlinePage getOutlinePage()
Returns the overview for the outline view.

Returns:
the overview

getAdapter

public java.lang.Object getAdapter(java.lang.Class type)
returns a reference to an outline view

See Also:
org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)

getViewer

public GraphicalViewer getViewer()


Copyright © 2004 - 2008 ETH Zurich and P&P Software GmbH, All Rights Reserved.