Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Schwarz2014-02-21 03:08:35 -0500
committerTobias Schwarz2014-02-21 03:08:35 -0500
commit7d76d6817d746f51ff613457d48b7ba39c5b9af7 (patch)
treedcdc2cf0cd1662a258dbf2e15f8bfa1fecf5430a
parentb05e9cbed5d30218daf0ef2d8c5cd64caa6f0c8e (diff)
downloadorg.eclipse.tcf-7d76d6817d746f51ff613457d48b7ba39c5b9af7.tar.gz
org.eclipse.tcf-7d76d6817d746f51ff613457d48b7ba39c5b9af7.tar.xz
org.eclipse.tcf-7d76d6817d746f51ff613457d48b7ba39c5b9af7.zip
Target Explorer: fix tooltip reset when no default context is set
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/handler/ConnectableToolbarCommandHandler.java30
1 files changed, 14 insertions, 16 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 68239a278..ce82dfe25 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
@@ -46,21 +46,19 @@ public class ConnectableToolbarCommandHandler extends ConnectableCommandHandler
@Override
public void updateElement(final UIElement element, Map parameters) {
final IPeerNode defaultContext = ServiceManager.getInstance().getService(IDefaultContextService.class).getDefaultContext(null);
- if (defaultContext != 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);
- }
- }
- });
- }
+ PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() {
+ @Override
+ public void run() {
+ if (defaultContext != null && getAction() == IConnectable.ACTION_CONNECT) {
+ element.setTooltip(NLS.bind(Messages.ConnectableToolbarCommandHandler_tooltip_connect, defaultContext.getName()));
+ }
+ else if (defaultContext != null && getAction() == IConnectable.ACTION_DISCONNECT) {
+ element.setTooltip(NLS.bind(Messages.ConnectableToolbarCommandHandler_tooltip_disconnect, defaultContext.getName()));
+ }
+ else {
+ element.setTooltip(null);
+ }
+ }
+ });
}
}

Back to the top