Dashboard > Spring Rich Client Project (Spring Rich) > User Documentation > Views
  Spring Rich Client Project (Spring Rich) Log In View a printable version of the current page.  
  Views
Added by Peter De Bruycker, last edited by Kevin Stembridge on Jan 16, 2007  (view change)
Labels: 
(None)

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() {
        // your logic goes here
    }
}

To register your ActionCommandExecutor implementation, it has to be registered in the registerLocalCommandExecutors method.

protected void setGlobalCommandExecutors(ViewContext context) {
    // register the DeleteCommandExecutor instance to the 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

Site running on a free Atlassian Confluence Open Source Project License granted to Spring Framework. Evaluate Confluence today.
Powered by Atlassian Confluence, the Enterprise Wiki. (Version: 2.5.5 Build:#811 Jul 25, 2007) - Bug/feature request - Contact Administrators