|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectbr.com.arsmachina.tapestrycrud.base.BasePage<T,K>
br.com.arsmachina.tapestrycrud.base.BaseListPage<T,K>
T - the entity class related to this encoder.K - the type of the class' primary key property.public abstract class BaseListPage<T,K extends Serializable>
Base class for pages that list entity objects. The object property is meant to be
used as the row parameter of the Grid component.
One example of its use can be found in the Ars Machina Project Example Application (page class. template).
| Constructor Summary | |
|---|---|
BaseListPage()
Single constructor of this class. |
|
| Method Summary | ||
|---|---|---|
protected boolean |
canRemove(T object)
Tells if a given object can be removed in this context. |
|
BeanModel<T> |
getBeanModel()
Adds an action property to the BeanModel. |
|
T |
getObject()
Returns the value of the object property. |
|
Object |
getObjects()
Method used as the source parameter of the Grid component. |
|
protected
|
getPrimaryKeyEncoder(Class<X> clasz)
Returns the configured PrimaryKeyEncoder for a given entity class. |
|
protected Object |
remove(EventContext context)
This method listens to the Constants.REMOVE_OBJECT_ACTION event and removes the
corresponding object. |
|
protected Object |
remove(T object)
Removes or not a given object. |
|
protected Object |
returnFromDoRemove()
Defines what #doRemove() will return. |
|
void |
setObject(T object)
Changes the value of the object property. |
|
protected void |
setRemoveErrorNotAllowedMessage()
Sets the remove not done because of lack of priviledge message in this page. |
|
protected void |
setRemoveErrorNotFoundMessage()
Sets the remove not done because object not found in this page. |
|
protected void |
setRemoveSuccessMessage()
Sets the remove success message in this page. |
|
| Methods inherited from class br.com.arsmachina.tapestrycrud.base.BasePage |
|---|
filterReadOnlyComponentsInBeanModel, getActivationContextEncoder, getController, getEntityClass, getFormZone, getLabelEncoder, getMessage, getMessages, getPrimaryKeyClass, getSelectModelFactory, getValueEncoder, returnZoneOnXHR, setMessage |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public BaseListPage()
| Method Detail |
|---|
@Cached public Object getObjects()
source parameter of the Grid component. This
implementation returns new ControllerGridDataSource(getController()).
Object.public T getObject()
object property.
T.public void setObject(T object)
object property.
object - a T.public BeanModel<T> getBeanModel()
action property to the BeanModel.
br.com.arsmachina.tapestrycrud.base.BasePage#getBeanModel()protected final Object remove(T object)
getController().delete(id), if canRemove(K) returns true.
object - a K.protected Object returnFromDoRemove()
#doRemove() will return.
Object or null.protected void setRemoveSuccessMessage()
protected void setRemoveErrorNotAllowedMessage()
protected void setRemoveErrorNotFoundMessage()
protected boolean canRemove(T object)
true.
object - a #T.
boolean.@OnEvent(value="removeObject") protected Object remove(EventContext context)
Constants.REMOVE_OBJECT_ACTION event and removes the
corresponding object.
context - an EventContext.protected <X,Y extends Serializable> PrimaryKeyEncoder<Y,X> getPrimaryKeyEncoder(Class<X> clasz)
PrimaryKeyEncoder for a given entity class.
getPrimaryKeyEncoder in class BasePage<T,K extends Serializable>X - the type of the entity.Y - the class' primary key field type.clasz - a Class.
PrimaryKeyEncoder.PrimaryKeyEncoderSource.get(java.lang.Class)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||