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
FieldsModifier and TypeFieldDescriptionstatic final As.Type<SimpleComposite<PresentationModel>> static final StringThis is an undocumented feature.static final Class<PresentationModel> static final String -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds aPropertyChangeListener.voidaddPropertyChangeListener(String propertyName, 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).Returns all the boundPropertyChangeListeners.getPropertyChangeListeners(String propertyName) Returns the boundPropertyChangeListeners for the given property.booleanhasListeners(String propertyName) Checks whether the given property has been bound to listeners.static PresentationModelCreates an instance given an owner and no roles.static PresentationModelCreates an instance given an owner and a single role.static PresentationModelof(Object owner, Collection<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, Collection<Object> roles) Creates an instance from an owner which might have thePresentablerole.voidRemoves aPropertyChangeListener.voidremovePropertyChangeListener(String propertyName, PropertyChangeListener listener) Removes aPropertyChangeListenerfor the given property.
-
Field Details
-
PresentationModel
-
_SimpleCompositeOfPresentationModel_
-
PROPERTY_CHILDREN
- See Also:
-
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:
-
-
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 aPropertyChangeListenerfor 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 aPropertyChangeListenerfor 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:
trueif the property is bound
-
getPropertyChangeListeners
Returns all the boundPropertyChangeListeners.- Returns:
- the listeners
-
getPropertyChangeListeners
Returns the boundPropertyChangeListeners 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 orRoleFactoryinstances- 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 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
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
-