Package com.lowagie.toolbox.arguments
Class OptionArgument
- java.lang.Object
-
- com.lowagie.toolbox.arguments.AbstractArgument
-
- com.lowagie.toolbox.arguments.OptionArgument
-
- All Implemented Interfaces:
java.awt.event.ActionListener
,java.beans.PropertyChangeListener
,java.util.EventListener
- Direct Known Subclasses:
PageSizeArgument
public class OptionArgument extends AbstractArgument
Argument that can be one of several options.- Since:
- 2.1.1 (imported from itexttoolbox project)
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
OptionArgument.Entry
An Entry that can be chosen as option.
-
Field Summary
Fields Modifier and Type Field Description private java.util.TreeMap<java.lang.String,OptionArgument.Entry>
options
-
Fields inherited from class com.lowagie.toolbox.arguments.AbstractArgument
description, name, pcs, tool, value
-
-
Constructor Summary
Constructors Constructor Description OptionArgument(AbstractTool tool, java.lang.String name, java.lang.String description)
Constructs an OptionArgument.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
actionPerformed(java.awt.event.ActionEvent evt)
void
addOption(java.lang.Object description, java.lang.Object value)
Adds an Option.java.lang.Object
getArgument()
Gets the argument as an object.java.lang.String
getUsage()
Give you a String that can be used in a usage description.-
Methods inherited from class com.lowagie.toolbox.arguments.AbstractArgument
addPropertyChangeListener, firePropertyChange, getDescription, getName, getTool, getValue, propertyChange, removePropertyChangeListener, setDescription, setName, setTool, setValue, setValue, toString
-
-
-
-
Field Detail
-
options
private java.util.TreeMap<java.lang.String,OptionArgument.Entry> options
-
-
Constructor Detail
-
OptionArgument
public OptionArgument(AbstractTool tool, java.lang.String name, java.lang.String description)
Constructs an OptionArgument.- Parameters:
tool
- the tool that needs this argumentname
- the name of the argumentdescription
- the description of the argument
-
-
Method Detail
-
addOption
public void addOption(java.lang.Object description, java.lang.Object value)
Adds an Option.- Parameters:
description
- the description of the optionvalue
- the value of the option
-
getArgument
public java.lang.Object getArgument() throws java.lang.InstantiationException
Gets the argument as an object.- Overrides:
getArgument
in classAbstractArgument
- Returns:
- an object
- Throws:
java.lang.InstantiationException
- if the specified key cannot be compared with the keys currently in the map
-
getUsage
public java.lang.String getUsage()
Description copied from class:AbstractArgument
Give you a String that can be used in a usage description.- Overrides:
getUsage
in classAbstractArgument
- Returns:
- String
- See Also:
AbstractArgument.getUsage()
-
actionPerformed
public void actionPerformed(java.awt.event.ActionEvent evt)
- Specified by:
actionPerformed
in interfacejava.awt.event.ActionListener
- Specified by:
actionPerformed
in classAbstractArgument
- Parameters:
evt
- ActionEvent- See Also:
ActionListener.actionPerformed(java.awt.event.ActionEvent)
-
-