Class BeanShellExpressionConfigurer
java.lang.Object
VASSAL.configure.Configurer
VASSAL.configure.StringConfigurer
VASSAL.configure.BeanShellExpressionConfigurer
A Configurer for Java Expressions
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumenum describing any special processing that needs to be done for particular expression types NONE = No special handling PME = Property Match Expression handling.Nested classes/interfaces inherited from class Configurer
Configurer.ContextLevelModifier and TypeClassDescriptionstatic enumThe ContextLevel of a Configurer defines the level that it is defined at. -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected FunctionBuilderprotected JPanelprotected booleanprotected Iconprotected StringConfigurerprotected JPanelprotected JButtonprotected JLabelprotected JTextAreaprotected BeanShellExpressionConfigurer.Optionprotected Stringprotected EditablePieceprotected Iconprotected VASSAL.configure.BeanShellExpressionConfigurer.Validatorprotected JLabelFields inherited from class StringConfigurer
DEFAULT_LENGHTH, DEFAULT_LENGTH, length, p, updateInProgressModifier and TypeFieldDescriptionprotected static final intDeprecated, for removal: This API element is subject to removal in a future version.protected static final intprotected intprotected JPanelprotected booleanFields inherited from class Configurer
changeSupport, context, contextLevel, frozen, hint, key, LIST_ENTRY_HIGHLIGHT_COLOR, name, NAME_PROPERTY, noUpdate, valueModifier and TypeFieldDescriptionprotected PropertyChangeSupportprotected AbstractBuildableprotected Configurer.ContextLevelprotected booleanWhen frozen is true, setting the value programmatically will not result in a PropertyChangeEvent being firedprotected StringA Hint to be displayed in an empty fieldprotected StringA String the uniquely identifies this propertystatic final ColorDefault Highlight Color for Configurable Listsprotected StringA String that provides a short description of the property to the userstatic final Stringprotected booleanWhen noUpdate is true, setting the value programmatically will not result in an update of the GUI Componentprotected ObjectThe value -
Constructor Summary
ConstructorsConstructorDescriptionBeanShellExpressionConfigurer(String key, String name, String val, GamePiece piece) Create a labeled BeanShellConfigurer with an initial value and target pieceBeanShellExpressionConfigurer(String key, String name, String val, GamePiece piece, BeanShellExpressionConfigurer.Option option) BeanShellExpressionConfigurer(String key, String name, String val, GamePiece piece, BeanShellExpressionConfigurer.Option option, boolean displayOnly) BeanShellExpressionConfigurer(String key, String name, String val, GamePiece piece, BeanShellExpressionConfigurer.Option option, FunctionBuilder builder) BeanShellExpressionConfigurer(String val, GamePiece piece) Create an unlabeled BeanShellConfigurer with an initial value and target piece -
Method Summary
Modifier and TypeMethodDescriptionvoidaddFocusListener(FocusListener listener) Add a FocusListener to the Swing Components that make up this Configurer.protected Stringprotected voiddoPopup()GUI interface for setting the option in an editing windowprotected Componentprotected voidinsertName(String name) protected voidinsertPropertyName(String name) Insert a property name into the expressionbooleanvoidremoveFocusListener(FocusListener listener) Remove a FocusListener from the Swing Components that make up this Configurer.voidMove the cursor to the first input field of this Configurerprotected voidprotected voidvoidsetDisplayOnly(boolean displayOnly) voidsetHighlighted(boolean highlighted) Set the highlighted status of this configurer.voidvoidsetSelectedText(String selectedText) voidSet the Object value from a Stringprotected voidstrip()protected voidIf we are the child of a FunctionBuilder, notify it we have changed.voidvalidate()Methods inherited from class StringConfigurer
buildTextField, getGrowthConstraint, setEnabled, setLabelVisible, updateHintModifier and TypeMethodDescriptionprotected JTextFieldprotected StringvoidsetEnabled(boolean enabled) Enable or Disable the action of this configurer/voidsetLabelVisible(boolean visible) Show/Hide the internal label maintained by this Configurer.voidupdateHint(String hint) Methods inherited from class Configurer
addPropertyChangeListener, fireUpdate, getContext, getContextLevel, getHint, getKey, getName, getScreenSize, getValue, initCustomControls, isFrozen, isHighlighted, isPieceContext, removePropertyChangeListener, repack, repack, setContext, setContext, setContext, setContextLevel, setFrozen, setHint, setHintKey, setLabelVisibile, setName, setValueModifier and TypeMethodDescriptionvoidAdd a listener to be notified when the Object state changesvoidFire a PropertyChangeEvent as if the value had been set from nullGet the Context for this ConfigurergetHint()Return the current hint StringgetKey()Unique identifiergetName()Plain English description of the Objectprotected DimensionReturn the current screen size for use by List type configurers to allow them to take up maximum screen real estate if needed.getValue()The Object value May be null if the Object has not been initializedvoidinitCustomControls(JDialog d, Configurable target) Initialize any custom controls / keystrokesbooleanisFrozen()booleanReturn the current highlighted statusbooleanvoidprotected voidrepack()Repack the current configurerprotected voidRepack a dialog or windowvoidsetContext(AbstractBuildable context) Set the Context for this Configurer to the first ancestor that is of type GameModule or Map NOTE: The ContextLevel may already have been preset by the ConfigureFactory when the Configurer was created.voidsetContext(Buildable context) voidsetContext(Configurable context) voidsetContextLevel(Configurer.ContextLevel contextLevel) voidsetFrozen(boolean val) If true, then don't fire PropertyChangeEvents when the value is resetvoidSet the Hint StringvoidsetHintKey(String hintKey) Set the Hint String via a I18n keyvoidsetLabelVisibile(boolean visible) Deprecated, for removal: This API element is subject to removal in a future version.voidvoidSet the Object value
-
Field Details
-
expressionPanel
-
detailPanel
-
validator
protected VASSAL.configure.BeanShellExpressionConfigurer.Validator validator -
extraDetails
-
up
-
down
-
errorMessage
-
variables
-
methods
-
target
-
option
-
selectedText
-
displayOnly
protected boolean displayOnly -
builder
-
nameField
-
-
Constructor Details
-
BeanShellExpressionConfigurer
-
BeanShellExpressionConfigurer
-
BeanShellExpressionConfigurer
public BeanShellExpressionConfigurer(String key, String name, String val, GamePiece piece, BeanShellExpressionConfigurer.Option option) -
BeanShellExpressionConfigurer
public BeanShellExpressionConfigurer(String key, String name, String val, GamePiece piece, BeanShellExpressionConfigurer.Option option, FunctionBuilder builder) -
BeanShellExpressionConfigurer
public BeanShellExpressionConfigurer(String key, String name, String val, GamePiece piece, BeanShellExpressionConfigurer.Option option, boolean displayOnly)
-
-
Method Details
-
strip
protected void strip() -
getOption
-
setOption
-
getValueString
- Overrides:
getValueStringin classStringConfigurer- Returns:
- a String representation of the Object value
-
setValue
Description copied from class:ConfigurerSet the Object value from a String- Overrides:
setValuein classStringConfigurer
-
requestFocus
public void requestFocus()Description copied from class:ConfigurerMove the cursor to the first input field of this Configurer- Overrides:
requestFocusin classStringConfigurer
-
setHighlighted
public void setHighlighted(boolean highlighted) Description copied from class:ConfigurerSet the highlighted status of this configurer. It is up to individual Configurers to override this method and implement a suitable visual highlighting scheme Note: Cannot make this abstract as it will break custom code.- Overrides:
setHighlightedin classStringConfigurer- Parameters:
highlighted- New Highlighted status
-
addFocusListener
Description copied from class:ConfigurerAdd a FocusListener to the Swing Components that make up this Configurer.- Overrides:
addFocusListenerin classStringConfigurer- Parameters:
listener- Focus Listener
-
removeFocusListener
Description copied from class:ConfigurerRemove a FocusListener from the Swing Components that make up this Configurer.- Overrides:
removeFocusListenerin classStringConfigurer- Parameters:
listener- Focus Listener
-
getTopLevelAncestor
-
getControls
Description copied from class:ConfigurerGUI interface for setting the option in an editing window- Overrides:
getControlsin classStringConfigurer
-
validate
public void validate() -
updateParentBuilder
protected void updateParentBuilder()If we are the child of a FunctionBuilder, notify it we have changed. -
doPopup
protected void doPopup() -
insertPropertyName
Insert a property name into the expression- Parameters:
name- property name
-
insertName
-
cleanName
-
setDetails
-
setDetails
protected void setDetails() -
getSelectedText
-
setSelectedText
-
isDisplayOnly
public boolean isDisplayOnly() -
setDisplayOnly
public void setDisplayOnly(boolean displayOnly)
-
Configurer.setLabelVisible(boolean)instead.