org.tentackle.ui
Class FormPanel

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JPanel
                  extended by org.tentackle.ui.FormPanel
All Implemented Interfaces:
ContainerListener, ImageObserver, MenuContainer, Serializable, EventListener, Accessible, FormContainer
Direct Known Subclasses:
AppDbObjectNaviPanel, AppDbObjectPanel, AppDbObjectTablePanel, FormCalendar, FormComponentPanel, HistoryTablePanel, QbfPanel, TooltipAndErrorPanel

public class FormPanel
extends JPanel
implements FormContainer, ContainerListener

Extended JPanel implementing FormContainer.

Author:
harald
See Also:
Serialized Form

Nested Class Summary
 
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 inherited from class javax.swing.JComponent
accessibleContext, 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
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
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.
 
Method Summary
 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 savepoint.
 void componentAdded(ContainerEvent e)
          Invoked when a component has been added to the container.
 void componentRemoved(ContainerEvent e)
          Invoked when a component has been removed from the container.
 void fireActionPerformed(ActionEvent e)
          Invokes all actionListeners for this panel.
 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.
 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 isAllChangeable()
          Returns whether this container has the all-changeable attribute set.
 boolean isHonourAllChangeable()
          Returns whether the container should honour the allChangeable attribute.
 void removeActionListener(ActionListener listener)
          Removes an ActionListener
 void saveValues()
          Sets a savepoint for all components in this container and all sub containers.
 void setAllChangeable(boolean flag)
          Sets the changeable attribute of all components of this container and all sub containers.
 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 setHonourAllChangeable(boolean flag)
          Sets whether the container should honour the allChangeable attribute.
 void setTitle(String title)
          set the (optional) title.
If the container is a window, the title is the window-title.
 void showHelp()
          Displays online help for this container.
 void triggerValuesChanged()
          Signals that values in the components of the container may have changed.
 
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, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, 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, 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, transferFocusBackward, 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, 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, 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, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FormPanel

public FormPanel(LayoutManager layout,
                 boolean doubleBuffered)
Creates a new FormPanel with the specified layout manager and buffering strategy.

Parameters:
layout - the LayoutManager to use
doubleBuffered - true for double-buffering, which uses additional memory space to achieve fast, flicker-free updates (default)

FormPanel

public FormPanel(boolean doubleBuffered)
Creates a new FormPanel with the default FlowLayout manager and buffering strategy.

Parameters:
doubleBuffered - true for double-buffering, which uses additional memory space to achieve fast, flicker-free updates (default)

FormPanel

public FormPanel(LayoutManager layout)
Creates a new FormPanel with the specified layout manager and double buffering.

Parameters:
layout - the LayoutManager to use

FormPanel

public FormPanel()
Creates a new FormPanel with the default FlowLayout manager and double buffering.

Method Detail

addActionListener

public void addActionListener(ActionListener listener)
Adds an ActionListener.
The listener can be invoked by the application on demand. Currently there is no events that will trigger fireActionPerformed() automatically. This depends on the application.

Parameters:
listener - the field listener to add

removeActionListener

public void removeActionListener(ActionListener listener)
Removes an ActionListener

Parameters:
listener - the field listener to remove

fireActionPerformed

public void fireActionPerformed(ActionEvent e)
Invokes all actionListeners for this panel.

Parameters:
e - the action event

componentAdded

public void componentAdded(ContainerEvent e)
Description copied from interface: java.awt.event.ContainerListener
Invoked when a component has been added to the container.

Specified by:
componentAdded in interface ContainerListener

componentRemoved

public void componentRemoved(ContainerEvent e)
Description copied from interface: java.awt.event.ContainerListener
Invoked when a component has been removed from the container.

Specified by:
componentRemoved in interface ContainerListener

getParentWindow

public Window getParentWindow()
Description copied from interface: FormContainer
Gets the parent window.

Specified by:
getParentWindow in interface FormContainer
Returns:
the parent window, null if none

