|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.millstone.base.ui.AbstractComponent | +--org.millstone.base.ui.AbstractField | +--org.millstone.base.ui.Select | +--org.millstone.base.ui.Table
Table component is used for representing data or components in pageable and selectable table.
Nested Class Summary |
Nested classes inherited from class org.millstone.base.ui.AbstractField |
AbstractField.ReadOnlyStatusChangeEvent, AbstractField.ValueChangeEvent |
Nested classes inherited from class org.millstone.base.data.Container |
Container.Editor, Container.Hierarchical, Container.Indexed, Container.ItemSetChangeEvent, Container.ItemSetChangeListener, Container.ItemSetChangeNotifier, Container.Ordered, Container.PropertySetChangeEvent, Container.PropertySetChangeListener, Container.PropertySetChangeNotifier, Container.Viewer |
Nested classes inherited from class org.millstone.base.data.Buffered |
Buffered.SourceException |
Nested classes inherited from class org.millstone.base.data.Property |
Property.ConversionException, Property.Editor, Property.ReadOnlyException, Property.ReadOnlyStatusChangeEvent, Property.ReadOnlyStatusChangeListener, Property.ReadOnlyStatusChangeNotifier, Property.ValueChangeEvent, Property.ValueChangeListener, Property.ValueChangeNotifier, Property.Viewer |
Nested classes inherited from class org.millstone.base.ui.Component |
Component.Event, Component.Listener |
Nested classes inherited from class org.millstone.base.terminal.Paintable |
Paintable.RepaintRequestEvent, Paintable.RepaintRequestListener |
Field Summary | |
static java.lang.String |
ALIGN_CENTER
Center column alignment. |
static java.lang.String |
ALIGN_LEFT
Left column alignment. |
static java.lang.String |
ALIGN_RIGHT
Right column alignment. |
static int |
COLUMN_HEADER_MODE_EXPLICIT
Column header mode: Column headers are explicitly specified with setColumnHeaders() |
static int |
COLUMN_HEADER_MODE_EXPLICIT_DEFAULTS_ID
Column header mode: Column headers are explicitly specified with setColumnHeaders() |
static int |
COLUMN_HEADER_MODE_HIDDEN
Column header mode: Column headers are hidden. |
static int |
COLUMN_HEADER_MODE_ID
Column header mode: Property ID:s are used as column headers. |
static int |
ROW_HEADER_MODE_EXPLICIT
Row caption mode: Item captions are explicitly specified. |
static int |
ROW_HEADER_MODE_EXPLICIT_DEFAULTS_ID
Row caption mode: Item captions are explicitly specified, but if the caption is missing, the item id objects toString() is
used instead. |
static int |
ROW_HEADER_MODE_HIDDEN
Row caption mode: The row headers are hidden. |
static int |
ROW_HEADER_MODE_ICON_ONLY
Row caption mode: Only icons are shown, the captions are hidden. |
static int |
ROW_HEADER_MODE_ID
Row caption mode: Items Id-objects toString() is used as row caption. |
static int |
ROW_HEADER_MODE_INDEX
Row caption mode: Index of the item is used as item caption. |
static int |
ROW_HEADER_MODE_ITEM
Row caption mode: Item-objects toString() is used as row caption. |
static int |
ROW_HEADER_MODE_PROPERTY
Row caption mode: Item captions are read from property specified with setItemCaptionPropertyId . |
Fields inherited from class org.millstone.base.ui.Select |
ITEM_CAPTION_MODE_EXPLICIT, ITEM_CAPTION_MODE_EXPLICIT_DEFAULTS_ID, ITEM_CAPTION_MODE_ICON_ONLY, ITEM_CAPTION_MODE_ID, ITEM_CAPTION_MODE_INDEX, ITEM_CAPTION_MODE_ITEM, ITEM_CAPTION_MODE_PROPERTY, itemIdMapper, items |
Fields inherited from interface org.millstone.base.data.Container |
NULL_ITEM_ID |
Constructor Summary | |
Table()
Create new empty table |
|
Table(java.lang.String caption)
Create new empty table with caption. |
|
Table(java.lang.String caption,
Container dataSource)
Create new table with caption and connect it to a Container. |
Method Summary | |
void |
addActionHandler(Action.Handler actionHandler)
Registers a new action handler for this container |
boolean |
addContainerProperty(java.lang.Object propertyId,
java.lang.Class type,
java.lang.Object defaultValue)
Adds a new property to the table and show it as a visible column. |
boolean |
addContainerProperty(java.lang.Object propertyId,
java.lang.Class type,
java.lang.Object defaultValue,
java.lang.String columnHeader,
Resource columnIcon,
java.lang.String columnAlignment)
Adds a new property to the table and show it as a visible column. |
java.lang.Object |
addItem(java.lang.Object[] cells,
java.lang.Object itemId)
Add new row to table and fill the visible cells with given values. |
void |
attach()
Notifies the component that it is connected to an application. |
void |
changeVariables(java.lang.Object source,
java.util.Map variables)
Invoked when the value of a variable has changed. |
void |
containerItemSetChange(Container.ItemSetChangeEvent event)
Container datasource item set change. |
void |
containerPropertySetChange(Container.PropertySetChangeEvent event)
Container datasource property set change. |
void |
detach()
Notifies the component that it is detached from the application. |
void |
focus()
Focusing to this component is not supported. |
java.lang.String[] |
getColumnAlignments()
Get array of column alignments. |
int |
getColumnHeaderMode()
Getter for property columnHeaderMode. |
java.lang.String[] |
getColumnHeaders()
Get the headers of the columns. |
Resource[] |
getColumnIcons()
Get the icons of the columns. |
java.lang.Object |
getCurrentPageFirstItemId()
Getter for property currentPageFirstItem. |
int |
getCurrentPageFirstItemIndex()
Getter for property currentPageFirstItem. |
int |
getPageLength()
Get the page length. |
int |
getRowHeaderMode()
Get the row header mode. |
java.lang.String |
getTag()
Get UIDL tag corresponding to component. |
java.lang.Object[] |
getVisibleColumns()
Get the array of visible column property id:s. |
java.util.Collection |
getVisibleItemIds()
Return list of items on the current page |
boolean |
isPageBufferingEnabled()
Getter for property pageBuffering. |
boolean |
isSelectable()
Getter for property selectable. |
void |
paintContent(PaintTarget target)
Paint the content of this component. |
void |
refreshCurrentPage()
Refresh the current page contents. |
void |
removeActionHandler(Action.Handler actionHandler)
Remove a previously registered action handler for the contents of this container. |
boolean |
removeAllItems()
Remove all items from the container. |
boolean |
removeContainerProperty(java.lang.Object propertyId)
Remove property from all items. |
boolean |
removeItem(java.lang.Object itemId)
Remove item identified by Id from the container. |
void |
setColumnAlignments(java.lang.String[] columnAlignments)
Set the column alignments. |
void |
setColumnHeaderMode(int columnHeaderMode)
Setter for property columnHeaderMode. |
void |
setColumnHeaders(java.lang.String[] columnHeaders)
Set the headers of the columns. |
void |
setColumnIcons(Resource[] columnIcons)
Set the icons of the columns. |
void |
setContainerDataSource(Container newDataSource)
Set the container as data-source for viewing. |
void |
setCurrentPageFirstItemId(java.lang.Object currentPageFirstItemId)
Setter for property currentPageFirstItem. |
void |
setCurrentPageFirstItemIndex(int currentPageFirstItemIndex)
Setter for property currentPageFirstItem. |
void |
setNewItemsAllowed(boolean allowNewOptions)
Adding new items is not supported. |
void |
setPageBufferingEnabled(boolean pageBuffering)
Setter for property pageBuffering. |
void |
setPageLength(int pageLength)
Set the page length. |
void |
setRowHeaderMode(int mode)
Set the row header mode. |
void |
setSelectable(boolean selectable)
Setter for property selectable. |
void |
setVisibleColumns(java.lang.Object[] visibleColumns)
Set the array of visible column property id:s. |
void |
valueChange(Property.ValueChangeEvent event)
This method listens to data source value changes and passes the changes forwards. |
Methods inherited from class org.millstone.base.ui.AbstractField |
addListener, addListener, addValidator, commit, constructField, discard, fireReadOnlyStatusChange, fireValueChange, getErrorMessage, getPropertyDataSource, getValidators, isInvalidAllowed, isInvalidCommitted, isModified, isReadOnly, isReadThrough, isValid, isWriteThrough, removeListener, removeListener, removeValidator, setInvalidAllowed, setInvalidCommitted, setPropertyDataSource, setReadOnly, setReadThrough, setWriteThrough, toString, validate |
Methods inherited from class org.millstone.base.ui.AbstractComponent |
addListener, addListener, addListener, addListener, childRequestedRepaint, dependsOn, fireComponentEvent, fireEvent, getApplication, getCaption, getComponentError, getDescription, getDirectDependencies, getIcon, getLocale, getParent, getStyle, getWindow, isEnabled, isImmediate, isVisible, paint, removeDirectDependency, removeListener, removeListener, removeListener, removeListener, removeListener, requestRepaint, requestRepaintRequests, setCaption, setComponentError, setDescription, setEnabled, setIcon, setImmediate, setLocale, setParent, setStyle, setVisible |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final java.lang.String ALIGN_LEFT
public static final java.lang.String ALIGN_CENTER
public static final java.lang.String ALIGN_RIGHT
public static final int COLUMN_HEADER_MODE_HIDDEN
public static final int COLUMN_HEADER_MODE_ID
public static final int COLUMN_HEADER_MODE_EXPLICIT
setColumnHeaders()
public static final int COLUMN_HEADER_MODE_EXPLICIT_DEFAULTS_ID
setColumnHeaders()
public static final int ROW_HEADER_MODE_HIDDEN
public static final int ROW_HEADER_MODE_ID
public static final int ROW_HEADER_MODE_ITEM
public static final int ROW_HEADER_MODE_INDEX
public static final int ROW_HEADER_MODE_EXPLICIT
public static final int ROW_HEADER_MODE_PROPERTY
setItemCaptionPropertyId
.
public static final int ROW_HEADER_MODE_ICON_ONLY
public static final int ROW_HEADER_MODE_EXPLICIT_DEFAULTS_ID
toString()
is
used instead.
Constructor Detail |
public Table()
public Table(java.lang.String caption)
public Table(java.lang.String caption, Container dataSource)
Method Detail |
public java.lang.Object[] getVisibleColumns()
The columns are show in the order of their appearance in this array
public void setVisibleColumns(java.lang.Object[] visibleColumns)
The columns are show in the order of their appearance in this array
visibleColumns
- Array of shown property id:s.public java.lang.String[] getColumnHeaders()
The headers match the property id:s given my the set
visible column headers. The table must be set in either
ROW_HEADER_MODE_EXPLICIT
or
ROW_HEADER_MODE_EXPLICIT_DEFAULTS_ID
mode
to show the headers. In the defaults mode any nulls in the
headers array are replaced with id.toString() outputs when
rendering.
public void setColumnHeaders(java.lang.String[] columnHeaders)
The headers match the property id:s given my the set
visible column headers. The table must be set in either
ROW_HEADER_MODE_EXPLICIT
or
ROW_HEADER_MODE_EXPLICIT_DEFAULTS_ID
mode
to show the headers. In the defaults mode any nulls in the
headers array are replaced with id.toString() outputs when
rendering.
columnHeaders
- Array of column headers that match the getVisibleColumns()
.public Resource[] getColumnIcons()
The icons in headers match the property id:s given my the set
visible column headers. The table must be set in either
ROW_HEADER_MODE_EXPLICIT
or
ROW_HEADER_MODE_EXPLICIT_DEFAULTS_ID
mode
to show the headers with icons.
getVisibleColumns()
.public void setColumnIcons(Resource[] columnIcons)
The icons in headers match the property id:s given my the set
visible column headers. The table must be set in either
ROW_HEADER_MODE_EXPLICIT
or
ROW_HEADER_MODE_EXPLICIT_DEFAULTS_ID
mode
to show the headers with icons.
columnIcons
- Array of icons that match the getVisibleColumns()
.public java.lang.String[] getColumnAlignments()
The items in the array must match the properties
identified by getVisibleColumns()
. The
possible values for the alignments include:
ALIGN_LEFT
: Left alignmentALIGN_CENTER
: CenteredALIGN_LEFT
: Right alignmentALIGN_LEFT
: any null
values are rendered as align lefts.
public void setColumnAlignments(java.lang.String[] columnAlignments)
The items in the array must match the properties
identified by getVisibleColumns()
. The
possible values for the alignments include:
ALIGN_LEFT
: Left alignmentALIGN_CENTER
: CenteredALIGN_LEFT
: Right alignmentALIGN_LEFT
columnAlignments
- Column alignments array.public int getPageLength()
Setting page length 0 disables paging.
public void setPageLength(int pageLength)
Setting page length 0 disables paging. The page length defaults to 0 (no paging).
public java.lang.Object getCurrentPageFirstItemId()
public void setCurrentPageFirstItemId(java.lang.Object currentPageFirstItemId)
public int getCurrentPageFirstItemIndex()
public void setCurrentPageFirstItemIndex(int currentPageFirstItemIndex)
public boolean isPageBufferingEnabled()
public void setPageBufferingEnabled(boolean pageBuffering)
pageBuffering
- New value of property pageBuffering.public boolean isSelectable()
The table is not selectable by default.
public void setSelectable(boolean selectable)
The table is not selectable by default.
selectable
- New value of property selectable.public int getColumnHeaderMode()
public void setColumnHeaderMode(int columnHeaderMode)
columnHeaderMode
- New value of property columnHeaderMode.public void refreshCurrentPage()
public void setRowHeaderMode(int mode)
The mode can be one of the following ones:
ROW_HEADER_MODE_HIDDEN
: The row captions are
hidden.ROW_HEADER_MODE_ID
: Items Id-objects
toString()
is used as row caption.
ROW_HEADER_MODE_ITEM
: Item-objects
toString()
is used as row caption.
ROW_HEADER_MODE_PROPERTY
: Property set with
setItemCaptionPropertyId()
is used as row header.
ROW_HEADER_MODE_EXPLICIT_DEFAULTS_ID
: Items
Id-objects toString()
is used as row header. If
caption is explicitly specified, it overrides the id-caption.
ROW_HEADER_MODE_EXPLICIT
: The row headers
must be explicitly specified.ROW_HEADER_MODE_INDEX
: The index of the item is
used as row caption. The index mode can
only be used with the containers implementing
Container.Indexed
interface.ROW_HEADER_MODE_HIDDEN
mode
- One of the modes listed above.public int getRowHeaderMode()
setRowHeaderMode(int)
public java.lang.Object addItem(java.lang.Object[] cells, java.lang.Object itemId) throws java.lang.UnsupportedOperationException
cells
- Object array that is used for filling the
visible cells new row. The types must be settable to
visible column property types.itemId
- Id the new row. If null, a new id is automatically
assigned. If given, the table cant already have a item with given id.
java.lang.UnsupportedOperationException
public void setContainerDataSource(Container newDataSource)
Select
setContainerDataSource
in interface Container.Viewer
setContainerDataSource
in class Select
newDataSource
- The new data source ItemContainer.Viewer.setContainerDataSource(Container)
public void changeVariables(java.lang.Object source, java.util.Map variables)
changeVariables
in interface VariableOwner
changeVariables
in class Select
public void paintContent(PaintTarget target) throws PaintException
paintContent
in class Select
target
- Paint target.
PaintException
- The paint operation failed.public java.lang.String getTag()
getTag
in class Select
public void addActionHandler(Action.Handler actionHandler)
Action.Container
addActionHandler
in interface Action.Container
actionHandler
- the new handler to be added.Action.Container.addActionHandler(Action.Handler)
public void removeActionHandler(Action.Handler actionHandler)
Action.Container
removeActionHandler
in interface Action.Container
actionHandler
- the handler to be removedAction.Container.removeActionHandler(Action.Handler)
public void valueChange(Property.ValueChangeEvent event)
AbstractField
valueChange
in interface Property.ValueChangeListener
valueChange
in class AbstractField
event
- the value change event telling the data source contents
have changedProperty.ValueChangeListener.valueChange(Property.ValueChangeEvent)
public void attach()
Component
getApplication()
and
getWindow()
functions might return null
before this method is called.
The caller of this method is Component.setParent(Component)
if the
parent is already in the application. If the parent is not in the
application, it must call the Component.attach()
for all its children
when it will be added to the application.
attach
in interface Component
attach
in class AbstractComponent
Component.attach()
public void detach()
Component
The Component.getApplication()
and Component.getWindow()
methods might return null
after this method is
called.
The caller of this method is Component.setParent(Component)
if the
parent is in the application. When the parent is detached from the application
it is its response to call Component.detach()
for all the children and
to detach itself from the terminal.
detach
in interface Component
detach
in class AbstractComponent
Component.attach()
public boolean removeAllItems()
Select
removeAllItems
in interface Container
removeAllItems
in class Select
Container.removeAllItems()
public boolean removeItem(java.lang.Object itemId)
Select
removeItem
in interface Container
removeItem
in class Select
Container.removeItem(Object)
public boolean removeContainerProperty(java.lang.Object propertyId) throws java.lang.UnsupportedOperationException
Select
removeContainerProperty
in interface Container
removeContainerProperty
in class Select
java.lang.UnsupportedOperationException
Container.removeContainerProperty(Object)
public boolean addContainerProperty(java.lang.Object propertyId, java.lang.Class type, java.lang.Object defaultValue) throws java.lang.UnsupportedOperationException
addContainerProperty
in interface Container
addContainerProperty
in class Select
propertyId
- Id of the proprtytype
- The class of the propertydefaultValue
- The default value given for all existing items
java.lang.UnsupportedOperationException
Container.addContainerProperty(Object, Class, Object)
public boolean addContainerProperty(java.lang.Object propertyId, java.lang.Class type, java.lang.Object defaultValue, java.lang.String columnHeader, Resource columnIcon, java.lang.String columnAlignment) throws java.lang.UnsupportedOperationException
propertyId
- Id of the proprtytype
- The class of the propertydefaultValue
- The default value given for all existing itemscolumnHeader
- Explicit header of the column. If explicit header is not needed, this should be set null.columnIcon
- Icon of the column. If icon is not needed, this should be set null.columnAlignment
- Alignment of the column. Null implies align left.
java.lang.UnsupportedOperationException
Container.addContainerProperty(Object, Class, Object)
public java.util.Collection getVisibleItemIds()
getVisibleItemIds
in class Select
Select.getVisibleItemIds()
public void containerItemSetChange(Container.ItemSetChangeEvent event)
containerItemSetChange
in interface Container.ItemSetChangeListener
containerItemSetChange
in class Select
Container.ItemSetChangeListener.containerItemSetChange(org.millstone.base.data.Container.ItemSetChangeEvent)
public void containerPropertySetChange(Container.PropertySetChangeEvent event)
containerPropertySetChange
in interface Container.PropertySetChangeListener
containerPropertySetChange
in class Select
Container.PropertySetChangeListener.containerPropertySetChange(org.millstone.base.data.Container.PropertySetChangeEvent)
public void setNewItemsAllowed(boolean allowNewOptions) throws java.lang.UnsupportedOperationException
setNewItemsAllowed
in class Select
allowNewOptions
- New value of property allowNewOptions.
java.lang.UnsupportedOperationException
- if set to true.Select.setNewItemsAllowed(boolean)
public void focus() throws java.lang.UnsupportedOperationException
focus
in class AbstractField
java.lang.UnsupportedOperationException
- if invoked.AbstractField.focus()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |