Package repast.simphony.ui.plugin.editor
Class AbstractWizardActionUI<T extends ControllerAction>
- java.lang.Object
-
- repast.simphony.ui.plugin.editor.AbstractWizardActionUI<T>
-
- All Implemented Interfaces:
ActionUI
- Direct Known Subclasses:
AbstractDescriptorWizardActionUI
public abstract class AbstractWizardActionUI<T extends ControllerAction> extends Object implements ActionUI
This is a simple abstractActionUI
implementation that is to be used for ui's where the editor is based on a set ofPanelWizardStep
s. This uses aOptionsEditorDialog
for its editor, and steps from implementations paths for the content.- Author:
- Jerry Vos
-
-
Constructor Summary
Constructors Constructor Description AbstractWizardActionUI(T action, String title, String label)
Constructs this with the specified action to work on, the title for any created editors and the label for displaying for actions.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description OptionsEditorDialog
getEditor(ScenarioTreeEvent evt)
Creates and returns anOptionsEditorDialog
whose content is the steps fromgetPath()
whose model is fromgetWizardModel(SimplePath, repast.simphony.scenario.Scenario , Object, ScenarioTreeEvent)
, and whose title is this wizard's title.String
getLabel()
Returns the label specified in the construction.protected abstract org.pietschy.wizard.models.SimplePath
getPath()
Retrieves the path that contains steps that will be the content for the dialog.JPopupMenu
getPopupMenu(ScenarioTreeEvent evt)
Always returns null.protected abstract org.pietschy.wizard.WizardModel
getWizardModel(org.pietschy.wizard.models.SimplePath path, Scenario scenario, Object contextId, ScenarioTreeEvent evt)
Retrieves theWizardModel
to be used when creating the wizard used when adding steps to the created dialog.
-
-
-
Field Detail
-
action
protected T extends ControllerAction action
-
title
protected String title
-
label
protected String label
-
-
Constructor Detail
-
AbstractWizardActionUI
public AbstractWizardActionUI(T action, String title, String label)
Constructs this with the specified action to work on, the title for any created editors and the label for displaying for actions.- Parameters:
action
- the action this UI representstitle
- the title for any editorslabel
- the label for the action
-
-
Method Detail
-
getPath
protected abstract org.pietschy.wizard.models.SimplePath getPath()
Retrieves the path that contains steps that will be the content for the dialog. This path will be the one passed to thegetWizardModel(SimplePath, Scenario, Object, ScenarioTreeEvent)
method.- Returns:
- a path of PanelWizardSteps
-
getWizardModel
protected abstract org.pietschy.wizard.WizardModel getWizardModel(org.pietschy.wizard.models.SimplePath path, Scenario scenario, Object contextId, ScenarioTreeEvent evt)
Retrieves theWizardModel
to be used when creating the wizard used when adding steps to the created dialog.- Parameters:
path
- the path for the wizard (created withgetPath()
)scenario
- the scenario (retrieved from the passed in event)contextId
- the context id (retrieved from the passed in event)evt
- the event that initiated the editor request (passed in in case extra info is needed)- Returns:
- the model to be used when creating the editor
-
getEditor
public OptionsEditorDialog getEditor(ScenarioTreeEvent evt)
Creates and returns anOptionsEditorDialog
whose content is the steps fromgetPath()
whose model is fromgetWizardModel(SimplePath, repast.simphony.scenario.Scenario , Object, ScenarioTreeEvent)
, and whose title is this wizard's title.- Specified by:
getEditor
in interfaceActionUI
- Parameters:
evt
- the ScenarioTreeEvent that triggered this method call.- Returns:
- a
OptionsEditorDialog
- See Also:
OptionsEditorDialog.create(WizardModel, org.pietschy.wizard.models.Path, String)
-
getLabel
public String getLabel()
Returns the label specified in the construction.
-
getPopupMenu
public JPopupMenu getPopupMenu(ScenarioTreeEvent evt)
Always returns null.- Specified by:
getPopupMenu
in interfaceActionUI
- Returns:
- JPopupMenu to attach to the tree entry for an action. This may return null for no popup.
-
-