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.String
CALLBACK_DISPOSE
This is an undocumented feature.static java.lang.Class<PresentationModel>
PresentationModel
static java.lang.String
PROPERTY_CHILDREN
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description void
addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Adds aPropertyChangeListener
.void
addPropertyChangeListener(java.lang.String propertyName, java.beans.PropertyChangeListener listener)
Adds aPropertyChangeListener
for the given property.void
dispose()
Disposes this object.static PresentationModel
empty()
Returns an empty instance (no roles with the exception of a dummyDisplayable
).java.beans.PropertyChangeListener[]
getPropertyChangeListeners()
Returns all the boundPropertyChangeListener
s.java.beans.PropertyChangeListener[]
getPropertyChangeListeners(java.lang.String propertyName)
Returns the boundPropertyChangeListener
s for the given property.boolean
hasListeners(java.lang.String propertyName)
Checks whether the given property has been bound to listeners.static PresentationModel
of(java.lang.Object owner)
Creates an instance given an owner and no roles.static PresentationModel
of(java.lang.Object owner, java.lang.Object role)
Creates an instance given an owner and a single role.static PresentationModel
of(java.lang.Object owner, java.util.Collection<java.lang.Object> roles)
Creates an instance given an owner and multiple roles.static PresentationModel
ofMaybePresentable(As owner)
Creates an instance from an owner which might have thePresentable
role.static PresentationModel
ofMaybePresentable(As owner, java.util.Collection<java.lang.Object> roles)
Creates an instance from an owner which might have thePresentable
role.void
removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Removes aPropertyChangeListener
.void
removePropertyChangeListener(java.lang.String propertyName, java.beans.PropertyChangeListener listener)
Removes aPropertyChangeListener
for 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 aNamedCallback
with 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 aPropertyChangeListener
for 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 aPropertyChangeListener
for 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:
true
if the property is bound
-
getPropertyChangeListeners
@Nonnull java.beans.PropertyChangeListener[] getPropertyChangeListeners()
Returns all the boundPropertyChangeListener
s.- Returns:
- the listeners
-
getPropertyChangeListeners
@Nonnull java.beans.PropertyChangeListener[] getPropertyChangeListeners(@Nonnull java.lang.String propertyName)
Returns the boundPropertyChangeListener
s 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 orRoleFactory
instances- 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 thePresentable
role. 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 orRoleFactory
instances- 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 thePresentable
role. 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
-
-