Nuxeo Enterprise Platform 5.4

org.nuxeo.ecm.gwt.runtime.client.ui
Interface Site

All Known Implementing Classes:
EditorSite, ViewPageSite, ViewSite

public interface Site

Defines an site for a view. This is an abstract concept that helps to separate the logical part of managing views from the widget management.

Widget frameworks must implement the Container class in order to be able to interact with view sites.

A site defines the place where the view will be placed. This 'place' can have a title and an icon. For example it can be a TAB in a tabbed view or a SECTION in an accordion view.

When a site will open an input object the view will be initialized with that input and the container updated if the title or icon changed.

A site is keeping a reference to the underlying data (that can be an widget or a data object) through the handle member. The handle is created by the container when the site will be installed into the container.

Author:
Bogdan Stefanescu

Method Summary
 void activate()
          Activate this site.
 void close()
          Close this site.
 void deactivate()
          Deactivate this site.
 void disable()
          Disable this site.
 void enable()
          Enable this site.
 java.lang.Object getHandle()
          The handle is an object created by the underlying widget framework and is used to associate a view site with a real widget.
 java.lang.String getIcon()
          Gets the icon to be used for that site.
 java.lang.String getName()
          Gets the site name.
 java.lang.String getTitle()
          Gets the title to be used for this site.
 View getView()
          Gets the view attached to that site.
 boolean isActive()
          Whether or not this view is activated.
 boolean isEnabled()
          Whether or not this site is enabled.
 void open(Container container, java.lang.Object input)
          Opens an input in that site.
 void updateIcon()
          Ask the site to update its icon based on its view icon.
 void updateTitle()
          Ask the site to update its title based on its view title.
 void updateWidget()
          Ask the site to update its widget based on its view widget.
 

Method Detail

getName

java.lang.String getName()
Gets the site name.

Returns:
the site name

getHandle

java.lang.Object getHandle()
The handle is an object created by the underlying widget framework and is used to associate a view site with a real widget. The handle will be created by a Container object that is connected to the view manager. The type of the handle is specific to each UI implementation

Returns:
the handle. can be null if the handle was not yet initialized

getView

View getView()
Gets the view attached to that site.


getTitle

java.lang.String getTitle()
Gets the title to be used for this site. This is generally asking the view to get a title based on the current input.

Returns:
the title, or the site name if none

getIcon

java.lang.String getIcon()
Gets the icon to be used for that site. This is generally asking the view to get an icon based on the current input.

Returns:
the icon or null if none

open

void open(Container container,
          java.lang.Object input)
Opens an input in that site.

The connection to the container will be created if it is not yet existing. In that case the container will create a handle for that site.

Then the view is asked if it is accepting the input. If not the container will be asked to hide this site.

If the view is accepting the input it will be installed in the container if it is not installed.

Then the view will have its input refreshed which may trigger UI updates like view content, title or icon.

The site is remembering its container so that methods like enable() or activate() can be called later.


updateTitle

void updateTitle()
Ask the site to update its title based on its view title. This will trigger a View.getTitle() operation.


updateIcon

void updateIcon()
Ask the site to update its icon based on its view icon. This will trigger a View.getIcon() operation.


updateWidget

void updateWidget()
Ask the site to update its widget based on its view widget. This will trigger a Drawable.getWidget() operation.


enable

void enable()
Enable this site. This will ask the container to enable the site. How enablement affect widget state is up to the container implementation. The container may show/hide the widget or may disable/enable it.


disable

void disable()
Disable this site. This will ask the container to disable the site. How enablement affect widget state is up to the container implementation. The container may show/hide the widget or may disable/enable it.


activate

void activate()
Activate this site. This will ask the container to activate the site. Activating means selecting the site. In a tab view it means selecting the site tab, in an accordion view it means expanding the site section.


deactivate

void deactivate()
Deactivate this site. This will ask the container to deactivate the site. Deactivating means deselecting the site. In a tab view it means deselecting the site tab, in an accordion view it means collapsing the site section.


close

void close()
Close this site. After a site was closed it cannot be reused (a new one will be created). This can be used for example in tab views that support closeable tabs.


isActive

boolean isActive()
Whether or not this view is activated.


isEnabled

boolean isEnabled()
Whether or not this site is enabled.


Nuxeo Enterprise Platform 5.4

Copyright © 2010 Nuxeo SAS. All Rights Reserved.