com.arsdigita.toolbox.ui
Class DomainObjectPropertySheet

java.lang.Object
  extended bycom.arsdigita.bebop.Completable
      extended bycom.arsdigita.bebop.SimpleComponent
          extended bycom.arsdigita.bebop.TextStylable
              extended bycom.arsdigita.bebop.BlockStylable
                  extended bycom.arsdigita.bebop.Table
                      extended bycom.arsdigita.bebop.PropertySheet
                          extended bycom.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

Nested Class Summary
static interface DomainObjectPropertySheet.AttributeFormatter
          An interface which can transform some property to a string.
protected static class DomainObjectPropertySheet.Property
           
 
Nested classes inherited from class com.arsdigita.bebop.PropertySheet
PropertySheet.GlobalizedLabelCellRenderer, PropertySheet.StringLabelCellRenderer
 
Nested classes inherited from class com.arsdigita.bebop.Table
Table.MatrixTableModelBuilder
 
Field Summary
static String versionId
           
 
Fields inherited from class com.arsdigita.bebop.PropertySheet
EMPTY_MODEL
 
Fields inherited from class com.arsdigita.bebop.Table
CELL_EVENT, SEP
 
Fields inherited from class com.arsdigita.bebop.BlockStylable
ABSBOTTOM, ABSMIDDLE, BASELINE, BOTTOM, CENTER, FULL_WIDTH, INSERT, LEFT, MIDDLE, RIGHT, TEXTTOP, TOP
 
Fields inherited from class com.arsdigita.bebop.SimpleComponent
m_attr
 
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
 
Fields inherited from interface com.arsdigita.bebop.Component
BEBOP_XML_NS, CLASS, ID, ON_CLICK, STYLE
 
Constructor Summary
DomainObjectPropertySheet(DomainObjectSelectionModel objModel)
          Construct a new DomainObjectPropertySheet
DomainObjectPropertySheet(DomainObjectSelectionModel objModel, boolean valueOutputEscape)
          Construct a new DomainObjectPropertySheet
 
Method Summary
 void add(GlobalizedMessage label, String attribute)
          Add a new property to the sheet.
 void add(GlobalizedMessage label, String attribute, DomainObjectPropertySheet.AttributeFormatter f)
          Add a new property to the sheet.
 void add(String label, String attribute)
          Deprecated. use add(GlobalizedMessage label, String attribute) instead
 void add(String label, String attribute, DomainObjectPropertySheet.AttributeFormatter f)
          Deprecated. Use add(GlobalizedMessage label, String attribute, AttributeFormatter f) instead
 DomainObjectSelectionModel getObjectSelectionModel()
           
protected  Iterator properties()
           
 
Methods inherited from class com.arsdigita.bebop.PropertySheet
getPropertySheetModelBuilder
 
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.BlockStylable
setBorder, setBorder, setBorderColor, setHorizontalAlignment, setMargin, setMargin, setPadding, setPadding, setVerticalAlignment
 
Methods inherited from class com.arsdigita.bebop.TextStylable
setBackgroundColor, setColor
 
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
 
Methods inherited from class com.arsdigita.bebop.Completable
addCompletionListener, fireCompletionEvent
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

versionId

public static final String versionId
See Also:
Constant Field Values
Constructor Detail

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 sheet
valueOutputEscape - The value of the label-value pair(i.e., column[1])'s output-escaping
Method Detail

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 attribute
attribute - 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 attribute
attribute - 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 attribute
attribute - 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 attribute
attribute - 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