Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Schwarz2014-02-21 03:06:33 -0500
committerTobias Schwarz2014-02-21 03:06:33 -0500
commitb05e9cbed5d30218daf0ef2d8c5cd64caa6f0c8e (patch)
treeb68a3ba820a5f97268878cc4bcf38afdf7893b9a
parentee6785f2900d2d932c8020f9bf4281d709df7e9b (diff)
downloadorg.eclipse.tcf-b05e9cbed5d30218daf0ef2d8c5cd64caa6f0c8e.tar.gz
org.eclipse.tcf-b05e9cbed5d30218daf0ef2d8c5cd64caa6f0c8e.tar.xz
org.eclipse.tcf-b05e9cbed5d30218daf0ef2d8c5cd64caa6f0c8e.zip
Target Explorer: fix ui hang
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/handler/ConnectableToolbarCommandHandler.java29
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/handler/ConnectableCommandHandler.java4
2 files changed, 21 insertions, 12 deletions
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/handler/ConnectableToolbarCommandHandler.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/handler/ConnectableToolbarCommandHandler.java
index 4123abee6..68239a278 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/handler/ConnectableToolbarCommandHandler.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/handler/ConnectableToolbarCommandHandler.java
@@ -22,6 +22,7 @@ import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNode;
import org.eclipse.tcf.te.tcf.locator.interfaces.services.IDefaultContextService;
import org.eclipse.tcf.te.tcf.ui.nls.Messages;
import org.eclipse.tcf.te.ui.handler.ConnectableCommandHandler;
+import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.commands.IElementUpdater;
import org.eclipse.ui.menus.UIElement;
@@ -43,19 +44,23 @@ public class ConnectableToolbarCommandHandler extends ConnectableCommandHandler
* @see org.eclipse.ui.commands.IElementUpdater#updateElement(org.eclipse.ui.menus.UIElement, java.util.Map)
*/
@Override
- public void updateElement(UIElement element, Map parameters) {
- IPeerNode defaultContext = ServiceManager.getInstance().getService(IDefaultContextService.class).getDefaultContext(null);
+ public void updateElement(final UIElement element, Map parameters) {
+ final IPeerNode defaultContext = ServiceManager.getInstance().getService(IDefaultContextService.class).getDefaultContext(null);
if (defaultContext != null) {
- if (action == IConnectable.ACTION_CONNECT) {
- element.setTooltip(NLS.bind(Messages.ConnectableToolbarCommandHandler_tooltip_connect, defaultContext.getName()));
- }
- else if (action == IConnectable.ACTION_DISCONNECT) {
- element.setTooltip(NLS.bind(Messages.ConnectableToolbarCommandHandler_tooltip_disconnect, defaultContext.getName()));
- }
- else {
- element.setTooltip(null);
- }
-
+ PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() {
+ @Override
+ public void run() {
+ if (getAction() == IConnectable.ACTION_CONNECT) {
+ element.setTooltip(NLS.bind(Messages.ConnectableToolbarCommandHandler_tooltip_connect, defaultContext.getName()));
+ }
+ else if (getAction() == IConnectable.ACTION_DISCONNECT) {
+ element.setTooltip(NLS.bind(Messages.ConnectableToolbarCommandHandler_tooltip_disconnect, defaultContext.getName()));
+ }
+ else {
+ element.setTooltip(null);
+ }
+ }
+ });
}
}
}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/handler/ConnectableCommandHandler.java b/target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/handler/ConnectableCommandHandler.java
index 30c13ed0b..8d1cb246a 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/handler/ConnectableCommandHandler.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/handler/ConnectableCommandHandler.java
@@ -43,6 +43,10 @@ public class ConnectableCommandHandler extends AbstractCommandHandler implements
protected int action = IConnectable.STATE_UNKNOWN;
protected boolean handleDirty = false;
+ public int getAction() {
+ return action;
+ }
+
/* (non-Javadoc)
* @see com.windriver.te.tcf.ui.handler.AbstractAgentCommandHandler#execute(org.eclipse.core.commands.ExecutionEvent)
*/

Back to the top