Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnton Leherbauer2016-05-03 05:19:55 -0400
committerAnton Leherbauer2016-05-03 05:19:55 -0400
commit2bec4cd50fd3e46c3675736c4d3eddaba5d4335f (patch)
tree239de1fbca72a8bdb29826882212d2ec267f6693 /target_explorer
parentb9a8fda0453233f65491ac15013c48a46bc20eb0 (diff)
downloadorg.eclipse.tcf-2bec4cd50fd3e46c3675736c4d3eddaba5d4335f.tar.gz
org.eclipse.tcf-2bec4cd50fd3e46c3675736c4d3eddaba5d4335f.tar.xz
org.eclipse.tcf-2bec4cd50fd3e46c3675736c4d3eddaba5d4335f.zip
Target Explorer: Fix update of connect/disconnect button tooltips
Diffstat (limited to 'target_explorer')
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/plugin.xml10
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/handler/DefaultContextSelectorToolbarContribution.java12
2 files changed, 7 insertions, 15 deletions
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/plugin.xml b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/plugin.xml
index 7233ee18c..b95c939af 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/plugin.xml
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/plugin.xml
@@ -1073,11 +1073,6 @@
<parameter name="action" value="connect"/>
<parameter name="handleDirty" value="true"/>
</class>
- <activeWhen>
- <with variable="defaultContextSelection">
- <adapt type="org.eclipse.tcf.te.core.interfaces.IConnectable"/>
- </with>
- </activeWhen>
<enabledWhen>
<with variable="defaultContextSelection">
<adapt type="org.eclipse.tcf.te.core.interfaces.IConnectable">
@@ -1093,11 +1088,6 @@
<class class="org.eclipse.tcf.te.tcf.ui.handler.ConnectableToolbarCommandHandler">
<parameter name="action" value="disconnect"/>
</class>
- <activeWhen>
- <with variable="defaultContextSelection">
- <adapt type="org.eclipse.tcf.te.core.interfaces.IConnectable"/>
- </with>
- </activeWhen>
<enabledWhen>
<with variable="defaultContextSelection">
<adapt type="org.eclipse.tcf.te.core.interfaces.IConnectable">
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/handler/DefaultContextSelectorToolbarContribution.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/handler/DefaultContextSelectorToolbarContribution.java
index 8bfe4edfc..e5867b902 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/handler/DefaultContextSelectorToolbarContribution.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/handler/DefaultContextSelectorToolbarContribution.java
@@ -540,11 +540,8 @@ implements IWorkbenchContribution, IEventListener, IPeerModelListener, IProperty
ChangeEvent changeEvent = (ChangeEvent)event;
IPeerNode peerNode = ServiceManager.getInstance().getService(IDefaultContextService.class).getDefaultContext(null);
boolean openEditorOnChange = UIPlugin.getScopedPreferences().getBoolean(IPreferenceKeys.PREF_OPEN_EDITOR_ON_DEFAULT_CONTEXT_CHANGE);
- if (peerNode != null && changeEvent.getSource() instanceof IDefaultContextService) {
- ICommandService service = (ICommandService)PlatformUI.getWorkbench().getService(ICommandService.class);
- service.refreshElements("org.eclipse.tcf.te.ui.toolbar.command.connect", null); //$NON-NLS-1$
- service.refreshElements("org.eclipse.tcf.te.ui.toolbar.command.disconnect", null); //$NON-NLS-1$
- if (openEditorOnChange) {
+ if (changeEvent.getSource() instanceof IDefaultContextService) {
+ if (openEditorOnChange && peerNode != null) {
ViewsUtil.openEditor(new StructuredSelection(peerNode));
}
}
@@ -565,14 +562,19 @@ implements IWorkbenchContribution, IEventListener, IPeerModelListener, IProperty
updatePending = true;
ExecutorsUtil.executeInUI(new Runnable() {
private boolean scheduled;
+ @SuppressWarnings("synthetic-access")
@Override
public void run() {
+ if (text == null) return;
if (!scheduled) {
Display.getCurrent().timerExec(200, this);
scheduled = true;
return;
}
updatePending = false;
+ ICommandService service = (ICommandService)PlatformUI.getWorkbench().getService(ICommandService.class);
+ service.refreshElements("org.eclipse.tcf.te.ui.toolbar.command.connect", null); //$NON-NLS-1$
+ service.refreshElements("org.eclipse.tcf.te.ui.toolbar.command.disconnect", null); //$NON-NLS-1$
update();
}
});

Back to the top