invalidateParentInfo

public void invalidateParentInfo()
Description copied from interface: FormContainer
Invalidates all container-relevant (cached) information for the hierarchy of this container's parents.
For optimization purposes.

Specified by:
invalidateParentInfo in interface FormContainer

setFormValues

public void setFormValues()
Description copied from interface: FormContainer
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.

Specified by:
setFormValues in interface FormContainer

setFormValuesKeepChanged

public void setFormValuesKeepChanged()
Description copied from interface: FormContainer
Sets the values in all unchanged form components in this container and all sub containers.
All changed components are left untouched.

Specified by:
setFormValuesKeepChanged in interface FormContainer
See Also:
FormComponent.isValueChanged()

getFormValues

public void getFormValues()
Description copied from interface: FormContainer
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.

Specified by:
getFormValues in interface FormContainer

saveValues

public void saveValues()
Description copied from interface: FormContainer
Sets a savepoint for all components in this container and all sub containers.

Specified by:
saveValues in interface FormContainer
See Also:
FormComponent.saveValue()

areValuesChanged

public boolean areValuesChanged()
Description copied from interface: FormContainer
Checks whether the contents of some components in this or sub containers have changed since the last savepoint.

Specified by:
areValuesChanged in interface FormContainer
Returns:
true if changed

triggerValuesChanged

public void triggerValuesChanged()
Description copied from interface: FormContainer
Signals that values in the components of the container may have changed. The container typically uses that to invoke areValuesChanged() and enabling/disabling a button (e.g. "save", see AppDbObjectDialog).

Specified by:
triggerValuesChanged in interface FormContainer

setAllChangeable

public void setAllChangeable(boolean flag)
Description copied from interface: FormContainer
Sets the changeable attribute of all components of this container and all sub containers.

Specified by:
setAllChangeable in interface FormContainer
Parameters:
flag - true if all changeable (default)

isAllChangeable

public boolean isAllChangeable()
Description copied from interface: FormContainer
Returns whether this container has the all-changeable attribute set.

Specified by:
isAllChangeable in interface FormContainer
Returns:
true if all changeable (default)

setHonourAllChangeable

public void setHonourAllChangeable(boolean flag)
Description copied from interface: FormContainer
Sets whether the container should honour the allChangeable attribute.

Specified by:
setHonourAllChangeable in interface FormContainer
Parameters:
flag - true to honour allchangeable (default)

isHonourAllChangeable

public boolean isHonourAllChangeable()
Description copied from interface: FormContainer
Returns whether the container should honour the allChangeable attribute.

Specified by:
isHonourAllChangeable in interface FormContainer
Returns:
true if honour allchangeable (default)

getTitle

public String getTitle()
Description copied from interface: FormContainer
Gets the container's title.

Specified by:
getTitle in interface FormContainer
Returns:
the container's title, null if none

setTitle

public void setTitle(String title)
Description copied from interface: FormContainer
set the (optional) title.
If the container is a window, the title is the window-title. If the container is a panel, the title is "internal", i.e. may be used by the application to trigger setting the window title, for example.

Specified by:
setTitle in interface FormContainer
Parameters:
title - the container's title, null if none

setHelpURL

public void setHelpURL(String helpURL)
Description copied from interface: FormContainer
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.

Specified by:
setHelpURL in interface FormContainer
Parameters:
helpURL - the help url
See Also:
FormHelper.openHelpURL(Component)

getHelpURL

public String getHelpURL()
Description copied from interface: FormContainer
Gets the online-help URL.

Specified by:
getHelpURL in interface FormContainer
Returns:
the help url, default is null

showHelp

public void showHelp()
Description copied from interface: FormContainer
Displays online help for this container.

Specified by:
showHelp in interface FormContainer


Copyright © 2001-2008 Harald Krake, Bergstr. 48, 78098 Triberg, Germany, harald@krake.de