Views
Lifecycle
You can register a PageComponentListener to an ApplicationPage. The PageComponentListener interface has four methods to interact with the lifecycle of your view:
- componentOpened: called when the View is opened
- componentFocusGained: called when the View gained foucs
- componentFocusLost: called when the View lost focus
- componentClosed: called when the View is closed
Inside your view implementation:
getContext().getPage().addPageComponentListener(aPageComponentListener);
Integration with the Window Menu and Toolbar
There are several global actions defined, they are always visible in the window menu, and delegate their implementation to the active PageComponent. These implementations are provided by ActionCommandExecutor implementations.
Example
private class DeleteCommandExecutor extends AbstractActionCommandExecutor {
public void execute() {
}
}
To register your ActionCommandExecutor implementation, it has to be registered in the registerLocalCommandExecutors method.
protected void setGlobalCommandExecutors(ViewContext context) {
context.register(GlobalCommandIds.DELETE, deleteCommand);
}
If the user presses the delete key (which is the accelerator of the global delete action), the local implementation will be executed.
Integration with other Views
State Persistence