info.magnolia.ui.framework.app
Class BaseSubApp

java.lang.Object
  extended by info.magnolia.ui.framework.app.BaseSubApp
All Implemented Interfaces:
SubApp
Direct Known Subclasses:
AboutMainSubApp, BrowserSubApp, DetailSubApp, EmbeddedPageSubApp, MessagesMainSubApp, PagesEditorSubApp, SampleEditorSubApp, SampleMainSubApp

public class BaseSubApp
extends Object
implements SubApp

Basic implementation of a subApp with default behavior suitable for most sub apps.

See Also:
SubApp

Constructor Summary
protected BaseSubApp(SubAppContext subAppContext, View view)
           
 
Method Summary
 AppContext getAppContext()
           
 String getCaption()
          This method will try to determine the current sub app caption, the one usually displayed in the tab where the subapp opens.
protected  Location getCurrentLocation()
           
 SubAppContext getSubAppContext()
           
 String getSubAppId()
           
 View getView()
           
 boolean isCloseable()
           
 void locationChanged(Location location)
           
protected  void onSubAppStart()
          This hook-up method is called on start(info.magnolia.ui.api.location.Location) and enables subclasses to perform additional work before the view is displayed.
protected  void onSubAppStop()
          This hook-up method is called on stop() and enables subclasses to perform additional work when stopping the subApp.
 View start(Location location)
           
 void stop()
           
 boolean supportsLocation(Location location)
          This method is being called by the AppController when iterating over opened subApps.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BaseSubApp

protected BaseSubApp(SubAppContext subAppContext,
                     View view)
Method Detail

start

public View start(Location location)
Specified by:
start in interface SubApp

stop

public void stop()
Specified by:
stop in interface SubApp

locationChanged

public void locationChanged(Location location)
Specified by:
locationChanged in interface SubApp

supportsLocation

public boolean supportsLocation(Location location)
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

onSubAppStart

protected void onSubAppStart()
This hook-up method is called on start(info.magnolia.ui.api.location.Location) and enables subclasses to perform additional work before the view is displayed. The default implementation does nothing.


onSubAppStop

protected void onSubAppStop()
This hook-up method is called on stop() and enables subclasses to perform additional work when stopping the subApp. The default implementation does nothing.


getSubAppContext

public SubAppContext getSubAppContext()

getSubAppId

public String getSubAppId()
Specified by:
getSubAppId in interface SubApp

getView

public View getView()
Specified by:
getView in interface SubApp

getAppContext

public AppContext getAppContext()

getCaption

public String getCaption()
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
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.

getCurrentLocation

protected Location getCurrentLocation()

isCloseable

public boolean isCloseable()
Specified by:
isCloseable in interface SubApp


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