From: lempinen Date: Thu, 20 May 2010 10:51:42 +0000 (+0000) Subject: Yet another fix for focus problems X-Git-Tag: simantics-1.2.0~239 X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=commitdiff_plain;h=715e02bd7100d15ad53d61cb1a66a27281340687;p=simantics%2Fsysdyn.git Yet another fix for focus problems git-svn-id: https://www.simantics.org/svn/simantics/sysdyn/trunk@15791 ac1ea38d-2e2b-0410-8846-a27921b304fc --- diff --git a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/dependencies/DependencyView.java b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/dependencies/DependencyView.java index 4027061f..bb500430 100644 --- a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/dependencies/DependencyView.java +++ b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/dependencies/DependencyView.java @@ -167,9 +167,8 @@ public class DependencyView extends ViewPart { @Override public void setFocus() { - Composite c = getBaseComposite(); - if(c != null && !c.isDisposed()) { - getBaseComposite().setFocus(); + if(baseComposite != null && !baseComposite.isDisposed()) { + baseComposite.setFocus(); component.setFocus(); } } @@ -183,9 +182,4 @@ public class DependencyView extends ViewPart { getSite().getWorkbenchWindow().getSelectionService().removePostSelectionListener(selectionListener); disposed = true; } - - private Composite getBaseComposite() { - return this.baseComposite; - } - } diff --git a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/editor/SysdynDiagramEditor.java b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/editor/SysdynDiagramEditor.java index 50575fc5..497b8cf9 100644 --- a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/editor/SysdynDiagramEditor.java +++ b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/editor/SysdynDiagramEditor.java @@ -231,7 +231,7 @@ public class SysdynDiagramEditor extends ResourceEditorPart { canvas = new EditorCanvas(editor); frame.add(canvas); - getFrameComposite().getDisplay().asyncExec(new Runnable() { + frameComposite.getDisplay().asyncExec(new Runnable() { @Override public void run() { setFocus(); @@ -246,11 +246,11 @@ public class SysdynDiagramEditor extends ResourceEditorPart { final ArrayList resources = new ArrayList(selection.size()); for(IElement element : selection) resources.add(mapping.inverseGet(element)); - getFrameComposite().getDisplay().asyncExec(new Runnable() { + frameComposite.getDisplay().asyncExec(new Runnable() { @Override public void run() { - if(!getFrameComposite().isDisposed()) + if(!frameComposite.isDisposed()) selectionProvider.setSelection(new StructuredSelection(resources)); } @@ -265,9 +265,8 @@ public class SysdynDiagramEditor extends ResourceEditorPart { @Override public void setFocus() { - Composite c = getFrameComposite(); - if(c != null && !c.isDisposed()) { - getFrameComposite().setFocus(); + if(frameComposite != null && !frameComposite.isDisposed()) { + frameComposite.setFocus(); if(canvas!=null) canvas.requestFocus(); } @@ -288,9 +287,4 @@ public class SysdynDiagramEditor extends ResourceEditorPart { } return super.getAdapter(adapter); } - - private Composite getFrameComposite() { - return this.frameComposite; - } - }