T-Plan Robot Enterprise 5.0.1
Build No. 5.0.1-20190308.1

com.tplan.robot.preferences
Class Preference

java.lang.Object
  extended by com.tplan.robot.preferences.Preference
All Implemented Interfaces:
ConfigurationKeys

public class Preference
extends java.lang.Object
implements ConfigurationKeys

The Preference class is a wrapper around a single configuration parameter. It defines meta data needed to display and edit the parameter value in the GUI. This meta data includes short name of the preference (called "label"), description, value type (string, boolean, integer, float, color, enumerated type or a keystroke), parameter key in the configuration file or a parameter set.


T-Plan Robot Enterprise, (C) 2009-2019 T-Plan Limited. All rights reserved.


Field Summary
static int TYPE_BOOLEAN
          A boolean value represented by a check box or a radio button.
static int TYPE_BUTTON
          Standalone JButton which can be attached through the PreferenceComponentManager.
static int TYPE_COLLAPSED_FOLDER
          "Collapsed container" preference type allowing to hide a group of preferences and display just a check box (since 4.0)
static int TYPE_COLOR
          A color value represented by a drop down with the default set of colors and a button allowing to add custom ones.
static int TYPE_COLOR_FROM_IMAGE
          Color from an image.
static int TYPE_COLOR_LIST
          List of colors.
static int TYPE_DIMENSION
          Dimension/size type (since 4.0)
static int TYPE_DIRECTORY
           
static int TYPE_DUMMY
          Dummy preference which represents no value.
static int TYPE_DYNAMIC_PANEL
          Dynamic panel whose content depends on the value selected in another preference
static int TYPE_DYNAMIC_PARAM_LIST
          A field specifying a dynamic parameter list
static int TYPE_FILE
           
static int TYPE_FILELIST
          List of files.
static int TYPE_FLOAT
          A floating point value represented by a number spinner.
static int TYPE_FLOAT_LIST
          List of floats (since 4.0)
static int TYPE_HIDDEN
          A hidden fixed value.
static int TYPE_INT
          An integer value represented by a number spinner.
static int TYPE_INT_DISPLAYED_AS_BOOLEAN
          Integer value which should be represented by a checkbox.
static int TYPE_INT_LIST
          List of integers (since 4.0)
static int TYPE_KEYSTROKE
          A key stroke such as "Ctrl+C".
static int TYPE_PASSWORD
          Password type - a String whose value should be masked when displayed in the GUI.
static int TYPE_PINCH
          Pinch/zoom parameters (since 3.5)
static int TYPE_POINT
          A point value (a location consisting of the [x, y] coordinates).
static int TYPE_POINT_RELATIVE
          Relative point (since 4.1)
static int TYPE_PREFERENCE_PANEL
          A custom implementation of PreferencePanel.
static int TYPE_RECTANGLE
          A rectangle field.
static int TYPE_REGEXP
          A field specifying a regular expression
static int TYPE_STRING
          A string preference type represented by a text field or a drop down.
static int TYPE_STRING_WITH_ACTION
          A string value represented by a text field with a customizable button which can be attached through the PreferenceComponentManager.
static int TYPE_STRINGLIST
          A list of semicolon separated string values where the supported value set is fixed.
static int TYPE_TEXT
          Multiline text, usually represented in the GUI by a text editor.
static int TYPE_TIME_INTERVAL
          Time interval such as 2 seconds or 5 minutes
 
Fields inherited from interface com.tplan.robot.preferences.ConfigurationKeys
CAPTURE_USE_LEGACY_DIALOG, COMPARETO_MAX_LOADED_PIXEL_ROWS, COMPARETO_MAX_SEARCH_HITS, DEFAULT_MODULE_PARAM_NAME, EDITOR_BREAKPOINT_COLOR, EDITOR_EXECUTED_LINE_COLOR, EDITOR_SYNTAX_ERROR_COLOR, IO_ACTIVE_FILE, IO_OPEN_FILE_LIST, IO_RECENT_SCRIPTS, IO_RECENT_SERVERS, MAX_DYNAMIC_MENU_ITEMS, MODULE_LIST_PARAM_NAME, REFRESH_DAEMON_ENABLE, REFRESH_DAEMON_MAX_IDLE_TIME, REPEAT_COMPARISON_FOR_MOVED_MOUSE, SCRIPT_HANDLER_CHECK_SYNTAX_BEFORE_EXECUTION, SCRIPT_HANDLER_OPEN_INCLUDED_FILES, STATUS_BAR_MINIMUM_DISPLAYED_UPDATE_SIZE, TOOLBAR_LOCATION
 
Constructor Summary
Preference()
          Default parameterless constructor for TYPE_STRING preferences.
Preference(int type, java.lang.String configurationKey, java.lang.String resourceKey, java.lang.String descriptionKey)
          Constructor allowing to pass resource bundle keys for the preference name and description rather than plain text.
Preference(com.tplan.robot.gui.preferences.PreferencePanel pnl)
           
Preference(java.lang.String configurationKey, int type, java.lang.String label, java.lang.String description)
          Generic constructor for any preference type.
Preference(java.lang.String configurationKey, java.lang.String label, java.lang.String description, int maxValue, int minValue)
          Constructor for numeric types (TYPE_INT, TYPE_FLOAT).
 
Method Summary
 void addAcceptedFileFilter(javax.swing.filechooser.FileFilter filter)
          Add a file filter to be shown in the file chooser of a TYPE_FILE preference.
 void checkValue(java.lang.Object value)
          Check if a value meets the rules defined in this instance and is acceptable for this preference (parameter).
