The mechanism of presentations allows users to manage component display settings.
Capabilities:
-
Saving presentations using their unique names
-
Editing and removing presentations
-
Fast switching between presentations
-
Setting up a default presentation, which will be applied when a screen with a component opens
-
Auto saving for security controls in an active presentation
-
Global presentations, which can be accessed by any system user
Classes and Interfaces
In order to use presentations, a component class should implement a com.haulmont.cuba.gui.components.Component.HasPresentations
interface. In the platform, these components are:
Presentation
− POJO presentation object.
Presentations
contains a list of component's presentations and a set of methods to work with them. Main methods:
-
getCurrent()
− returns current presentation ornull
, if presentation is not defined -
setCurrent(Presentation p)
− sets an active presentation -
getSettings(Presentation p)
− returns an XML-element with display settings for the current presentation -
setSettings(Presentation p, Element e)
− modifies display settings for the specified presentation -
getPresentation(Object id)
− returns a presentation based on its identifier -
getPresentations()
− returns a list of presentations identifiers for the given component -
commit()
− saves presentations to the database
PresentationsImpl
− element implementation Presentations
.
PresentationsChangeListener
− a listener interface tracking presentation changes.
In order to create, change or remove global presentations, user should have rights to cuba.gui.presentations.global. More details are available in the CUBA Platform Manual. Security Subsystem.