com.arsdigita.toolbox.ui
Class DomainObjectPropertySheet
java.lang.Object
com.arsdigita.bebop.Completable
com.arsdigita.bebop.SimpleComponent
com.arsdigita.bebop.TextStylable
com.arsdigita.bebop.BlockStylable
com.arsdigita.bebop.Table
com.arsdigita.bebop.PropertySheet
com.arsdigita.toolbox.ui.DomainObjectPropertySheet
- All Implemented Interfaces:
- BebopConstants, Cloneable, Component, Lockable
- public class DomainObjectPropertySheet
- extends PropertySheet
Displays a list of label-value pairs, which represent the attributes
of a domain object.
Typical usage is
DomainObjectPropertySheet mySheet = new DomainObjectPropertySheet(myDomainObjectSelectionModel);
mySheet.add("Name:", ContentPage.NAME);
mySheet.add("Title:", ContentPage.TITLE);
The first argument is the visible label for the property, and
the second argument is the name of the property as it appears in
the PDL file.
Instead of specifying the property directly, you may specify the "path"
to the property. For example,
mySheet.add("Address Line 1:", "user.address.street");
The code above tells the DomainObjectPropertySheet
to look for
the child of the current object named "user"; then look for the child
of the user named "address", and finally to return the property of
the address named "street".
Note that, by default, DomainObjectPropertySheet
retrieves
the values for its properties directly from the underlying DataObject
of the DomainObject
. This means that the Java getXXX
methods of the DomainObject
will never be called. Of course, it
is always possible to create a custom DomainObjectPropertySheet.AttributeFormatter
that will call the
appropriate methods.
- Version:
- $Id: //core-platform/dev/src/com/arsdigita/toolbox/ui/DomainObjectPropertySheet.java#10 $
- Author:
- Stanislav Freidin
Fields inherited from class com.arsdigita.bebop.BlockStylable |
ABSBOTTOM, ABSMIDDLE, BASELINE, BOTTOM, CENTER, FULL_WIDTH, INSERT, LEFT, MIDDLE, RIGHT, TEXTTOP, TOP |
Fields inherited from interface com.arsdigita.bebop.util.BebopConstants |
BEBOP_BORDER, BEBOP_BOXPANEL, BEBOP_CELL, BEBOP_CHECKBOX, BEBOP_CHECKBOXGROUP, BEBOP_COLUMNPANEL, BEBOP_DATE, BEBOP_DATETIME, BEBOP_DHTMLEDITOR, BEBOP_FORMERRORS, BEBOP_FORMWIDGET, BEBOP_GRIDPANEL, BEBOP_LIST, BEBOP_MULTISELECT, BEBOP_OPTION, BEBOP_PAD, BEBOP_PADFRAME, BEBOP_PANELROW, BEBOP_PORTAL, BEBOP_PORTLET, BEBOP_RADIO, BEBOP_RADIOGROUP, BEBOP_SEG_BODY, BEBOP_SEG_HEADER, BEBOP_SEG_PANEL, BEBOP_SEGMENT, BEBOP_SELECT, BEBOP_TABLE, BEBOP_TABLEBODY, BEBOP_TABLEROW, BEBOP_TEXTAREA |
Methods inherited from class com.arsdigita.bebop.Table |
addTableActionListener, children, clearSelection, createTableActionListener, fireCellSelected, fireHeadSelected, generateExtraXMLAttributes, generateXML, getBorder, getCellPadding, getCellSpacing, getColumn, getColumnModel, getColumnSelectionModel, getControler, getDefaultCellRenderer, getEmptyView, getHeader, getModelBuilder, getRowSelectionModel, getStriped, getTableModel, getWidth, isSelectedCell, isSelectedColumn, isSelectedRow, lock, register, removeTableActionListener, respond, setBorder, setCellPadding, setCellSpacing, setColumn, setColumnModel, setColumnSelectionModel, setDefaultCellRenderer, setEmptyView, setHeader, setModelBuilder, setRowSelectionModel, setStriped, setWidth |
Methods inherited from class com.arsdigita.bebop.SimpleComponent |
clone, exportAttributes, getAttribute, getClassAttr, getIdAttr, getKey, getMetaDataAttribute, getStyleAttr, hasAttributes, isLocked, isVisible, register, setAttribute, setClassAttr, setIdAttr, setKey, setMetaDataAttribute, setStyleAttr, setVisible |
versionId
public static final String versionId
- See Also:
- Constant Field Values
DomainObjectPropertySheet
public DomainObjectPropertySheet(DomainObjectSelectionModel objModel)
- Construct a new DomainObjectPropertySheet
- Parameters:
objModel
- The selection model which feeds domain objects to this
property sheet.
DomainObjectPropertySheet
public DomainObjectPropertySheet(DomainObjectSelectionModel objModel,
boolean valueOutputEscape)
- Construct a new DomainObjectPropertySheet
- Parameters:
objModel
- The selection model which feeds domain objects to this
property sheetvalueOutputEscape
- The value of the label-value pair(i.e.,
column[1])'s output-escaping
add
public void add(String label,
String attribute)
- Deprecated. use add(GlobalizedMessage label, String attribute) instead
- Add a new property to the sheet. The sheet will automatically
retrieve an attribute of the object and call toString() on it
- Parameters:
label
- The label for the attributeattribute
- The name for the attribute. Could be a simple name
or a compound path, such as "foo.bar.baz"
add
public void add(GlobalizedMessage label,
String attribute)
- Add a new property to the sheet. The sheet will automatically
retrieve an attribute of the object and call toString() on it
- Parameters:
label
- The label for the attributeattribute
- The name for the attribute. Could be a simple name
or a compound path, such as "foo.bar.baz"
add
public void add(String label,
String attribute,
DomainObjectPropertySheet.AttributeFormatter f)
- Deprecated. Use add(GlobalizedMessage label, String attribute, AttributeFormatter f) instead
- Add a new property to the sheet. The sheet will use an
AttributeFormatter to convert the value of the attribute
to a String.
- Parameters:
label
- The label for the attributeattribute
- The name for the attribute
add
public void add(GlobalizedMessage label,
String attribute,
DomainObjectPropertySheet.AttributeFormatter f)
- Add a new property to the sheet. The sheet will use an
AttributeFormatter to convert the value of the attribute
to a String.
- Parameters:
label
- The label for the attributeattribute
- The name for the attribute
getObjectSelectionModel
public DomainObjectSelectionModel getObjectSelectionModel()
- Returns:
- The object selection model
properties
protected Iterator properties()
- Returns:
- The iterator over all properties
Copyright (c) 2004 Red Hat, Inc. Corporation. All Rights Reserved. Generated at July 21 2004:2337 UTC