static java.lang.String createMandatoryFieldLabel(java.lang.String label)
          Create an HTML label with a trailing red asterisk used to indicate a mandatory field.
 java.lang.String[] getAcceptedFileExtensions()
          Get the list of accepted file extensions for the TYPE_FILE and TYPE_FILELIST preferences.
 java.lang.String getAcceptedFileExtensionsDesc()
          Get description of the file extension based filter for the TYPE_FILE preferences.
 java.lang.String[] getAcceptedFileExtensionsDescs()
          Get description of the file extension based filter for the TYPE_FILE preferences.
 java.lang.String getButtonGroup()
           
 int getColumns()
          Get the default text field width in characters.
 PreferenceComponentManager getComponentManager()
           
 ConfigurableCreator getConfigurableCreator()
          Set the object able to create a Configurable object based on the value it depends on.
 java.lang.String getConfigurationKey()
          Get the preference/parameter name (configuration key).
 java.lang.String getCurrentDirectory()
           
 java.io.File getCurrentFile()
           
 java.lang.String[] getCustomInputTemplates()
          Get the custom input templates.
 com.tplan.robot.gui.preferences.PreferencePanel getCustomPanel()
           
 java.lang.Object getDefaultValue()
          Get the default value of this preference (parameter).
 java.lang.String getDependentOption()
          Get the preference name (configuration key) that this preference depends on.
 java.lang.String[] getDependentOptions()
           
 java.lang.String getDescription()
          Get the preference/parameter description.
 java.lang.String getDescriptionOfAvailableValues()
          Get description of available values.
 java.lang.String getDirDefaultSearchPath()
          Get the default path for verification of value of a TYPE_DIRECTORY or TYPE_FILE preference.
 java.lang.String getDirFileToSearchFor()
          Get the file name to verify existence of in a TYPE_DIRECTORY or TYPE_FILE preference.
 java.util.List getDisplayValues()
          Get the fixed set of values displayable in the GUI.
 java.util.Map getDisplayValuesTable()
          Get the map of descriptions and their values.
 java.util.Map getDynamicPanels()
           
 javax.swing.JComponent getFileAccessory()
          Get the file accessory component.
 javax.swing.JFileChooser getFileChooser()
          Get the custom file chooser for the TYPE_FILE and TYPE_DIRECTORY preference type.
 com.tplan.robot.gui.components.FileChooserManager getFileChooserManager()
          Get the file chooser manager for the TYPE_FILE and TYPE_DIRECTORY preferences.
 java.util.List<javax.swing.filechooser.FileFilter> getFileFilters()
          Get file filters for the file chooser employed by the TYPE_FILE preferences.
 javax.swing.filechooser.FileView getFileView()
           
 java.lang.String getHintText()
           
 java.lang.String getHintTitle()
           
 java.util.List<java.lang.String> getIgnoreDynamicParamList()
          Get the list of parameter names to be ignored by the TYPE_DYNAMIC_PARAM_LIST preference.
 ColorChooserImageProvider getImageProvider()
           
 java.lang.Object getJoinWith()
          See setJoinWith(java.lang.Object).
 java.lang.String getLabel()
          Get the preference/parameter label (short description).
 java.lang.String getLabelAfter()
           
 java.lang.String[] getLabels()
           
 int getLeftInset()
          Get the left inset (padding) in pixels.
 int getMaxPointX()
          Get the maximum acceptable X coordinate value of the TYPE_POINT and TYPE_POINT_RELATIVE preferences.
 int getMaxPointY()
          Get the maximum acceptable Y coordinate value of the TYPE_POINT and TYPE_POINT_RELATIVE preferences.
 int getMaxValue()
          Get the maximum value.
 int getMinPointX()
          Get the minimum acceptable X coordinate value of the TYPE_POINT and TYPE_POINT_RELATIVE preferences.
 int getMinPointY()
          Get the minimum acceptable Y coordinate value of the TYPE_POINT and TYPE_POINT_RELATIVE preferences.
 int getMinValue()
          Get the minimum value.
 java.lang.String getPreferredContainerName()
          Get the preferred container name.
 java.lang.String getSummary()
          Get a simple HTML summary with the preference details.
 int getTextRowsToDisplay()
          Get the number of visible text rows to be displayed if the parameter is displayed in a text pane in the GUI.
 int getType()
          Get the preference type (numeric code).
 java.lang.String getTypeDesc()
          Get description of a preference type (see getType())..
static java.util.Map<java.lang.Integer,java.lang.String> getTypeMap(boolean baseTypesOnly)
          Get the map of preference type names and their integer codes.
 java.util.List getValues()
          Get the list of raw values to be mapped to descriptions returned by getDisplayValues().
 boolean isAcceptEmptyValue()
          Indicates whether the empty value ("") should be accepted as a valid one and saved or not.
 boolean isAcceptFileAsUri()
          Find out whether the TYPE_FILE preference values may be provided in form of URI.
 boolean isCustomInputEnabled()
           
 boolean isDirSearchForceValueToFound()
          Indicates whether the preference value should be forced to the value of the verification file search.
 boolean isDirSearchIgnoreCase()
           
 boolean isDirSearchUseRegularExpressions()
           
 boolean isHideBorder()
          Defines whether to display border of a TYPE_DYNAMIC_PANEL preference.
 boolean isMandatory()
          Find out if the preference is mandatory and must be specified.
 boolean isMatchMode()
          A flag used for the TYPE_REGEXP preference types.
 boolean isNumber()
          Find out if the preference/parameter is a number type or not.
 boolean isOpaque()
          Defines whether to make the TYPE_DYNAMIC_PANEL preference component opaque or transparent.
 boolean isRemoveIfDisabled()
           
 boolean isRemoveProtocol()
          Specifies whether the preference value should be checked on load (in the PreferencePanel.loadPreferences(java.lang.Object) method) against the URL/URI syntax.
 boolean isSaveDefaultValue()
          See setDefaultValue(java.lang.Object, boolean).
 boolean isScreenSelectionEnabled()
           
 boolean isSelectOnly()
          Indicate whether the values of this parameter are enumerated.
 boolean isUseCheckBox()
           
 boolean isWindowsKeyCompatMode()
          Find out if the Windows compatibility mode of a key stroke preference (type TYPE_KEYSTROKE) is on or off.
 void setAcceptedFileExtensions(java.lang.String[] acceptedFileExtensions, java.lang.String descriptionKey)
          Set the list of accepted file extensions for the TYPE_FILE and TYPE_FILELIST preferences.
 void setAcceptEmptyValue(boolean acceptEmptyValue)
          Defines whether the empty value ("") should be accepted as a valid one and saved or not.
 void setAcceptFileAsUri(boolean reportFileAsURI)
          Controls whether the TYPE_FILE preference should accept files in form of a URL or URI, for example "file://C:\test.png".
 void setButtonGroup(java.lang.String buttonGroup)
           
 void setButtonGroup(java.lang.String buttonGroup, boolean useCheckBox)
           
 void setColumns(int columns)
          Set the default text field width in characters.
 void setComponentManager(PreferenceComponentManager componentManager)
           
 void setConfigurableCreator(ConfigurableCreator configurableCreator)
          Set the Configurable object creator for the TYPE_DYNAMIC_PANEL preference.
 void setCurrentDirectory(java.lang.String path)
           
 void setCurrentFile(java.io.File currentFile)
           
 void setCustomInputEnabled(boolean enabled, java.lang.String[] templates)
          Enable/disable the custom input mode.
 void setDefaultValue(java.lang.Object defaultValue)
          Set the default value of this parameter.
 void setDefaultValue(java.lang.Object defaultValue, boolean forceSaving)
          Set the default value of this parameter with optional forcing of saving of the default value.
 void setDependentOption(java.lang.String dependentOption)
           
 void setDependentOption(java.lang.String dependentOption, boolean removeIfDisabled)
          Declare that this preference/parameter is only valid if the specified parameter is TYPE_BOOLEAN and its value is true.
 void setDependentOptions(java.lang.String[] dependentOptions)
           
 void setDescription(java.lang.String desc)
           
 void setDescriptionKey(java.lang.String descriptionKey)
          Set the description resource bundle key.
 void setDescriptionOfAvailableValues(java.lang.String descriptionOfAvailableValues)
          Set description of available values.
 void setDirFileToSearchFor(java.lang.String fileToSearchFor, java.lang.String defaultSearchPath, boolean useRegularExpressions, boolean ignoreCase, boolean forceValueToFound)
          This method allows to set verification options for TYPE_FILE and TYPE_DIRECTORY preferences.
 void setDisplayValues(java.util.List displayValues)
          This method allows together with setValues(java.util.List) to define enumerated values for parameter of the TYPE_STRING type.
 void setDisplayValuesTable(java.util.Map displayValuesTable)
          This method allows to define enumerated values for a TYPE_STRINGLIST parameter.
 void setDynamicPanels(java.util.Map dynamicPanels, java.lang.String dependentOption)
           
 void setDynamicPanels(java.util.Map dynamicPanels, java.lang.String[] dependentOptions)
          Set the map of dynamic panels.
 void setFileAccessory(javax.swing.JComponent fileAccessory)
          Set the file accessory component.
 void setFileChooser(javax.swing.JFileChooser fileChooser)
          Set the custom file chooser to be used by the GUI component representing the TYPE_FILE and TYPE_DIRECTORY preferences.
 void setFileChooserManager(com.tplan.robot.gui.components.FileChooserManager fileChooserManager)
          Set the manager for the file chooser provided by the GUI component representing the TYPE_FILE and TYPE_DIRECTORY preferences.
 void setFileChooserManager(java.lang.ref.Reference<com.tplan.robot.gui.components.FileChooserManager> fileChooserManager)
          Set the manager for the file chooser provided by the GUI component representing the TYPE_FILE and TYPE_DIRECTORY preferences.
 void setFileView(javax.swing.filechooser.FileView fileView)
           
 void setHideBorder(boolean hideBorder)
          Hide the container border of a TYPE_DYNAMIC_PANEL preference.
 void setHint(java.lang.String title, java.lang.String hint)
           
 void setIgnoreDynamicParamList(java.util.List<java.lang.String> ignoreDynamicParamList)
          Set the list of parameter names to be ignored by the TYPE_DYNAMIC_PARAM_LIST preference.
 void setImageProvider(ColorChooserImageProvider imageProvider)
           
 void setImageProvider(java.lang.ref.Reference<ColorChooserImageProvider> imageProvider)
           
 void setJoinWith(java.lang.Object joinWith)
          Set the configuration key of another option that this BOOLEAN preference should be visually joined with (put in one line).
 void setLabel(java.lang.String label)
          Set the preference label.
 void setLabelAfter(java.lang.String labelAfter)
           
 void setLabels(java.lang.String[] labels)
           
 void setLeftInset(int leftInset)
          Set the left inset (padding) in pixels.
 void setMandatory(boolean mandatory)
          Set whether the preferece is mandatory and must be specified.
 void setMatchMode(boolean matchMode)
          See isMatchMode().
 void setMaxValue(int maxValue)
          Set the maximum value.
 void setMinValue(int minValue)
          Set the minimum value.
 void setOpaque(boolean opaque)
          Set opacity of the TYPE_DYNAMIC_PANEL preference component.
 void setPointBounds(int minX, int minY, int maxX, int maxY)
          Set the coordinate bounds applied to the TYPE_POINT and TYPE_POINT_RELATIVE preferences.
 void setPreferredContainerName(java.lang.String preferredContainerName)
          Set the preferred container name.
 void setRemoveProtocol(boolean removeProtocol)
          Set on/off the protocol removal mode.
 void setScreenSelectionEnabled(boolean screenSelectionEnabled)
           
 void setSelectOnly(boolean selectOnly)
          Indicate whether the values of this parameter are enumerated (select-only, one-of).
 void setTextRowsToDisplay(int textRowsToDisplay)
          Set the number of visible text rows to be displayed if the parameter is displayed in a text pane in the GUI.
 void setValues(java.util.List values)
          Set the list of raw values to be mapped to descriptions defined through setDisplayValues(java.util.List).
 void setWindowsKeyCompatMode(boolean windowsKeyCompatMode)
          Set the Windows compatibility mode on/off.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TYPE_STRING

