From c305a1c830fb6b9710526f53967ca437ba0f38bd Mon Sep 17 00:00:00 2001 From: jkauttio Date: Mon, 13 Apr 2015 10:08:20 +0000 Subject: [PATCH] Change the radio buttons in the tool bar so that the state is stored over tool restarts (this was surprisingly much easier than resetting the state) fixes #5760 git-svn-id: https://www.simantics.org/svn/simantics/sysdyn/trunk@31160 ac1ea38d-2e2b-0410-8846-a27921b304fc --- org.simantics.sysdyn.ui/plugin.xml | 2 +- .../org/simantics/sysdyn/ui/handlers/DiagramToolHandler.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/org.simantics.sysdyn.ui/plugin.xml b/org.simantics.sysdyn.ui/plugin.xml index 9756871a..33cf9bba 100644 --- a/org.simantics.sysdyn.ui/plugin.xml +++ b/org.simantics.sysdyn.ui/plugin.xml @@ -2001,7 +2001,7 @@ + value="true"> diff --git a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/handlers/DiagramToolHandler.java b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/handlers/DiagramToolHandler.java index 6a5a3577..d3fde7e7 100644 --- a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/handlers/DiagramToolHandler.java +++ b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/handlers/DiagramToolHandler.java @@ -13,11 +13,11 @@ public class DiagramToolHandler extends AbstractHandler { @Override public Object execute(ExecutionEvent event) throws ExecutionException { - final ICanvasContext context = (ICanvasContext)HandlerUtil.getActiveEditor(event).getAdapter(ICanvasContext.class); + ICanvasContext context = (ICanvasContext)HandlerUtil.getActiveEditor(event).getAdapter(ICanvasContext.class); if (context == null) { throw new ExecutionException("Could not get context from editor"); } - + String value = (String)event.getCommand().getState(RadioState.STATE_ID).getValue(); // if one of the connection modes is selected, use the -- 2.47.1