Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUwe Stieber2014-07-22 02:29:50 -0400
committerUwe Stieber2014-07-22 02:29:50 -0400
commit553c5fcf19fac0ed552525b78eae862d113be400 (patch)
treedb2ae2897a2a2875e50122aaca563eadb8eb0f2c
parent74e2cbe5e8e0a1d4b7a9d9c5b18b36d06133add8 (diff)
downloadorg.eclipse.tcf-553c5fcf19fac0ed552525b78eae862d113be400.tar.gz
org.eclipse.tcf-553c5fcf19fac0ed552525b78eae862d113be400.tar.xz
org.eclipse.tcf-553c5fcf19fac0ed552525b78eae862d113be400.zip
Terminals: Fix dependencies to avoid to depend on o.e.ui.ide which is a non-RCP plug-in
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui.terminals/META-INF/MANIFEST.MF3
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui.terminals/src/org/eclipse/tcf/te/ui/terminals/panels/AbstractConfigurationPanel.java25
2 files changed, 24 insertions, 4 deletions
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.ui.terminals/META-INF/MANIFEST.MF b/target_explorer/plugins/org.eclipse.tcf.te.ui.terminals/META-INF/MANIFEST.MF
index 70c42e9b4..72ccd7cf6 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui.terminals/META-INF/MANIFEST.MF
+++ b/target_explorer/plugins/org.eclipse.tcf.te.ui.terminals/META-INF/MANIFEST.MF
@@ -16,8 +16,7 @@ Require-Bundle: org.eclipse.core.expressions;bundle-version="3.4.400",
org.eclipse.tcf.te.ui.swt;bundle-version="1.3.0",
org.eclipse.tm.terminal;bundle-version="3.2.300",
org.eclipse.ui;bundle-version="3.8.0",
- org.eclipse.ui.forms;bundle-version="3.5.200",
- org.eclipse.ui.ide;bundle-version="3.10.0"
+ org.eclipse.ui.forms;bundle-version="3.5.200"
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Bundle-ActivationPolicy: lazy
Bundle-Localization: plugin
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.ui.terminals/src/org/eclipse/tcf/te/ui/terminals/panels/AbstractConfigurationPanel.java b/target_explorer/plugins/org.eclipse.tcf.te.ui.terminals/src/org/eclipse/tcf/te/ui/terminals/panels/AbstractConfigurationPanel.java
index 561dfd3c8..1ac4867e8 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui.terminals/src/org/eclipse/tcf/te/ui/terminals/panels/AbstractConfigurationPanel.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.ui.terminals/src/org/eclipse/tcf/te/ui/terminals/panels/AbstractConfigurationPanel.java
@@ -21,6 +21,7 @@ import java.util.Map;
import java.util.Map.Entry;
import org.eclipse.core.runtime.Assert;
+import org.eclipse.core.runtime.Platform;
import org.eclipse.jface.dialogs.IDialogSettings;
import org.eclipse.jface.dialogs.IInputValidator;
import org.eclipse.jface.dialogs.InputDialog;
@@ -49,7 +50,7 @@ import org.eclipse.tcf.te.ui.terminals.interfaces.IConfigurationPanel;
import org.eclipse.tcf.te.ui.terminals.nls.Messages;
import org.eclipse.ui.ISharedImages;
import org.eclipse.ui.WorkbenchEncoding;
-import org.eclipse.ui.ide.IDEEncoding;
+import org.osgi.framework.Bundle;
/**
* Abstract terminal configuration panel implementation.
@@ -527,7 +528,7 @@ public abstract class AbstractConfigurationPanel extends AbstractWizardConfigura
encodings.add("UTF-8"); //$NON-NLS-1$
// The currently selected IDE encoding from the preferences
- String ideEncoding = IDEEncoding.getResourceEncoding();
+ String ideEncoding = getResourceEncoding();
if (ideEncoding != null && !encodings.contains(ideEncoding)) encodings.add(ideEncoding);
// The default Eclipse Workbench encoding (configured in the preferences)
@@ -553,6 +554,26 @@ public abstract class AbstractConfigurationPanel extends AbstractWizardConfigura
}
/**
+ * Get the current value of the encoding preference. If the value is not set
+ * return <code>null</code>.
+ * <p>
+ * <b>Note:</b> Copied from <code>org.eclipse.ui.ide.IDEEncoding</code>.
+ *
+ * @return String
+ */
+ @SuppressWarnings("deprecation")
+ private String getResourceEncoding() {
+ String preference = null;
+
+ if (Platform.getBundle("org.eclipse.core.resources") != null //$NON-NLS-1$
+ && Platform.getBundle("org.eclipse.core.resources").getState() == Bundle.ACTIVE) { //$NON-NLS-1$
+ preference = org.eclipse.core.resources.ResourcesPlugin.getPlugin().getPluginPreferences().getString(org.eclipse.core.resources.ResourcesPlugin.PREF_ENCODING);
+ }
+
+ return preference != null && preference.length() > 0 ? preference : null;
+ }
+
+ /**
* Select the encoding.
*
* @param encoding The encoding. Must not be <code>null</code>.

Back to the top