]> gerrit.simantics Code Review - simantics/sysdyn.git/commitdiff
Yet another fix for focus problems
authorlempinen <lempinen@ac1ea38d-2e2b-0410-8846-a27921b304fc>
Thu, 20 May 2010 10:51:42 +0000 (10:51 +0000)
committerlempinen <lempinen@ac1ea38d-2e2b-0410-8846-a27921b304fc>
Thu, 20 May 2010 10:51:42 +0000 (10:51 +0000)
git-svn-id: https://www.simantics.org/svn/simantics/sysdyn/trunk@15791 ac1ea38d-2e2b-0410-8846-a27921b304fc

org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/dependencies/DependencyView.java
org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/editor/SysdynDiagramEditor.java

index 4027061f92cde3afa926cf54635edb00c44026ec..bb500430995df6aa1cba1c3443b3fffb081de75c 100644 (file)
@@ -167,9 +167,8 @@ public class DependencyView extends ViewPart {
 \r
     @Override\r
     public void setFocus() {\r
-        Composite c = getBaseComposite();\r
-        if(c != null && !c.isDisposed()) {\r
-            getBaseComposite().setFocus();\r
+        if(baseComposite != null && !baseComposite.isDisposed()) {\r
+            baseComposite.setFocus();\r
             component.setFocus();\r
         }\r
     }\r
@@ -183,9 +182,4 @@ public class DependencyView extends ViewPart {
         getSite().getWorkbenchWindow().getSelectionService().removePostSelectionListener(selectionListener);\r
         disposed = true;\r
     }\r
-\r
-    private Composite getBaseComposite() {\r
-        return this.baseComposite;\r
-    }\r
-\r
 }\r
index 50575fc5db3cdff45562fb232259592eb93e9209..497b8cf9528739a83b144783f5c1dddeda1b2941 100644 (file)
@@ -231,7 +231,7 @@ public class SysdynDiagramEditor extends ResourceEditorPart {
                 canvas = new EditorCanvas(editor);\r
                 frame.add(canvas);\r
 \r
-                getFrameComposite().getDisplay().asyncExec(new Runnable() {  \r
+                frameComposite.getDisplay().asyncExec(new Runnable() {  \r
                     @Override\r
                     public void run() {\r
                         setFocus();\r
@@ -246,11 +246,11 @@ public class SysdynDiagramEditor extends ResourceEditorPart {
                         final ArrayList<Resource> resources = new ArrayList<Resource>(selection.size());\r
                         for(IElement element : selection)\r
                             resources.add(mapping.inverseGet(element));\r
-                        getFrameComposite().getDisplay().asyncExec(new Runnable() {\r
+                        frameComposite.getDisplay().asyncExec(new Runnable() {\r
 \r
                             @Override\r
                             public void run() {\r
-                                if(!getFrameComposite().isDisposed())\r
+                                if(!frameComposite.isDisposed())\r
                                     selectionProvider.setSelection(new StructuredSelection(resources));\r
                             }\r
 \r
@@ -265,9 +265,8 @@ public class SysdynDiagramEditor extends ResourceEditorPart {
 \r
     @Override\r
     public void setFocus() {     \r
-        Composite c = getFrameComposite();\r
-        if(c != null && !c.isDisposed()) {\r
-            getFrameComposite().setFocus();\r
+        if(frameComposite != null && !frameComposite.isDisposed()) {\r
+            frameComposite.setFocus();\r
             if(canvas!=null)\r
                 canvas.requestFocus();\r
         }\r
@@ -288,9 +287,4 @@ public class SysdynDiagramEditor extends ResourceEditorPart {
         }\r
         return super.getAdapter(adapter);\r
     }\r
-\r
-    private Composite getFrameComposite() {\r
-        return this.frameComposite;\r
-    }\r
-\r
 }\r