public class FormComponentPanel extends FormPanel implements FormComponent
JPanel.AccessibleJPanelJComponent.AccessibleJComponentContainer.AccessibleAWTContainerComponent.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategylistenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOWaccessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH| Constructor and Description |
|---|
FormComponentPanel()
Creates a
FormComponentPanel for a StringFormField. |
FormComponentPanel(FormComponent comp)
Creates a
FormComponentPanel for a given FormComponent. |
| Modifier and Type | Method and Description |
|---|---|
void |
addValueListener(ValueListener l)
Adds a value listener that implements the binding between this component
and the data.
|
void |
clearValueShownModified()
Clears the value shown status.
May be used by components that update the value shown programmatically. |
void |
fireValueChanged()
Fires all value listeners registered on this component
invoking their
valueChanged-handler.This method is invoked whenever the data has been changed and that change should be reflected in the view. |
void |
fireValueEntered()
Fires all listeners registered on this component
invoking their
valueEntered-handler.This method is invoked whenever the user edited the view and that change should be reflected in the data. |
int |
getBaseline(int width,
int height)
Returns the baseline of this component.
|
FormComponentBinding |
getBinding()
Gets the binding.
|
String |
getBindingPath()
Gets the binding path.
|
String |
getComponentPath()
Gets the component path.
|
FocusTraversalGroup |
getFocusTraversalGroup()
Gets the focus traversal group for this component.
|
FormComponent |
getFormComponent()
Gets the embedded form component.
|
Object |
getFormValue()
Retrieves the value from this component.
The method is used to update the data model if the view has changed because the user edited it. |
String |
getHelpURL()
Gets the online-help URL.
|
Window |
getParentWindow()
Gets the parent window.
|
PropertyGroup |
getPropertyGroup()
Gets the property group for this component.
|
Object |
getValueShown()
Gets the value shown to the user.
This is the visual representation, not necessarily the model's value. |
boolean |
hasFocus()
Returns whether this component has the keyboard focus.
|
void |
invalidateParentInfo()
Invalidates all container-relevant (cached) information
for the hierarchy of this container's parents.
For optimization purposes. |
boolean |
isAutoUpdate()
Returns whether the auto-update feature is enabled.
|
boolean |
isBindable()
Determines whether this container is bindable.
|
boolean |
isCellEditorUsage()
Returns whether this component is used as a cell editor.
|
boolean |
isChangeable()
Returns if this component is changeable.
|
boolean |
isFireRunning()
Checks whether a fire-method is running.
|
boolean |
isFormTraversable()
Returns whether this component is form traversable or not.
|
boolean |
isHonourChangeable()
Returns whether this component should honour the changeable-attribute or not.
|
boolean |
isMandatory()
Gets the mandatory option.
|
boolean |
isSmartValueEntered()
Returns whether the model should only be updated
if the component's value really changed.
The default is true. |
boolean |
isTriggerValueChangedEnabled()
Determines whether triggering value changes is enabled.
|
boolean |
isValueChanged()
Checks whether the contents have been changed since the last savepoint.
|
boolean |
isValueShownModified()
Checks whether the currently shown value differs
from the initially shown.
Used to implement smartValueEntered. |
void |
prepareFocusLost()
Prepares for FOCUS_LOST.
Gives this component the opportunity to invoke fireValueEntered() earlier than FOCUS_LOST is really received. |
void |
removeValueListener(ValueListener l)
Remove a value listener.
|
void |
requestFocus() |
boolean |
requestFocus(boolean temporary) |
boolean |
requestFocusInWindow() |
void |
requestFocusLater()
Requests the keyboard focus for this component by appending
an event to the end of the event queue.
Applications should not use requestFocus() or requestFocusInWindow() unless the order in which the events are processed is unimportant. |
void |
saveValue()
Sets a savepoint for the data of this component.
Allows to decide whether the user has changed the data associated with this component or not. |
void |
setAutoUpdate(boolean autoupdate)
Sets the auto-update feature for all components in this container and all sub containers.
|
void |
setBindable(boolean bindable)
Sets whether this container is bindable, i.e.
|
void |
setBinding(FormComponentBinding binding)
Sets the binding.
|
void |
setBindingPath(String bindingPath)
Sets the path to bind this component to.
|
void |
setCellEditorUsage(boolean flag)
Sets a hint that this component is used as a cell editor.
Some components behave differently in tables than in forms, for example. |
void |
setChangeable(boolean flag)
Set the component to be changeable.
This is a unified abstraction and will be translated to setEditable or setEnabled, whatever is appropriate to this component. |
void |
setComponentPath(String componentPath)
Sets the component path.
|
void |
setFireRunning(boolean running)
Sets a component's flag that a fire-method is currently running.
Used by the framework to minimize valueChanged/valueEntered processing. |
void |
setFocusTraversalGroup(FocusTraversalGroup group)
Sets the focus traversal group for this component.
|
void |
setFormComponent(FormComponent comp)
Sets the embedded form field component.
|
void |
setFormTraversable(boolean formTraversable)
Sets whether this component is form traversable or not, i.e.
|
void |
setFormValue(Object obj)
Sets a value in this component.
The method is used to update the view if the data has changed. |
void |
setFormWrapWindow(FormWindow parent)
Sets the window that will fire a
FormWrapEvent when this
components loses the keyboard focus. |
void |
setHelpURL(String helpURL)
Sets the online-help URL.
If a help url is set for this container, a browser will be launched to show that url if there is no help url for the component the help was requested for. |
void |
setHonourChangeable(boolean flag)
Sets whether this component should honour the changeable-attribute or not.
The default is true. |
void |
setMandatory(boolean mandatory)
Sets the mandatory option.
Mandatory fields are differently visualized. |
void |
setPropertyGroup(PropertyGroup group)
Sets the property group for this component.
|
void |
setSmartValueEntered(boolean smartValueEntered)
Sets whether the model should only be updated
if the component's value really changed.
The default is true. |
void |
setTriggerValueChangedEnabled(boolean enabled)
Enables triggering value changes.
Disabling this feature may be necessary for model-agnostic components. |
void |
showErrorPopup(String message)
Shows the error popup for a given message.
The popup component used is an ErrorToolTip. |
void |
showHelp()
Displays online help for this container.
|
void |
triggerValueChanged()
Promotes the fact that value changed to all
FormContainers this
component is a child of. |
void |
updateAllChangeable(boolean flag)
Updates the container's changeable flag.
|
boolean |
wasFocusGainedFromTransfer()
Returns whether the keyboard focus was gained due to
FormComponent.transferFocus()
in the opposite component. |
boolean |
wasFocusGainedFromTransferBackward()
Returns whether the keyboard focus was gained due to
FormComponent.transferFocusBackward()
in the opposite component. |
boolean |
wasTransferFocus()
Returns whether this component lost the keyboard focus due to
FormComponent.transferFocus(). |
boolean |
wasTransferFocusBackward()
Returns whether this component lost the keyboard focus due to
FormComponent.transferFocusBackward(). |
boolean |
wasTransferFocusByEnter()
Returns whether this component lost the keyboard focus due to
KeyEvent.VK_ENTER. |
addActionListener, areValuesChanged, componentAdded, componentRemoved, createBinder, fireActionPerformed, getBinder, getFormValues, getTitle, isTriggerValuesChangedEnabled, removeActionListener, saveValues, setFormValues, setFormValuesKeepChanged, setTitle, setTriggerValuesChangedEnabled, triggerValuesChangedgetAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUIaddAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, 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, 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, setVisible, unregisterKeyboardAction, updateadd, 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, validateTreeaction, 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, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, 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, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycleclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waittransferFocus, transferFocusBackwardpublic FormComponentPanel(FormComponent comp)
FormComponentPanel for a given FormComponent.comp - the componentpublic FormComponentPanel()
FormComponentPanel for a StringFormField.public FormComponent getFormComponent()
public void setFormComponent(FormComponent comp)
comp - the component.public void requestFocus()
requestFocus in class JComponentpublic boolean requestFocus(boolean temporary)
requestFocus in class JComponentpublic boolean requestFocusInWindow()
requestFocusInWindow in class JComponentpublic void setFireRunning(boolean running)
FormComponentsetFireRunning in interface FormComponentrunning - true if some fire-method is runningpublic boolean isFireRunning()
FormComponentisFireRunning in interface FormComponentpublic void addValueListener(ValueListener l)
FormComponentaddValueListener in interface FormComponentl - the value listener to addpublic void removeValueListener(ValueListener l)
FormComponentremoveValueListener in interface FormComponentl - the value listener to removepublic void fireValueChanged()
FormComponentvalueChanged-handler.fireValueChanged in interface FormComponentpublic void fireValueEntered()
FormComponentvalueEntered-handler.fireValueEntered in interface FormComponentpublic void setFormValue(Object obj)
FormComponentsetFormValue in interface FormComponentobj - is the object to setpublic Object getFormValue()
FormComponentgetFormValue in interface FormComponentpublic void setChangeable(boolean flag)
FormChangeablesetChangeable in interface FormChangeablesetChangeable in class FormPanelflag - true the user can edit the data, false if show onlypublic boolean isChangeable()
FormChangeableisChangeable in interface FormChangeableisChangeable in class FormPanelpublic void setAutoUpdate(boolean autoupdate)
FormContainersetAutoUpdate in interface FormComponentsetAutoUpdate in interface FormContainersetAutoUpdate in class FormPanelautoupdate - true if auto update the data (default), false if notFormComponent.setAutoUpdate(boolean)public boolean isAutoUpdate()
FormContainerisAutoUpdate in interface FormComponentisAutoUpdate in interface FormContainerisAutoUpdate in class FormPanelFormComponent.isAutoUpdate()public void setHonourChangeable(boolean flag)
FormChangeablesetHonourChangeable in interface FormChangeablesetHonourChangeable in class FormPanelflag - true if honour the changeable attribute, false if notpublic boolean isHonourChangeable()
FormChangeableisHonourChangeable in interface FormChangeableisHonourChangeable in class FormPanelpublic void updateAllChangeable(boolean flag)
FormChangeableComponent
Whenever FormChangeable.setChangeable(boolean) is invoked
all of the container's components get this method invoked.
updateAllChangeable in interface FormChangeableComponentflag - true if changeablepublic void requestFocusLater()
FormComponentrequestFocusLater in interface FormComponentpublic void setFormWrapWindow(FormWindow parent)
FormComponentFormWrapEvent when this
components loses the keyboard focus. When fired the reference
to the window is cleared.setFormWrapWindow in interface FormComponentparent - the window (usually the parent window of this component).public boolean isValueChanged()
FormComponentisValueChanged in interface FormComponentFormComponent.saveValue()public void saveValue()
FormComponentsaveValue in interface FormComponentFormComponent.isValueChanged()public void triggerValueChanged()
FormComponentFormContainers this
component is a child of.triggerValueChanged in interface FormComponentpublic void setTriggerValueChangedEnabled(boolean enabled)
FormComponentsetTriggerValueChangedEnabled in interface FormComponentenabled - true if invoke FormComponent.triggerValueChanged() on each change (default), false if not.public boolean isTriggerValueChangedEnabled()
FormComponentisTriggerValueChangedEnabled in interface FormComponentFormComponent.triggerValueChanged() on each change (default), false if not.public String getHelpURL()
FormContainergetHelpURL in interface FormComponentgetHelpURL in interface FormContainergetHelpURL in class FormPanelpublic void setHelpURL(String helpURL)
FormContainersetHelpURL in interface FormComponentsetHelpURL in interface FormContainersetHelpURL in class FormPanelhelpURL - the help urlFormUtilities.openHelpURL(Component)public void showHelp()
FormContainershowHelp in interface FormComponentshowHelp in interface FormContainershowHelp in class FormPanelpublic void showErrorPopup(String message)
FormComponentErrorToolTip.showErrorPopup in interface FormComponentmessage - the message to be displayed, null to removepublic boolean hasFocus()
FormComponenthasFocus in interface FormComponenthasFocus in class Componentpublic boolean wasTransferFocus()
FormComponentFormComponent.transferFocus().wasTransferFocus in interface FormComponentpublic boolean wasTransferFocusBackward()
FormComponentFormComponent.transferFocusBackward().wasTransferFocusBackward in interface FormComponentpublic boolean wasFocusGainedFromTransfer()
FormComponentFormComponent.transferFocus()
in the opposite component.wasFocusGainedFromTransfer in interface FormComponentFormFocusTraversalPolicypublic boolean wasFocusGainedFromTransferBackward()
FormComponentFormComponent.transferFocusBackward()
in the opposite component.wasFocusGainedFromTransferBackward in interface FormComponentFormFocusTraversalPolicypublic boolean wasTransferFocusByEnter()
FormComponentKeyEvent.VK_ENTER.wasTransferFocusByEnter in interface FormComponentpublic Window getParentWindow()
FormContainergetParentWindow in interface FormComponentgetParentWindow in interface FormContainergetParentWindow in class FormPanelpublic void invalidateParentInfo()
FormContainerinvalidateParentInfo in interface FormComponentinvalidateParentInfo in interface FormContainerinvalidateParentInfo in class FormPanelpublic void setCellEditorUsage(boolean flag)
FormComponentsetCellEditorUsage in interface FormComponentflag - true if component is a cell editor, false if not.public boolean isCellEditorUsage()
FormComponentisCellEditorUsage in interface FormComponentpublic void prepareFocusLost()
FormComponentprepareFocusLost in interface FormComponentpublic void setFormTraversable(boolean formTraversable)
FormComponentsetFormTraversable in interface FormComponentformTraversable - true if traversable, false if notpublic boolean isFormTraversable()
FormComponentisFormTraversable in interface FormComponentpublic void setFocusTraversalGroup(FocusTraversalGroup group)
FormComponentsetFocusTraversalGroup in interface FormComponentgroup - the focus traversal grouppublic FocusTraversalGroup getFocusTraversalGroup()
FormComponentgetFocusTraversalGroup in interface FormComponentpublic void setPropertyGroup(PropertyGroup group)
FormPanelsetPropertyGroup in interface FormComponentsetPropertyGroup in class FormPanelgroup - the property grouppublic PropertyGroup getPropertyGroup()
FormPanelgetPropertyGroup in interface FormComponentgetPropertyGroup in class FormPanelpublic void setMandatory(boolean mandatory)
FormComponentsetMandatory in interface FormComponentmandatory - true if mandatorypublic boolean isMandatory()
FormComponentisMandatory in interface FormComponentpublic void setComponentPath(String componentPath)
FormComponentThe path is <declaring-class-name>.<field-name>. Example "de.krake.invoicer.InvoicePanel.customerNumberField".
Notice: the component path is set during binding.
setComponentPath in interface FormComponentcomponentPath - the component pathpublic String getComponentPath()
FormComponentgetComponentPath in interface FormComponentpublic void setBindingPath(String bindingPath)
FormComponentUsually the binding path will be determined from the components declared name. However, it can be set programatically as well.
setBindingPath in interface FormComponentbindingPath - the binding path, for ex. "invoiceNumber", null if autobindingBinderpublic String getBindingPath()
FormComponentgetBindingPath in interface FormComponentpublic void setBinding(FormComponentBinding binding)
FormComponentsetBinding in interface FormComponentbinding - the binding, null if none.public FormComponentBinding getBinding()
FormComponentgetBinding in interface FormComponentpublic void setBindable(boolean bindable)
FormContainerFormContainers are bindable by default.
setBindable in interface FormComponentsetBindable in interface FormContainersetBindable in class FormPanelbindable - true if bindable, else not eligible for the binding processpublic boolean isBindable()
FormContainerisBindable in interface FormComponentisBindable in interface FormContainerisBindable in class FormPanelpublic void setSmartValueEntered(boolean smartValueEntered)
FormComponentsetSmartValueEntered in interface FormComponentsmartValueEntered - true if optimize, false if always update the modelpublic boolean isSmartValueEntered()
FormComponentisSmartValueEntered in interface FormComponentpublic Object getValueShown()
FormComponentgetValueShown in interface FormComponentpublic boolean isValueShownModified()
FormComponentisValueShownModified in interface FormComponentpublic void clearValueShownModified()
FormComponentclearValueShownModified in interface FormComponentpublic int getBaseline(int width,
int height)
FormComponentgetBaseline in interface FormComponentgetBaseline in class JComponentwidth - the width to get the baseline forheight - the height to get the baseline forTentackle - a domain driven enterprise framework