.newTopLevelMenu( "Home" )
.respondsWith( new Command() {
@Override
public void execute() {
if ( defaultPerspective != null ) {
placeManager.goTo( new DefaultPlaceRequest( defaultPerspective.getIdentifier() ) );
} else {
Window.alert( "Default perspective not found." );
}
}
} )
.endMenu()
.newTopLevelMenu( "Perspectives" )
.withItems( getPerspectives() )
.endMenu()
.newTopLevelMenu( "Logout" )
.respondsWith( new Command() {
@Override
public void execute() {
redirect( GWT.getModuleBaseURL() + "uf_logout" );
}
} )
.endMenu()
.newTopLevelMenu( "Find" )
.position( MenuPosition.RIGHT )
.respondsWith( new Command() {
@Override
public void execute() {
placeManager.goTo( "FindForm" );
}
} )
.endMenu()
.newSearchItem( "Search..." )
.position( MenuPosition.RIGHT )
.respondsWith( new MenuSearchItem.SearchCommand() {
@Override
public void execute( final String term ) {
placeManager.goTo( new DefaultPlaceRequest( "FullTextSearchForm" ).addParameter( "term", term ) );
}
} )
.endMenu()
.build();