]> gerrit.simantics Code Review - simantics/sysdyn.git/commitdiff
Chart editor that displays a chart when it is double-clicked on model browser (fixes...
authorlempinen <lempinen@ac1ea38d-2e2b-0410-8846-a27921b304fc>
Thu, 6 Jun 2013 09:33:02 +0000 (09:33 +0000)
committerlempinen <lempinen@ac1ea38d-2e2b-0410-8846-a27921b304fc>
Thu, 6 Jun 2013 09:33:02 +0000 (09:33 +0000)
git-svn-id: https://www.simantics.org/svn/simantics/sysdyn/trunk@27511 ac1ea38d-2e2b-0410-8846-a27921b304fc

org.simantics.sysdyn.ui/plugin.xml
org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/trend/TrendEditor.java [new file with mode: 0644]

index f838fc80c03c323950643a106e4357d1cf045742..3ca2664afd2da0b23ff2381ae08fd6535a13b9af 100644 (file)
             class="org.simantics.sysdyn.ui.modelica.SysdynModelicaEditor"\r
             contributorClass="org.simantics.sysdyn.ui.modelica.TextEditorActionBarContributor"\r
             default="false"\r
+            icon="platform:/plugin/com.famfamfam.silk/icons/page_white_text.png"\r
             id="org.simantics.sysdyn.ui.modelicaEditor"\r
             name="Modelica code viewer">\r
       </editor>\r
+      <editor\r
+            class="org.simantics.sysdyn.ui.trend.TrendEditor"\r
+            default="false"\r
+            icon="platform:/plugin/com.famfamfam.silk/icons/chart_line.png"\r
+            id="org.simantics.sysdyn.ui.jfreeChartEditor"\r
+            name="Chart Viewer">\r
+      </editor>\r
    </extension>\r
    <extension\r
          point="org.simantics.ui.resourceEditorAdapter">\r
             priority="2"\r
             type_uris="http://www.simantics.org/Sysdyn-0.0/Configuration">\r
       </adapter>\r
+      <adapter\r
+            editorId="org.simantics.sysdyn.ui.jfreeChartEditor"\r
+            priority="2"\r
+            type_uris="http://www.simantics.org/JFreeChart-0.0/Chart">\r
+      </adapter>\r
    </extension>\r
    <extension\r
          point="org.eclipse.ui.views">\r
diff --git a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/trend/TrendEditor.java b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/trend/TrendEditor.java
new file mode 100644 (file)
index 0000000..258bae5
--- /dev/null
@@ -0,0 +1,32 @@
+/*******************************************************************************\r
+ * Copyright (c) 2013 Association for Decentralized Information Management in\r
+ * Industry THTH ry.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ *     Semantum Oy - initial API and implementation\r
+ *******************************************************************************/\r
+package org.simantics.sysdyn.ui.trend;\r
+\r
+import org.eclipse.swt.SWT;\r
+import org.eclipse.swt.widgets.Composite;\r
+import org.simantics.jfreechart.chart.ChartComposite;\r
+import org.simantics.ui.workbench.ResourceEditorPart;\r
+\r
+public class TrendEditor extends ResourceEditorPart {\r
+\r
+    private ChartComposite chart;\r
+    \r
+    @Override\r
+    public void createPartControl(Composite parent) {\r
+        chart = new ChartComposite(parent, getResourceInput().getResource(), SWT.NONE);\r
+    }\r
+\r
+    @Override\r
+    public void setFocus() {\r
+        chart.forceFocus();\r
+    }\r
+}\r