]> gerrit.simantics Code Review - simantics/sysdyn.git/commitdiff
Tables in shortcut tabs have data field. The content of the data field is inserted...
authorlempinen <lempinen@ac1ea38d-2e2b-0410-8846-a27921b304fc>
Wed, 10 Mar 2010 09:42:23 +0000 (09:42 +0000)
committerlempinen <lempinen@ac1ea38d-2e2b-0410-8846-a27921b304fc>
Wed, 10 Mar 2010 09:42:23 +0000 (09:42 +0000)
git-svn-id: https://www.simantics.org/svn/simantics/sysdyn/trunk@14749 ac1ea38d-2e2b-0410-8846-a27921b304fc

org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/equation/EquationView.java
org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/equation/ShortcutTabs.java

index ad4630e0908c65ce95fff4474d698ee465a60796..ff8e7547cf9bdc04dafa6c5e656e5330a40f4841 100644 (file)
@@ -299,7 +299,7 @@ public class EquationView extends ViewPart implements ISelectionListener {
                 public void mouseDoubleClick(MouseEvent e) {\r
                     TableItem item = table.getItem(new Point(e.x, e.y));\r
                     if(item != null) {\r
-                        final String var = item.getText();\r
+                        final String var = (String)item.getData();\r
                         table.getDisplay().asyncExec(new Runnable() {\r
 \r
                             @Override\r
index 8e69426f60fa4152e0d80b3affe9602ecad445d1..d256d01960d7c2b56367bf12bcf4bc63d6d1ccad 100644 (file)
@@ -46,13 +46,17 @@ public class ShortcutTabs extends Composite {
         functions.setText("Functions"); \r
         functionTable = new Table (tabFolder, SWT.SINGLE | SWT.BORDER | SWT.FULL_SELECTION);\r
         TableItem item = new TableItem(functionTable, SWT.NONE);\r
-        item.setText("min({ })");\r
+        item.setText("min()");\r
+        item.setData("min({ })");\r
         item = new TableItem(functionTable, SWT.NONE);\r
-        item.setText("max({ })");\r
+        item.setText("max()");\r
+        item.setData("max({ })");\r
         item = new TableItem(functionTable, SWT.NONE);\r
-        item.setText("abs({ })");\r
+        item.setText("abs()");\r
+        item.setData("abs({ })");\r
         item = new TableItem(functionTable, SWT.NONE);\r
         item.setText("if then else");\r
+        item.setData("if then else");\r
         functions.setControl(functionTable);\r
         \r
         this.layout();\r
@@ -65,6 +69,7 @@ public class ShortcutTabs extends Composite {
         for(String d : dependencies) {\r
             item = new TableItem(variableTable, SWT.NONE);\r
             item.setText(d);\r
+            item.setData(d);\r
         }\r
         return dependencies;\r
     }\r