Package org.gorpipe.querydialogs
Class Argument
java.lang.Object
org.gorpipe.querydialogs.BasicBean
org.gorpipe.querydialogs.AbstractListBean
org.gorpipe.querydialogs.Argument
- All Implemented Interfaces:
Serializable,ListModel
- Direct Known Subclasses:
DateArgument,FileArgument,FormatArgument,NumberArgument
A base class for all arguments.
Aside from being a bean this class also provides a ListModel interface on the allowed values for this argument
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final Objectstatic final StringThe property name for the argument's current operator.static final StringThe property name for the argument's raw value.protected final ArgumentTypeprotected Object -
Constructor Summary
ConstructorsConstructorDescriptionConstructor that copies the input argument.Argument(ArgumentType type, ArgumentDescription argDescr, Boolean optional, Object defaultValue, List<? extends Object> allowedValues, URI valuesPath, List<String> operators, Boolean advanced, Integer displayWidth) Base constructor for all arguments. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidcheckAllowed(Object theValue) abstract ArgumentMake a copy of the argument.booleanGet argument description.Get the name to display for argument.Get the display width for argument.getElementAt(int index) getName()Get argument name.intgetSize()Get argument tooltip.getType()getValue()String[]Get the values header.booleanbooleanGet if argument is advanced.booleanisEmpty()Get if argument is empty.booleanGet if argument is optional.voidloadDeferredValues(boolean checkForHeader, Function<String, BufferedReader> fileResolver) Possibly long running, should not be called on the EDT.protected ObjectparseValue(String val) voidsetDisplayWidth(Integer displayWidth) Set the display width for argument.voidsetOperator(String operator) voidvoidvoidsetValuesHeader(String[] valuesHeader) toString()Methods inherited from class org.gorpipe.querydialogs.AbstractListBean
addListDataListener, fireContentsChanged, removeListDataListenerMethods inherited from class org.gorpipe.querydialogs.BasicBean
addPropertyChangeListener, addPropertyChangeListener, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getPropertyChangeListeners, getPropertyChangeListeners, removePropertyChangeListener, removePropertyChangeListener
-
Field Details
-
PROPERTY_VALUE
The property name for the argument's raw value.- See Also:
-
PROPERTY_OPERATOR
The property name for the argument's current operator.- See Also:
-
DEFERRED_LIST
-
path2LoadedValues
-
path2LoadedValuesHeader
-
type
-
value
-
defaultValue
-
allowedValues
-
-
Constructor Details
-
Argument
public Argument(ArgumentType type, ArgumentDescription argDescr, Boolean optional, Object defaultValue, List<? extends Object> allowedValues, URI valuesPath, List<String> operators, Boolean advanced, Integer displayWidth) Base constructor for all arguments.All extensions of this abstract type are recommended to build via this constructor
- Parameters:
type- - the type of argumentargDescr- - the argument descriptionoptional- - true if this argument is not required, false otherwisedefaultValue- - the initial value for this argumentallowedValues- - a list of allowed values for this argumentoperators- - a list of operators supported by this argumentadvanced- -trueif argument is advanced, otherwise false. Can be used to determine visibility mode of argument.
-
Argument
Constructor that copies the input argument.- Parameters:
arg- the argument to copy
-
-
Method Details
-
getName
Get argument name.- Returns:
- the argument name
-
getDescription
Get argument description.- Returns:
- the argument description
-
getTooltip
Get argument tooltip.- Returns:
- the argument tooltip
-
isOptional
public boolean isOptional()Get if argument is optional.- Returns:
trueif argument is optional, otherwisefalse
-
isEmpty
public boolean isEmpty()Get if argument is empty.- Returns:
trueif argument is empty, otherwisefalse
-
isAdvanced
public boolean isAdvanced()Get if argument is advanced.- Returns:
trueif argument is advanced, otherwisefalse
-
getDisplayWidth
Get the display width for argument.- Returns:
- the display width for argument
-
setDisplayWidth
Set the display width for argument.- Parameters:
displayWidth- the display width to set
-
getDisplayName
Get the name to display for argument.- Returns:
- display name
-
getType
-
getValuesPath
-
getDefaultValue
-
checkAllowed
-
setValue
-
getValue
-
setValue
-
getOperator
-
setOperator
-
getOperators
- Returns:
- a list of available operators
-
getElementAt
-
getSize
public int getSize() -
toString
-
hasDeferredValues
public boolean hasDeferredValues() -
deferredValuesLoaded
public boolean deferredValuesLoaded() -
getValuesHeader
Get the values header.- Returns:
- the values header
-
setValuesHeader
-
loadDeferredValues
public void loadDeferredValues(boolean checkForHeader, Function<String, BufferedReader> fileResolver) throws IOExceptionPossibly long running, should not be called on the EDT.- Throws:
IOException
-
parseValue
-
copyArgument
Make a copy of the argument.- Returns:
- the argument copy
-