From: lempinen Date: Wed, 10 Mar 2010 09:42:23 +0000 (+0000) Subject: Tables in shortcut tabs have data field. The content of the data field is inserted... X-Git-Tag: simantics-1.0~46 X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=commitdiff_plain;h=bbddfa5322d8af6d438bea35d8f594888156cd68;p=simantics%2Fsysdyn.git Tables in shortcut tabs have data field. The content of the data field is inserted to expressions git-svn-id: https://www.simantics.org/svn/simantics/sysdyn/trunk@14749 ac1ea38d-2e2b-0410-8846-a27921b304fc --- diff --git a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/equation/EquationView.java b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/equation/EquationView.java index ad4630e0..ff8e7547 100644 --- a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/equation/EquationView.java +++ b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/equation/EquationView.java @@ -299,7 +299,7 @@ public class EquationView extends ViewPart implements ISelectionListener { public void mouseDoubleClick(MouseEvent e) { TableItem item = table.getItem(new Point(e.x, e.y)); if(item != null) { - final String var = item.getText(); + final String var = (String)item.getData(); table.getDisplay().asyncExec(new Runnable() { @Override diff --git a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/equation/ShortcutTabs.java b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/equation/ShortcutTabs.java index 8e69426f..d256d019 100644 --- a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/equation/ShortcutTabs.java +++ b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/equation/ShortcutTabs.java @@ -46,13 +46,17 @@ public class ShortcutTabs extends Composite { functions.setText("Functions"); functionTable = new Table (tabFolder, SWT.SINGLE | SWT.BORDER | SWT.FULL_SELECTION); TableItem item = new TableItem(functionTable, SWT.NONE); - item.setText("min({ })"); + item.setText("min()"); + item.setData("min({ })"); item = new TableItem(functionTable, SWT.NONE); - item.setText("max({ })"); + item.setText("max()"); + item.setData("max({ })"); item = new TableItem(functionTable, SWT.NONE); - item.setText("abs({ })"); + item.setText("abs()"); + item.setData("abs({ })"); item = new TableItem(functionTable, SWT.NONE); item.setText("if then else"); + item.setData("if then else"); functions.setControl(functionTable); this.layout(); @@ -65,6 +69,7 @@ public class ShortcutTabs extends Composite { for(String d : dependencies) { item = new TableItem(variableTable, SWT.NONE); item.setText(d); + item.setData(d); } return dependencies; }