org.argouml.uml.cognitive.critics
Class WizOperName

java.lang.Object
  |
  +--org.argouml.kernel.Wizard
        |
        +--org.argouml.uml.cognitive.critics.WizMEName
              |
              +--org.argouml.uml.cognitive.critics.WizOperName
All Implemented Interfaces:
java.io.Serializable

public class WizOperName
extends WizMEName

A wizard to help the user change the name of an operation to a better name. Same as WizMEName expect that it handles the special case where the operation instead should be made a constructor of the class. This is helpful in languages where constructors have names that do not agree with the convention for method names (i.e. Java). Path looks like this for the case when it is not supposed to be a constructor: step0 -> step1 Path looks like this for the case when it is supposed to be a constructor: step0 -> step1 -> step2 (OK! in the case converted to constructor) -> step2 (same as step1 in the scenario above)

See Also:
Serialized Form

Field Summary
protected  MStereotype _oldStereotype
           
protected  boolean _oldStereotypeIsSet
           
protected  java.lang.String _option0
           
protected  java.lang.String _option1
           
protected  WizStepChoice _step1
           
protected  WizStepCue _step2
           
protected static Category cat
           
 
Fields inherited from class org.argouml.uml.cognitive.critics.WizMEName
_instructions, _label, _mustEdit, _origSuggest, _suggestion
 
Fields inherited from class org.argouml.kernel.Wizard
_finished, _item, _panels, _started, _step
 
Constructor Summary
WizOperName()
           
 
Method Summary
 void doAction(int oldStep)
          Take action at the completion of a step.
 int getNumSteps()
          Get the number of steps in this wizard.
 javax.swing.JPanel makePanel(int newStep)
          Create a new panel for the given step.
 void setPossibleConstructor(boolean b)
          Method to tell the Wizard what path it should work with.
 void undoAction(int origStep)
          There is a possibility that the next step forward takes another path in this wizard.
 
Methods inherited from class org.argouml.uml.cognitive.critics.WizMEName
canGoNext, getModelElement, getSuggestion, setInstructions, setMustEdit, setSuggestion
 
Methods inherited from class org.argouml.kernel.Wizard
back, canFinish, canGoBack, doAction, finish, getCurrentPanel, getPanel, getProgress, getToDoItem, isFinished, isStarted, next, setToDoItem, undoAction
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

cat

protected static Category cat

_option0

protected java.lang.String _option0

_option1

protected java.lang.String _option1

_step1

protected WizStepChoice _step1

_step2

protected WizStepCue _step2

_oldStereotype

protected MStereotype _oldStereotype

_oldStereotypeIsSet

protected boolean _oldStereotypeIsSet
Constructor Detail

WizOperName

public WizOperName()
Method Detail

getNumSteps

public int getNumSteps()
Description copied from class: Wizard
Get the number of steps in this wizard. Subclasses should override to return a constant, or compute based on context.

Overrides:
getNumSteps in class WizMEName

setPossibleConstructor

public void setPossibleConstructor(boolean b)
Method to tell the Wizard what path it should work with.


makePanel

public javax.swing.JPanel makePanel(int newStep)
Create a new panel for the given step.

Overrides:
makePanel in class WizMEName

undoAction

public void undoAction(int origStep)
There is a possibility that the next step forward takes another path in this wizard. To allow for this we must destroy the path already traveled by. TODO: I (Linus) would say that this is really a problem with the Wizard implementation since I believe it should be possible to explore a path in the wizard and then go back.

Overrides:
undoAction in class Wizard

doAction

public void doAction(int oldStep)
Take action at the completion of a step. For example, when the given step is 0, do nothing; and when the given step is 1, do the first action. Argo non-modal wizards should take action as they do along, as soon as possible, they should not wait until the final step.

Overrides:
doAction in class WizMEName


ArgoUML © 1996-2003 (20040216)ArgoUML Project HomeArgoUML Cookbook