Interface PresentationModel

All Superinterfaces:
As

public interface PresentationModel extends 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
  • Field Details

  • Method Details

    • dispose

      void dispose()
      Disposes this object.
    • addPropertyChangeListener

      void addPropertyChangeListener(@Nonnull PropertyChangeListener listener)
      Parameters:
      listener - the listener
    • addPropertyChangeListener

      void addPropertyChangeListener(@Nonnull String propertyName, @Nonnull PropertyChangeListener listener)
      Adds a PropertyChangeListener for the given property.
      Parameters:
      propertyName - the name of the property
      listener - the listener
    • removePropertyChangeListener

      void removePropertyChangeListener(@Nonnull PropertyChangeListener listener)
      Parameters:
      listener - the listener
    • removePropertyChangeListener

      void removePropertyChangeListener(@Nonnull String propertyName, @Nonnull PropertyChangeListener listener)
      Removes a PropertyChangeListener for the given property.
      Parameters:
      propertyName - the name of the property
      listener - the listener
    • hasListeners

      boolean hasListeners(@Nonnull 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 PropertyChangeListener[] getPropertyChangeListeners()
      Returns all the bound PropertyChangeListeners.
      Returns:
      the listeners
    • getPropertyChangeListeners

      @Nonnull PropertyChangeListener[] getPropertyChangeListeners(@Nonnull String propertyName)
      Returns the bound PropertyChangeListeners for the given property.
      Parameters:
      propertyName - the name of the property
      Returns:
      the listeners
    • of

      @Nonnull static PresentationModel of(@Nonnull 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 Object owner, @Nonnull Object role)
      Creates an instance given an owner and a single role.
      Parameters:
      owner - the owner
      role - the role (or a RoleFactory)
      Returns:
      the new instance
      Since:
      3.2-ALPHA-3
    • of

      @Nonnull static PresentationModel of(@Nonnull Object owner, @Nonnull Collection<Object> roles)
      Creates an instance given an owner and multiple roles.
      Parameters:
      owner - the owner
      roles - roles or RoleFactory 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 dummy Displayable).
      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 the Presentable role. If it is present, it is called to create the PresentationModel; otherwise a default one is created. Additional roles are added.
      Parameters:
      owner - the owner
      roles - roles or RoleFactory 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 the Presentable role. If it is present, it is called to create the PresentationModel; otherwise a default one is created.
      Parameters:
      owner - the owner
      Returns:
      the new instance
      Since:
      3.2-ALPHA-8