public class FormPanel extends JPanel implements FormContainer, ContainerListener
JPanel implementing FormContainer.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 |
|---|
FormPanel()
Creates a new FormPanel with the default FlowLayout manager and
double buffering.
|
FormPanel(boolean doubleBuffered)
Creates a new FormPanel with the default FlowLayout manager
and buffering strategy.
|
FormPanel(LayoutManager layout)
Creates a new FormPanel with the specified layout manager and
double buffering.
|
FormPanel(LayoutManager layout,
boolean doubleBuffered)
Creates a new FormPanel with the specified layout manager and buffering
strategy.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addActionListener(ActionListener listener)
Adds an ActionListener.
The listener can be invoked by the application on demand. |
boolean |
areValuesChanged()
Checks whether the contents of some components in this or sub containers
have changed since the last
FormContainer.saveValues(). |
void |
componentAdded(ContainerEvent e) |
void |
componentRemoved(ContainerEvent e) |
protected FormComponentBinder |
createBinder()
Creates a binder for this form.
The default implementation invokes FormBindingFactory.createFormComponentBinder(this). |
void |
fireActionPerformed(ActionEvent e)
Invokes all actionListeners for this panel.
|
FormComponentBinder |
getBinder()
Gets the binder of this container.
|
void |
getFormValues()
Retrieves the values from all components in this container and
all sub containers.
Used to update the data from the view according to the data binding. |
String |
getHelpURL()
Gets the online-help URL.
|
Window |
getParentWindow()
Gets the parent window.
|
PropertyGroup |
getPropertyGroup()
Gets the property group for this component.
|
String |
getTitle()
Gets the container's title.
|
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 |
isChangeable()
Returns if this component is changeable.
|
boolean |
isHonourChangeable()
Returns whether this component should honour the changeable-attribute or not.
|
boolean |
isTriggerValuesChangedEnabled()
Determines whether triggering value changes is enabled.
|
void |
removeActionListener(ActionListener listener)
Removes an ActionListener
|
void |
saveValues()
Sets a savepoint for all components in this container and
all sub containers.
|
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 |
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 |
setFormValues()
Sets the values in all form components in this container and all
sub containers.
Used to update the view from the data according to the data binding. |
void |
setFormValuesKeepChanged()
Sets the values in all unchanged form components in this container and
all sub containers.
All changed components are left untouched. |
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 |
setPropertyGroup(PropertyGroup group)
Sets the property group for this component.
|
void |
setTitle(String title)
set the (optional) title.
If the container is a window, the title is the window-title. |
void |
setTriggerValuesChangedEnabled(boolean enabled)
Enables triggering value changes.
Disabling this feature may be necessary for model-agnostic containers. |
void |
showHelp()
Displays online help for this container.
|
void |
triggerValuesChanged()
Signals that values in the components of the container may have changed.
|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUIaddAncestorListener, 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, 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, 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, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCyclepublic FormPanel(LayoutManager layout, boolean doubleBuffered)
layout - the LayoutManager to usedoubleBuffered - true for double-buffering, which
uses additional memory space to achieve fast, flicker-free
updates (default)public FormPanel(boolean doubleBuffered)
doubleBuffered - true for double-buffering, which
uses additional memory space to achieve fast, flicker-free
updates (default)public FormPanel(LayoutManager layout)
layout - the LayoutManager to usepublic FormPanel()
public void setPropertyGroup(PropertyGroup group)
group - the property grouppublic PropertyGroup getPropertyGroup()
public void addActionListener(ActionListener listener)
listener - the field listener to addpublic void removeActionListener(ActionListener listener)
listener - the field listener to removepublic void fireActionPerformed(ActionEvent e)
e - the action eventpublic void componentAdded(ContainerEvent e)
componentAdded in interface ContainerListenerpublic void componentRemoved(ContainerEvent e)
componentRemoved in interface ContainerListenerpublic Window getParentWindow()
FormContainergetParentWindow in interface FormContainerpublic void invalidateParentInfo()
FormContainerinvalidateParentInfo in interface FormContainerpublic void setAutoUpdate(boolean autoupdate)
FormContainersetAutoUpdate in interface FormContainerautoupdate - true if auto update the data (default), false if notFormComponent.setAutoUpdate(boolean)public boolean isAutoUpdate()
FormContainerisAutoUpdate in interface FormContainerFormComponent.isAutoUpdate()public void setFormValues()
FormContainersetFormValues in interface FormContainerpublic void setFormValuesKeepChanged()
FormContainersetFormValuesKeepChanged in interface FormContainerFormComponent.isValueChanged()public void getFormValues()
FormContainergetFormValues in interface FormContainerpublic void saveValues()
FormContainersaveValues in interface FormContainerFormComponent.saveValue()public void setTriggerValuesChangedEnabled(boolean enabled)
FormContainersetTriggerValuesChangedEnabled in interface FormContainerenabled - true if invoke FormContainer.triggerValuesChanged() on each change (default), false if not.public boolean isTriggerValuesChangedEnabled()
FormContainerisTriggerValuesChangedEnabled in interface FormContainerFormContainer.triggerValuesChanged() on each change (default), false if not.public boolean areValuesChanged()
FormContainerFormContainer.saveValues().
Notice that only components with (FormComponent.isTriggerValueChangedEnabled() == true)
will be checked.
areValuesChanged in interface FormContainerpublic void triggerValuesChanged()
FormContainertriggerValuesChanged in interface FormContainerpublic void setChangeable(boolean flag)
FormChangeablesetChangeable in interface FormChangeableflag - true the user can edit the data, false if show onlypublic boolean isChangeable()
FormChangeableisChangeable in interface FormChangeablepublic void setHonourChangeable(boolean flag)
FormChangeablesetHonourChangeable in interface FormChangeableflag - true if honour the changeable attribute, false if notpublic boolean isHonourChangeable()
FormChangeableisHonourChangeable in interface FormChangeablepublic String getTitle()
FormContainergetTitle in interface FormContainerpublic void setTitle(String title)
FormContainersetTitle in interface FormContainertitle - the container's title, null if nonepublic void setHelpURL(String helpURL)
FormContainersetHelpURL in interface FormContainerhelpURL - the help urlFormUtilities.openHelpURL(Component)public String getHelpURL()
FormContainergetHelpURL in interface FormContainerpublic void showHelp()
FormContainershowHelp in interface FormContainerprotected FormComponentBinder createBinder()
FormBindingFactory.createFormComponentBinder(this).public FormComponentBinder getBinder()
FormContainergetBinder in interface FormContainerpublic void setBindable(boolean bindable)
FormContainerFormContainers are bindable by default.
setBindable in interface FormContainerbindable - true if bindable, else not eligible for the binding processpublic boolean isBindable()
FormContainerisBindable in interface FormContainerTentackle - distributed, domain- and model-driven