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);
}
}
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");
}
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");
}
Aggregations