public static final int TYPE_STRING
A string preference type represented by a text field or a drop down.

See Also:
Constant Field Values

TYPE_INT

public static final int TYPE_INT
An integer value represented by a number spinner.

See Also:
Constant Field Values

TYPE_FLOAT

public static final int TYPE_FLOAT
A floating point value represented by a number spinner.

See Also:
Constant Field Values

TYPE_BOOLEAN

public static final int TYPE_BOOLEAN
A boolean value represented by a check box or a radio button.

See Also:
Constant Field Values

TYPE_COLOR

public static final int TYPE_COLOR
A color value represented by a drop down with the default set of colors and a button allowing to add custom ones.

See Also:
Constant Field Values

TYPE_KEYSTROKE

public static final int TYPE_KEYSTROKE
A key stroke such as "Ctrl+C". The editor is an editable text field with the record and Keyboard Tool buttons.

See Also:
Constant Field Values

TYPE_STRINGLIST

public static final int TYPE_STRINGLIST
A list of semicolon separated string values where the supported value set is fixed.

See Also:
Constant Field Values

TYPE_INT_DISPLAYED_AS_BOOLEAN

public static final int TYPE_INT_DISPLAYED_AS_BOOLEAN
Integer value which should be represented by a checkbox. True represents value<0, false is value>=0. This option is intended to serve as the "Don't show this message againg" flags in the app warning messages.

See Also:
Constant Field Values

TYPE_FILE

public static final int TYPE_FILE
See Also:
Constant Field Values

TYPE_DIRECTORY

public static final int TYPE_DIRECTORY
See Also:
Constant Field Values

TYPE_PASSWORD

public static final int TYPE_PASSWORD
Password type - a String whose value should be masked when displayed in the GUI.

See Also:
Constant Field Values

TYPE_FILELIST

public static final int TYPE_FILELIST
List of files.

See Also:
Constant Field Values

TYPE_TEXT

public static final int TYPE_TEXT
Multiline text, usually represented in the GUI by a text editor.

See Also:
Constant Field Values

TYPE_COLOR_FROM_IMAGE

public static final int TYPE_COLOR_FROM_IMAGE
Color from an image.

See Also:
Constant Field Values

TYPE_DUMMY

public static final int TYPE_DUMMY
Dummy preference which represents no value. It may be used to display descriptions in GUI where a preference description is usually displayed.

See Also:
Constant Field Values

TYPE_DYNAMIC_PANEL

public static final int TYPE_DYNAMIC_PANEL
Dynamic panel whose content depends on the value selected in another preference

See Also:
Constant Field Values

TYPE_COLOR_LIST

public static final int TYPE_COLOR_LIST
List of colors.

See Also:
Constant Field Values

TYPE_TIME_INTERVAL

public static final int TYPE_TIME_INTERVAL
Time interval such as 2 seconds or 5 minutes

See Also:
Constant Field Values

TYPE_POINT

public static final int TYPE_POINT
A point value (a location consisting of the [x, y] coordinates).

See Also:
Constant Field Values

TYPE_PREFERENCE_PANEL

public static final int TYPE_PREFERENCE_PANEL
A custom implementation of PreferencePanel.

See Also:
Constant Field Values

TYPE_RECTANGLE

public static final int TYPE_RECTANGLE
A rectangle field.

See Also:
Constant Field Values

TYPE_REGEXP

public static final int TYPE_REGEXP
A field specifying a regular expression

See Also:
Constant Field Values

TYPE_DYNAMIC_PARAM_LIST

public static final int TYPE_DYNAMIC_PARAM_LIST
A field specifying a dynamic parameter list

See Also:
Constant Field Values

TYPE_STRING_WITH_ACTION

public static final int TYPE_STRING_WITH_ACTION
A string value represented by a text field with a customizable button which can be attached through the PreferenceComponentManager.

See Also:
Constant Field Values

TYPE_HIDDEN

public static final int TYPE_HIDDEN
A hidden fixed value.

See Also:
Constant Field Values

TYPE_PINCH

public static final int TYPE_PINCH
Pinch/zoom parameters (since 3.5)

See Also:
Constant Field Values

TYPE_DIMENSION

public static final int TYPE_DIMENSION
Dimension/size type (since 4.0)

See Also:
Constant Field Values

TYPE_COLLAPSED_FOLDER

