Skip to content
Snippets Groups Projects
Commit 2cbb7540 authored by Nelson Tavares de Sousa's avatar Nelson Tavares de Sousa
Browse files

added teetime perspective

parent 39e4013c
No related branches found
No related tags found
No related merge requests found
...@@ -24,26 +24,4 @@ ...@@ -24,26 +24,4 @@
</command> </command>
</extension> </extension>
<extension
point="org.eclipse.ui.menus">
<menuContribution
locationURI="popup:org.eclipse.ui.popup.any?before=additions">
<command
commandId="teetime.configuration.dsl.klighd.openConfigurationDiagram"
label="Open Configuration diagram"
style="push">
<visibleWhen
checkEnabled="false">
<iterate ifEmpty="false" operator="or">
<or>
<instanceof
value="teetime.configuration.dsl.config.Configuration">
</instanceof>
</or>
</iterate>
</visibleWhen>
</command>
</menuContribution>
</extension>
</plugin> </plugin>
...@@ -59,12 +59,12 @@ public class OpenDiagramHandler extends AbstractHandler { ...@@ -59,12 +59,12 @@ public class OpenDiagramHandler extends AbstractHandler {
IXtextDocument xtextDocument = EditorUtils.getActiveXtextEditor().getDocument(); IXtextDocument xtextDocument = EditorUtils.getActiveXtextEditor().getDocument();
xtextDocument.readOnly(new IUnitOfWork<XtextResource, XtextResource>() { xtextDocument.readOnly(new IUnitOfWork<XtextResource, XtextResource>() {
public XtextResource exec(XtextResource state) throws Exception { public XtextResource exec(XtextResource state) throws Exception {
if (DiagramViewManager.getView("teetime.configuration.dsl.klighd.ConfigurationDiagram") == null) { if (DiagramViewManager.getView(null) == null) {
DiagramViewManager.createView("teetime.configuration.dsl.klighd.ConfigurationDiagram", DiagramViewManager.createView(null,
"Configuration Diagram", state.getContents().get(0), "Configuration Diagram", state.getContents().get(0),
KlighdSynthesisProperties.create()); KlighdSynthesisProperties.create());
} else { } else {
DiagramViewManager.updateView("teetime.configuration.dsl.klighd.ConfigurationDiagram", DiagramViewManager.updateView(null,
"Configuration Diagram", state.getContents().get(0), "Configuration Diagram", state.getContents().get(0),
KlighdSynthesisProperties.create()); KlighdSynthesisProperties.create());
} }
......
teetime.configuration.dsl.ui/icons/new_teetime_file.png

565 B

...@@ -460,4 +460,35 @@ ...@@ -460,4 +460,35 @@
project="false"> project="false">
</wizard> </wizard>
</extension> </extension>
<extension
point="org.eclipse.ui.perspectives">
<perspective
class="teetime.configuration.dsl.ui.perspective.PerspectiveFactory"
icon="icons/sign-16x16.png"
id="teetime.configuration.dsl.ui.perspective"
name="TeeTime">
</perspective>
</extension>
<extension
point="org.eclipse.ui.perspectiveExtensions">
<perspectiveExtension
targetID="teetime.configuration.dsl.ui.perspective">
<view
id="de.cau.cs.kieler.klighd.ui.parts.DiagramViewPart"
minimized="false"
relationship="stack"
relative="bottom">
</view>
<view
id="teetime.configuration.dsl.Config.compare.contentViewers"
minimized="false"
relationship="stack"
relative="top">
</view>
<view
id="org.eclipse.ui.views.ResourceNavigator"
relationship="stack"
relative="left"/>
</perspectiveExtension>
</extension>
</plugin> </plugin>
package teetime.configuration.dsl.ui.perspective;
import org.eclipse.ui.IPageLayout;
import org.eclipse.ui.IPerspectiveFactory;
public class PerspectiveFactory implements IPerspectiveFactory {
@Override
public void createInitialLayout(IPageLayout layout) {
layout.createFolder("left", IPageLayout.LEFT, 0.2f, IPageLayout.ID_EDITOR_AREA);
layout.createFolder("bottom", IPageLayout.BOTTOM, 0.4f, IPageLayout.ID_EDITOR_AREA);
layout.createFolder("top", IPageLayout.TOP, 0.4f, IPageLayout.ID_EDITOR_AREA);
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment