|
Oracle Fusion Middleware Java API Reference for Oracle Extension SDK 11g Release 2 (11.1.2.1.0) E17493-02 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object oracle.javatools.ui.builders.BasicBuilder<T> oracle.javatools.ui.builders.ListBuilder<T>
public final class ListBuilder<T>
A class to simply and concisely build a list component which has many more abilities than a standard list.
Tell the builder the features you'd like the list to have, call build(), and the builder will take care of putting one together for you.
The builder takes care of ensuring that it conforms to UI standards, and does the common work of putting together things like creating a reorderable list, adding the scrollpane, and other commonly configured list settings.
T is the type of item in the list.
Nested Class Summary | |
---|---|
static class |
ListBuilder.DefaultAction
Built in actions that can be used to quickly create toolbar button actions |
Nested classes/interfaces inherited from class oracle.javatools.ui.builders.BasicBuilder |
---|
BasicBuilder.Instructions |
Field Summary |
---|
Fields inherited from class oracle.javatools.ui.builders.BasicBuilder |
---|
instructions |
Constructor Summary | |
---|---|
ListBuilder()
|
Method Summary | |
---|---|
BuiltList<T> |
build()
Create and return the final concrete component that can be added to a component hierarchy. |
protected void |
buildToolbar(oracle.javatools.ui.builders.BuiltBasic builtBasic)
|
protected BasicBuilder.Instructions |
createInstructions()
|
void |
setActionsDefault(ListBuilder.DefaultAction defaultAction,
java.awt.event.ActionListener listener)
Add one of the DefaultActions to the toolbar and listen to it. |
void |
setIconFromMethod(java.lang.String methodName)
Supply the name of a method on the type of element contained in the List, this method will be called to get the icon of the displayed element. This will only be used if a renderer isn't set directly. The method must have no parameters, do not include parenthesis. |
void |
setModel(java.util.List<? extends T> list)
Set the initial contents of the JList from the contents of the given java.util.List. |
void |
setModel(T[] array)
Set the initial contents of the JList from the contents of the given array. |
void |
setRenderer(javax.swing.ListCellRenderer renderer)
Set the renderer used by the list. |
void |
setRenderUsingMethod(java.lang.String methodName)
Uses reflection to render the items in the list, thus avoiding the need to create a specialized renderer |
void |
setReorderable(boolean reorderable)
Allow the contents of the list to be reordered by the user. |
void |
setSelectionMode(int selectionMode)
Set the selection mode of the list, by default the mode is single selection |
void |
setSortable(boolean sortable)
Initially sort the list by using the natural ordering of the items in the list. |
void |
setSorter(java.util.Comparator<T> comparator)
Initially sort the list by using the ordering of the items determined by the given comparator Note: only DefaultListModels, SimpleListModels, and models supplied as arrays or lists will obey this ability currently. |
void |
setVisibleRows(int visibleRows)
Set the preferred number of visible rows |
Methods inherited from class oracle.javatools.ui.builders.BasicBuilder |
---|
setActions, setActionsSecondary, setActionsSecondary, setCheckable, setDoubleClickListener, setEmptyText, setEmptyTextLarge, setLabel, setResizable, setRollover, setSelection, setSelectionEnabledAction, setSelectionEnabledComponent, setTitlebar, setToolbarComponents |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ListBuilder()
Method Detail |
---|
protected BasicBuilder.Instructions createInstructions()
createInstructions
in class BasicBuilder<T>
public void setModel(T[] array)
array
- the array to display in the listpublic void setModel(java.util.List<? extends T> list)
list
- the java.util.List to display in the listpublic void setVisibleRows(int visibleRows)
visibleRows
- the number of visible rowspublic void setReorderable(boolean reorderable)
reorderable
- public void setSorter(java.util.Comparator<T> comparator)
comparator
- the object used to determine sort orderpublic void setSortable(boolean sortable)
sortable
- public void setRenderer(javax.swing.ListCellRenderer renderer)
renderer
- public void setRenderUsingMethod(java.lang.String methodName)
Uses reflection to render the items in the list, thus avoiding the need to create a specialized renderer
e.g. If the ListBuilder is building a list of Locale objects, calling this method with 'getDisplayLanguage' will display the Locale items as languages.
This will only be used if a renderer isn't set directly.
The method must have no parameters, do not include parenthesis.
methodName
- a method from the type of the ListModel element.public void setActionsDefault(ListBuilder.DefaultAction defaultAction, java.awt.event.ActionListener listener)
defaultAction
- listener
- a listener to be called when the action is performedpublic void setIconFromMethod(java.lang.String methodName)
methodName
- a method from the type of the ListModel element.public void setSelectionMode(int selectionMode)
selectionMode
- a ListSelectionModel constantpublic BuiltList<T> build()
protected void buildToolbar(oracle.javatools.ui.builders.BuiltBasic builtBasic)
buildToolbar
in class BasicBuilder<T>
|
Oracle Fusion Middleware Java API Reference for Oracle Extension SDK 11g Release 2 (11.1.2.1.0) E17493-02 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |