pl.edu.agh.cast.editor.action.delegate
Class AbstractOpenEditorActionDelegate<M extends IPresentationDataSet<? extends IPresentationElement<? extends IElement>>,V extends IVisualDataSet<? extends IVisualElement<? extends IPresentationElement<? extends IElement>>,M>,T extends IDiagram<M,V>>

java.lang.Object
  extended by pl.edu.agh.cast.editor.action.delegate.AbstractOpenEditorActionDelegate<M,V,T>
Type Parameters:
M - presentation data set which is base of diagram
V - visual data set which is base of diagram
T - input diagram for editor
All Implemented Interfaces:
org.eclipse.ui.IActionDelegate, org.eclipse.ui.IWorkbenchWindowActionDelegate
Direct Known Subclasses:
OpenEmptySchemaEditor, OpenSampleSchemaEditor

public abstract class AbstractOpenEditorActionDelegate<M extends IPresentationDataSet<? extends IPresentationElement<? extends IElement>>,V extends IVisualDataSet<? extends IVisualElement<? extends IPresentationElement<? extends IElement>>,M>,T extends IDiagram<M,V>>
extends Object
implements org.eclipse.ui.IWorkbenchWindowActionDelegate

Abstract action for opening editors. XXX: This class contains diagram only for testing purpose! the action is created only once so the diagram given in constructor is the same for all calls of this action. TODO: this action should open only empty editors!!!

Author:
AGH CAST Team

Constructor Summary
AbstractOpenEditorActionDelegate(String id)
          Initializes the action with Id of the editor to open.
 
Method Summary
 void dispose()
          
abstract  T getDiagram()
          Returns an instance of a diagram to be used in new editor instance.
protected abstract  String getNewEditorName()
           
 void init(org.eclipse.ui.IWorkbenchWindow window)
          
 void run(org.eclipse.jface.action.IAction action)
          
 void selectionChanged(org.eclipse.jface.action.IAction action, org.eclipse.jface.viewers.ISelection selection)
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractOpenEditorActionDelegate

public AbstractOpenEditorActionDelegate(String id)
Initializes the action with Id of the editor to open.

Parameters:
id - Id of the editor to open
Method Detail

getDiagram

public abstract T getDiagram()
Returns an instance of a diagram to be used in new editor instance.

Returns:
an instance of a diagram to be displayed

dispose

public void dispose()

Specified by:
dispose in interface org.eclipse.ui.IWorkbenchWindowActionDelegate
See Also:
IWorkbenchWindowActionDelegate.dispose()

init

public void init(org.eclipse.ui.IWorkbenchWindow window)

Specified by:
init in interface org.eclipse.ui.IWorkbenchWindowActionDelegate
See Also:
IWorkbenchWindowActionDelegate.init(org.eclipse.ui.IWorkbenchWindow)

run

public void run(org.eclipse.jface.action.IAction action)

Specified by:
run in interface org.eclipse.ui.IActionDelegate
See Also:
IActionDelegate.run(org.eclipse.jface.action.IAction)

selectionChanged

public void selectionChanged(org.eclipse.jface.action.IAction action,
                             org.eclipse.jface.viewers.ISelection selection)

Specified by:
selectionChanged in interface org.eclipse.ui.IActionDelegate
See Also:
IActionDelegate.selectionChanged(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection)

getNewEditorName

protected abstract String getNewEditorName()


Copyright © 2007-2009 IISG AGH-UST Krakow, Poland. All Rights Reserved.