public static final int TYPE_COLLAPSED_FOLDER
"Collapsed container" preference type allowing to hide a group of preferences and display just a check box (since 4.0)

See Also:
Constant Field Values

TYPE_INT_LIST

public static final int TYPE_INT_LIST
List of integers (since 4.0)

Since:
4.0
See Also:
Constant Field Values

TYPE_FLOAT_LIST

public static final int TYPE_FLOAT_LIST
List of floats (since 4.0)

Since:
4.0
See Also:
Constant Field Values

TYPE_POINT_RELATIVE

public static final int TYPE_POINT_RELATIVE
Relative point (since 4.1)

Since:
4.1
See Also:
Constant Field Values

TYPE_BUTTON

public static final int TYPE_BUTTON
Standalone JButton which can be attached through the PreferenceComponentManager.

Since:
5.0
See Also:
Constant Field Values
Constructor Detail

Preference

public Preference()
Default parameterless constructor for TYPE_STRING preferences.


Preference

public Preference(com.tplan.robot.gui.preferences.PreferencePanel pnl)

Preference

public Preference(java.lang.String configurationKey,
                  java.lang.String label,
                  java.lang.String description,
                  int maxValue,
                  int minValue)
Constructor for numeric types (TYPE_INT, TYPE_FLOAT).

Parameters:
configurationKey - preference/parameter name.
label - label (short description). In GUI representation of this preference the label is displayed next to the editable component. If the preference is a boolean type (TYPE_BOOLEAN or TYPE_INT_DISPLAYED_AS_BOOLEAN), the label will serve as the check box text.
description - optional preference description (may be null). In GUI representation of this preference it is typically displayed in a text pane above the editable component. The description may be plain text or HTML. In the latter case and it may also contain enhanced application links supported by the CustomHyperlinkListener class.
maxValue - maximum acceptable value. Use Integer.MAX_VALUE to indicate that the limit should not be set.
minValue - minimum acceptable value. Use Integer.MIN_VALUE to indicate that the limit should not be set.

Preference

public Preference(java.lang.String configurationKey,
                  int type,
                  java.lang.String label,
                  java.lang.String description)
Generic constructor for any preference type.

Parameters:
configurationKey - preference/parameter name.
type - preference value type - one of the numeric codes defined by the TYPE_ prefixed constants defined in this class
label - label (short description). In GUI representation of this preference the label is displayed next to the editable component. If the preference is a boolean type (TYPE_BOOLEAN or TYPE_INT_DISPLAYED_AS_BOOLEAN), the label will serve as the check box text.
description - optional preference description (may be null). In GUI representation of this preference it is typically displayed in a text pane above the editable component. The description may be plain text or HTML. In the latter case and it may also contain enhanced application links supported by the CustomHyperlinkListener class.

Preference

public Preference(int type,
                  java.lang.String configurationKey,
                  java.lang.String resourceKey,
                  java.lang.String descriptionKey)

Constructor allowing to pass resource bundle keys for the preference name and description rather than plain text. It should be used for preferences created by objects which may experience change of the underlying resource bundle, for example objects which exist at the time when user may select to change the display language.

A good example are desktop clients which should use exclusively this constructor. As their preferences are displayed as logon parameters in the Login Dialog which allows to change the language, they must allow the dialog to reload the texts from the new resource bundle.

Parameters:
type - preference value type - one of the numeric codes defined by the TYPE_ prefixed constants defined in this class
configurationKey - preference/parameter name.
resourceKey - message key of the preference name (label).
descriptionKey - message key of the preference description (may be null).
Method Detail

getTypeMap

public static java.util.Map<java.lang.Integer,java.lang.String> getTypeMap(boolean baseTypesOnly)
Get the map of preference type names and their integer codes.

Returns:
map of supported preference types and codes.

getType

public int getType()
Get the preference type (numeric code).

Returns:
See the TYPE_ prefixed constants defined in this class for possible return values.

getDisplayValues

public java.util.List getDisplayValues()
Get the fixed set of values displayable in the GUI. See setDisplayValues(java.util.List).

Returns:
fixed set of values displayable in the GUI.

setDisplayValues

public void setDisplayValues(java.util.List displayValues)

This method allows together with setValues(java.util.List) to define enumerated values for parameter of the TYPE_STRING type. The GUI then typically doesn't allow to edit the value in a generic editor and rather displays a fixed list (JComboBox) allowing to select only one of the predefined values.

The absolute minimum to define a value set is to call this setDisplayValues() method with a list of acceptable values. This is fine where we want to display the values as they are. Though the list is a generic one and may contain any objects, the values may be internally converted to String instances and the object consuming the parameters should handle the stored parameter value with regard to this.

The setValues(java.util.List) method is optional and allows to define raw values to be assigned internally to the displayed descriptions. As the values are matched to descriptions based on the index, the lists must naturally have the same length. If the value list is defined, the component will populate the parameter with the raw value rather than the one displayed in the GUI.

Parameters:
displayValues - a list of enumerated values good for displaying in the GUI.

getValues

public java.util.List getValues()
Get the list of raw values to be mapped to descriptions returned by getDisplayValues(). Applies to enumerated string parameters only (TYPE_STRING).

Returns:
list of raw parameter values.

setValues

public void setValues(java.util.List values)
Set the list of raw values to be mapped to descriptions defined through setDisplayValues(java.util.List). Applies to enumerated string parameters only (TYPE_STRING).

Parameters:
values - list of raw parameter values.

getDisplayValuesTable

public java.util.Map getDisplayValuesTable()
Get the map of descriptions and their values. See setDisplayValuesTable(java.util.Map). Applies to enumerated string list parameters only (TYPE_STRINGLIST).

Returns:
map of values and descriptions to be displayed in the component.

setDisplayValuesTable

public void setDisplayValuesTable(java.util.Map displayValuesTable)

This method allows to define enumerated values for a TYPE_STRINGLIST parameter. The GUI then typically doesn't allow to edit the value in a generic editor and rather displays a fixed list (JList) allowing to select only one or more of the predefined values in a particular order.

The principle is very similar to the one described in setDisplayValues(java.util.List). As TYPE_STRINGLIST however allows to change order of the displayed values, the mapping must be realized through a Map instead of a pair of List instances. The map should contain the [value, description] pairs where descriptions are displayed in the GUI and the parameter is then populated with the corresponding raw value.

Parameters:
displayValuesTable - map of descriptions and values where values are the keys and descriptions are the map values. If you want to make the GUI display and store the same value set, create a map where description and value are the same for each acceptable value.

getLabel

public java.lang.String getLabel()
Get the preference/parameter label (short description). In GUI representation the label is displayed next to the editable component. If the preference is a boolean type (TYPE_BOOLEAN or TYPE_INT_DISPLAYED_AS_BOOLEAN), the label serves as the check box text.

Returns:
preference/parameter label.

setLabel

public void setLabel(java.lang.String label)
Set the preference label.

Parameters:
label - the label text.
Since:
5.0

getDescription

public java.lang.String getDescription()
Get the preference/parameter description. It is optional and may be null. In GUI representation of this preference it is typically displayed in a text pane above the editable component. The description may be plain text or HTML. In the latter case and it may also contain enhanced application links supported by the CustomHyperlinkListener class.

Returns:
preference/parameter description.

setDescription

public void setDescription(java.lang.String desc)

getConfigurationKey

public java.lang.String getConfigurationKey()
Get the preference/parameter name (configuration key).

Returns:
preference/parameter name (configuration key).

