X-Git-Url: https://gerrit.simantics.org/r/gitweb?p=simantics%2Fplatform.git;a=blobdiff_plain;f=bundles%2Forg.simantics.charts%2Fsrc%2Forg%2Fsimantics%2Fcharts%2Feditor%2FPropertiesAction.java;fp=bundles%2Forg.simantics.charts%2Fsrc%2Forg%2Fsimantics%2Fcharts%2Feditor%2FPropertiesAction.java;h=2ec342f369748e635ac5e83dca551f395d87ca37;hp=dd2e92e15f4e5a8d3eae9761073a66db5d608d99;hb=0ae2b770234dfc3cbb18bd38f324125cf0faca07;hpb=24e2b34260f219f0d1644ca7a138894980e25b14 diff --git a/bundles/org.simantics.charts/src/org/simantics/charts/editor/PropertiesAction.java b/bundles/org.simantics.charts/src/org/simantics/charts/editor/PropertiesAction.java index dd2e92e15..2ec342f36 100644 --- a/bundles/org.simantics.charts/src/org/simantics/charts/editor/PropertiesAction.java +++ b/bundles/org.simantics.charts/src/org/simantics/charts/editor/PropertiesAction.java @@ -1,45 +1,45 @@ -package org.simantics.charts.editor; - -import org.eclipse.jface.action.Action; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.Shell; -import org.simantics.charts.ontology.ChartResource; -import org.simantics.charts.ui.ChartDoubleClickHandler; -import org.simantics.db.ReadGraph; -import org.simantics.db.Resource; -import org.simantics.db.exception.DatabaseException; -import org.simantics.db.request.Read; -import org.simantics.ui.SimanticsUI; - -/** - * @author Tuukka Lehtonen - */ -public class PropertiesAction extends Action { - - private Control control; - private Resource component; - - public PropertiesAction(String name, Control control, Resource component) { - super(name); - this.control = control; - this.component = component; - } - - @Override - public void run() { - final Shell shell = control.getShell(); - SimanticsUI.getSession().asyncRequest(new Read() { - @Override - public Object perform(ReadGraph graph) throws DatabaseException { - ChartResource CHART = ChartResource.getInstance(graph); - if ( graph.isInstanceOf(component, CHART.Chart_Item) ) { - ChartDoubleClickHandler.openChartItemPropertiesDialog(graph, component, shell.getDisplay()); - } else - if ( graph.isInstanceOf(component, CHART.Chart) ) { - ChartDoubleClickHandler.openChartPropertiesDialog(graph, component, shell.getDisplay()); - } - return null; - }}); - } - +package org.simantics.charts.editor; + +import org.eclipse.jface.action.Action; +import org.eclipse.swt.widgets.Control; +import org.eclipse.swt.widgets.Shell; +import org.simantics.charts.ontology.ChartResource; +import org.simantics.charts.ui.ChartDoubleClickHandler; +import org.simantics.db.ReadGraph; +import org.simantics.db.Resource; +import org.simantics.db.exception.DatabaseException; +import org.simantics.db.request.Read; +import org.simantics.ui.SimanticsUI; + +/** + * @author Tuukka Lehtonen + */ +public class PropertiesAction extends Action { + + private Control control; + private Resource component; + + public PropertiesAction(String name, Control control, Resource component) { + super(name); + this.control = control; + this.component = component; + } + + @Override + public void run() { + final Shell shell = control.getShell(); + SimanticsUI.getSession().asyncRequest(new Read() { + @Override + public Object perform(ReadGraph graph) throws DatabaseException { + ChartResource CHART = ChartResource.getInstance(graph); + if ( graph.isInstanceOf(component, CHART.Chart_Item) ) { + ChartDoubleClickHandler.openChartItemPropertiesDialog(graph, component, shell.getDisplay()); + } else + if ( graph.isInstanceOf(component, CHART.Chart) ) { + ChartDoubleClickHandler.openChartPropertiesDialog(graph, component, shell.getDisplay()); + } + return null; + }}); + } + } \ No newline at end of file