Package it.tidalwave.role.ui
Interface PresentationModel
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface it.tidalwave.util.As
As.Defaults, As.NotFoundBehaviour<T extends java.lang.Object>
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringCALLBACK_DISPOSEThis is an undocumented feature.static java.lang.Class<PresentationModel>PresentationModelstatic java.lang.StringPROPERTY_CHILDREN
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddPropertyChangeListener(java.beans.PropertyChangeListener listener)Adds aPropertyChangeListener.voidaddPropertyChangeListener(java.lang.String propertyName, java.beans.PropertyChangeListener listener)Adds aPropertyChangeListenerfor the given property.voiddispose()Disposes this object.static PresentationModelempty()Returns an empty instance (no roles with the exception of a dummyDisplayable).java.beans.PropertyChangeListener[]getPropertyChangeListeners()Returns all the boundPropertyChangeListeners.java.beans.PropertyChangeListener[]getPropertyChangeListeners(java.lang.String propertyName)Returns the boundPropertyChangeListeners for the given property.booleanhasListeners(java.lang.String propertyName)Checks whether the given property has been bound to listeners.static PresentationModelof(java.lang.Object owner)Creates an instance given an owner and no roles.static PresentationModelof(java.lang.Object owner, java.lang.Object role)Creates an instance given an owner and a single role.static PresentationModelof(java.lang.Object owner, java.util.Collection<java.lang.Object> roles)Creates an instance given an owner and multiple roles.static PresentationModelofMaybePresentable(As owner)Creates an instance from an owner which might have thePresentablerole.static PresentationModelofMaybePresentable(As owner, java.util.Collection<java.lang.Object> roles)Creates an instance from an owner which might have thePresentablerole.voidremovePropertyChangeListener(java.beans.PropertyChangeListener listener)Removes aPropertyChangeListener.voidremovePropertyChangeListener(java.lang.String propertyName, java.beans.PropertyChangeListener listener)Removes aPropertyChangeListenerfor the given property.
-
-
-
Field Detail
-
PresentationModel
static final java.lang.Class<PresentationModel> PresentationModel
-
PROPERTY_CHILDREN
static final java.lang.String PROPERTY_CHILDREN
- See Also:
- Constant Field Values
-
CALLBACK_DISPOSE
static final java.lang.String CALLBACK_DISPOSE
This is an undocumented feature. If you add aNamedCallbackwith this name as a role in this object, it will be called back whendispose()is called.- See Also:
- Constant Field Values
-
-
Method Detail
-
dispose
void dispose()
Disposes this object.
-
addPropertyChangeListener
void addPropertyChangeListener(@Nonnull java.beans.PropertyChangeListener listener)Adds aPropertyChangeListener.- Parameters:
listener- the listener
-
addPropertyChangeListener
void addPropertyChangeListener(@Nonnull java.lang.String propertyName, @Nonnull java.beans.PropertyChangeListener listener)Adds aPropertyChangeListenerfor the given property.- Parameters:
propertyName- the name of the propertylistener- the listener
-
removePropertyChangeListener
void removePropertyChangeListener(@Nonnull java.beans.PropertyChangeListener listener)Removes aPropertyChangeListener.- Parameters:
listener- the listener
-
removePropertyChangeListener
void removePropertyChangeListener(@Nonnull java.lang.String propertyName, @Nonnull java.beans.PropertyChangeListener listener)Removes aPropertyChangeListenerfor the given property.- Parameters:
propertyName- the name of the propertylistener- the listener
-
hasListeners
boolean hasListeners(@Nonnull java.lang.String propertyName)Checks whether the given property has been bound to listeners.- Parameters:
propertyName- the name of the property- Returns:
trueif the property is bound
-
getPropertyChangeListeners
@Nonnull java.beans.PropertyChangeListener[] getPropertyChangeListeners()
Returns all the boundPropertyChangeListeners.- Returns:
- the listeners
-
getPropertyChangeListeners
@Nonnull java.beans.PropertyChangeListener[] getPropertyChangeListeners(@Nonnull java.lang.String propertyName)Returns the boundPropertyChangeListeners for the given property.- Parameters:
propertyName- the name of the property- Returns:
- the listeners
-
of
@Nonnull static PresentationModel of(@Nonnull java.lang.Object owner)
Creates an instance given an owner and no roles.- Parameters:
owner- the owner- Returns:
- the new instance
- Since:
- 3.2-ALPHA-3
-
of
@Nonnull static PresentationModel of(@Nonnull java.lang.Object owner, @Nonnull java.lang.Object role)
Creates an instance given an owner and a single role.- Parameters:
owner- the ownerrole- the role (or aRoleFactory)- Returns:
- the new instance
- Since:
- 3.2-ALPHA-3
-
of
@Nonnull static PresentationModel of(@Nonnull java.lang.Object owner, @Nonnull java.util.Collection<java.lang.Object> roles)
Creates an instance given an owner and multiple roles.- Parameters:
owner- the ownerroles- roles orRoleFactoryinstances- Returns:
- the new instance
- Since:
- 3.2-ALPHA-1, 3.2-ALPHA-3 (refactored)
-
empty
@Nonnull static PresentationModel empty()
Returns an empty instance (no roles with the exception of a dummyDisplayable).- Returns:
- the empty instance
- Since:
- 3.2-ALPHA-3
-
ofMaybePresentable
@Nonnull static PresentationModel ofMaybePresentable(@Nonnull As owner, @Nonnull java.util.Collection<java.lang.Object> roles)
Creates an instance from an owner which might have thePresentablerole. If it is present, it is called to create thePresentationModel; otherwise a default one is created. Additional roles are added.- Parameters:
owner- the ownerroles- roles orRoleFactoryinstances- Returns:
- the new instance
- Since:
- 3.2-ALPHA-8
-
ofMaybePresentable
@Nonnull static PresentationModel ofMaybePresentable(@Nonnull As owner)
Creates an instance from an owner which might have thePresentablerole. If it is present, it is called to create thePresentationModel; otherwise a default one is created.- Parameters:
owner- the owner- Returns:
- the new instance
- Since:
- 3.2-ALPHA-8
-
-