de.cau.cs.kieler.core.model.graphiti.ui
Class GraphitiNewWizard

java.lang.Object
  extended by org.eclipse.jface.wizard.Wizard
      extended by de.cau.cs.kieler.core.model.graphiti.ui.GraphitiNewWizard
All Implemented Interfaces:
IWizard, INewWizard, IWorkbenchWizard

public abstract class GraphitiNewWizard
extends Wizard
implements INewWizard

A generic wizard for creation of new Graphiti diagrams.

Rating red

Field Summary
 
Fields inherited from class org.eclipse.jface.wizard.Wizard
DEFAULT_IMAGE
 
Constructor Summary
GraphitiNewWizard(String name, String diagExt, String domainExt, String thediagramTypeName)
          Creates a new-wizard for Graphiti, with no grid.
GraphitiNewWizard(String name, String diagExt, String domainExt, String thediagramTypeName, String theeditorId)
          Creates a new-wizard for Graphiti, with no grid.
GraphitiNewWizard(String name, String diagExt, String domainExt, String thediagramTypeName, String theeditorId, int thegridSize, boolean thesnapToGrid)
          Creates a new-wizard for Graphiti, with customizable grid.
 
Method Summary
 void addPages()
          
protected  void configureDiagram(org.eclipse.graphiti.mm.pictograms.Diagram diagram)
          Configure the diagram.
protected abstract  EObject createModel(String name)
          Create an instance of the top-level object for the domain model.
static Map<?,?> createSaveOptions()
          Creates save options for the resources.
 void init(IWorkbench theworkbench, IStructuredSelection theselection)
          
 boolean performFinish()
          
static void setCharset(IFile file)
          Set the character set for the given file to UTF-8.
 
Methods inherited from class org.eclipse.jface.wizard.Wizard
addPage, canFinish, createPageControls, dispose, getContainer, getDefaultPageImage, getDialogSettings, getNextPage, getPage, getPageCount, getPages, getPreviousPage, getShell, getStartingPage, getTitleBarColor, getWindowTitle, isHelpAvailable, needsPreviousAndNextButtons, needsProgressMonitor, performCancel, setContainer, setDefaultPageImageDescriptor, setDialogSettings, setForcePreviousAndNextButtons, setHelpAvailable, setNeedsProgressMonitor, setTitleBarColor, setWindowTitle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.eclipse.jface.wizard.IWizard
canFinish, createPageControls, dispose, getContainer, getDefaultPageImage, getDialogSettings, getNextPage, getPage, getPageCount, getPages, getPreviousPage, getStartingPage, getTitleBarColor, getWindowTitle, isHelpAvailable, needsPreviousAndNextButtons, needsProgressMonitor, performCancel, setContainer
 

Constructor Detail

GraphitiNewWizard

public GraphitiNewWizard(String name,
                         String diagExt,
                         String domainExt,
                         String thediagramTypeName)
Creates a new-wizard for Graphiti, with no grid.

Parameters:
name - the name of the wizard
diagExt - the diagram file extension
domainExt - the domain model file extension
thediagramTypeName - the diagram type name of the graphiti diagram

GraphitiNewWizard

public GraphitiNewWizard(String name,
                         String diagExt,
                         String domainExt,
                         String thediagramTypeName,
                         String theeditorId)
Creates a new-wizard for Graphiti, with no grid.

Parameters:
name - the name of the wizard
diagExt - the diagram file extension
domainExt - the domain model file extension
thediagramTypeName - the diagram type of the graphiti diagram
theeditorId - identifier of the diagram editor, or null if no editor shall be opened after model creation

GraphitiNewWizard

public GraphitiNewWizard(String name,
                         String diagExt,
                         String domainExt,
                         String thediagramTypeName,
                         String theeditorId,
                         int thegridSize,
                         boolean thesnapToGrid)
Creates a new-wizard for Graphiti, with customizable grid.

Parameters:
name - the name of the wizard
diagExt - the diagram file extension
domainExt - the domain model file extension
thediagramTypeName - the diagram type name of the graphiti diagram
theeditorId - identifier of the diagram editor, or null if no editor shall be opened after model creation
thegridSize - the grid size (0 means no grid)
thesnapToGrid - the setting for snapping to grid
Method Detail

init

public final void init(IWorkbench theworkbench,
                       IStructuredSelection theselection)

Specified by:
init in interface IWorkbenchWizard

addPages

public final void addPages()

Specified by:
addPages in interface IWizard
Overrides:
addPages in class Wizard

performFinish

public final boolean performFinish()

Specified by:
performFinish in interface IWizard
Specified by:
performFinish in class Wizard

createSaveOptions

public static Map<?,?> createSaveOptions()
Creates save options for the resources.

Returns:
new save options

setCharset

public static void setCharset(IFile file)
Set the character set for the given file to UTF-8.

Parameters:
file - a file

configureDiagram

protected void configureDiagram(org.eclipse.graphiti.mm.pictograms.Diagram diagram)
Configure the diagram. May be overridden by subclasses.

Parameters:
diagram - the top-level element of the pictogram model

createModel

protected abstract EObject createModel(String name)
Create an instance of the top-level object for the domain model.

Parameters:
name - name of the model
Returns:
an instance of the domain model object