info.magnolia.ui.contentapp.detail
Class DetailSubApp

java.lang.Object
  extended by info.magnolia.ui.framework.app.BaseSubApp
      extended by info.magnolia.ui.contentapp.detail.DetailSubApp
All Implemented Interfaces:
SubApp

public class DetailSubApp
extends BaseSubApp

Base implementation of an item subApp. Provides sensible implementation for services shared by all item subApps. Implementers of this class represent a tab for viewing and editing items typically opened from an BrowserSubApp. Subclasses can augment the default behavior and perform additional tasks by overriding the following methods:

Currently lacking listeners for ContentChangedEvent. Currently lacking handling of locationChanged. Related to MGNLUI-154

See Also:
DetailEditorPresenter, ContentSubAppView, DetailLocation

Constructor Summary
protected DetailSubApp(SubAppContext subAppContext, ContentSubAppView view, info.magnolia.event.EventBus adminCentralEventBus, DetailEditorPresenter workbench, info.magnolia.i18nsystem.SimpleTranslator i18n)
           
 
Method Summary
protected  String getBaseCaption(DetailLocation location)
          Create the base caption string.
 String getCaption()
          This method will try to determine the current sub app caption, the one usually displayed in the tab where the subapp opens.
 DetailLocation getCurrentLocation()
          Wraps the current DefaultLocation in a ItemLocation.
 ContentSubAppView getView()
           
protected  String getWorkspace()
           
 void locationChanged(Location location)
          On location change, reload the view and tab caption.
protected  void setCaption(DetailLocation location)
          Set the Tab caption.
 View start(Location location)
          Performs some routine tasks needed by all item subApps before the view is displayed.
 boolean supportsLocation(Location location)
          This method is being called by the AppController when iterating over opened subApps.
 
Methods inherited from class info.magnolia.ui.framework.app.BaseSubApp
getAppContext, getSubAppContext, getSubAppId, isCloseable, onSubAppStart, onSubAppStop, stop
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DetailSubApp

@Inject
protected DetailSubApp(SubAppContext subAppContext,
                              ContentSubAppView view,
                              @Named(value="admincentral")
                              info.magnolia.event.EventBus adminCentralEventBus,
                              DetailEditorPresenter workbench,
                              info.magnolia.i18nsystem.SimpleTranslator i18n)
Method Detail

start

public View start(Location location)
Performs some routine tasks needed by all item subApps before the view is displayed. The tasks are:

Specified by:
start in interface SubApp
Overrides:
start in class BaseSubApp

getCurrentLocation

public DetailLocation getCurrentLocation()
Wraps the current DefaultLocation in a ItemLocation. Providing getter and setters for used parameters.

Overrides:
getCurrentLocation in class BaseSubApp

getView

public ContentSubAppView getView()
Specified by:
getView in interface SubApp
Overrides:
getView in class BaseSubApp

supportsLocation

public boolean supportsLocation(Location location)
Description copied from class: BaseSubApp
This method is being called by the AppController when iterating over opened subApps. The subApp itself decides whether it supports the current location based on parameters or whether the appController should launch a new instance of the subApp.

Specified by:
supportsLocation in interface SubApp
Overrides:
supportsLocation in class BaseSubApp

locationChanged

public void locationChanged(Location location)
On location change, reload the view and tab caption.

Specified by:
locationChanged in interface SubApp
Overrides:
locationChanged in class BaseSubApp

getCaption

public String getCaption()
Description copied from class: BaseSubApp
This method will try to determine the current sub app caption, the one usually displayed in the tab where the subapp opens.

Specified by:
getCaption in interface SubApp
Overrides:
getCaption in class BaseSubApp
Returns:
the configured label for this subapp. If no label is found in the subapp configuration, it will try to use the label from the parent app. If the latter is missing too, it will return an empty string.

getWorkspace

protected String getWorkspace()

setCaption

protected void setCaption(DetailLocation location)
Set the Tab caption. If a version is part of the DetailLocation, add this version information to the Tab caption.


getBaseCaption

protected String getBaseCaption(DetailLocation location)
Create the base caption string. Default is the item path.



Copyright © 2013 Magnolia International Ltd.. All Rights Reserved.