|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
org.openswing.swing.form.client.Form
Title: OpenSwing Framework
Description: Panel used to contains input controls. It can set input control values and retrieve from them the values to set the model (the value object). It can also remotely read data and set the v.o. (and the input controls).
Copyright: Copyright (C) 2006 Mauro Carniel
This file is part of OpenSwing Framework. This library is free software; you can redistribute it and/or modify it under the terms of the (LGPL) Lesser General Public License as published by the Free Software Foundation; GNU LESSER GENERAL PUBLIC LICENSE Version 2.1, February 1999 This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. The author may be contacted at: maurocarniel@tin.it
Nested Class Summary |
Nested classes inherited from class javax.swing.JComponent |
javax.swing.JComponent.AccessibleJComponent |
Field Summary |
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 | |
Form()
|
Method Summary | |
void |
actionPerformed(java.awt.event.ActionEvent e)
Callback method invoked by the navigator bar of the grid when the user has pressed a button on it. |
void |
addButtonsNotEnabled(java.util.HashSet buttons,
GenericButtonController buttonController)
Define GenericButton objects linked to this that will be disabled (independently from the form mode) when the specified attribute will be set to the specified value. |
void |
addGenericButton(GenericButton b)
Add a generic button, that inherits abilitation state of the other form buttons. |
void |
addInputControlAttributesNotEditableOnState(java.util.HashSet attributeNames,
java.lang.String stateAttributeName,
java.lang.Object state)
Define input controls attribute names that will be disabled (independently from enabledOnInsert/Edit settings) when the specified attribute will be set to the specified value. |
void |
addLinkButton(LinkButton b)
Add a link button, that inherits abilitation state of the other form buttons. |
void |
addLinkedPanel(java.awt.Container c)
Add a linked panel, that will receive the same events of this form (in pull/store operations). |
void |
addNotify()
Method overridden to initialize input controls. |
void |
bind(InputControl comp)
Create a binding between the specified input control and this data model |
void |
cleanUp()
Clean up fields content. |
void |
cleanUp(boolean cleanUpAlsoNotEditableFields)
Clean up fields content, for each field or editable only fields. |
boolean |
containsLinkedPanel(java.awt.Container c)
|
void |
copy()
Method called by copy button. |
void |
delete()
Method called by delete button. |
void |
dropFocusFromForm()
Remove focus from current form. |
void |
edit()
Method called by edit button. |
void |
executeReload()
This method is called by reload method to reload data. |
void |
export()
Method called when user has clicked on export button: not supported. |
void |
filterSort()
Method called when used has clicked on filter button: not supported. |
void |
finalize()
|
java.util.HashSet |
getBindedButtons()
|
CopyButton |
getCopyButton()
|
boolean |
getCurrentValue(GenericButton button)
|
DeleteButton |
getDeleteButton()
|
EditButton |
getEditButton()
|
FormController |
getFormController()
|
java.lang.String |
getFunctionId()
|
java.util.ArrayList |
getInputControlsNotValid()
|
InsertButton |
getInsertButton()
|
java.util.Set |
getLazyInitializedAttributes()
|
int |
getMode()
|
javax.swing.border.Border |
getNotFocusedBorder()
|
ReloadButton |
getReloadButton()
|
int |
getRowIndexInGrid()
|
SaveButton |
getSaveButton()
|
java.lang.String |
getVOClassName()
|
VOModel |
getVOModel()
|
void |
importData()
Method called when user has clicked on import button: not supported. |
void |
insert()
Method called by insert button. |
boolean |
isButtonDisabled(GenericButton button)
Method called by GenericButton.setEnabled method to check if the button must be disabled. |
boolean |
isChanged()
|
boolean |
isCreateInnerVO()
|
boolean |
isCurrentFormHasFocus()
|
void |
linkGrid(GridControl grid,
java.util.HashSet pkAttributes,
boolean reloadModelWhenSelectingOnGrid)
Link the specified grid control to the current Form, so that: - row selection event (fired by grid navigator bar) will force the Form data loading (ONLY IF loadModelWhenSelectingOnGrid is set to true )
- insert new data on the Form will refresh grid by adding a new row
- update data on Form will refresh grid for the related changed row
- delete existing data on the Form will refresh grid content by removing the related row
To correctly identify the row on grid to change a matching beetween attributes (specified in "pkAttributes" argument)
of grid v.o. and Form v.o. is performed: it will be identified the first row on grid that matches this filter criteria, based on attribute values.
|
void |
linkGrid(GridControl grid,
java.util.HashSet pkAttributes,
boolean reloadModelWhenSelectingOnGrid,
boolean reloadModelWhenClickingWithMouse,
boolean reloadModelWhenPressingKey,
NavigatorBar navBar)
Link the specified grid control to the current Form, so that: - grid navigator bar event (i.e. pressing one of its buttons) on grid will force the Form data loading (e.g. when using grid navigator bar) - insert new data on the Form will refresh grid by adding a new row - update data on Form will refresh grid for the related changed row - delete existing data on the Form will refresh grid content by removing the related row To correctly identify the row on grid to change a matching beetween attributes (specified in "pkAttributes" argument) of grid v.o. and Form v.o. is performed: it will be identified the first row on grid that matches this filter criteria, based on attribute values. |
void |
linkGrid(GridControl grid,
java.util.HashSet pkAttributes,
boolean reloadModelWhenSelectingOnGrid,
NavigatorBar navBar)
Link the specified grid control to the current Form, so that: - grid navigator bar event (i.e. pressing one of its buttons) on grid will force the Form data loading (e.g. when using grid navigator bar) - insert new data on the Form will refresh grid by adding a new row - update data on Form will refresh grid for the related changed row - delete existing data on the Form will refresh grid content by removing the related row To correctly identify the row on grid to change a matching beetween attributes (specified in "pkAttributes" argument) of grid v.o. and Form v.o. is performed: it will be identified the first row on grid that matches this filter criteria, based on attribute values. |
boolean |
pull()
Set the content for each linked input control, based on value object content. |
boolean |
pull(java.lang.String attributeName)
Set the content for the specified linked input control, based on value object content. |
boolean |
push()
If all input controls linked to the form are in a valid state, then push each value to its associated data model. |
void |
reload()
Method called by refresh/cancel button. |
void |
removeGenericButton(GenericButton b)
Remove a generic button, that inherits abilitation state of the other form buttons. |
void |
removeLinkButton(LinkButton b)
Remove a link button, that inherits abilitation state of the other form buttons. |
void |
removeLinkedPanel(java.awt.Container c)
Remove an added linked panel. |
void |
requestFocus()
|
void |
resetButtonsState()
Method automatically called by the Form to check buttons disabilitation. |
boolean |
save()
Method called by save button. |
void |
setCopyButton(CopyButton copyButton)
Set copy button linked to this form. |
void |
setCreateInnerVO(boolean createInnerVO)
Define if an inner v.o. must be automatically instantiated when a setter method is invoked. |
void |
setCurrentValue(GenericButton button,
boolean currentValue)
Set current enabled value of button. |
void |
setDeleteButton(DeleteButton deleteButton)
Set delete button linked to this form. |
void |
setEditButton(EditButton editButton)
Set edit button linked to this form. |
void |
setFocusOnForm()
Set focus on current form. |
void |
setFormController(FormController formController)
Set form controller. |
void |
setFunctionId(java.lang.String functionId)
Set the functionId identifier, associated to the container |
void |
setInsertButton(InsertButton insertButton)
Set insert button linked to this form. |
void |
setMode(int mode)
Set current form mode and consequently the input controls editing state. |
void |
setReloadButton(ReloadButton reloadButton)
Set refresh/cancel button linked to this form. |
void |
setSaveButton(SaveButton saveButton)
Set save button linked to this form. |
void |
setVOClassName(java.lang.String voClassName)
Set data model to link to the form. |
void |
unbind(InputControl comp)
Remove an existing binding between the specified input control and this data model |
void |
valueChanged(ValueChangeEvent e)
Invoked when the value of a linked input control changes. |
Methods inherited from class javax.swing.JPanel |
getAccessibleContext, getUI, getUIClassID, setUI, updateUI |
Methods inherited from class javax.swing.JComponent |
addAncestorListener, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintImmediately, paintImmediately, print, printAll, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFont, setForeground, 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, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, remove, remove, removeAll, removeContainerListener, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, 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, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, 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, 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 |
Constructor Detail |
public Form()
Method Detail |
public final java.util.Set getLazyInitializedAttributes()
public final boolean isCurrentFormHasFocus()
public final void setCurrentValue(GenericButton button, boolean currentValue)
setCurrentValue
in interface DataController
button
- generic button that fires this eventcurrentValue
- current enabled valuepublic final boolean getCurrentValue(GenericButton button)
getCurrentValue
in interface DataController
button
- generic button
public final void finalize()
public final void requestFocus()
public final void setFocusOnForm()
public final void dropFocusFromForm()
public final void addNotify()
public final InsertButton getInsertButton()
public final CopyButton getCopyButton()
public final EditButton getEditButton()
public final void setEditButton(EditButton editButton)
editButton
- edit buttonpublic final void setInsertButton(InsertButton insertButton)
insertButton
- insert buttonpublic final void setCopyButton(CopyButton copyButton)
copyButton
- insert buttonpublic final ReloadButton getReloadButton()
public final void setReloadButton(ReloadButton reloadButton)
public final DeleteButton getDeleteButton()
public final void setDeleteButton(DeleteButton deleteButton)
deleteButton
- delete buttonpublic final SaveButton getSaveButton()
public final void setSaveButton(SaveButton saveButton)
saveButton
- save buttonpublic final void setMode(int mode)
mode
- form mode; possible values: READONLY, INSERT, EDITpublic final boolean isChanged()
true
if there exists at least one input control that has been changed, false
otherwisepublic final void addInputControlAttributesNotEditableOnState(java.util.HashSet attributeNames, java.lang.String stateAttributeName, java.lang.Object state)
attributeNames
- collections of attribute names related to input controls to disablestateAttributeName
- attribute name in the form value object to teststate
- attribute value in the form value object to test: if the value is this one, then input controls will be disabled (in INSERT/EDIT modes)public final void addButtonsNotEnabled(java.util.HashSet buttons, GenericButtonController buttonController)
buttons
- collections GenericButton objects linked to this that have to be disabledbuttonController
- interface that defines button disabilitation, according to some custom policypublic final boolean isButtonDisabled(GenericButton button)
isButtonDisabled
in interface DataController
button
- button whose abilitation must be checked
true
if no policy is defined in the form for the specified button, false
if there exists a disabilitation policy for the specified button (through addButtonsNotEnabledOnState form method)public final void resetButtonsState()
public final int getMode()
public final void reload()
reload
in interface DataController
public final void executeReload()
public final void insert()
insert
in interface DataController
public final void copy()
copy
in interface DataController
public final void edit()
edit
in interface DataController
public final void delete()
delete
in interface DataController
public final java.util.ArrayList getInputControlsNotValid()
public final boolean push()
public final boolean pull()
public final boolean pull(java.lang.String attributeName)
public final boolean save()
save
in interface DataController
true
if data saving is successfully completed, false
if an error occourspublic final FormController getFormController()
public final void setFormController(FormController formController)
formController
- form controllerpublic final java.lang.String getVOClassName()
public final void setVOClassName(java.lang.String voClassName)
public final VOModel getVOModel()
public final void removeLinkedPanel(java.awt.Container c)
public final void addLinkedPanel(java.awt.Container c)
c
- container to linkpublic final boolean containsLinkedPanel(java.awt.Container c)
c
- panel to check
true
if "panel" is a linked panel, false
otherwisepublic final void cleanUp()
public final void cleanUp(boolean cleanUpAlsoNotEditableFields)
cleanUpAlsoNotEditableFields
- define if all fields must be clean uppublic final void bind(InputControl comp) throws java.lang.Exception
comp
- input control
java.lang.Exception
- if an error occourspublic final void unbind(InputControl comp) throws java.lang.Exception
comp
- input control to unbind
java.lang.Exception
- if an error occourspublic final void valueChanged(ValueChangeEvent e)
valueChanged
in interface ValueChangeListener
e
- ValueChangeEvent describing the eventpublic final void export()
export
in interface DataController
public final void importData()
importData
in interface DataController
public void filterSort()
filterSort
in interface DataController
public final void setFunctionId(java.lang.String functionId)
functionId
- identifier associated to the containerpublic final java.lang.String getFunctionId()
getFunctionId
in interface DataController
public final javax.swing.border.Border getNotFocusedBorder()
public final void addGenericButton(GenericButton b)
b
- generic button, that inherits abilitation state of the other form buttonspublic final void removeGenericButton(GenericButton b)
b
- generic button, that inherits abilitation state of the other form buttonspublic final void addLinkButton(LinkButton b)
b
- link button, that inherits abilitation state of the other form buttonspublic final void removeLinkButton(LinkButton b)
b
- link button, that inherits abilitation state of the other form buttonspublic final void linkGrid(GridControl grid, java.util.HashSet pkAttributes, boolean reloadModelWhenSelectingOnGrid)
true
)
- insert new data on the Form will refresh grid by adding a new row
- update data on Form will refresh grid for the related changed row
- delete existing data on the Form will refresh grid content by removing the related row
To correctly identify the row on grid to change a matching beetween attributes (specified in "pkAttributes" argument)
of grid v.o. and Form v.o. is performed: it will be identified the first row on grid that matches this filter criteria, based on attribute values.
NOTE: "reloadModelWhenSelectingOnGrid" is set to true
then Form data reloading is performed also when clicking with the left mouse button onto the grid and when pressing up/down keys onto the grid.
grid
- grid control linked to the current Form, to update grid contentpkAttributes
- attributes that must be defined both on grid v.o. and on the Form v.o. used to select on grid the (first) row that matches pk values; if the grid v.o. is the same class or a super-class of Form v.o. then this HashSet couldreloadModelWhenSelectingOnGrid
- true
to force data Form reloading when changing row selection on grid by grid navigator barpublic final void linkGrid(GridControl grid, java.util.HashSet pkAttributes, boolean reloadModelWhenSelectingOnGrid, NavigatorBar navBar)
true
then Form data reloading is performed also when clicking with the left mouse button onto the grid and when pressing up/down keys onto the grid.
grid
- grid control linked to the current Form, to update grid contentpkAttributes
- attributes that must be defined both on grid v.o. and on the Form v.o. used to select on grid the (first) row that matches pk values; if the grid v.o. is the same class or a super-class of Form v.o. then this HashSet couldreloadModelWhenSelectingOnGrid
- true
to force data Form reloading when changing row selection on grid by grid navigator barnavBar
- navigation bar linked to the current Form, used to load data on Form according to the selected row on grid, whose selection has been changed when using this navigator barpublic final void linkGrid(GridControl grid, java.util.HashSet pkAttributes, boolean reloadModelWhenSelectingOnGrid, boolean reloadModelWhenClickingWithMouse, boolean reloadModelWhenPressingKey, NavigatorBar navBar)
grid
- grid control linked to the current Form, to update grid contentpkAttributes
- attributes that must be defined both on grid v.o. and on the Form v.o. used to select on grid the (first) row that matches pk values; if the grid v.o. is the same class or a super-class of Form v.o. then this HashSet couldreloadModelWhenSelectingOnGrid
- true
to force data Form reloading when changing row selection on grid by grid navigator barreloadModelWhenClickingWithMouse
- true
to enable Form data reloading when clicking with the left mouse button onto the gridreloadModelWhenPressingKey
- true
to enable Form data reloading when pressing up/down keys onto the gridnavBar
- navigation bar linked to the current Form, used to load data on Form according to the selected row on grid, whose selection has been changed when using this navigator barpublic final int getRowIndexInGrid()
public final void actionPerformed(java.awt.event.ActionEvent e)
actionPerformed
in interface java.awt.event.ActionListener
public final boolean isCreateInnerVO()
public final void setCreateInnerVO(boolean createInnerVO)
createInnerVO
- define if an inner v.o. must be automatically instantiated when a setter method is invokedpublic final java.util.HashSet getBindedButtons()
getBindedButtons
in interface DataController
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |