Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'target_explorer/plugins')
-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