isNumber

public boolean isNumber()
Find out if the preference/parameter is a number type or not.

Returns:
true if the preference is either TYPE_INT or TYPE_FLOAT, false otherwise.

isSelectOnly

public boolean isSelectOnly()
Indicate whether the values of this parameter are enumerated. See setSelectOnly(boolean).

Returns:
true if the values are enumerated, false if not.

setSelectOnly

public void setSelectOnly(boolean selectOnly)
Indicate whether the values of this parameter are enumerated (select-only, one-of). If the flag is set to true, the GUI typically doesn't allow to edit the value in a generic editor and rather displays a fixed list (JComboBox, JList etc.) allowing to select one of the predefined values. See the setDisplayValues(java.util.List) method for description of how to define a set of enumerated values.

Parameters:
selectOnly - true if the parameter values are enumerated, false if not.

getMaxValue

public int getMaxValue()
Get the maximum value. Applies just to numeric types such as TYPE_INT or TYPE_FLOAT.

Returns:
maximum numeric value of the parameter. Defaults to Integer.MAX_VALUE.

setMaxValue

public void setMaxValue(int maxValue)
Set the maximum value. Applies just to numeric types such as TYPE_INT or TYPE_FLOAT.

Parameters:
maxValue - maximum numeric value of the parameter or Integer.MAX_VALUE to unset this limit.

getMinValue

public int getMinValue()
Get the minimum value. Applies just to numeric types such as TYPE_INT or TYPE_FLOAT.

Returns:
minimum numeric value of the parameter. Defaults to Integer.MIN_VALUE.

setMinValue

public void setMinValue(int minValue)
Set the minimum value. Applies just to numeric types such as TYPE_INT or TYPE_FLOAT.

Parameters:
minValue - maximum numeric value of the parameter or Integer.MIN_VALUE to unset this limit.

getPreferredContainerName

public java.lang.String getPreferredContainerName()
Get the preferred container name. See setPreferredContainerName(java.lang.String).

Returns:
preferred container name.

setPreferredContainerName

public void setPreferredContainerName(java.lang.String preferredContainerName)
Set the preferred container name. The GUI will create separate titled and frames panel for each unique container name declared by the displayed preferences. If you want multiple preferences to form a logical group and appear in the same container, give them the same container name using this method.

Parameters:
preferredContainerName - container name (title). If the name is null, the GUI container this preference displays in will not be titled.

getDependentOption

public java.lang.String getDependentOption()
Get the preference name (configuration key) that this preference depends on. See setDependentOption(java.lang.String).

Returns:
dependent parameter name or null if no such relationship has been defined through the setDependentOption(java.lang.String) method.

getDependentOptions

public java.lang.String[] getDependentOptions()

setDependentOption

public void setDependentOption(java.lang.String dependentOption,
                               boolean removeIfDisabled)
Declare that this preference/parameter is only valid if the specified parameter is TYPE_BOOLEAN and its value is true. This flag is used in GUI to implement parameter pairs representing a parameter which can be set on or off.

Parameters:
dependentOption - name (configuration key) of the preference that this one depends on.

setDependentOption

public void setDependentOption(java.lang.String dependentOption)

setDependentOptions

public void setDependentOptions(java.lang.String[] dependentOptions)

getAcceptedFileExtensions

public java.lang.String[] getAcceptedFileExtensions()
Get the list of accepted file extensions for the TYPE_FILE and TYPE_FILELIST preferences. See the setAcceptedFileExtensions(java.lang.String[], java.lang.String) method.

Returns:
string array of accepted file extensions, for example new String[] {"txt"}.

setAcceptedFileExtensions

public void setAcceptedFileExtensions(java.lang.String[] acceptedFileExtensions,
                                      java.lang.String descriptionKey)
Set the list of accepted file extensions for the TYPE_FILE and TYPE_FILELIST preferences. The optional description will be displayed in the filter drop down of the file chooser.

Parameters:
acceptedFileExtensions - string array of accepted file extensions, for example new String[] {"txt"}.
descriptionKey - filter description or resource bundle key of the description.

getAcceptedFileExtensionsDesc

public java.lang.String getAcceptedFileExtensionsDesc()
Get description of the file extension based filter for the TYPE_FILE preferences. The description is first searched in the application resource bundles by the description key provided in the setAcceptedFileExtensions(java.lang.String[], java.lang.String) method. If it is not found, the method returns the key itself.

Returns:
file filter description.

addAcceptedFileFilter

public void addAcceptedFileFilter(javax.swing.filechooser.FileFilter filter)
Add a file filter to be shown in the file chooser of a TYPE_FILE preference.

Parameters:
filter - a filter.

getFileFilters

public java.util.List<javax.swing.filechooser.FileFilter> getFileFilters()
Get file filters for the file chooser employed by the TYPE_FILE preferences. See addAcceptedFileFilter(javax.swing.filechooser.FileFilter).

Returns:
the list of file filters.

getAcceptedFileExtensionsDescs

public java.lang.String[] getAcceptedFileExtensionsDescs()
Get description of the file extension based filter for the TYPE_FILE preferences. The description is first searched in the application resource bundles by the description key provided in the setAcceptedFileExtensions(java.lang.String[], java.lang.String) method. If it is not found, the method returns the key itself.

Returns:
file filter description.

getSummary

public java.lang.String getSummary()
Get a simple HTML summary with the preference details. Used by the GUI to display raw parameter properties as tool tip messages. This method should not be used by parametrized objects.

Returns:
HTML code with preference raw data summary (name/preference key, type, raw value stored in user configuration).

getTypeDesc

public java.lang.String getTypeDesc()
Get description of a preference type (see getType())..

Returns:
type description.

isAcceptEmptyValue

public boolean isAcceptEmptyValue()
Indicates whether the empty value ("") should be accepted as a valid one and saved or not. Applies only to the TYPE_STRING preferences.

Returns:
value of the accept flag.

setAcceptEmptyValue

public void setAcceptEmptyValue(boolean acceptEmptyValue)
Defines whether the empty value ("") should be accepted as a valid one and saved or not. Applies only to the TYPE_STRING preferences. Default value is true.

Parameters:
acceptEmptyValue - the acceptEmptyValue to set

getTextRowsToDisplay

public int getTextRowsToDisplay()
Get the number of visible text rows to be displayed if the parameter is displayed in a text pane in the GUI. This property makes sense only for the TYPE_TEXT type and it is ignored by other types.

Returns:
number of text rows to display if the parameter is displayed in GUI.

setTextRowsToDisplay

public void setTextRowsToDisplay(int textRowsToDisplay)
Set the number of visible text rows to be displayed if the parameter is displayed in a text pane in the GUI. This property makes sense only for the TYPE_TEXT type and it is ignored by other types.

Parameters:
textRowsToDisplay - number of text rows to display if the parameter is displayed in GUI.

getDefaultValue

public java.lang.Object getDefaultValue()
Get the default value of this preference (parameter). If the default value is null and the preference type is a primitive one such as int, float or boolean, the real default value equals to the default Java one for the primitive type (zero for int/float, false for boolean).

Returns:
the defaultValue

setDefaultValue

public void setDefaultValue(java.lang.Object defaultValue)
Set the default value of this parameter. Since the GUI typically doesn't store parameters of a primitive type (TYPE_BOOLEAN, TYPE_INT, TYPE_FLOAT, TYPE_STRING) whose value is equal to the default one, do not set the default value for mandatory parameters which must be always stored.

