@Singleton public class AppControllerImpl extends Object implements AppController, LocationChangedEvent.Handler, LocationChangeRequestedEvent.Handler
AppController
.
The App controller that manages the lifecycle of running apps and raises callbacks to the app.
It provides methods to start, stop and focus already running App
s.
Registers handlers to the following location change events triggered by the LocationController
:
LocationController
,
AppContext
,
App
Constructor and Description |
---|
AppControllerImpl(info.magnolia.module.ModuleRegistry moduleRegistry,
info.magnolia.objectfactory.ComponentProvider componentProvider,
AppDescriptorRegistry appDescriptorRegistry,
LocationController locationController,
info.magnolia.event.EventBus admincentralEventBus,
MessagesManager messagesManager,
info.magnolia.i18nsystem.SimpleTranslator i18n) |
Modifier and Type | Method and Description |
---|---|
void |
focusCurrentApp() |
Location |
getAppLocation(String appName)
Returns the current location of a running app instance or null, if it is not running.
|
App |
getCurrentApp() |
Location |
getCurrentAppLocation()
Returns the current location of the focused app.
|
boolean |
isAppStarted(String appName) |
void |
onLocationChanged(LocationChangedEvent event)
|
void |
onLocationChangeRequested(LocationChangeRequestedEvent event) |
void |
openChooseDialog(String appName,
UiContext uiContext,
String selectedId,
ChooseDialogCallback callback) |
void |
openChooseDialog(String appName,
UiContext uiContext,
String targetTreeRootPath,
String selectedId,
ChooseDialogCallback callback) |
void |
setViewport(Viewport viewport) |
App |
startIfNotAlreadyRunning(String appName,
Location location)
Deprecated.
|
App |
startIfNotAlreadyRunningThenFocus(String appName,
Location location)
This method can be called to launch an
App and then delegate it to the LocationController . |
void |
stopApp(String appName) |
void |
stopCurrentApp() |
@Inject public AppControllerImpl(info.magnolia.module.ModuleRegistry moduleRegistry, info.magnolia.objectfactory.ComponentProvider componentProvider, AppDescriptorRegistry appDescriptorRegistry, LocationController locationController, @Named(value="admincentral") info.magnolia.event.EventBus admincentralEventBus, MessagesManager messagesManager, info.magnolia.i18nsystem.SimpleTranslator i18n)
public void setViewport(Viewport viewport)
setViewport
in interface AppController
public App startIfNotAlreadyRunningThenFocus(String appName, Location location)
App
and then delegate it to the LocationController
.
It should have the same effect as calling the LocationController
directly.appName
- of the App
to start.location
- holds information about the subApp to use and the parameters.@Deprecated public App startIfNotAlreadyRunning(String appName, Location location)
LocationController
.
It will not open in the Viewport
.
This is e.g. used to pass the App
into a dialog and obtain app-specific information from outside the app.
See MGNLUI-379.appName
- of the App
to start.location
- holds information about the subApp to use and the parameters.public void stopApp(String appName)
stopApp
in interface AppController
public void stopCurrentApp()
stopCurrentApp
in interface AppController
public boolean isAppStarted(String appName)
isAppStarted
in interface AppController
public void focusCurrentApp()
focusCurrentApp
in interface AppController
public App getCurrentApp()
getCurrentApp
in interface AppController
public Location getCurrentAppLocation()
getCurrentAppLocation
in interface AppController
LocationController.getWhere()
public Location getAppLocation(String appName)
getAppLocation
in interface AppController
public void onLocationChanged(LocationChangedEvent event)
LocationChangedEvent
s by:
AppDescriptor
associated with the Location
.AppContext
if not running, otherwise obtain it from the running apps.AppContext
to the appHistory.onLocationChanged
in interface LocationChangedEvent.Handler
public void onLocationChangeRequested(LocationChangeRequestedEvent event)
onLocationChangeRequested
in interface LocationChangeRequestedEvent.Handler
public void openChooseDialog(String appName, UiContext uiContext, String selectedId, ChooseDialogCallback callback)
openChooseDialog
in interface AppController
public void openChooseDialog(String appName, UiContext uiContext, String targetTreeRootPath, String selectedId, ChooseDialogCallback callback)
openChooseDialog
in interface AppController
Copyright © 2017 Magnolia International Ltd.. All rights reserved.