org.gcn.plinguaplugin.simulatorCreator
Class SimulatorCreatorDisplayer

java.lang.Object
  extended by org.eclipse.jface.wizard.Wizard
      extended by org.gcn.plinguaplugin.simulatorCreator.SimulatorCreatorDisplayer
All Implemented Interfaces:
org.eclipse.jface.wizard.IWizard, org.eclipse.ui.INewWizard, org.eclipse.ui.IWorkbenchWizard

public class SimulatorCreatorDisplayer
extends org.eclipse.jface.wizard.Wizard
implements org.eclipse.ui.INewWizard

This class provides an user interface for creating simulators for P-systems

Author:
Manuel Garcia-Quismondo-Fernandez

Field Summary
 
Fields inherited from class org.eclipse.jface.wizard.Wizard
DEFAULT_IMAGE
 
Constructor Summary
SimulatorCreatorDisplayer(org.gcn.plinguacore.util.psystem.Psystem psystem, java.lang.String name)
          Creates a new SimulatorCreatorDisplayer instance which creates a simulator for the Psystem instance given as argument
 
Method Summary
 void addPages()
           
 boolean canFinish()
           
 boolean getOpenSimulationConsole()
          Gets a boolean representing if a simulation console will be shown when the simulator is created
 org.gcn.plinguacore.util.psystem.Psystem getPsystem()
          Gets the Psystem instance
 PsystemController getPsystemController()
          Gets the PsystemController instance used by this instance
 java.lang.String getPsystemName()
          Gets the file name where the original P-system is encoded
 java.lang.String getSelectedFile()
          Gets the route of the file where the simulator file will be created
 java.lang.String getSelectedSimulator()
          Gets the ID of the simulator to create
 void init(org.eclipse.ui.IWorkbench workbench, org.eclipse.jface.viewers.IStructuredSelection selection)
           
 boolean performFinish()
          Creates the simulator for the Psystem instance according to the user interface parameters
protected  void reportError(java.lang.String route, java.lang.Exception exception)
          Reports if there were an error while creating the simulator file
 void setAlternativeSteps(boolean alternativeSteps)
          Sets if the simulator to create can execute alternative steps
 void setOpenSimulationConsole(boolean openSimulationConsole)
          Sets if a simulation console will be shown when the simulator is created
 void setPsystem(org.gcn.plinguacore.util.psystem.Psystem psystem)
          Sets the Psystem instance for this instance
 void setPsystemName(java.lang.String psystemName)
          Sets the file name where the original P-system is encoded
 void setSelectedFile(java.lang.String simulatorRoute)
          Sets the route of the file where the simulator file will be created
 void setSelectedSimulator(java.lang.String simulatorID)
          Sets the ID of the simulator to create
 void setStepsBack(boolean stepsBack)
          Sets if the simulator to create can execute steps back
 
Methods inherited from class org.eclipse.jface.wizard.Wizard
addPage, 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
createPageControls, dispose, getContainer, getDefaultPageImage, getDialogSettings, getNextPage, getPage, getPageCount, getPages, getPreviousPage, getStartingPage, getTitleBarColor, getWindowTitle, isHelpAvailable, needsPreviousAndNextButtons, needsProgressMonitor, performCancel, setContainer
 

Constructor Detail

SimulatorCreatorDisplayer

public SimulatorCreatorDisplayer(org.gcn.plinguacore.util.psystem.Psystem psystem,
                                 java.lang.String name)
Creates a new SimulatorCreatorDisplayer instance which creates a simulator for the Psystem instance given as argument

Parameters:
psystem - the Psystem instance to provide a simulator for
name - the name of the P-System to create a simulator for
Method Detail

getPsystemController

public PsystemController getPsystemController()
Gets the PsystemController instance used by this instance

Returns:
the PsystemController instance used by this instance

addPages

public void addPages()
Specified by:
addPages in interface org.eclipse.jface.wizard.IWizard
Overrides:
addPages in class org.eclipse.jface.wizard.Wizard
See Also:
Wizard.addPages()

setStepsBack

public void setStepsBack(boolean stepsBack)
Sets if the simulator to create can execute steps back

Parameters:
stepsBack - the boolean representing if the simulator to create can execute steps back

setAlternativeSteps

public void setAlternativeSteps(boolean alternativeSteps)
Sets if the simulator to create can execute alternative steps

Parameters:
alternativeSteps - the boolean representing if the simulator to create can execute alternative steps

performFinish

public boolean performFinish()
Creates the simulator for the Psystem instance according to the user interface parameters

Specified by:
performFinish in interface org.eclipse.jface.wizard.IWizard
Specified by:
performFinish in class org.eclipse.jface.wizard.Wizard

setOpenSimulationConsole

public void setOpenSimulationConsole(boolean openSimulationConsole)
Sets if a simulation console will be shown when the simulator is created

Parameters:
openSimulationConsole - a boolean representing if a simulation console will be shown when the simulator is created

getOpenSimulationConsole

public boolean getOpenSimulationConsole()
Gets a boolean representing if a simulation console will be shown when the simulator is created

Returns:
true if a simulation console will be shown when the simulator is created, false otherwise

init

public void init(org.eclipse.ui.IWorkbench workbench,
                 org.eclipse.jface.viewers.IStructuredSelection selection)
Specified by:
init in interface org.eclipse.ui.IWorkbenchWizard
See Also:
IWorkbenchWizard.init(org.eclipse.ui.IWorkbench, org.eclipse.jface.viewers.IStructuredSelection)

setPsystem

public void setPsystem(org.gcn.plinguacore.util.psystem.Psystem psystem)
Sets the Psystem instance for this instance

Parameters:
psystem - the Psystem instance to be set

getPsystem

public org.gcn.plinguacore.util.psystem.Psystem getPsystem()
Gets the Psystem instance

Returns:
thePsystem instance

setSelectedSimulator

public void setSelectedSimulator(java.lang.String simulatorID)
Sets the ID of the simulator to create

Parameters:
simulatorID - the ID of the simulator to create

getSelectedSimulator

public java.lang.String getSelectedSimulator()
Gets the ID of the simulator to create

Returns:
the ID of the simulator to create

getSelectedFile

public java.lang.String getSelectedFile()
Gets the route of the file where the simulator file will be created

Returns:
the route of the file where the simulator file will be created

setSelectedFile

public void setSelectedFile(java.lang.String simulatorRoute)
Sets the route of the file where the simulator file will be created

Parameters:
simulatorRoute - the route of the file where the simulator will be created

canFinish

public boolean canFinish()
Specified by:
canFinish in interface org.eclipse.jface.wizard.IWizard
Overrides:
canFinish in class org.eclipse.jface.wizard.Wizard
See Also:
Wizard.canFinish()

reportError

protected void reportError(java.lang.String route,
                           java.lang.Exception exception)
Reports if there were an error while creating the simulator file

Parameters:
route - the file route where the simulator were expected to be created
exception - the exception launched as a result of the file creation

setPsystemName

public void setPsystemName(java.lang.String psystemName)
Sets the file name where the original P-system is encoded

Parameters:
psystemName - the file name where the original P-system is encoded

getPsystemName

public java.lang.String getPsystemName()
Gets the file name where the original P-system is encoded

Returns:
the file name where the original P-system is encoded