|
||||||||||
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.JScrollPane
org.openswing.swing.client.PropertyGridControl
Title: OpenSwing Framework
Description: Grid control having two columns: property name and property value, where each row (each property) has its own data type (text, numeric, date, check-box, lookup, etc.), expressed as input control. Hence this control can be used to set a collection of properties. Note that PropertyGridControl is not an input control so it cannot be added to a Form panel.
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 javax.swing.ScrollPaneConstants |
COLUMN_HEADER, HORIZONTAL_SCROLLBAR, HORIZONTAL_SCROLLBAR_ALWAYS, HORIZONTAL_SCROLLBAR_AS_NEEDED, HORIZONTAL_SCROLLBAR_NEVER, HORIZONTAL_SCROLLBAR_POLICY, LOWER_LEADING_CORNER, LOWER_LEFT_CORNER, LOWER_RIGHT_CORNER, LOWER_TRAILING_CORNER, ROW_HEADER, UPPER_LEADING_CORNER, UPPER_LEFT_CORNER, UPPER_RIGHT_CORNER, UPPER_TRAILING_CORNER, VERTICAL_SCROLLBAR, VERTICAL_SCROLLBAR_ALWAYS, VERTICAL_SCROLLBAR_AS_NEEDED, VERTICAL_SCROLLBAR_NEVER, VERTICAL_SCROLLBAR_POLICY, VIEWPORT |
Fields inherited from interface java.awt.image.ImageObserver |
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
PropertyGridControl()
|
Method Summary | |
void |
addProperties(ValueObject valueObject)
Add a set properties to the grid, retrieving them from the specified value object: for each attribute defined in the v.o. will be created a row (a property) in the grid. |
boolean |
addProperty(java.lang.String propertyDescription,
InputControl inputControl,
java.lang.Object defaultValue,
java.lang.Object userObject)
Add a property to the grid. |
void |
clearData()
Clear grid content. |
void |
copy()
copy |
void |
delete()
delete |
void |
edit()
edit |
void |
export()
export |
void |
filterSort()
filterSort |
int |
findRow(java.lang.String attributeName)
|
java.lang.String |
getAttributeName(int rowIndex)
|
java.util.HashSet |
getBindedButtons()
|
PropertyGridController |
getController()
|
boolean |
getCurrentValue(GenericButton button)
|
EditButton |
getEditButton()
|
java.lang.String |
getFunctionId()
getFunctionId |
InputControl |
getInputControl(int rowIndex)
|
InputControl |
getInputControl(java.lang.String attributeName)
|
InsertButton |
getInsertButton()
|
int |
getMode()
|
java.lang.Object |
getOldPropertyValue(int rowIndex)
|
java.lang.Object |
getOldPropertyValue(java.lang.String attributeName)
|
void |
getProperties(ValueObject valueObject)
Set value object content, according to property values: for each attribute defined in the v.o. that matches with a row in the grid, its value will be retrieved from the grid and set into the v.o. |
int |
getPropertyNameWidth(int width)
|
java.lang.Object |
getPropertyValue(int rowIndex)
|
java.lang.Object |
getPropertyValue(java.lang.String attributeName)
|
int |
getPropertyValueWidth()
|
ReloadButton |
getReloadButton()
|
SaveButton |
getSaveButton()
|
java.lang.Object |
getUserObject(int rowIndex)
|
java.lang.Object |
getUserObject(java.lang.String attributeName)
|
void |
importData()
import |
void |
insert()
insert |
boolean |
isButtonDisabled(GenericButton button)
isButtonDisabled |
void |
reload()
reload |
boolean |
save()
Method called when user clicks on save button. |
void |
setController(PropertyGridController controller)
Set the controller used to fetch data (property values). |
void |
setCurrentValue(GenericButton button,
boolean currentValue)
Set current enabled value of button. |
void |
setEditButton(EditButton editButton)
Set edit button linked to grid. |
void |
setInsertButton(InsertButton insertButton)
Set insert button linked to grid. |
void |
setMode(int mode)
Set grid mode. |
void |
setProperties(ValueObject valueObject)
Set property values, based on the specified value object: for each attribute defined in the v.o. that matches with a row in the grid, its value will be retrieved and set in the grid. |
void |
setPropertyNameWidth(int width)
|
void |
setPropertyValue(int rowIndex,
java.lang.Object value)
|
boolean |
setPropertyValue(java.lang.String attributeName,
java.lang.Object value)
|
void |
setPropertyValueWidth(int width)
|
void |
setReloadButton(ReloadButton reloadButton)
Set reload button linked to grid. |
void |
setSaveButton(SaveButton saveButton)
Set save button linked to grid. |
boolean |
validateRows()
Execute a validation on changed rows. |
Methods inherited from class javax.swing.JScrollPane |
createHorizontalScrollBar, createVerticalScrollBar, getAccessibleContext, getColumnHeader, getCorner, getHorizontalScrollBar, getHorizontalScrollBarPolicy, getRowHeader, getUI, getUIClassID, getVerticalScrollBar, getVerticalScrollBarPolicy, getViewport, getViewportBorder, getViewportBorderBounds, isValidateRoot, isWheelScrollingEnabled, setColumnHeader, setColumnHeaderView, setComponentOrientation, setCorner, setHorizontalScrollBar, setHorizontalScrollBarPolicy, setLayout, setRowHeader, setRowHeaderView, setUI, setVerticalScrollBar, setVerticalScrollBarPolicy, setViewport, setViewportBorder, setViewportView, setWheelScrollingEnabled, updateUI |
Methods inherited from class javax.swing.JComponent |
addAncestorListener, addNotify, 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, paint, paintImmediately, paintImmediately, print, printAll, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, 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, 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, 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 PropertyGridControl()
Method Detail |
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 int getMode()
public final void setMode(int mode)
mode
- grid mode; possibile values: READONLY, INSERT, EDITpublic final void clearData()
public final boolean addProperty(java.lang.String propertyDescription, InputControl inputControl, java.lang.Object defaultValue, java.lang.Object userObject)
propertyDescription
- description of the property; this is NOT automatically translated: use ClientSettings.getInstance().getResources().getResource() to translate itinputControl
- type of property; this input control must have setted "attributeName" and "required" propertiesdefaultValue
- default value, used when the grid is in INSERT modeuserObject
- additional info (optional)
false
if the specified attribute name has already been used for another row, true
otherwisepublic final int findRow(java.lang.String attributeName)
attributeName
- attribute name that identify a row
public final boolean setPropertyValue(java.lang.String attributeName, java.lang.Object value)
attributeName
- attribute name that identify the rowvalue
- property value to set
false
if the specified attribute name has not been found in the model, true
otherwisepublic final void setPropertyValue(int rowIndex, java.lang.Object value)
rowIndex
- row index in the modelvalue
- property value to setpublic final java.lang.Object getPropertyValue(java.lang.String attributeName)
attributeName
- attribute name that identify the row
public final java.lang.Object getPropertyValue(int rowIndex)
rowIndex
- row index in the model
public final java.lang.Object getOldPropertyValue(java.lang.String attributeName)
attributeName
- attribute name that identify the row
public final java.lang.Object getOldPropertyValue(int rowIndex)
rowIndex
- row index in the model
public final java.lang.Object getUserObject(java.lang.String attributeName)
attributeName
- attribute name that identify the row
public final java.lang.Object getUserObject(int rowIndex)
rowIndex
- row index in the model
public final InputControl getInputControl(java.lang.String attributeName)
attributeName
- attribute name that identify the row
public final InputControl getInputControl(int rowIndex)
rowIndex
- row index in the model
public final void addProperties(ValueObject valueObject)
valueObject
- value object used to create a set of properties, whose description is determined by translating attribute namespublic final void setProperties(ValueObject valueObject)
public final void getProperties(ValueObject valueObject)
public final java.lang.String getAttributeName(int rowIndex)
rowIndex
- row index
public InsertButton getInsertButton()
public EditButton getEditButton()
public void setEditButton(EditButton editButton)
editButton
- edit button linked to gridpublic void setInsertButton(InsertButton insertButton)
insertButton
- insert button linked to gridpublic ReloadButton getReloadButton()
public void setReloadButton(ReloadButton reloadButton)
reloadButton
- reload button linked to gridpublic SaveButton getSaveButton()
public void setSaveButton(SaveButton saveButton)
saveButton
- save button linked to gridpublic void reload()
reload
in interface DataController
public void insert()
insert
in interface DataController
public void copy()
copy
in interface DataController
public void edit()
edit
in interface DataController
public void delete()
delete
in interface DataController
public final boolean validateRows()
true
if all changed rows are in a valid state, false
otherwisepublic final boolean save()
save
in interface DataController
true
if saving operation was correctly completed, false
otherwisepublic void export()
export
in interface DataController
public void importData()
importData
in interface DataController
public java.lang.String getFunctionId()
getFunctionId
in interface DataController
public boolean isButtonDisabled(GenericButton button)
isButtonDisabled
in interface DataController
button
- GenericButton
public void filterSort()
filterSort
in interface DataController
public final PropertyGridController getController()
public final void setController(PropertyGridController controller)
controller
- controller used to fetch data (property values)public final void setPropertyNameWidth(int width)
public final void setPropertyValueWidth(int width)
public final int getPropertyNameWidth(int width)
public final int getPropertyValueWidth()
public 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 |