Skip to content

Instantly share code, notes, and snippets.

@romartin
Created December 21, 2015 17:58
Show Gist options
  • Select an option

  • Save romartin/ca0b826c5762a67ec8d7 to your computer and use it in GitHub Desktop.

Select an option

Save romartin/ca0b826c5762a67ec8d7 to your computer and use it in GitHub Desktop.
/**
* The gallery perspective.
*/
@ApplicationScoped
@WorkbenchPerspective(identifier = "DisplayerGalleryPerspective")
public class DisplayerGalleryPerspective {
@Perspective
public PerspectiveDefinition buildPerspective() {
PanelDefinition west = new PanelDefinitionImpl( StaticWorkbenchPanelPresenter.class.getName() );
west.setWidth(200);
west.setMinWidth(150);
west.addPart("GalleryTreeScreen");
PerspectiveDefinition perspective = new PerspectiveDefinitionImpl(MultiTabWorkbenchPanelPresenter.class.getName());
perspective.setName(AppConstants.INSTANCE.menu_gallery());
perspective.getRoot().insertChild(CompassPosition.WEST, west);
perspective.getRoot().addPart("GalleryHomeScreen");
return perspective;
}
@WorkbenchMenu
public Menus getMenus() {
return MenuFactory
.newTopLevelMenu( "Test" ).respondsWith( new Command() {
@Override
public void execute() {
Window.alert( "Test!" );
}
} )
.endMenu()
.build();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment