de.mguennewig.pobjform
Interface ReferenceElement

All Superinterfaces:
FormElement, InputElement, ValueElement
All Known Implementing Classes:
HtmlReferenceElement, SwingReferenceElement

public interface ReferenceElement
extends InputElement

An input element to select one entry from possible entries of a referenced table.

NOTE: This elements requires the form to have a Container instance.

Author:
Michael Günnewig
See Also:
ReferenceToClass, PObjForm.getContainer()

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
 
Method Summary
 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 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[] tableDeclarations, 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 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 interface de.mguennewig.pobjform.InputElement
addChangeListener, getInputEntry, getRenderAs, getType, getVisualString, isHiddenInput, isMandatory, isRightAligned, isVisible, removeChangeListener, setMandatory, setRenderAs, setRightAligned
 
Methods inherited from interface de.mguennewig.pobjform.ValueElement
getCurrentString, getInitialObject, getInitialString, getObject, setCurrentAsInitialState, setObject
 
Methods inherited from interface de.mguennewig.pobjform.FormElement
appendToList, getContainer, getEntry, getForm, getLabel, getProperty, getPullInPrefix, hasChanged, isPulledIn, omitRowHeader, setLabel, setProperty, setPullInPrefix, setVisible, startsNewCell, validate
 

Method Detail

setGroupBy

void setGroupBy(Member designator,
                boolean ascending)
Group the set by the designator.

Throws:
java.lang.IllegalArgumentException - if the designator refers to a non-existing table
See Also:
setRestriction(ClassDecl[],Predicate[]), Query.ASCENDING, Query.DESCENDING

setRestriction

void setRestriction(Predicate filter)
Restrict the set of values to an arbitrary subset of the entries of the referenced table.

See Also:
setRestriction(ClassDecl[],Predicate[])

setRestriction

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.

See Also:
setRestriction(ClassDecl[],Predicate[])

setRestriction

void setRestriction(ClassDecl[] tableDeclarations,
                    Predicate[] filters)
Restrict the set of values to an arbitrary subset of the entries of the referenced table.

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.

Parameters:
tableDeclarations - 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.
See Also:
Query

isStaticIfOneOption

boolean isStaticIfOneOption()
Tests whether the input element will be rendered as static if the number of non-null options is exactly one.

See Also:
setStaticIfOneOption(boolean)

setStaticIfOneOption

void setStaticIfOneOption(boolean staticIfOneOption)
Sets whether the input element will be rendered as static if the number on non-null options is exactly one.