Search in sources :

Example 1 with WorkspacePresenter

use of org.eclipse.che.ide.workspace.WorkspacePresenter in project che by eclipse.

the class WorkspacePresenterPersistenceTest method setUp.

@Before
public void setUp() throws Exception {
    Map<String, Perspective> map = new HashMap<>();
    map.put("perspective1", perspective1);
    map.put("perspective2", perspective2);
    perspectiveManager = new PerspectiveManager(map, "perspective1");
    when(perspectiveManagerProvider.get()).thenReturn(perspectiveManager);
    presenter = new WorkspacePresenter(workspaceView, perspectiveManagerProvider, mainMenuPresenter, statusPanelGroupPresenter, toolbarPresenter, "perspective1");
}
Also used : PerspectiveManager(org.eclipse.che.ide.api.parts.PerspectiveManager) WorkspacePresenter(org.eclipse.che.ide.workspace.WorkspacePresenter) Perspective(org.eclipse.che.ide.api.parts.Perspective) HashMap(java.util.HashMap) Before(org.junit.Before)

Example 2 with WorkspacePresenter

use of org.eclipse.che.ide.workspace.WorkspacePresenter in project che by eclipse.

the class BootstrapController method displayIDE.

private void displayIDE() {
    // Start UI
    SimpleLayoutPanel mainPanel = new SimpleLayoutPanel();
    RootLayoutPanel.get().add(mainPanel);
    // Make sure the root panel creates its own stacking context
    RootLayoutPanel.get().getElement().getStyle().setZIndex(0);
    WorkspacePresenter workspacePresenter = workspaceProvider.get();
    // Display IDE
    workspacePresenter.go(mainPanel);
    // Bind browser's window events
    Window.addWindowClosingHandler(new Window.ClosingHandler() {

        @Override
        public void onWindowClosing(Window.ClosingEvent event) {
            eventBus.fireEvent(WindowActionEvent.createWindowClosingEvent(event));
        }
    });
    Window.addCloseHandler(new CloseHandler<Window>() {

        @Override
        public void onClose(CloseEvent<Window> event) {
            eventBus.fireEvent(WindowActionEvent.createWindowClosedEvent());
        }
    });
}
Also used : Window(com.google.gwt.user.client.Window) WorkspacePresenter(org.eclipse.che.ide.workspace.WorkspacePresenter) SimpleLayoutPanel(com.google.gwt.user.client.ui.SimpleLayoutPanel)

Aggregations

WorkspacePresenter (org.eclipse.che.ide.workspace.WorkspacePresenter)2 Window (com.google.gwt.user.client.Window)1 SimpleLayoutPanel (com.google.gwt.user.client.ui.SimpleLayoutPanel)1 HashMap (java.util.HashMap)1 Perspective (org.eclipse.che.ide.api.parts.Perspective)1 PerspectiveManager (org.eclipse.che.ide.api.parts.PerspectiveManager)1 Before (org.junit.Before)1