Search in sources :

Example 1 with PerspectiveManager

use of org.eclipse.che.ide.api.parts.PerspectiveManager in project che by eclipse.

the class AbstractPerspectiveAction method update.

/** {@inheritDoc} */
@Override
public final void update(@NotNull ActionEvent event) {
    PerspectiveManager manager = event.getPerspectiveManager();
    Presentation presentation = event.getPresentation();
    boolean isWorkspaceRunning = false;
    if (appContext != null) {
        Workspace workspace = appContext.getWorkspace();
        isWorkspaceRunning = workspace != null && WorkspaceStatus.RUNNING.equals(workspace.getStatus());
    }
    boolean inPerspective = perspectives == null || perspectives.isEmpty() ? true : perspectives.contains(manager.getPerspectiveId());
    presentation.setEnabledAndVisible(inPerspective && isWorkspaceRunning);
    if (inPerspective && isWorkspaceRunning) {
        updateInPerspective(event);
    }
}
Also used : PerspectiveManager(org.eclipse.che.ide.api.parts.PerspectiveManager) Workspace(org.eclipse.che.api.core.model.workspace.Workspace)

Example 2 with PerspectiveManager

use of org.eclipse.che.ide.api.parts.PerspectiveManager in project che by eclipse.

the class PerspectiveManagerTest method setUp.

@Before
public void setUp() {
    Map<String, Perspective> perspectives = new HashMap<>();
    perspectives.put("Machine Perspective", machinePerspective);
    perspectives.put("Project Perspective", projectPerspective);
    manager = new PerspectiveManager(perspectives, "Project Perspective");
}
Also used : PerspectiveManager(org.eclipse.che.ide.api.parts.PerspectiveManager) Perspective(org.eclipse.che.ide.api.parts.Perspective) HashMap(java.util.HashMap) Before(org.junit.Before)

Example 3 with PerspectiveManager

use of org.eclipse.che.ide.api.parts.PerspectiveManager 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)

Aggregations

PerspectiveManager (org.eclipse.che.ide.api.parts.PerspectiveManager)3 HashMap (java.util.HashMap)2 Perspective (org.eclipse.che.ide.api.parts.Perspective)2 Before (org.junit.Before)2 Workspace (org.eclipse.che.api.core.model.workspace.Workspace)1 WorkspacePresenter (org.eclipse.che.ide.workspace.WorkspacePresenter)1