Parameters:
defaultValue - default parameter value. It is not validated so make sure it is of the declared type and meets the rules and relationships declared in this parameter.

setDefaultValue

public void setDefaultValue(java.lang.Object defaultValue,
                            boolean forceSaving)
Set the default value of this parameter with optional forcing of saving of the default value.

Parameters:
defaultValue - default parameter value. It is not validated so make sure it is of the declared type and meets the rules and relationships declared in this parameter.
forceSaving - the UI by default doesn't save the parameter to the configuration container when its value is equal to the default one. Use the value of true to override this behavior and save the default value anyway. This makes sense just for the parameters of primitive types (TYPE_BOOLEAN, TYPE_INT, TYPE_FLOAT, TYPE_STRING) because default values of all other ones are stored always.
Since:
3.1

isAcceptFileAsUri

public boolean isAcceptFileAsUri()
Find out whether the TYPE_FILE preference values may be provided in form of URI.

Returns:
true the parameter value should be converted from URI or false otherwise.

setAcceptFileAsUri

public void setAcceptFileAsUri(boolean reportFileAsURI)
Controls whether the TYPE_FILE preference should accept files in form of a URL or URI, for example "file://C:\test.png".

Parameters:
reportFileAsURI - true indicates that the parameter value might be in URI/URL format.

checkValue

public void checkValue(java.lang.Object value)
                throws java.lang.IllegalArgumentException
Check if a value meets the rules defined in this instance and is acceptable for this preference (parameter). For example if the preference is of the TYPE_INT type, the method checks whether the value is a number or whether it may be converted to a number. If the minimum and/or maximum values are set through the setMinValue(int) and setMaxValue(int) methods, the value is also checked against these limits.

Parameters:
value -
Throws:
java.lang.IllegalArgumentException

isMandatory

public boolean isMandatory()
Find out if the preference is mandatory and must be specified. This flag is ignored by user preferences. It however plays a role when the preference object is reused for a parametrized object which may declare through this property that the parameter is mandatory and its value must be specified.

Returns:
true if the preference (parameter) is mandatory, false if not.

setMandatory

public void setMandatory(boolean mandatory)
Set whether the preferece is mandatory and must be specified. This flag is ignored by user preferences. It however plays a role when the preference object is reused for a parametrized object which may declare through this property that the parameter is mandatory and its value must be specified.

Parameters:
mandatory - true if the preference (parameter) is mandatory, false if not.

getFileAccessory

public javax.swing.JComponent getFileAccessory()
Get the file accessory component. Applies just to TYPE_FILE, TYPE_FILELIST and TYPE_DIRECTORY preferences. It is an optional component for the file chooser which may provide a preview of the file (for example an image thumbnail). See the JFileChooser.setAccessory(javax.swing.JComponent) method for more information.

Returns:
the file chooser accessory component.

setFileAccessory

public void setFileAccessory(javax.swing.JComponent fileAccessory)
Set the file accessory component. Applies just to TYPE_FILE, TYPE_FILELIST and TYPE_DIRECTORY preferences. It is an optional component for the file chooser which may provide a preview of the file (for example an image thumbnail). See the JFileChooser.setAccessory(javax.swing.JComponent) method for more information.

Parameters:
fileAccessory - the file chooser accessory component.

getImageProvider

public ColorChooserImageProvider getImageProvider()
Returns:
the imageProvider

setImageProvider

public void setImageProvider(ColorChooserImageProvider imageProvider)
Parameters:
imageProvider - the imageProvider to set

setImageProvider

public void setImageProvider(java.lang.ref.Reference<ColorChooserImageProvider> imageProvider)
Parameters:
imageProvider - the imageProvider to set

setDirFileToSearchFor

public void setDirFileToSearchFor(java.lang.String fileToSearchFor,
                                  java.lang.String defaultSearchPath,
                                  boolean useRegularExpressions,
                                  boolean ignoreCase,
                                  boolean forceValueToFound)

This method allows to set verification options for TYPE_FILE and TYPE_DIRECTORY preferences. As these preference types are often used to store install locations of integrated third party component, this is intended to provide a quick verification mechanism like "check if the path selected by user contains this specific file".

The fileToSearchFor parameter may specify the required file name or a regular expression (pattern) the selected file must comply with. If the preference is of the TYPE_DIRECTORY type, the underlying GUI component is expected to search the selected directory recursively and verify whether it contains a file complying with the specified name or pattern.

Parameters:
fileToSearchFor - file name or a Pattern compliant regular expression.
defaultSearchPath - default directory. It may be used for resolution of relative paths. It may be null.
useRegularExpressions - true matches the specified file name using regular expressions, false sets regular string comparison.
ignoreCase - whether the regular comparison should be done in a case sensitive way or not. If the value is true, the file names will be compared with the fileToSearchFor parameter using String.equalsIgnoreCase(java.lang.String) instead of standard String.equals(java.lang.Object). If regular expressions are on (the useRegularExpressions parameter is true), this parameter is ignored.
forceValueToFound - Indicates whether the preference value should be forced to the located file (TYPE_FILE) or its parent folder (TYPE_DIRECTORY). The value of true forces the file search mechanism to set the value to the file found, false leaves the value as it was selected by the user.

getDirFileToSearchFor

public java.lang.String getDirFileToSearchFor()
Get the file name to verify existence of in a TYPE_DIRECTORY or TYPE_FILE preference. See setDirFileToSearchFor(java.lang.String, java.lang.String, boolean, boolean, boolean).

Returns:
file name or regular expression to be verified.

getCurrentDirectory

public java.lang.String getCurrentDirectory()

setCurrentDirectory

public void setCurrentDirectory(java.lang.String path)

getDirDefaultSearchPath

public java.lang.String getDirDefaultSearchPath()
Get the default path for verification of value of a TYPE_DIRECTORY or TYPE_FILE preference. See setDirFileToSearchFor(java.lang.String, java.lang.String, boolean, boolean, boolean).

Returns:
file name or regular expression to be verified.

isDirSearchUseRegularExpressions

public boolean isDirSearchUseRegularExpressions()
Returns:
the useRegularExpressions

isDirSearchIgnoreCase

public boolean isDirSearchIgnoreCase()
Returns:
the ignoreCase

isDirSearchForceValueToFound

public boolean isDirSearchForceValueToFound()
Indicates whether the preference value should be forced to the value of the verification file search. See setDirFileToSearchFor(java.lang.String, java.lang.String, boolean, boolean, boolean).

Returns:
true forces the file search mechanism to set the value to the file found, false leaves the value as selected by the user.

getDescriptionOfAvailableValues

public java.lang.String getDescriptionOfAvailableValues()
Get description of available values. This text is used just by the TYPE_STRINGLIST preference type and it is displayed as a description of the list of available (disabled) values on the right side of the GUI component.

Returns:
label text for available values.

setDescriptionOfAvailableValues

public void setDescriptionOfAvailableValues(java.lang.String descriptionOfAvailableValues)
Set description of available values. This text is used just by the TYPE_STRINGLIST preference type and it is displayed as a description of the list of available (disabled) values on the right side of the GUI component.

Parameters:
descriptionOfAvailableValues - label text for available values.

getButtonGroup

public java.lang.String getButtonGroup()
Returns:
the buttonGroup

setButtonGroup

public void setButtonGroup(java.lang.String buttonGroup,
                           boolean useCheckBox)
