|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.awt.Component java.awt.Container javax.swing.JComponent javax.swing.JComboBox com.jbbres.lib.actions.tools.swing.AbstractVariableComboBox<C>
C
- - the type that the variables can contain.public abstract class AbstractVariableComboBox<C>
An abstract JComboBox
to display Variable
instances
within an Action
UI
All sub-classes of AbstractVariableComboBox
can display the
Variable
instances available in the workflow. The class
parameter C
allows to restrict the variables to a specific type
of data. For example, if an instance of AbstractVariableComboBox
is declared as
class JFileComboBox extends AbstractVariableComboBox<File>the
JFileComboBox
will only display variables that can store or
return a File
object.
If variables are added or removed from the workflow, the box is automatically updated.
The combo box can also contain objects (instance of C
) that will
remain "static" (in opposition to the variables, whose value can change). A
combo box displaying File
variable, can also list a serie of
File
object that are not variable. Use the
addStaticItem(Object)
to add a static object to the combo box.
Static items appears at the beginning of the list.
The combo box can also contain instances of VComboBoxPersonalizedItem
. When a VComboBoxPersonalizedItem
item, the action (on a
javax.swing.Action
sense) associated to it is triggered.
VComboBoxPersonalizedItem
items appear at the end of the list.
v1.1.0:
WorkflowDefinitionListener
VComboBoxPersonalizedItem
,
Serialized FormNested Class Summary |
---|
Nested classes/interfaces inherited from class javax.swing.JComboBox |
---|
javax.swing.JComboBox.KeySelectionManager |
Nested classes/interfaces inherited from class javax.swing.JComponent |
---|
javax.swing.JComponent.AccessibleJComponent |
Nested classes/interfaces inherited from class java.awt.Component |
---|
java.awt.Component.BaselineResizeBehavior |
Field Summary | |
---|---|
static java.lang.String |
PROPERTY_PERSONALIZED_ITEM_PROPERTIES
The property key for the personalized item properties. |
static java.lang.String |
PROPERTY_SELECTED_INDEX
The property key for the selected index. |
Fields inherited from class javax.swing.JComponent |
---|
TOOL_TIP_TEXT_KEY, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
Fields inherited from class java.awt.Component |
---|
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 | |
---|---|
AbstractVariableComboBox(Workflow workflow)
Creates a new box. |
Method Summary | |
---|---|
void |
actionMoved(WorkflowDefinitionEvent e)
Invoked when an action is moved from its current position to a new position. |
void |
actionPerformed(java.awt.event.ActionEvent e)
|
void |
addItem(java.lang.Object item)
Adds an item to the item list. |
void |
addPersonalizedItem(VComboBoxPersonalizedItem<C> item)
Adds an ComboVariablePersonalizedItem from the box. |
void |
addStaticItem(C item)
Adds a static item in the box. |
void |
elementAdded(WorkflowDefinitionEvent e)
Invoked when a new element is added to the workflow. |
void |
elementRemoved(WorkflowDefinitionEvent e)
Invoked when an element is removed from the workflow. |
VComboBoxPersonalizedItem<?>[] |
getAllPersonalizedItems()
Returns all the personalized items available in the list. |
java.lang.Object[] |
getAllStaticItems()
Returns all the static items available in the list. |
Variable[] |
getAllVariables()
Returns all the variables available in the list. |
java.util.Properties |
getProperties()
|
C |
getSelectedValue()
Returns the value of the current selected item. |
void |
notificationReceived(WorkflowDefinitionEvent e)
Invoked when a notification is received. |
void |
removeItem(java.lang.Object item)
Removes an item from the item list. |
void |
removePersonalizedItem(VComboBoxPersonalizedItem<C> item)
Removes an ComboVariablePersonalizedItem from the box list. |
void |
removeStaticItem(C item)
Removes a static item from the box list. |
void |
setProperties(java.util.Properties properties)
|
void |
setWorkflow(Workflow workflow)
Sets the workflow whom variables are displayed in this box. |
java.lang.Class<C> |
variableClass()
In order to match and cast the input and output object from one element to the other, Actions need to know from what class is the input object, but Java does not provide functionality to do so where you are dealing with parametrised class ( <C> ). |
void |
variableInstanceNameChanged(VariableServiceEvent e)
Invoked when the variable instance name is changed. |
void |
variableValueChanged(VariableServiceEvent e)
Invoked when the variable value is changed. |
Methods inherited from class javax.swing.JComboBox |
---|
addActionListener, addItemListener, addPopupMenuListener, configureEditor, contentsChanged, firePopupMenuCanceled, firePopupMenuWillBecomeInvisible, firePopupMenuWillBecomeVisible, getAccessibleContext, getAction, getActionCommand, getActionListeners, getEditor, getItemAt, getItemCount, getItemListeners, getKeySelectionManager, getMaximumRowCount, getModel, getPopupMenuListeners, getPrototypeDisplayValue, getRenderer, getSelectedIndex, getSelectedItem, getSelectedObjects, getUI, getUIClassID, hidePopup, insertItemAt, intervalAdded, intervalRemoved, isEditable, isLightWeightPopupEnabled, isPopupVisible, processKeyEvent, removeActionListener, removeAllItems, removeItemAt, removeItemListener, removePopupMenuListener, selectWithKeyChar, setAction, setActionCommand, setEditable, setEditor, setEnabled, setKeySelectionManager, setLightWeightPopupEnabled, setMaximumRowCount, setModel, setPopupVisible, setPrototypeDisplayValue, setRenderer, setSelectedIndex, setSelectedItem, setUI, showPopup, updateUI |
Methods inherited from class javax.swing.JComponent |
---|
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, 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, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintImmediately, paintImmediately, print, printAll, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update |
Methods inherited from class java.awt.Container |
---|
add, add, add, add, add, addContainerListener, 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, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusBackward, transferFocusDownCycle, validate |
Methods inherited from class java.awt.Component |
---|
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, contains, createImage, createImage, createVolatileImage, createVolatileImage, dispatchEvent, enable, enableInputMethods, 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, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, 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, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String PROPERTY_SELECTED_INDEX
public static final java.lang.String PROPERTY_PERSONALIZED_ITEM_PROPERTIES
Constructor Detail |
---|
public AbstractVariableComboBox(Workflow workflow)
workflow
- - workflow associated to the box. Can be null
,
however the variables will not be available before the
workflow is set by the setWorkflow
function.Method Detail |
---|
public void addItem(java.lang.Object item)
Variable
, this method has no effect.
addItem
in class javax.swing.JComboBox
item
- the itempublic void removeItem(java.lang.Object item)
removeItem
in class javax.swing.JComboBox
item
- the itempublic void addPersonalizedItem(VComboBoxPersonalizedItem<C> item)
ComboVariablePersonalizedItem
from the box. The
ComboVariablePersonalizedItem are displayed at the end of the selection
list. If the user click on it, the itemSelected
method of
the action is called.
item
- - item to be added.removePersonalizedItem(VComboBoxPersonalizedItem)
public void removePersonalizedItem(VComboBoxPersonalizedItem<C> item)
ComboVariablePersonalizedItem
from the box list.
item
- - item to be removedaddPersonalizedItem(VComboBoxPersonalizedItem)
public void addStaticItem(C item)
item
- - item to be added.removeStaticItem(Object)
public void removeStaticItem(C item)
item
- - item to be removedaddStaticItem(Object)
public C getSelectedValue()
null
.getSelectedItem
.
public Variable[] getAllVariables()
public VComboBoxPersonalizedItem<?>[] getAllPersonalizedItems()
public java.lang.Object[] getAllStaticItems()
public void setWorkflow(Workflow workflow)
workflow
- - worflowpublic final java.lang.Class<C> variableClass()
<C>
).JAbstractComboVariable
are
required to provide a the class of the object that the watched variables
might store via this function.Variable<String>
,
the code of this function should be:return String.class;
public java.util.Properties getProperties()
getProperties
in interface com.jbbres.lib.PropertiesOwner
public void setProperties(java.util.Properties properties)
setProperties
in interface com.jbbres.lib.PropertiesOwner
public void actionMoved(WorkflowDefinitionEvent e)
WorkflowDefinitionListener
actionMoved
in interface WorkflowDefinitionListener
e
- the eventpublic void elementAdded(WorkflowDefinitionEvent e)
WorkflowDefinitionListener
elementAdded
in interface WorkflowDefinitionListener
e
- the eventpublic void elementRemoved(WorkflowDefinitionEvent e)
WorkflowDefinitionListener
elementRemoved
in interface WorkflowDefinitionListener
e
- the eventpublic void notificationReceived(WorkflowDefinitionEvent e)
WorkflowDefinitionListener
Notification are messages that can be send to the workflow during the workflow definition process. They contain useful information for the user in order to improve or correct his/her workflow.
notificationReceived
in interface WorkflowDefinitionListener
e
- the eventpublic void variableValueChanged(VariableServiceEvent e)
VariableServiceListener
variableValueChanged
in interface VariableServiceListener
e
- - the eventpublic void variableInstanceNameChanged(VariableServiceEvent e)
VariableServiceListener
variableInstanceNameChanged
in interface VariableServiceListener
e
- - the eventpublic void actionPerformed(java.awt.event.ActionEvent e)
actionPerformed
in interface java.awt.event.ActionListener
actionPerformed
in class javax.swing.JComboBox
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |