|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectde.mguennewig.pobjform.AbstractFormElement
de.mguennewig.pobjform.AbstractValueElement
de.mguennewig.pobjform.AbstractInputElement
de.mguennewig.pobjform.swing.SwingInputElement
de.mguennewig.pobjform.swing.SwingReferenceElement
public final class SwingReferenceElement
A Swing implementation of a ReferenceElement.
The Swing component for this element as well as the model are created lazily to safe resources.
| Field Summary |
|---|
| Fields inherited from interface de.mguennewig.pobjform.InputElement |
|---|
MAX_INPUT_SIZE, RENDER_AS_DISABLED, RENDER_AS_HIDDEN, RENDER_AS_HIDDEN_WITH_LABEL, RENDER_AS_INPUT, RENDER_AS_TEXT |
| Constructor Summary | |
|---|---|
SwingReferenceElement(PObjSwingForm form,
InputEntry entry)
Creates a new SwingReferenceElement. |
|
| Method Summary | |
|---|---|
void |
actionPerformed(java.awt.event.ActionEvent e)
|
javax.swing.JComboBox |
getComponent()
Returns the Swing component for the input element. |
java.lang.String |
getCurrentString()
Returns the string representation of the current object. |
java.lang.Object |
getInitialObject()
Returns the initial object. |
java.lang.Object |
getObject()
Returns the current object. |
java.lang.String |
getVisualString()
Returns the human readable textual representation of the current value. |
boolean |
isStaticIfOneOption()
Tests whether the input element will be rendered as static if the number of non-null options is exactly one. |
void |
setGroupBy(Member designator,
boolean ascending)
Group the set by the designator. |
void |
setObject(java.lang.Object obj)
Sets the current object to the new value. |
void |
setProperty(java.lang.String property)
Sets the property to a new value, and propagates the change to all child elements. |
void |
setRestriction(java.lang.Class<? extends PObject>[] tableClasses,
Predicate[] filters)
Restrict the set of values to an arbitrary subset of the entries of the referenced table. |
void |
setRestriction(ClassDecl[] tableExprs,
Predicate[] filters)
Restrict the set of values to an arbitrary subset of the entries of the referenced table. |
void |
setRestriction(Predicate filter)
Restrict the set of values to an arbitrary subset of the entries of the referenced table. |
void |
setRightAligned(boolean rightAligned)
Sets whether the data should be right aligned. |
void |
setStaticIfOneOption(boolean staticIfOneOption)
Sets whether the input element will be rendered as static if the number on non-null options is exactly one. |
| Methods inherited from class de.mguennewig.pobjform.swing.SwingInputElement |
|---|
getErrorComponent, getInitialString, getLabelComponent, hasChanged, setCurrentAsInitialState, setInitialString, setLabel, setRenderAs, updateErrorComponent |
| Methods inherited from class de.mguennewig.pobjform.AbstractInputElement |
|---|
addChangeListener, getChangeListeners, getInputEntry, getRenderAs, getType, isHiddenInput, isMandatory, isRightAligned, isVisible, removeChangeListener, setMandatory, setVisible, validate |
| Methods inherited from class de.mguennewig.pobjform.AbstractFormElement |
|---|
appendToList, getContainer, getEntry, getForm, getLabel, getProperty, getPullInPrefix, isPulledIn, omitRowHeader, setPullInPrefix, startsNewCell |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface de.mguennewig.pobjform.InputElement |
|---|
addChangeListener, getInputEntry, getRenderAs, getType, isHiddenInput, isMandatory, isRightAligned, isVisible, removeChangeListener, setMandatory, setRenderAs |
| Methods inherited from interface de.mguennewig.pobjform.ValueElement |
|---|
getInitialString, setCurrentAsInitialState |
| Methods inherited from interface de.mguennewig.pobjform.FormElement |
|---|
appendToList, getContainer, getEntry, getForm, getLabel, getProperty, getPullInPrefix, hasChanged, isPulledIn, omitRowHeader, setLabel, setPullInPrefix, setVisible, startsNewCell, validate |
| Constructor Detail |
|---|
public SwingReferenceElement(PObjSwingForm form,
InputEntry entry)
| Method Detail |
|---|
public void setProperty(java.lang.String property)
setProperty in interface FormElementsetProperty in class AbstractFormElementpublic void setRightAligned(boolean rightAligned)
setRightAligned in interface InputElementsetRightAligned in class AbstractInputElementpublic java.lang.Object getObject()
getObject in interface ValueElementgetObject in class AbstractInputElementpublic void setObject(java.lang.Object obj)
setObject in interface ValueElementsetObject in class AbstractInputElementjava.lang.IllegalArgumentException - if obj is not null and
not a persistent PObject instance.public java.lang.Object getInitialObject()
ValueElement
getInitialObject in interface ValueElementgetInitialObject in class SwingInputElementPObjReadError - if any database error occurs.ReferenceModel.fromString(Container,ClassDecl,String)public java.lang.String getCurrentString()
ValueElement
getCurrentString in interface ValueElementpublic java.lang.String getVisualString()
This is the value used to write the current value into the UI element.
It is never null.
getVisualString in interface InputElementgetVisualString in class AbstractInputElementpublic javax.swing.JComboBox getComponent()
getComponent in interface SwingFormElementPObjReadError - if any database error occurs.
public void setGroupBy(Member designator,
boolean ascending)
setGroupBy in interface ReferenceElementReferenceElement.setRestriction(ClassDecl[],Predicate[]),
Query.ASCENDING,
Query.DESCENDINGpublic void setRestriction(Predicate filter)
setRestriction in interface ReferenceElementPObjReadError - if any database error occurs.ReferenceElement.setRestriction(ClassDecl[],Predicate[])
public void setRestriction(java.lang.Class<? extends PObject>[] tableClasses,
Predicate[] filters)
setRestriction in interface ReferenceElementPObjReadError - if any database error occurs.ReferenceElement.setRestriction(ClassDecl[],Predicate[])
public void setRestriction(ClassDecl[] tableExprs,
Predicate[] filters)
By default the set of values is defined as part of the
column which is used in the select box. The filter is
used as part of the query that returns a list of values of the target
table.
setRestriction in interface ReferenceElementtableExprs - A list of table declarations that will be
included in the query. The first element must be the declaration
of the referenced table or null.filters - A list of predicates to restrict the result set of the
query or an empty list to clear any filter.
PObjReadError - if any database error occurs.Querypublic boolean isStaticIfOneOption()
isStaticIfOneOption in interface ReferenceElementReferenceElement.setStaticIfOneOption(boolean)public void setStaticIfOneOption(boolean staticIfOneOption)
setStaticIfOneOption in interface ReferenceElementPObjReadError - if any database error occurs.public void actionPerformed(java.awt.event.ActionEvent e)
actionPerformed in interface java.awt.event.ActionListener
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||