Parameters:
buttonGroup - the buttonGroup to set

setButtonGroup

public void setButtonGroup(java.lang.String buttonGroup)

getJoinWith

public java.lang.Object getJoinWith()
See setJoinWith(java.lang.Object).

Returns:
key of another preference to join this BOOLEAN preference with.

setJoinWith

public void setJoinWith(java.lang.Object joinWith)
Set the configuration key of another option that this BOOLEAN preference should be visually joined with (put in one line). This allows to create composed preferences where the first component is a radio or check box which is followed by any other preference. The other preference should define dependency on this preference through setDependentOption(java.lang.String).

Parameters:
joinWith - key of the other preference to join this preference with.
Throws:
java.lang.IllegalStateException - when this preference is not of TYPE_BOOLEAN or TYPE_INT_DISPLAYED_AS_BOOLEAN.

getDynamicPanels

public java.util.Map getDynamicPanels()
Returns:
the dynamicPanels

setDynamicPanels

public void setDynamicPanels(java.util.Map dynamicPanels,
                             java.lang.String[] dependentOptions)
Set the map of dynamic panels. The key is the value of the option which drives it. The value may be either a Configurable instance or a list of Preference instances.

Parameters:
dynamicPanels - the dynamicPanels to set

setDynamicPanels

public void setDynamicPanels(java.util.Map dynamicPanels,
                             java.lang.String dependentOption)

isUseCheckBox

public boolean isUseCheckBox()
Returns:
the useCheckBox

getLabelAfter

public java.lang.String getLabelAfter()
Returns:
the labelAfter

setLabelAfter

public void setLabelAfter(java.lang.String labelAfter)
Parameters:
labelAfter - the labelAfter to set

isRemoveIfDisabled

public boolean isRemoveIfDisabled()
Returns:
the removeIfDisabled

getCustomPanel

public com.tplan.robot.gui.preferences.PreferencePanel getCustomPanel()
Returns:
the customPanel

getHintTitle

public java.lang.String getHintTitle()
Returns:
the hint

setHint

public void setHint(java.lang.String title,
                    java.lang.String hint)
Parameters:
hint - the hint to set

getHintText

public java.lang.String getHintText()
Returns:
the hint

getFileView

public javax.swing.filechooser.FileView getFileView()
Returns:
the fileView

setFileView

public void setFileView(javax.swing.filechooser.FileView fileView)
Parameters:
fileView - the fileView to set

getCurrentFile

public java.io.File getCurrentFile()
Returns:
the currentFile

setCurrentFile

public void setCurrentFile(java.io.File currentFile)
Parameters:
currentFile - the currentFile to set

getColumns

public int getColumns()
Get the default text field width in characters. See setColumns(int) for more.

Returns:
the required text field width.

setColumns

public void setColumns(int columns)

Set the default text field width in characters. This can be used for preferences using a JTextField editor to force the field width to be able to hold a certain text length.

Be aware that as JTextField instances typically use a proportional font, the field width is typically calculated as the maximum character width times the number of columns. That's why the field may display wide enough to fit for example 50 characters even though the columns are set to 25 or 30.

Parameters:
columns - number of character the text field should be able to display.

getFileChooserManager

public com.tplan.robot.gui.components.FileChooserManager getFileChooserManager()
Get the file chooser manager for the TYPE_FILE and TYPE_DIRECTORY preferences. See setFileChooserManager(com.tplan.robot.gui.components.FileChooserManager) for more.

Returns:
the file chooser manager.

setFileChooserManager

public void setFileChooserManager(com.tplan.robot.gui.components.FileChooserManager fileChooserManager)

Set the manager for the file chooser provided by the GUI component representing the TYPE_FILE and TYPE_DIRECTORY preferences. The manager can be used to customize the chooser view, accessory, file filters etc. It can also register as a PropertyChangeListener to the chooser to react on a file selection.

Note that other supported ways of the file chooser customization are the methods of setFileAccessory(javax.swing.JComponent), setFileView(javax.swing.filechooser.FileView), addAcceptedFileFilter(javax.swing.filechooser.FileFilter) and setAcceptedFileExtensions(java.lang.String[], java.lang.String). It is also possible to replace the default file chooser with a custom one through the setFileChooser(javax.swing.JFileChooser) method.

Parameters:
fileChooserManager - the fileChooserManager to set

setFileChooserManager

public void setFileChooserManager(java.lang.ref.Reference<com.tplan.robot.gui.components.FileChooserManager> fileChooserManager)

Set the manager for the file chooser provided by the GUI component representing the TYPE_FILE and TYPE_DIRECTORY preferences. The manager can be used to customize the chooser view, accessory, file filters etc. It can also register as a PropertyChangeListener to the chooser to react on a file selection.

Note that other supported ways of the file chooser customization are the methods of setFileAccessory(javax.swing.JComponent), setFileView(javax.swing.filechooser.FileView), addAcceptedFileFilter(javax.swing.filechooser.FileFilter) and setAcceptedFileExtensions(java.lang.String[], java.lang.String). It is also possible to replace the default file chooser with a custom one through the setFileChooser(javax.swing.JFileChooser) method.

Parameters:
fileChooserManager - the fileChooserManager to set

getLeftInset

public int getLeftInset()
Get the left inset (padding) in pixels. See setLeftInset(int) for more.

Returns:
the left inset (padding) in pixels.

setLeftInset

public void setLeftInset(int leftInset)
Set the left inset (padding) in pixels. This allows to indent components to the right, for example in order to emphasize dependency on the previous component in the form.

Parameters:
leftInset - the left inset (padding) in pixels. The default value is 0 which ensures that all components in the same container are aligned vertically to the left.

isMatchMode

public boolean isMatchMode()
A flag used for the TYPE_REGEXP preference types. It indicates whether the regular expression identified by the option is going to be used for text matching (return value is true) or for text splitting or parsing (return value is false).

Returns:
true if the regexp is going to be used for text matching, false if not.

setMatchMode

public void setMatchMode(boolean matchMode)
See isMatchMode().

Parameters:
matchMode - true if the regexp is going to be used for text matching, false if not.

getFileChooser

public javax.swing.JFileChooser getFileChooser()
Get the custom file chooser for the TYPE_FILE and TYPE_DIRECTORY preference type.

Returns:
the custom file chooser (null by default).

setFileChooser

public void setFileChooser(javax.swing.JFileChooser fileChooser)
Set the custom file chooser to be used by the GUI component representing the TYPE_FILE and TYPE_DIRECTORY preferences.

Parameters:
fileChooser - a custom file chooser to be used by the preference editor.

getConfigurableCreator

public ConfigurableCreator getConfigurableCreator()

Set the object able to create a Configurable object based on the value it depends on. This value is used exclusively by the TYPE_DYNAMIC_PANEL preference type to provide dynamic content based on a value provided in another preference component. This dependency must be declared through a call of the setDependentOption(java.lang.String) method.

