Package it.tidalwave.role.ui
Interface PresentationModel
- All Superinterfaces:
As
TODO: As the NetBeans Node, it should allow children, have event listeners for children added/removed/changed.
This class so becomes the true M in MVC.
- Author:
- Fabrizio Giudici
- Stereotype:
- Role
-
Nested Class Summary
-
Field Summary
Modifier and TypeFieldDescriptionstatic final As.Type
<SimpleComposite<PresentationModel>> static final String
This is an undocumented feature.static final Class
<PresentationModel> static final String
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds aPropertyChangeListener
.void
addPropertyChangeListener
(String propertyName, 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
).Returns all the boundPropertyChangeListener
s.getPropertyChangeListeners
(String propertyName) Returns the boundPropertyChangeListener
s for the given property.boolean
hasListeners
(String propertyName) Checks whether the given property has been bound to listeners.static PresentationModel
Creates an instance given an owner and no roles.static PresentationModel
Creates an instance given an owner and a single role.static PresentationModel
of
(Object owner, Collection<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, Collection<Object> roles) Creates an instance from an owner which might have thePresentable
role.void
Removes aPropertyChangeListener
.void
removePropertyChangeListener
(String propertyName, PropertyChangeListener listener) Removes aPropertyChangeListener
for the given property.
-
Field Details
-
PresentationModel
-
_SimpleCompositeOfPresentationModel_
-
PROPERTY_CHILDREN
- See Also:
-
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:
-
-
Method Details
-
dispose
void dispose()Disposes this object. -
addPropertyChangeListener
Adds aPropertyChangeListener
.- Parameters:
listener
- the listener
-
addPropertyChangeListener
void addPropertyChangeListener(@Nonnull String propertyName, @Nonnull PropertyChangeListener listener) Adds aPropertyChangeListener
for the given property.- Parameters:
propertyName
- the name of the propertylistener
- the listener
-
removePropertyChangeListener
Removes aPropertyChangeListener
.- Parameters:
listener
- the listener
-
removePropertyChangeListener
void removePropertyChangeListener(@Nonnull String propertyName, @Nonnull PropertyChangeListener listener) Removes aPropertyChangeListener
for the given property.- Parameters:
propertyName
- the name of the propertylistener
- the listener
-
hasListeners
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
Returns all the boundPropertyChangeListener
s.- Returns:
- the listeners
-
getPropertyChangeListeners
Returns the boundPropertyChangeListener
s for the given property.- Parameters:
propertyName
- the name of the property- Returns:
- the listeners
-
of
Creates an instance given an owner and no roles.- Parameters:
owner
- the owner- Returns:
- the new instance
- Since:
- 3.2-ALPHA-3
-
of
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
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
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 Collection<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
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
-