|
|||||||||
| 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.formaria.swing.Panel
org.formaria.swing.pojo.PojoPanel
public class PojoPanel
A panel that accepts a POJO as an argument and constructs a form in response
Copyright (c) Formaria Ltd., 2001-2008, This software is licensed under the GNU Public License (GPL), please see license.txt for more details. If you make commercial use of this software you must purchase a commercial license from Formaria.
| Nested Class Summary | |
|---|---|
class |
PojoPanel.PojoPanelFocusTraversalPolicy
|
| Nested classes/interfaces inherited from class javax.swing.JPanel |
|---|
javax.swing.JPanel.AccessibleJPanel |
| Nested classes/interfaces inherited from class javax.swing.JComponent |
|---|
javax.swing.JComponent.AccessibleJComponent |
| Nested classes/interfaces inherited from class java.awt.Container |
|---|
java.awt.Container.AccessibleAWTContainer |
| Nested classes/interfaces inherited from class java.awt.Component |
|---|
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
| Field Summary | |
|---|---|
protected boolean |
alwaysDirty
|
protected java.util.Hashtable<java.lang.String,java.lang.Object> |
backingStore
|
protected AriaBuilder |
builder
|
protected int |
colWidth
|
protected StyleFactory |
componentFactory
|
protected java.lang.String |
dataPath
|
protected boolean |
enabledByDefault
|
protected java.util.ArrayList<java.lang.String> |
excludes
|
protected java.util.ArrayList<java.beans.PropertyDescriptor> |
fields
|
protected java.lang.String |
fieldValidationRule
|
protected boolean |
includeByDefault
|
protected boolean |
inputEnabled
|
protected int |
labelWidth
|
protected int |
numCols
|
protected java.util.ArrayList<java.lang.String> |
paths
|
protected java.lang.Class |
pojoClass
|
protected Project |
project
|
protected java.beans.PropertyDescriptor[] |
properties
|
protected DataModel |
rootModel
|
protected int |
rowHeight
|
protected int |
spacing
|
protected Translator |
translator
|
protected boolean |
useColumnOrder
|
protected java.util.Hashtable<java.lang.String,XmlElement> |
viewFields
|
protected XmlElement |
viewModel
|
protected java.util.ArrayList<java.lang.String> |
viewOrder
|
protected java.lang.String |
viewPath
|
| Fields inherited from class org.formaria.swing.Panel |
|---|
arc, BORDER_BEVEL, BORDER_FLAT, BORDER_NONE, drawBorder, padding, translucent, usesLaf |
| 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 | |
|---|---|
PojoPanel()
|
|
| Method Summary | |
|---|---|
void |
allAttributesSet()
Called when all the attributes have been set |
void |
backupInputs()
Store the input values to a backing store |
void |
enableInputs(boolean state)
Enabled the input fields |
int |
getColWidth()
Get the column width |
protected void |
getCompoundProperty(java.beans.PropertyDescriptor[] pp,
java.lang.String target)
Get the property descriptor corresponding to a compound path using '.' separators. |
protected void |
getCompoundProperty(java.beans.PropertyDescriptor properties,
java.lang.String target)
|
java.lang.String |
getDataPath()
Get the POJO path within the data model |
protected java.lang.String |
getDisplayName(java.lang.String fieldName,
java.lang.String defaultName)
Try to get the display name |
java.lang.String |
getFieldValidationRule()
Get the name of the field validation rule |
int |
getLabelWidth()
Get the label width |
int |
getNumCols()
Get the number of columns |
java.awt.Dimension |
getPreferredSize()
Get the preferred size of the panel. |
int |
getRowHeight()
Get the row height |
int |
getSpacing()
Get the input field spacing |
boolean |
isAlwaysDirty()
Get the alwaysDirty flag |
boolean |
isEnabledByDefault()
Are the input fields enabled by default? |
protected boolean |
isFieldEnabled(java.lang.String fieldName)
|
protected boolean |
isFieldExcluded(java.lang.String name)
Is the field excluded from the form? |
protected boolean |
isFieldVisible(java.lang.String fieldName)
|
boolean |
isFocusCycleRoot()
Provide to support setting of the focus traversal policy |
boolean |
isIncludeByDefault()
Get the include by default flag |
boolean |
isInputEnabled()
Are the inputs enabled? |
boolean |
isUseColumnOrder()
Get the input field traversal mode |
void |
loadDefaultViewFile()
Attempt to load the default view file. |
protected void |
populatePanel()
|
void |
resetEnabledState()
Return the input fields to their default state |
void |
restoreInputs()
Store the input values to a backing store |
void |
setAlwaysDirty(boolean alwaysDirty)
Set the always dirty flag |
void |
setColWidth(int colWidth)
Set the column width. |
void |
setDataPath(java.lang.String path)
Set the path to the POJO instance |
void |
setEnabledByDefault(boolean enabledByDefault)
Set the default enabled status |
void |
setExclude(java.lang.String attribValue)
Set a comma separated list of excluded fields |
void |
setFieldOrder(java.lang.String fieldOrder)
Set the order of the input fields. |
void |
setFieldValidationRule(java.lang.String fieldValidationRule)
Set the name of the field validation rule |
void |
setIncludeByDefault(boolean includeByDefault)
Flag that all fields are to be included by default |
void |
setInputEnabled(boolean inputEnabled)
|
void |
setLabelWidth(int labelWidth)
Set the label or prompt width in pixels. |
void |
setNumCols(int numCols)
Set the number of columns over which to display the inputs |
void |
setPojoClass(java.lang.String className)
|
void |
setRowHeight(int rowHeight)
Set the row height in pixels. |
void |
setSpacing(int spacing)
Set the input field spacing |
void |
setUseColumnOrder(boolean useColumnOrder)
Set the column vs row input field traversal mode |
void |
setViewFile(java.lang.String resName)
Read the view file |
void |
setViewPath(java.lang.String path)
Read the view file |
| Methods inherited from class org.formaria.swing.Panel |
|---|
addNotify, getArc, getDrawBorder, getInsets, getPainter, getUsesLaf, paintComponent, restoreState, saveState, setArc, setBlend, setBorder, setBounds, setDrawBorder, setImageName, setPad, setPainter, setSwingBorder, setTitle, setTitlePos, setTitlePosition, setTitleStyle, setToolTip, setTranslucent, setUsesLaf, update |
| Methods inherited from class javax.swing.JPanel |
|---|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI |
| Methods inherited from class javax.swing.JComponent |
|---|
addAncestorListener, 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, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, 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, 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 |
| 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, 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, 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 |
| Field Detail |
|---|
protected java.util.ArrayList<java.lang.String> excludes
protected java.util.Hashtable<java.lang.String,XmlElement> viewFields
protected java.util.ArrayList<java.lang.String> viewOrder
protected XmlElement viewModel
protected java.lang.String viewPath
protected java.util.ArrayList<java.beans.PropertyDescriptor> fields
protected java.util.ArrayList<java.lang.String> paths
protected java.beans.PropertyDescriptor[] properties
protected int numCols
protected int rowHeight
protected int labelWidth
protected int colWidth
protected int spacing
protected java.lang.Class pojoClass
protected Project project
protected Translator translator
protected StyleFactory componentFactory
protected DataModel rootModel
protected AriaBuilder builder
protected java.lang.String dataPath
protected boolean enabledByDefault
protected boolean inputEnabled
protected boolean alwaysDirty
protected boolean useColumnOrder
protected boolean includeByDefault
protected java.lang.String fieldValidationRule
protected java.util.Hashtable<java.lang.String,java.lang.Object> backingStore
| Constructor Detail |
|---|
public PojoPanel()
| Method Detail |
|---|
public void allAttributesSet()
MultiAttributedComponent
allAttributesSet in interface MultiAttributedComponentpublic void setPojoClass(java.lang.String className)
public java.awt.Dimension getPreferredSize()
getPreferredSize in class Panelprotected void populatePanel()
public void resetEnabledState()
public void enableInputs(boolean state)
state - the enabled statepublic boolean isInputEnabled()
public void backupInputs()
public void restoreInputs()
public void loadDefaultViewFile()
public void setViewFile(java.lang.String resName)
resName - public void setViewPath(java.lang.String path)
path - the name of the model path containing the viewprotected boolean isFieldExcluded(java.lang.String name)
name - the field/property name
protected java.lang.String getDisplayName(java.lang.String fieldName,
java.lang.String defaultName)
fieldName - defaultName -
protected boolean isFieldEnabled(java.lang.String fieldName)
protected boolean isFieldVisible(java.lang.String fieldName)
protected void getCompoundProperty(java.beans.PropertyDescriptor[] pp,
java.lang.String target)
throws java.beans.IntrospectionException
pp - target -
java.beans.IntrospectionException
protected void getCompoundProperty(java.beans.PropertyDescriptor properties,
java.lang.String target)
throws java.beans.IntrospectionException
java.beans.IntrospectionExceptionpublic boolean isFocusCycleRoot()
isFocusCycleRoot in class java.awt.Containerpublic void setFieldOrder(java.lang.String fieldOrder)
fieldOrder - public int getNumCols()
public void setNumCols(int numCols)
numCols - the number of columnspublic int getRowHeight()
public void setRowHeight(int rowHeight)
rowHeight - the row heightpublic int getLabelWidth()
public void setLabelWidth(int labelWidth)
labelWidth - the width in pixelspublic int getColWidth()
public void setColWidth(int colWidth)
colWidth - the width in pixelspublic int getSpacing()
public void setSpacing(int spacing)
spacing - the spacing in pixelspublic java.lang.String getDataPath()
public void setDataPath(java.lang.String path)
public boolean isEnabledByDefault()
public void setEnabledByDefault(boolean enabledByDefault)
enabledByDefault - public void setInputEnabled(boolean inputEnabled)
public boolean isAlwaysDirty()
public void setAlwaysDirty(boolean alwaysDirty)
alwaysDirty - true to always mark the POJO as dirtypublic boolean isUseColumnOrder()
public void setUseColumnOrder(boolean useColumnOrder)
useColumnOrder - if true traverse the input fields column by columnpublic boolean isIncludeByDefault()
public void setIncludeByDefault(boolean includeByDefault)
includeByDefault - true to include all fieldspublic java.lang.String getFieldValidationRule()
public void setFieldValidationRule(java.lang.String fieldValidationRule)
fieldValidationRule - public void setExclude(java.lang.String attribValue)
attribValue - the list of fields
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||