com.arsdigita.formbuilder
Class WidgetLabel

java.lang.Object
  extended bycom.arsdigita.domain.DomainObject
      extended bycom.arsdigita.domain.ObservableDomainObject
          extended bycom.arsdigita.kernel.ACSObject
              extended bycom.arsdigita.auditing.AuditedACSObject
                  extended bycom.arsdigita.formbuilder.PersistentComponent
                      extended bycom.arsdigita.formbuilder.PersistentLabel
                          extended bycom.arsdigita.formbuilder.WidgetLabel
All Implemented Interfaces:
AttributeMetaDataProvider, Audited, PersistentComponentFactory

public class WidgetLabel
extends PersistentLabel

This class is used to associate PersistentLabels with PersistentWidgets. This association facilitates the UI processes for adding, deleting and moving widgets on forms.


Field Summary
static String BASE_DATA_OBJECT_TYPE
           
static String WIDGET_ID
           
 
Fields inherited from class com.arsdigita.formbuilder.PersistentLabel
versionId
 
Fields inherited from class com.arsdigita.formbuilder.PersistentComponent
ATTRIBUTE_STRING
 
Fields inherited from class com.arsdigita.kernel.ACSObject
CONTAINER, DEFAULT_DOMAIN_CLASS, DISPLAY_NAME, ID, OBJECT_TYPE
 
Constructor Summary
WidgetLabel()
          Constructor.
WidgetLabel(BigDecimal id)
          Constructor.
WidgetLabel(DataObject obj)
          Constructor.
WidgetLabel(ObjectType type)
          Constructor.
WidgetLabel(OID oid)
          Constructor.
WidgetLabel(String typeName)
          Constructor.
 
Method Summary
static WidgetLabel create(PersistentWidget widget, String label)
          This method creates a new widget and initialises all the required attributes
static WidgetLabel findByWidget(PersistentWidget widget)
          Retrieves the widget label class associated with the specified persistent widget.
 PersistentWidget getWidget()
          Retrieves the persistent widget object associated with this label.
 BigDecimal getWidgetID()
          Retrieves the id of the persistent widget associated with this label
 void setWidget(PersistentWidget widget)
          Sets the persistent widget associated with this label
 void setWidgetID(BigDecimal id)
          Sets the id of the persistent widget associated with this label
 
Methods inherited from class com.arsdigita.formbuilder.PersistentLabel
create, createComponent, getLabel, setLabel, setup
 
Methods inherited from class com.arsdigita.formbuilder.PersistentComponent
beforeSave, getAdminName, getAttributeMetaData, getComponentAttribute, getDescription, setAdminName, setComponentAttribute, setDescription, setDomainClass
 
Methods inherited from class com.arsdigita.auditing.AuditedACSObject
getCreationDate, getCreationIP, getCreationUser, getLastModifiedDate, getLastModifiedIP, getLastModifiedUser, initialize
 
Methods inherited from class com.arsdigita.kernel.ACSObject
assertPrivilege, checkPrivilege, doCreateCheck, doWriteCheck, getBaseDataObjectType, getContainer, getDefaultDomainClass, getDisplayName, getID, getSpecificObjectType, getSpecificOID, gimmeContainer, isContainerModified, setID, setID
 
Methods inherited from class com.arsdigita.domain.ObservableDomainObject
addObserver, getObservers
 
Methods inherited from class com.arsdigita.domain.DomainObject
add, add, addToAssociation, afterDelete, afterSave, beforeDelete, clear, delete, disconnect, equals, get, getObjectType, getOID, getSession, hashCode, isDeleted, isDisconnected, isModified, isNew, isPropertyModified, isValid, remove, remove, remove, removeFromAssociation, save, set, setAssociation, setAssociation, specializeDataObject, specializeDataObject, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.arsdigita.formbuilder.PersistentComponentFactory
delete, getID, isNew, save
 

Field Detail

BASE_DATA_OBJECT_TYPE

public static final String BASE_DATA_OBJECT_TYPE
See Also:
Constant Field Values

WIDGET_ID

public static String WIDGET_ID
Constructor Detail

WidgetLabel

public WidgetLabel()
Constructor. Creates a new widget label.


WidgetLabel

public WidgetLabel(String typeName)
Constructor. Used by subclasses to specify a different base data object type

Parameters:
typeName - the base data object type

WidgetLabel

public WidgetLabel(ObjectType type)
Constructor. Used by subclasses to specify a different base data object type

Parameters:
type - the object type

WidgetLabel

public WidgetLabel(DataObject obj)
Constructor. Instantiates a widget label from a previously retrieved data object.

Parameters:
obj - the data object

WidgetLabel

public WidgetLabel(BigDecimal id)
            throws DataObjectNotFoundException
Constructor. Instantiates a widget label retrieving the the data object with the specified id

Parameters:
id - the id of the widget label to retrieve

WidgetLabel

public WidgetLabel(OID oid)
            throws DataObjectNotFoundException
Constructor. Used by subclasses to retrieve an existing widget label matching the supplied oid.

Parameters:
oid - the oid of the widget label to retrieve
Method Detail

create

public static WidgetLabel create(PersistentWidget widget,
                                 String label)
This method creates a new widget and initialises all the required attributes

Parameters:
widget - the persistent widget associated with the label
label - the text for the label

findByWidget

public static WidgetLabel findByWidget(PersistentWidget widget)
                                throws DataObjectNotFoundException
Retrieves the widget label class associated with the specified persistent widget.

Parameters:
widget - the persistent widget whose label to find
Throws:
DataObjectNotFoundException - if the there is no label associated with the widget

setWidget

public void setWidget(PersistentWidget widget)
Sets the persistent widget associated with this label


setWidgetID

public void setWidgetID(BigDecimal id)
Sets the id of the persistent widget associated with this label


getWidget

public PersistentWidget getWidget()
                           throws DataObjectNotFoundException
Retrieves the persistent widget object associated with this label. Using this method is not very desirable since it has to do one query to find out the default domain class, and another to actually retrieve the object.

Throws:
DataObjectNotFoundException

getWidgetID

public BigDecimal getWidgetID()
Retrieves the id of the persistent widget associated with this label



Copyright (c) 2004 Red Hat, Inc. Corporation. All Rights Reserved. Generated at July 21 2004:2337 UTC