ConForM.CoopnTools.CoKer
Class CoopnMultiTextOption

java.lang.Object
  |
  +--ConForM.CoopnTools.CoKer.CoopnMultiTextOption
All Implemented Interfaces:
CoopnOption, CoopnParamOption
Direct Known Subclasses:
CoopnMultiTextProperty

public class CoopnMultiTextOption
extends java.lang.Object
implements CoopnParamOption

Textual array options in CO-OPN tools environments. The values of these options may be given by decoding a specific option with parameter in the command line or by an apposite graphical dialog.

See Also:

Field Summary
protected  java.lang.String badOptionSText
           
protected  java.lang.String badOptionText
           
protected  javax.swing.JTextField component
           
protected  java.lang.String[] defaultValue
           
protected  java.io.PrintWriter errStream
           
protected  java.lang.String helpText
           
protected  java.lang.String label
           
protected  int level
           
protected  java.lang.String name
           
protected  java.lang.String paramText
           
protected  java.lang.String trigger
           
protected  java.lang.String triggerText
           
 
Fields inherited from interface ConForM.CoopnTools.CoKer.CoopnOption
ALL, BASIC, EXTENDED
 
Constructor Summary
CoopnMultiTextOption(java.lang.String trigger, int level, java.lang.String[] defaultValue, CoopnEnvMgr envMgr)
          Creates a new textual option with the default resource file.
CoopnMultiTextOption(java.lang.String trigger, int level, java.lang.String defaultValue, CoopnEnvMgr envMgr)
          Creates a new textual option with the default resource file.
CoopnMultiTextOption(java.lang.String trigger, int level, java.lang.String resource, java.lang.String[] defaultValue, CoopnEnvMgr envMgr)
          Creates a new textual option.
CoopnMultiTextOption(java.lang.String trigger, int level, java.lang.String resource, java.lang.String defaultValue, CoopnEnvMgr envMgr)
          Creates a new textual option.
 
Method Summary
 boolean decodeCommandLine(java.util.List elements, java.util.Map decodedOptions)
          Decode the command line.
 boolean decodeDialog(java.util.Map decodedOptions)
          Decode the dialog component.
 javax.swing.JComponent getDialogComponent()
          Return the SWING component associated to the option; for instance, a checkbox in the case of "-a". there is one dialog component per flag object; multiple invocations to this method of the same object will return each time the same JComponent.
 java.lang.String getHelpText()
          Return the help text associated to the option; for instance, "specify the output file" for "-o file".
 java.lang.String getLabel()
          Return the label of the option; for instance "output file" for "-o file".
 int getLevel()
          Get the level of the option.
 java.lang.String getName()
          Return the name of the option; for instance, "-o file" for option "-o file".
 java.lang.String parameterText()
          Return the parameter text of the option; for instance, "file" for option "-o file".
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

trigger

protected java.lang.String trigger

level

protected int level

defaultValue

protected java.lang.String[] defaultValue

badOptionSText

protected java.lang.String badOptionSText

errStream

protected java.io.PrintWriter errStream

label

protected java.lang.String label

helpText

protected java.lang.String helpText

paramText

protected java.lang.String paramText

triggerText

protected java.lang.String triggerText

name

protected java.lang.String name

component

protected javax.swing.JTextField component

badOptionText

protected java.lang.String badOptionText
Constructor Detail

CoopnMultiTextOption

public CoopnMultiTextOption(java.lang.String trigger,
                            int level,
                            java.lang.String resource,
                            java.lang.String[] defaultValue,
                            CoopnEnvMgr envMgr)
Creates a new textual option.
Parameters:
trigger - the trigger text, for instance "a"
level - the level of option, one of ALL, BASIC or EXTENDED
resource - the resource file for the trigger, or null for the default resource file; following string keys are serached: LABELx and HELPx, where x is the trigger
defaultValue - the default value
envMgr - the associated environment manager

CoopnMultiTextOption

public CoopnMultiTextOption(java.lang.String trigger,
                            int level,
                            java.lang.String[] defaultValue,
                            CoopnEnvMgr envMgr)
Creates a new textual option with the default resource file.
Parameters:
trigger - the trigger text, for instance "a"
level - the level of option, one of ALL, BASIC or EXTENDED
defaultValue - the default value
envMgr - the associated environment manager

CoopnMultiTextOption

public CoopnMultiTextOption(java.lang.String trigger,
                            int level,
                            java.lang.String resource,
                            java.lang.String defaultValue,
                            CoopnEnvMgr envMgr)
Creates a new textual option.
Parameters:
trigger - the trigger text, for instance "a"
level - the level of option, one of ALL, BASIC or EXTENDED
resource - the resource file for the trigger, or null for the default resource file; following string keys are serached: LABELx and HELPx, where x is the trigger
defaultValue - the default value, as a string of elements separated by the system path separator.
envMgr - the associated environment manager

CoopnMultiTextOption

public CoopnMultiTextOption(java.lang.String trigger,
                            int level,
                            java.lang.String defaultValue,
                            CoopnEnvMgr envMgr)
Creates a new textual option with the default resource file.
Parameters:
trigger - the trigger text, for instance "a"
level - the level of option, one of ALL, BASIC or EXTENDED
defaultValue - the default value, as a string of elements separated by the system path separator.
envMgr - the associated environment manager
Method Detail

parameterText

public java.lang.String parameterText()
Return the parameter text of the option; for instance, "file" for option "-o file".
Specified by:
parameterText in interface CoopnParamOption

getName

public java.lang.String getName()
Return the name of the option; for instance, "-o file" for option "-o file".
Specified by:
getName in interface CoopnOption

getLabel

public java.lang.String getLabel()
Return the label of the option; for instance "output file" for "-o file".
Specified by:
getLabel in interface CoopnOption

getHelpText

public java.lang.String getHelpText()
Return the help text associated to the option; for instance, "specify the output file" for "-o file".
Specified by:
getHelpText in interface CoopnOption

getDialogComponent

public javax.swing.JComponent getDialogComponent()
Return the SWING component associated to the option; for instance, a checkbox in the case of "-a". there is one dialog component per flag object; multiple invocations to this method of the same object will return each time the same JComponent.
Specified by:
getDialogComponent in interface CoopnOption

getLevel

public int getLevel()
Get the level of the option.
Specified by:
getLevel in interface CoopnOption

decodeCommandLine

public boolean decodeCommandLine(java.util.List elements,
                                 java.util.Map decodedOptions)
Decode the command line. The words of the command line are stored into a list; if the option is found in the command line, the associated elements are discarded form the list, and the association is put in a map
Specified by:
decodeCommandLine in interface CoopnOption
Parameters:
elements - A list of String
decodedOptions - The mapping of options
Returns:
false iff the option is found, but erroneous in the elements.

decodeDialog

public boolean decodeDialog(java.util.Map decodedOptions)
Decode the dialog component.
Specified by:
decodeDialog in interface CoopnOption
Returns:
false iff the option is found, but erroneous in the dialog.