Note that another supported way of creating a TYPE_DYNAMIC_PANEL is to create a map of [value, params] pairs where the params objects are either preference lists (List<Preference> or Configurable instances. The map must be then passed to the preference through the setDynamicPanels(java.util.Map, java.lang.String) method. This way is however suitable when the list of driving values is fixed and well known in advance.

Returns:
an object implementing the ConfigurableCreator interface.

setConfigurableCreator

public void setConfigurableCreator(ConfigurableCreator configurableCreator)
Set the Configurable object creator for the TYPE_DYNAMIC_PANEL preference. See getConfigurableCreator() for details.

Parameters:
configurableCreator - a configuration parameter producer.

getIgnoreDynamicParamList

public java.util.List<java.lang.String> getIgnoreDynamicParamList()
Get the list of parameter names to be ignored by the TYPE_DYNAMIC_PARAM_LIST preference. This allows the dynamic parameter list to skip other parameters which are being used in the same form.

Returns:
names of parameters to be ignored (not to be recognized as dynamic ones) by a TYPE_DYNAMIC_PARAM_LIST preference.

setIgnoreDynamicParamList

public void setIgnoreDynamicParamList(java.util.List<java.lang.String> ignoreDynamicParamList)
Set the list of parameter names to be ignored by the TYPE_DYNAMIC_PARAM_LIST preference. This allows the dynamic parameter list to skip other parameters which are being used in the same form.

Parameters:
ignoreDynamicParamList - names of parameters to be ignored (not to be recognized as dynamic ones) by a TYPE_DYNAMIC_PARAM_LIST preference.

getComponentManager

public PreferenceComponentManager getComponentManager()
Returns:
the componentManager

setComponentManager

public void setComponentManager(PreferenceComponentManager componentManager)
Parameters:
componentManager - the componentManager to set

isSaveDefaultValue

public boolean isSaveDefaultValue()
See setDefaultValue(java.lang.Object, boolean).

Returns:
true if the default value is to be saved, false if not (the default value).

setCustomInputEnabled

public void setCustomInputEnabled(boolean enabled,
                                  java.lang.String[] templates)
Enable/disable the custom input mode. When it is enabled the preference editor will allow to assign a value which is not of the preference declared type. This is typically used for script code editing where a parameter may be an atomic one (such as int or float) or it may be result of a method call or a variable.

Parameters:
enabled - true enables the input mode, false disables. The mode is by default enabled.
templates - optional array of code template code shortcuts allowed in the value. If the argument is null the editor will offer all templates which are not standalone and have compatible type.

isCustomInputEnabled

public boolean isCustomInputEnabled()

getCustomInputTemplates

public java.lang.String[] getCustomInputTemplates()
Get the custom input templates. See setCustomInputEnabled(boolean, java.lang.String[]) for details.

Returns:
the array of custom input code template keys (codes).

setDescriptionKey

public void setDescriptionKey(java.lang.String descriptionKey)
Set the description resource bundle key. Unlike setDescription(java.lang.String) which sets the description directly, this method allows to load the text from the resource bundle. If both the key and the description are set the getDescription() method will prefer the resource bundle text.

Parameters:
descriptionKey - the resource bundle key of the preference description.

getLabels

public java.lang.String[] getLabels()
Returns:
the labels

setLabels

public void setLabels(java.lang.String[] labels)
Parameters:
labels - the labels to set

isScreenSelectionEnabled

public boolean isScreenSelectionEnabled()
Returns:
the screenSelectionEnabled

setScreenSelectionEnabled

public void setScreenSelectionEnabled(boolean screenSelectionEnabled)
Parameters:
screenSelectionEnabled - the screenSelectionEnabled to set

isRemoveProtocol

public boolean isRemoveProtocol()

Specifies whether the preference value should be checked on load (in the PreferencePanel.loadPreferences(java.lang.Object) method) against the URL/URI syntax. If the string contains a protocol it will be removed. For example, a string like "rfb://localhost:5901" will be stripped to "localhos:5901".

This mode is applied only to the String preferences (TYPE_STRING, TYPE_STRING_WITH_ACTION and TYPE_PASSWORD). The flag is ignored for other preference types. The default value is false.

Returns:
the flag indicating whether the protocol should be removed or not.
Since:
3.4.1

setRemoveProtocol

public void setRemoveProtocol(boolean removeProtocol)
Set on/off the protocol removal mode. See isRemoveProtocol() for details.

Parameters:
removeProtocol - the removeProtocol to set

setPointBounds

public void setPointBounds(int minX,
                           int minY,
                           int maxX,
                           int maxY)
Set the coordinate bounds applied to the TYPE_POINT and TYPE_POINT_RELATIVE preferences.

Parameters:
minX - minimum acceptable X coordinate value (defaults to 0).
minY - minimum acceptable Y coordinate value (defaults to 0).
maxX - maximum acceptable X coordinate value (defaults to 9999).
maxY - maximum acceptable Y coordinate value (defaults to 9999).
Since:
4.1

getMinPointX

public int getMinPointX()
Get the minimum acceptable X coordinate value of the TYPE_POINT and TYPE_POINT_RELATIVE preferences. The default value is 0 (zero).

Returns:
the minimum acceptable X coordinate value.

getMaxPointX

public int getMaxPointX()
Get the maximum acceptable X coordinate value of the TYPE_POINT and TYPE_POINT_RELATIVE preferences. The default value is 9999 which ensures that the coordinate editor is not too wide.

Returns:
the maximum acceptable X coordinate value.

getMinPointY

public int getMinPointY()
Get the minimum acceptable Y coordinate value of the TYPE_POINT and TYPE_POINT_RELATIVE preferences. The default value is 0 (zero).

Returns:
the minimum acceptable Y coordinate value.

getMaxPointY

public int getMaxPointY()
Get the maximum acceptable Y coordinate value of the TYPE_POINT and TYPE_POINT_RELATIVE preferences. The default value is 9999 which ensures that the coordinate editor is not too wide.

Returns:
the maximum acceptable Y coordinate value.

isHideBorder

public boolean isHideBorder()
Defines whether to display border of a TYPE_DYNAMIC_PANEL preference. See setHideBorder(boolean).

Returns:
false if border rendering is on (default) or false if the border is disabled.
Since:
4.1

setHideBorder

public void setHideBorder(boolean hideBorder)
Hide the container border of a TYPE_DYNAMIC_PANEL preference.

Parameters:
hideBorder - true will hide the border, false will show it. The default value is false (show the border).
Since:
4.1

isOpaque

public boolean isOpaque()
Defines whether to make the TYPE_DYNAMIC_PANEL preference component opaque or transparent.

Returns:
true for opaque and false for transparent.
Since:
4.1

setOpaque

public void setOpaque(boolean opaque)
Set opacity of the TYPE_DYNAMIC_PANEL preference component.

Parameters:
opaque - true for opaque and false for transparent.
Since:
4.1

isWindowsKeyCompatMode

public boolean isWindowsKeyCompatMode()
Find out if the Windows compatibility mode of a key stroke preference (type TYPE_KEYSTROKE) is on or off.

Returns:
true/false if the mode is on/off.

setWindowsKeyCompatMode

public void setWindowsKeyCompatMode(boolean windowsKeyCompatMode)
Set the Windows compatibility mode on/off. It gets applied only to the key stroke preferences (type TYPE_KEYSTROKE). The main difference is that when the mode is on the field records the 'Windows' key instead of the 'Command' one on Mac OS.

Parameters:
windowsKeyCompatMode - true/false to set the Windows compat mode on/off.

createMandatoryFieldLabel

public static java.lang.String createMandatoryFieldLabel(java.lang.String label)
Create an HTML label with a trailing red asterisk used to indicate a mandatory field.

Parameters:
label - a plain text label.
Returns:
an HTML text with the label and asterisk compatible with JLabel.

T-Plan Robot Enterprise 5.0.1
Build No. 5.0.1-20190308.1