Skip to content

Commit

Permalink
add control perspective
Browse files Browse the repository at this point in the history
  • Loading branch information
nxi committed Sep 3, 2024
1 parent 17f5724 commit fe3f572
Show file tree
Hide file tree
Showing 3 changed files with 90 additions and 0 deletions.
7 changes: 7 additions & 0 deletions bragg/nbi/au.gov.ansto.bragg.nbi.ui/plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,13 @@
fixed="true"
name="SICS Experiment">
</perspective>
<perspective
class="au.gov.ansto.bragg.nbi.ui.internal.ControlExperimentPerspective"
icon="icons/reports_stack.png"
id="au.gov.ansto.bragg.nbi.ui.ControlExperimentPerspective"
fixed="true"
name="Control Experiment">
</perspective>
<perspective
class="au.gov.ansto.bragg.nbi.ui.internal.EmptyPerspective"
id="au.gov.ansto.bragg.nbi.ui.EmptyPerspective"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
/*******************************************************************************
* Copyright (c) 2007 Australian Nuclear Science and Technology Organisation.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Norman Xiong (Bragg Institute) - initial API and implementation
*******************************************************************************/
package au.gov.ansto.bragg.nbi.ui.internal;

import org.eclipse.ui.IPageLayout;
import org.eclipse.ui.IPerspectiveFactory;

public class ControlExperimentPerspective implements IPerspectiveFactory {

public static final String CONTROL_EXPERIMENT_PERSPECTIVE_ID = "au.gov.ansto.bragg.nbi.ui.ControlExperimentPerspective";
public static final String CONTROL_TABLE_VIEW_ID = "org.gumtree.control.ui.ControlTableView";
public static final String CONTROL_BATCH_RUNNER_VIEW_ID = "org.gumtree.control.ui.batchScriptManagerView";
public static final String CONTROL_TERMINAL_VIEW_ID = "org.gumtree.control.ui.ControlTerminalView";
public static final String PROJECT_EXPLORER_VIEW_ID = "org.eclipse.ui.navigator.ProjectExplorer";
public static final String ID_VIEW_ACTIVITY_MONITOR = "au.gov.ansto.bragg.nbi.ui.SicsRealtimeDataView";

public void createInitialLayout(final IPageLayout factory) {
factory.addShowViewShortcut(CONTROL_BATCH_RUNNER_VIEW_ID);
factory.addShowViewShortcut(CONTROL_TERMINAL_VIEW_ID);
factory.addShowViewShortcut(PROJECT_EXPLORER_VIEW_ID);

factory.addPerspectiveShortcut(CONTROL_EXPERIMENT_PERSPECTIVE_ID);

// IFolderLayout bottomRight =
// factory.createFolder(
// "bottomRight", //NON-NLS-1
// IPageLayout.BOTTOM,
// 0.70f,
// factory.getEditorArea());
// bottomRight.addView(CONTROL_TERMINAL_VIEW_ID);
factory.addView(CONTROL_TERMINAL_VIEW_ID, IPageLayout.BOTTOM, 0.70f, factory.getEditorArea());

// IFolderLayout bottomLeft =
// factory.createFolder(
// "bottomLeft", //NON-NLS-1
// IPageLayout.LEFT,
// 0.33f,
// "bottomRight");
// bottomLeft.addView(PROJECT_EXPLORER_VIEW_ID);
factory.addStandaloneView(PROJECT_EXPLORER_VIEW_ID, false, IPageLayout.LEFT, 0.33f, CONTROL_TERMINAL_VIEW_ID);

// IFolderLayout right =
// factory.createFolder(
// "right",
// IPageLayout.RIGHT,
// 0.50f,
// factory.getEditorArea());
// right.addView(CONTROL_BATCH_RUNNER_VIEW_ID);
factory.addStandaloneView(CONTROL_BATCH_RUNNER_VIEW_ID, false, IPageLayout.RIGHT, 0.4f, factory.getEditorArea());

factory.addStandaloneView(CONTROL_TABLE_VIEW_ID, false, IPageLayout.RIGHT, 0.4f, factory.getEditorArea());

factory.addStandaloneView(ID_VIEW_ACTIVITY_MONITOR, false, IPageLayout.RIGHT, 0.50f, CONTROL_TERMINAL_VIEW_ID);

factory.setEditorAreaVisible(false);
factory.getViewLayout(CONTROL_TERMINAL_VIEW_ID).setCloseable(false);
factory.getViewLayout(CONTROL_TERMINAL_VIEW_ID).setMoveable(false);
// factory.getViewLayout("bottomLeft").setMoveable(false);
// factory.getViewLayout("bottomLeft").setCloseable(false);
// factory.getViewLayout("right").setMoveable(false);
// factory.getViewLayout("right").setCloseable(false);

factory.setFixed(true);
}


}
8 changes: 8 additions & 0 deletions framework/sics/org.gumtree.control.ui/plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,14 @@
name="Batch Script Manager"
restorable="true">
</view>
<view
category="org.gumtree.control.ui"
class="org.gumtree.control.ui.ControlTerminalView"
icon="icons/terminal.png"
id="org.gumtree.control.ui.ControlTerminalView"
name="Control Terminal View"
restorable="true">
</view>
</extension>
<extension
point="org.gumtree.ui.communicationAdapters">
Expand Down

0 comments on commit fe3f572

Please sign in to comment.