From cee32ea20496a35193fbe1c49234f18d478fc95c Mon Sep 17 00:00:00 2001 From: lempinen Date: Thu, 6 Jun 2013 09:33:02 +0000 Subject: [PATCH] Chart editor that displays a chart when it is double-clicked on model browser (fixes #4198) git-svn-id: https://www.simantics.org/svn/simantics/sysdyn/trunk@27511 ac1ea38d-2e2b-0410-8846-a27921b304fc --- org.simantics.sysdyn.ui/plugin.xml | 13 ++++++++ .../sysdyn/ui/trend/TrendEditor.java | 32 +++++++++++++++++++ 2 files changed, 45 insertions(+) create mode 100644 org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/trend/TrendEditor.java diff --git a/org.simantics.sysdyn.ui/plugin.xml b/org.simantics.sysdyn.ui/plugin.xml index f838fc80..3ca2664a 100644 --- a/org.simantics.sysdyn.ui/plugin.xml +++ b/org.simantics.sysdyn.ui/plugin.xml @@ -27,9 +27,17 @@ class="org.simantics.sysdyn.ui.modelica.SysdynModelicaEditor" contributorClass="org.simantics.sysdyn.ui.modelica.TextEditorActionBarContributor" default="false" + icon="platform:/plugin/com.famfamfam.silk/icons/page_white_text.png" id="org.simantics.sysdyn.ui.modelicaEditor" name="Modelica code viewer"> + + @@ -43,6 +51,11 @@ priority="2" type_uris="http://www.simantics.org/Sysdyn-0.0/Configuration"> + + 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 index 00000000..258bae53 --- /dev/null +++ b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/trend/TrendEditor.java @@ -0,0 +1,32 @@ +/******************************************************************************* + * Copyright (c) 2013 Association for Decentralized Information Management in + * Industry THTH ry. + * 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: + * Semantum Oy - initial API and implementation + *******************************************************************************/ +package org.simantics.sysdyn.ui.trend; + +import org.eclipse.swt.SWT; +import org.eclipse.swt.widgets.Composite; +import org.simantics.jfreechart.chart.ChartComposite; +import org.simantics.ui.workbench.ResourceEditorPart; + +public class TrendEditor extends ResourceEditorPart { + + private ChartComposite chart; + + @Override + public void createPartControl(Composite parent) { + chart = new ChartComposite(parent, getResourceInput().getResource(), SWT.NONE); + } + + @Override + public void setFocus() { + chart.forceFocus(); + } +} -- 2.47.1