Package adams.gui.core
Class PropertiesParameterPanel
- java.lang.Object
-
- java.awt.Component
-
- java.awt.Container
-
- javax.swing.JComponent
-
- javax.swing.JPanel
-
- adams.gui.core.BasePanel
-
- adams.gui.core.PropertiesParameterPanel
-
- All Implemented Interfaces:
ImageObserver
,MenuContainer
,Serializable
,Accessible
public class PropertiesParameterPanel extends BasePanel
Displays all properties in a props file as parameters (alphabetically sorted if no custom order for properties provided).- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
setPropertyOrder(List)
, Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
PropertiesParameterPanel.PropertyHint
Enumeration of hints for properties.static class
PropertiesParameterPanel.PropertyType
The various data types a property can have.-
Nested classes/interfaces inherited from class javax.swing.JPanel
JPanel.AccessibleJPanel
-
Nested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
-
Nested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainer
-
Nested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
-
-
Field Summary
Fields Modifier and Type Field Description static int
DEFAULT_WIDTH_CHOOSERS
the default width for choosers.protected Map<String,PropertiesParameterPanel.PropertyType>
m_ActualPropertyTypes
the actual property/property type relation.protected Map<String,Class>
m_ArrayClass
the property/arrayclass relation.protected Map<String,String>
m_ArraySeparator
the property/arrayseparator relation.protected BaseButton
m_ButtonLoad
the load props button.protected BaseButton
m_ButtonSave
the save props button.protected Map<String,AbstractChooserPanel>
m_Choosers
the property/chooser relation.protected Map<String,Component>
m_Component
the property/component relation.protected Dimension
m_DefaultSQLDimension
the default size for SQL fields.protected Map<String,Class>
m_Enums
the property/enum relation.protected BaseFileChooser
m_FileChooser
the filechooser for loading/saving properties.protected Map<String,String>
m_Help
the property/help relation.protected List<String>
m_Identifiers
the identifiers of the property.protected Map<String,String>
m_Label
the property/label relation.protected Map<String,String>
m_ListDefaults
the property/list default relation.protected Map<String,String[]>
m_Lists
the property/lists relation.protected List<String>
m_Order
the custom order for the properties.protected JPanel
m_PanelButtons
the panel for the buttons.protected ParameterPanel
m_PanelProperties
the panel for the properties.protected Map<String,Set<PropertiesParameterPanel.PropertyHint>>
m_PropertyHints
the property/hints relation.protected Map<String,PropertiesParameterPanel.PropertyType>
m_PropertyTypes
the property/property type relation.protected Map<String,BaseRegExp>
m_RegExp
the property/regexp relation.-
Fields inherited from class javax.swing.JComponent
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
-
Fields inherited from class java.awt.Component
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
-
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
-
-
Constructor Summary
Constructors Constructor Description PropertiesParameterPanel()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addChangeListener(ChangeListener l)
Adds the change listener.void
addProperty(String identifier, String label, AbstractChooserPanel chooser)
Adds the chooser panel at the end.void
addProperty(String identifier, String label, Component comp)
Adds a property.void
addPropertyHint(String property, PropertiesParameterPanel.PropertyHint hint)
Associates the property hint with the specified property.void
addPropertyType(String property, PropertiesParameterPanel.PropertyType type)
Associates the property type with the specified property.protected void
clearProperties()
Removes all properties.void
clearPropertyTypes()
Removes all property/property type relations.protected void
finishInit()
finishes the initialization.protected String
fixPath(String property, String path)
Fixes the path, if necessary.protected PropertiesParameterPanel.PropertyType
fixPropertyType(String key, PropertiesParameterPanel.PropertyType type)
Makes sure that the specified property type can be actually displayed.PropertiesParameterPanel.PropertyType
getActualPropertyType(String property)
Checks whether a property type has been specified for a particular property.Class
getArrayClass(String property)
Returns the custom array class associated with a particular property.String
getArraySeparator(String property)
Returns the custom array separator associated with a particular property.AbstractChooserPanel
getChooser(String property)
Returns the chooser associated with a particular property.Component
getComponent(String property)
Returns the custom component associated with a particular property.Dimension
getDefaultSQLDimension()
Returns the dimension to use for SQL query fields.Class
getEnum(String property)
Returns the enum associated with a particular property.protected BaseFileChooser
getFileChooser()
Returns the file chooser to use for loading/saving of props files.String
getHelp(String property)
Returns the help associated with a particular property.String
getLabel(String property)
Returns the label associated with a particular property.String[]
getList(String property)
Returns the list associated with a particular property.String
getListDefault(String property)
Returns the default list item associated with a particular property.Properties
getProperties()
Returns the currently display properties as a properties object.Component
getProperty(int index)
Returns the component at the specified location.Component
getProperty(String identifier)
Returns the component associated with the identifier.int
getPropertyCount()
Returns the number of properties currently displayed.Set<PropertiesParameterPanel.PropertyHint>
getPropertyHints(String property)
Returns the hints associated with a property.List<String>
getPropertyOrder()
Returns the order for the properties.PropertiesParameterPanel.PropertyType
getPropertyType(String property)
Checks whether a property type has been specified for a particular property.BaseRegExp
getRegExp(String property)
Returns the regexp associated with a particular property.protected String
getText(Component comp)
Returns the text from the component.boolean
hasArrayClass(String property)
Checks whether a custom array class has been specified for a particular property.boolean
hasArraySeparator(String property)
Checks whether a custom array separator has been specified for a particular property.boolean
hasChooser(String property)
Checks whether a chooser has been specified for a particular property.boolean
hasComponent(String property)
Checks whether a custom component has been specified for a particular property.boolean
hasEnum(String property)
Checks whether a enum has been specified for a particular property.boolean
hasHelp(String property)
Checks whether a help has been specified for a particular property.boolean
hasLabel(String property)
Checks whether a label has been specified for a particular property.boolean
hasList(String property)
Checks whether a list has been specified for a particular property.boolean
hasListDefault(String property)
Checks whether a list default has been specified for a particular property.boolean
hasPropertyHints(String property)
Checks whether any property hints have been specified for a particular property.boolean
hasPropertyType(String property)
Checks whether a property type has been specified for a particular property.boolean
hasRegExp(String property)
Checks whether a regexp has been specified for a particular property.protected void
initGUI()
For initializing the GUI.protected void
initialize()
Initializes the members.boolean
isButtonPanelVisible()
Returns the visibility state of the buttons panel (load/save).protected void
loadProperties()
Loads properties from a file, prompts the user to select props file.void
removeChangeListener(ChangeListener l)
Removes the change listener.protected void
saveProperties()
Saves properties to a file, prompts the user to select props file.void
setArrayClass(String property, Class value)
Associates the custom array class with a particular property.\void
setArraySeparator(String property, String value)
Associates the custom array separator with a particular property.void
setButtonPanelVisible(boolean value)
Sets the visibility state of the buttons panel (load/save).void
setChooser(String property, AbstractChooserPanel value)
Associates the chooser with a particular property.void
setComponent(String property, Component value)
Associates the custom component with a particular property.\ Must have setText(String) and getText() methods!void
setDefaultSQLDimension(Dimension value)
Sets the default dimension to use for SQL query fields.void
setEnum(String property, Class value)
Associates the enum with a particular property.void
setHelp(String property, String value)
Associates the help with a particular property.void
setLabel(String property, String value)
Associates the label with a particular property.void
setList(String property, String[] value)
Associates the list with a particular property.void
setListDefault(String property, String value)
Associates the list default item with a particular property.void
setProperties(Properties value)
Sets the properties to base the properties on.void
setPropertyOrder(String[] value)
Sets the order for the properties.void
setPropertyOrder(List<String> value)
Sets the order for the properties.void
setRegExp(String property, BaseRegExp value)
Associates the regexp with a particular property.protected void
setText(Component comp, String text)
Updates the text of the component.protected void
updateToolTipText(Component comp, String help)
Updates the tool tip.-
Methods inherited from class adams.gui.core.BasePanel
afterHide, afterShow, beforeHide, beforeShow, closeParent, getParentChild, getParentDialog, getParentFrame, getParentInternalFrame, getParentTitle, initFileChooser, main, printErrorMessage, printException, saveComponent, setEnabledCascade, setEnabledCascade, setParentTitle, setVisible
-
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
-
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, unregisterKeyboardAction, update
-
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTree
-
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setMixingCutoutShape, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
-
-
-
-
Field Detail
-
DEFAULT_WIDTH_CHOOSERS
public static final int DEFAULT_WIDTH_CHOOSERS
the default width for choosers.- See Also:
- Constant Field Values
-
m_PanelProperties
protected ParameterPanel m_PanelProperties
the panel for the properties.
-
m_PropertyTypes
protected Map<String,PropertiesParameterPanel.PropertyType> m_PropertyTypes
the property/property type relation.
-
m_ActualPropertyTypes
protected Map<String,PropertiesParameterPanel.PropertyType> m_ActualPropertyTypes
the actual property/property type relation.
-
m_Choosers
protected Map<String,AbstractChooserPanel> m_Choosers
the property/chooser relation.
-
m_RegExp
protected Map<String,BaseRegExp> m_RegExp
the property/regexp relation.
-
m_ArraySeparator
protected Map<String,String> m_ArraySeparator
the property/arrayseparator relation.
-
m_PropertyHints
protected Map<String,Set<PropertiesParameterPanel.PropertyHint>> m_PropertyHints
the property/hints relation.
-
m_PanelButtons
protected JPanel m_PanelButtons
the panel for the buttons.
-
m_ButtonLoad
protected BaseButton m_ButtonLoad
the load props button.
-
m_ButtonSave
protected BaseButton m_ButtonSave
the save props button.
-
m_FileChooser
protected BaseFileChooser m_FileChooser
the filechooser for loading/saving properties.
-
m_DefaultSQLDimension
protected Dimension m_DefaultSQLDimension
the default size for SQL fields.
-
-
Method Detail
-
initialize
protected void initialize()
Initializes the members.- Overrides:
initialize
in classBasePanel
-
finishInit
protected void finishInit()
finishes the initialization.- Overrides:
finishInit
in classBasePanel
-
setDefaultSQLDimension
public void setDefaultSQLDimension(Dimension value)
Sets the default dimension to use for SQL query fields.- Parameters:
value
- the preferred size
-
getDefaultSQLDimension
public Dimension getDefaultSQLDimension()
Returns the dimension to use for SQL query fields.- Returns:
- the preferred size
-
clearPropertyTypes
public void clearPropertyTypes()
Removes all property/property type relations.
-
clearProperties
protected void clearProperties()
Removes all properties.
-
addProperty
public void addProperty(String identifier, String label, Component comp)
Adds a property.- Parameters:
identifier
- the unique identifier of the propertylabel
- the label to add, the mnemonic to use is preceded by "_"comp
- the component to add- Throws:
IllegalArgumentException
- if the identifier already exists
-
addProperty
public void addProperty(String identifier, String label, AbstractChooserPanel chooser)
Adds the chooser panel at the end.- Parameters:
identifier
- the unique identifier of the propertylabel
- the label to add, the mnemonic to use is preceded by "_"chooser
- the chooser panel to add- Throws:
IllegalArgumentException
- if the identifier already exists
-
getProperty
public Component getProperty(int index)
Returns the component at the specified location.- Parameters:
index
- the index of the specified location- Returns:
- the component at the position
-
getProperty
public Component getProperty(String identifier)
Returns the component associated with the identifier.- Parameters:
identifier
- the identifier of the property to return- Returns:
- the associated component, null if none found
-
getPropertyCount
public int getPropertyCount()
Returns the number of properties currently displayed.- Returns:
- the number of properties
-
addPropertyType
public void addPropertyType(String property, PropertiesParameterPanel.PropertyType type)
Associates the property type with the specified property.- Parameters:
property
- the property to associate a type withtype
- the property type
-
hasPropertyType
public boolean hasPropertyType(String property)
Checks whether a property type has been specified for a particular property.- Parameters:
property
- the property to associate a type with- Returns:
- true if a type has been specified
-
getPropertyType
public PropertiesParameterPanel.PropertyType getPropertyType(String property)
Checks whether a property type has been specified for a particular property.- Parameters:
property
- the property to associate a type with- Returns:
- true if a type has been specified
-
getActualPropertyType
public PropertiesParameterPanel.PropertyType getActualPropertyType(String property)
Checks whether a property type has been specified for a particular property.- Parameters:
property
- the property to associate a type with- Returns:
- true if a type has been specified
-
setPropertyOrder
public void setPropertyOrder(String[] value)
Sets the order for the properties.- Parameters:
value
- the ordered property names
-
setPropertyOrder
public void setPropertyOrder(List<String> value)
Sets the order for the properties.- Parameters:
value
- the ordered property names
-
getPropertyOrder
public List<String> getPropertyOrder()
Returns the order for the properties.- Returns:
- the ordered property names
-
addPropertyHint
public void addPropertyHint(String property, PropertiesParameterPanel.PropertyHint hint)
Associates the property hint with the specified property.- Parameters:
property
- the property to associate a hint withhint
- the property hint
-
hasPropertyHints
public boolean hasPropertyHints(String property)
Checks whether any property hints have been specified for a particular property.- Parameters:
property
- the property to check- Returns:
- true if at least one hint has been specified
-
getPropertyHints
public Set<PropertiesParameterPanel.PropertyHint> getPropertyHints(String property)
Returns the hints associated with a property.- Parameters:
property
- the property to get the hints for- Returns:
- the hints
-
hasChooser
public boolean hasChooser(String property)
Checks whether a chooser has been specified for a particular property.- Parameters:
property
- the property check- Returns:
- true if a chooser has been specified
-
setChooser
public void setChooser(String property, AbstractChooserPanel value)
Associates the chooser with a particular property.- Parameters:
property
- the property to associate the chooser withvalue
- the chooser to use
-
getChooser
public AbstractChooserPanel getChooser(String property)
Returns the chooser associated with a particular property.- Parameters:
property
- the property to get the chooser for- Returns:
- the chooser, null if none available
-
hasComponent
public boolean hasComponent(String property)
Checks whether a custom component has been specified for a particular property.- Parameters:
property
- the property check- Returns:
- true if a custom component has been specified
-
setComponent
public void setComponent(String property, Component value)
Associates the custom component with a particular property.\ Must have setText(String) and getText() methods!- Parameters:
property
- the property to associate the chooser withvalue
- the custom component to use
-
getComponent
public Component getComponent(String property)
Returns the custom component associated with a particular property.- Parameters:
property
- the property to get the chooser for- Returns:
- the custom component, null if none available
-
hasArrayClass
public boolean hasArrayClass(String property)
Checks whether a custom array class has been specified for a particular property.- Parameters:
property
- the property check- Returns:
- true if a custom array class has been specified
-
setArrayClass
public void setArrayClass(String property, Class value)
Associates the custom array class with a particular property.\- Parameters:
property
- the property to associate the chooser withvalue
- the custom array class to use
-
getArrayClass
public Class getArrayClass(String property)
Returns the custom array class associated with a particular property.- Parameters:
property
- the property to get the chooser for- Returns:
- the custom array class, null if none available
-
hasArraySeparator
public boolean hasArraySeparator(String property)
Checks whether a custom array separator has been specified for a particular property. If no separator specified, comma is used.- Parameters:
property
- the property check- Returns:
- true if a custom array separator has been specified
-
setArraySeparator
public void setArraySeparator(String property, String value)
Associates the custom array separator with a particular property. If no separator specified, comma is used.- Parameters:
property
- the property to associate the chooser withvalue
- the custom array separator to use
-
getArraySeparator
public String getArraySeparator(String property)
Returns the custom array separator associated with a particular property. If no separator specified, comma is used.- Parameters:
property
- the property to get the chooser for- Returns:
- the custom array separator, null if none available
-
hasEnum
public boolean hasEnum(String property)
Checks whether a enum has been specified for a particular property.- Parameters:
property
- the property to check- Returns:
- true if a enum has been specified
-
setEnum
public void setEnum(String property, Class value)
Associates the enum with a particular property.- Parameters:
property
- the property to associate the enum withvalue
- the enum to use
-
getEnum
public Class getEnum(String property)
Returns the enum associated with a particular property.- Parameters:
property
- the property to get the enum for- Returns:
- the enum, null if none available
-
hasList
public boolean hasList(String property)
Checks whether a list has been specified for a particular property.- Parameters:
property
- the property check- Returns:
- true if a list has been specified
-
setList
public void setList(String property, String[] value)
Associates the list with a particular property.- Parameters:
property
- the property to associate the list withvalue
- the list to use
-
getList
public String[] getList(String property)
Returns the list associated with a particular property.- Parameters:
property
- the property to get the list for- Returns:
- the list, null if none available
-
hasListDefault
public boolean hasListDefault(String property)
Checks whether a list default has been specified for a particular property.- Parameters:
property
- the property check- Returns:
- true if a list default has been specified
-
setListDefault
public void setListDefault(String property, String value)
Associates the list default item with a particular property.- Parameters:
property
- the property to associate the list withvalue
- the default to use
-
getListDefault
public String getListDefault(String property)
Returns the default list item associated with a particular property.- Parameters:
property
- the property to get the default for- Returns:
- the default, null if none available
-
hasHelp
public boolean hasHelp(String property)
Checks whether a help has been specified for a particular property.- Parameters:
property
- the property check- Returns:
- true if a help has been specified
-
setHelp
public void setHelp(String property, String value)
Associates the help with a particular property.- Parameters:
property
- the property to associate the help withvalue
- the help to use
-
getHelp
public String getHelp(String property)
Returns the help associated with a particular property.- Parameters:
property
- the property to get the help for- Returns:
- the help, null if none available
-
hasLabel
public boolean hasLabel(String property)
Checks whether a label has been specified for a particular property.- Parameters:
property
- the property check- Returns:
- true if a label has been specified
-
setLabel
public void setLabel(String property, String value)
Associates the label with a particular property.- Parameters:
property
- the property to associate the label withvalue
- the label to use
-
getLabel
public String getLabel(String property)
Returns the label associated with a particular property.- Parameters:
property
- the property to get the label for- Returns:
- the label, null if none available
-
hasRegExp
public boolean hasRegExp(String property)
Checks whether a regexp has been specified for a particular property.- Parameters:
property
- the property check- Returns:
- true if a regexp has been specified
-
setRegExp
public void setRegExp(String property, BaseRegExp value)
Associates the regexp with a particular property.- Parameters:
property
- the property to associate the label withvalue
- the regexp to use
-
getRegExp
public BaseRegExp getRegExp(String property)
Returns the regexp associated with a particular property.- Parameters:
property
- the property to get the label for- Returns:
- the regexp, null if none available
-
fixPropertyType
protected PropertiesParameterPanel.PropertyType fixPropertyType(String key, PropertiesParameterPanel.PropertyType type)
Makes sure that the specified property type can be actually displayed.- Parameters:
key
- the propertytype
- the type- Returns:
- the (potentially) fixed type
-
updateToolTipText
protected void updateToolTipText(Component comp, String help)
Updates the tool tip.- Parameters:
comp
- the component to updatehelp
- the tip text to use, ignored if null
-
setText
protected void setText(Component comp, String text)
Updates the text of the component.- Parameters:
comp
- the component to updatetext
- the text to set
-
getText
protected String getText(Component comp)
Returns the text from the component.- Parameters:
comp
- the component to get the text from- Returns:
- the obtained text
-
setProperties
public void setProperties(Properties value)
Sets the properties to base the properties on.- Parameters:
value
- the properties to use
-
fixPath
protected String fixPath(String property, String path)
Fixes the path, if necessary.- Parameters:
property
- the property this path is frompath
- the path to fix- Returns:
- the fixed path
- See Also:
PropertiesParameterPanel.PropertyHint.FORWARD_SLASHES
,getPropertyHints(String)
-
getProperties
public Properties getProperties()
Returns the currently display properties as a properties object.- Returns:
- the properties
-
getFileChooser
protected BaseFileChooser getFileChooser()
Returns the file chooser to use for loading/saving of props files.- Returns:
- the file chooser
-
loadProperties
protected void loadProperties()
Loads properties from a file, prompts the user to select props file.
-
saveProperties
protected void saveProperties()
Saves properties to a file, prompts the user to select props file.
-
setButtonPanelVisible
public void setButtonPanelVisible(boolean value)
Sets the visibility state of the buttons panel (load/save).- Parameters:
value
- true if to show buttons
-
isButtonPanelVisible
public boolean isButtonPanelVisible()
Returns the visibility state of the buttons panel (load/save).- Returns:
- true if buttons displayed
-
addChangeListener
public void addChangeListener(ChangeListener l)
Adds the change listener.- Parameters:
l
- the change listener
-
removeChangeListener
public void removeChangeListener(ChangeListener l)
Removes the change listener.- Parameters:
l
- the change listener
-
-