Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Schwarz2014-02-20 03:35:43 -0500
committerTobias Schwarz2014-02-20 03:36:17 -0500
commit1606f1f3a734e8d8648fe98799d39ee21833adac (patch)
treee83969aed3f18107c5c0899d25a82a7954d8a0a9
parent4bf3f83b75c1633b1806b8304bc6b95030ed7213 (diff)
downloadorg.eclipse.tcf-1606f1f3a734e8d8648fe98799d39ee21833adac.tar.gz
org.eclipse.tcf-1606f1f3a734e8d8648fe98799d39ee21833adac.tar.xz
org.eclipse.tcf-1606f1f3a734e8d8648fe98799d39ee21833adac.zip
Target Explorer: add hidden pref to enable
"openEditorOnDefaultContextChange" (org.eclipse.tcf.te.tcf.ui/org.eclipse.tcf.te.tcf.ui.defaultcontext.open.editor=true)
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/activator/UIPlugin.java14
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/handler/DefaultContextSelectorToolbarContribution.java7
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/internal/preferences/IPreferenceKeys.java4
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/internal/preferences/PreferencesInitializer.java2
4 files changed, 23 insertions, 4 deletions
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/activator/UIPlugin.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/activator/UIPlugin.java
index aca50c5c2..621c29f7e 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/activator/UIPlugin.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/activator/UIPlugin.java
@@ -22,6 +22,7 @@ import org.eclipse.tcf.te.runtime.callback.AsyncCallbackCollector;
import org.eclipse.tcf.te.runtime.concurrent.util.ExecutorsUtil;
import org.eclipse.tcf.te.runtime.interfaces.callback.ICallback;
import org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer;
+import org.eclipse.tcf.te.runtime.preferences.ScopedEclipsePreferences;
import org.eclipse.tcf.te.runtime.services.ServiceManager;
import org.eclipse.tcf.te.runtime.services.interfaces.IService;
import org.eclipse.tcf.te.runtime.stepper.interfaces.IStepContext;
@@ -50,6 +51,8 @@ import org.osgi.framework.BundleContext;
public class UIPlugin extends AbstractUIPlugin {
// The shared instance
private static UIPlugin plugin;
+ // The scoped preferences instance
+ private static volatile ScopedEclipsePreferences scopedPreferences;
// The workbench listener instance
private IWorkbenchListener listener;
// Reference to the workbench listener
@@ -82,6 +85,16 @@ public class UIPlugin extends AbstractUIPlugin {
return "org.eclipse.tcf.te.tcf.ui"; //$NON-NLS-1$
}
+ /**
+ * Return the scoped preferences for this plugin.
+ */
+ public static ScopedEclipsePreferences getScopedPreferences() {
+ if (scopedPreferences == null) {
+ scopedPreferences = new ScopedEclipsePreferences(getUniqueIdentifier());
+ }
+ return scopedPreferences;
+ }
+
/* (non-Javadoc)
* @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
*/
@@ -211,6 +224,7 @@ public class UIPlugin extends AbstractUIPlugin {
}
plugin = null;
+ scopedPreferences = null;
super.stop(context);
}
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 ab1138a9e..500dbc1cf 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
@@ -52,8 +52,10 @@ import org.eclipse.tcf.te.tcf.locator.interfaces.services.IDefaultContextService
import org.eclipse.tcf.te.tcf.locator.model.ModelManager;
import org.eclipse.tcf.te.tcf.ui.activator.UIPlugin;
import org.eclipse.tcf.te.tcf.ui.internal.ImageConsts;
+import org.eclipse.tcf.te.tcf.ui.internal.preferences.IPreferenceKeys;
import org.eclipse.tcf.te.tcf.ui.nls.Messages;
import org.eclipse.tcf.te.ui.swt.SWTControlUtil;
+import org.eclipse.tcf.te.ui.views.ViewsUtil;
import org.eclipse.tcf.te.ui.views.handler.OpenEditorHandler;
import org.eclipse.tcf.te.ui.views.navigator.DelegatingLabelProvider;
import org.eclipse.ui.PlatformUI;
@@ -358,6 +360,11 @@ implements IWorkbenchContribution, IEventListener, IPeerModelListener {
if (event instanceof ChangeEvent) {
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 (openEditorOnChange && peerNode != null && changeEvent.getSource() instanceof IDefaultContextService) {
+ ViewsUtil.openEditor(new StructuredSelection(peerNode));
+ }
+
if (changeEvent.getSource() instanceof IDefaultContextService ||
(changeEvent.getSource() == peerNode &&
(IPeerNodeProperties.PROP_CONNECT_STATE.equals(changeEvent.getEventId()) || "properties".equals(changeEvent.getEventId())))) { //$NON-NLS-1$
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/internal/preferences/IPreferenceKeys.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/internal/preferences/IPreferenceKeys.java
index 9cd4a04a3..bfde01541 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/internal/preferences/IPreferenceKeys.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/internal/preferences/IPreferenceKeys.java
@@ -29,7 +29,7 @@ public interface IPreferenceKeys {
public static final String PREF_ACTIVATE_CURRENT_USER_FILTER = PREFIX + "model.currentUserFilter.activate"; //$NON-NLS-1$
/**
- * Preference key to access the flag to enable the default context status bar trim area.
+ * Preference key to allow target path for module load.
*/
- public static final String PREF_DEFAULT_CONTEXT_TRIM_AREA_ENABLE = PREFIX + "feature.statusbar.trim.defaultcontext.enable"; //$NON-NLS-1$
+ public static final String PREF_OPEN_EDITOR_ON_DEFAULT_CONTEXT_CHANGE = "org.eclipse.tcf.te.tcf.ui.defaultcontext.open.editor"; //$NON-NLS-1$
}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/internal/preferences/PreferencesInitializer.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/internal/preferences/PreferencesInitializer.java
index d493699d1..376163549 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/internal/preferences/PreferencesInitializer.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/internal/preferences/PreferencesInitializer.java
@@ -35,7 +35,5 @@ public class PreferencesInitializer extends AbstractPreferenceInitializer {
store.setDefault(IPreferenceKeys.PREF_HIDE_DYNAMIC_TARGET_DISCOVERY_EXTENSION, true);
// [Hidden] Activate current user filter: default off
store.setDefault(IPreferenceKeys.PREF_ACTIVATE_CURRENT_USER_FILTER, false);
- // [Hidden] Enable default context status bar trim area: default off
- store.setDefault(IPreferenceKeys.PREF_DEFAULT_CONTEXT_TRIM_AREA_ENABLE, false);
}
}

Back to the top