Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonah Graham2019-06-25 15:19:53 -0400
committerJonah Graham2019-07-08 14:51:09 -0400
commit936dec35174222ecac199460f07657d4b5caed11 (patch)
treecbc22a207f8191381eb0588337cb20da2848c73a
parentd54fbd7da2568cf111ea37d4c44b3caf8e14aa93 (diff)
downloadorg.eclipse.cdt-936dec35174222ecac199460f07657d4b5caed11.tar.gz
org.eclipse.cdt-936dec35174222ecac199460f07657d4b5caed11.tar.xz
org.eclipse.cdt-936dec35174222ecac199460f07657d4b5caed11.zip
Remove workaround for private methods in IDE
Now that Bug 516470 is resolved, we don't need the workaround in CDT anymore. Change-Id: I3e8b0f0ce7fc272a81d6b7437ce7a8d588e91991
-rw-r--r--debug/org.eclipse.cdt.debug.ui/META-INF/MANIFEST.MF4
-rw-r--r--debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/CDebugModelPresentation.java2
-rw-r--r--debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/CDebugUIUtils.java150
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/META-INF/MANIFEST.MF4
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/sourcelookup/DsfSourceDisplayAdapter.java3
5 files changed, 6 insertions, 157 deletions
diff --git a/debug/org.eclipse.cdt.debug.ui/META-INF/MANIFEST.MF b/debug/org.eclipse.cdt.debug.ui/META-INF/MANIFEST.MF
index 794cf9ae12..d142f46b72 100644
--- a/debug/org.eclipse.cdt.debug.ui/META-INF/MANIFEST.MF
+++ b/debug/org.eclipse.cdt.debug.ui/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.cdt.debug.ui; singleton:=true
-Bundle-Version: 8.3.100.qualifier
+Bundle-Version: 8.3.200.qualifier
Bundle-Activator: org.eclipse.cdt.debug.ui.CDebugUIPlugin
Bundle-Vendor: %providerName
Bundle-Localization: plugin
@@ -41,7 +41,7 @@ Export-Package: org.eclipse.cdt.debug.internal.ui;x-friends:="org.eclipse.cdt.ds
org.eclipse.cdt.debug.ui.preferences,
org.eclipse.cdt.debug.ui.provisional;x-internal:=true,
org.eclipse.cdt.debug.ui.sourcelookup
-Require-Bundle: org.eclipse.ui.ide;bundle-version="[3.13.0,4.0.0)",
+Require-Bundle: org.eclipse.ui.ide;bundle-version="[3.16.0,4.0.0)",
org.eclipse.jface.text;bundle-version="[3.2.0,4.0.0)",
org.eclipse.ui.workbench.texteditor;bundle-version="[3.2.0,4.0.0)",
org.eclipse.ui.editors;bundle-version="[3.2.0,4.0.0)",
diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/CDebugModelPresentation.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/CDebugModelPresentation.java
index 5777b4fa77..50f266f578 100644
--- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/CDebugModelPresentation.java
+++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/CDebugModelPresentation.java
@@ -235,7 +235,7 @@ public class CDebugModelPresentation extends LabelProvider implements IDebugMode
URI uri = uriEditorInput.getURI();
try {
IFileStore fileStore = EFS.getStore(uri);
- id = CDebugUIUtils.getEditorId(fileStore, false);
+ id = IDE.getEditorDescriptorForFileStore(fileStore, false).getId();
} catch (CoreException e) {
// fallback to default case
}
diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/CDebugUIUtils.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/CDebugUIUtils.java
index 73502f46f3..6feaf454d8 100644
--- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/CDebugUIUtils.java
+++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/CDebugUIUtils.java
@@ -14,8 +14,6 @@
*******************************************************************************/
package org.eclipse.cdt.debug.internal.ui;
-import java.io.IOException;
-import java.io.InputStream;
import java.net.URI;
import java.util.Iterator;
@@ -27,8 +25,6 @@ import org.eclipse.cdt.debug.core.model.ICValue;
import org.eclipse.cdt.debug.core.model.IEnableDisableTarget;
import org.eclipse.cdt.debug.ui.CDebugUIPlugin;
import org.eclipse.cdt.debug.ui.breakpoints.CBreakpointPropertyDialogAction;
-import org.eclipse.core.filesystem.EFS;
-import org.eclipse.core.filesystem.IFileStore;
import org.eclipse.core.filesystem.URIUtil;
import org.eclipse.core.resources.IMarker;
import org.eclipse.core.runtime.CoreException;
@@ -36,9 +32,7 @@ import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.content.IContentType;
import org.eclipse.debug.core.DebugException;
import org.eclipse.debug.core.DebugPlugin;
import org.eclipse.debug.core.model.IBreakpoint;
@@ -62,23 +56,12 @@ import org.eclipse.jface.viewers.ISelectionChangedListener;
import org.eclipse.jface.viewers.ISelectionProvider;
import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.IEditorDescriptor;
import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IEditorRegistry;
import org.eclipse.ui.IFileEditorInput;
import org.eclipse.ui.IPathEditorInput;
import org.eclipse.ui.IStorageEditorInput;
import org.eclipse.ui.IURIEditorInput;
import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.ide.FileStoreEditorInput;
-import org.eclipse.ui.ide.IDE;
-import org.eclipse.ui.ide.IUnassociatedEditorStrategy;
-import org.eclipse.ui.internal.ide.IDEWorkbenchMessages;
-import org.eclipse.ui.internal.ide.IDEWorkbenchPlugin;
-import org.eclipse.ui.internal.ide.registry.SystemEditorOrTextEditorStrategy;
-import org.eclipse.ui.internal.ide.registry.UnassociatedEditorStrategyRegistry;
import org.eclipse.ui.progress.UIJob;
import org.eclipse.ui.texteditor.ITextEditor;
import org.eclipse.ui.texteditor.SimpleMarkerAnnotation;
@@ -376,137 +359,4 @@ public class CDebugUIUtils {
// this should actually all be delegated to KeyStroke class
return KeyStroke.getInstance(modifierKeys, KeyStroke.NO_KEY).format() + keyOrClick;
}
-
- /**
- * Returns an editor id appropriate for opening the given file
- * store.
- * <p>
- * The editor descriptor is determined using a multi-step process. This
- * method will attempt to resolve the editor based on content-type bindings
- * as well as traditional name/extension bindings.
- * </p>
- * <ol>
- * <li>The workbench editor registry is consulted to determine if an editor
- * extension has been registered for the file type. If so, an instance of
- * the editor extension is opened on the file. See
- * <code>IEditorRegistry.getDefaultEditor(String)</code>.</li>
- * <li>The operating system is consulted to determine if an in-place
- * component editor is available (e.g. OLE editor on Win32 platforms).</li>
- * <li>The operating system is consulted to determine if an external editor
- * is available.</li>
- * <li>The workbench editor registry is consulted to determine if the
- * default text editor is available.</li>
- * </ol>
- * </p>
- *
- * @param fileStore
- * the file store
- * @return the id of an editor, appropriate for opening the file
- * @throws PartInitException
- * if no editor can be found
- * @todo The IDE class has this method as a private, copied here so that it can be
- * exposed. See https://bugs.eclipse.org/bugs/show_bug.cgi?id=516470
- * @deprecated Deprecated on creation as this is waiting for Bug 516470 to be resolved
- */
- @Deprecated
- public static String getEditorId(IFileStore fileStore, boolean allowInteractive) throws PartInitException {
- String name = fileStore.fetchInfo().getName();
- if (name == null) {
- throw new IllegalArgumentException();
- }
-
- IContentType contentType = null;
- try {
- InputStream is = null;
- try {
- is = fileStore.openInputStream(EFS.NONE, null);
- contentType = Platform.getContentTypeManager().findContentTypeFor(is, name);
- } finally {
- if (is != null) {
- is.close();
- }
- }
- } catch (CoreException ex) {
- // continue without content type
- } catch (IOException ex) {
- // continue without content type
- }
-
- IEditorRegistry editorReg = PlatformUI.getWorkbench().getEditorRegistry();
-
- IEditorDescriptor defaultEditor = editorReg.getDefaultEditor(name, contentType);
- defaultEditor = IDE.overrideDefaultEditorAssociation(new FileStoreEditorInput(fileStore), contentType,
- defaultEditor);
- return getEditorDescriptor(name, editorReg, defaultEditor, allowInteractive).getId();
- }
-
- /**
- * Get the editor descriptor for a given name using the editorDescriptor
- * passed in as a default as a starting point.
- *
- * @param name
- * The name of the element to open.
- * @param editorReg
- * The editor registry to do the lookups from.
- * @param defaultDescriptor
- * IEditorDescriptor or <code>null</code>
- * @return IEditorDescriptor
- * @throws PartInitException
- * if no valid editor can be found
- *
- * @todo The IDE class has this method as a private, copied here so that it can be
- * exposed via getEditorId. See https://bugs.eclipse.org/bugs/show_bug.cgi?id=516470
- * @deprecated Deprecated on creation as this is waiting for Bug 516470 to be resolved
- */
- @Deprecated
- private static IEditorDescriptor getEditorDescriptor(String name, IEditorRegistry editorReg,
- IEditorDescriptor defaultDescriptor, boolean allowInteractive) throws PartInitException {
-
- if (defaultDescriptor != null) {
- return defaultDescriptor;
- }
-
- IUnassociatedEditorStrategy strategy = getUnassociatedEditorStrategy(allowInteractive);
- IEditorDescriptor editorDesc;
- try {
- editorDesc = strategy.getEditorDescriptor(name, editorReg);
- } catch (CoreException e) {
- throw new PartInitException(IDEWorkbenchMessages.IDE_noFileEditorFound, e);
- }
-
- // if no valid editor found, bail out
- if (editorDesc == null) {
- throw new PartInitException(IDEWorkbenchMessages.IDE_noFileEditorFound);
- }
-
- return editorDesc;
- }
-
- /**
- * @param allowInteractive
- * Whether interactive strategies are considered
- * @return The strategy to use in order to open unknown file. Either as set
- * by preference, or a {@link SystemEditorOrTextEditorStrategy} if
- * none is explicitly configured. Never returns {@code null}.
- *
- * @todo The IDE class has this method as a private, copied here so that it can be
- * exposed via getEditorId. See https://bugs.eclipse.org/bugs/show_bug.cgi?id=516470
- * @deprecated Deprecated on creation as this is waiting for Bug 516470 to be resolved
- */
- @Deprecated
- private static IUnassociatedEditorStrategy getUnassociatedEditorStrategy(boolean allowInteractive) {
- String preferedStrategy = IDEWorkbenchPlugin.getDefault().getPreferenceStore()
- .getString(IDE.UNASSOCIATED_EDITOR_STRATEGY_PREFERENCE_KEY);
- IUnassociatedEditorStrategy res = null;
- UnassociatedEditorStrategyRegistry registry = IDEWorkbenchPlugin.getDefault()
- .getUnassociatedEditorStrategyRegistry();
- if (allowInteractive || !registry.isInteractive(preferedStrategy)) {
- res = registry.getStrategy(preferedStrategy);
- }
- if (res == null) {
- res = new SystemEditorOrTextEditorStrategy();
- }
- return res;
- }
-
}
diff --git a/dsf/org.eclipse.cdt.dsf.ui/META-INF/MANIFEST.MF b/dsf/org.eclipse.cdt.dsf.ui/META-INF/MANIFEST.MF
index b6c30d5553..71403ec9ca 100644
--- a/dsf/org.eclipse.cdt.dsf.ui/META-INF/MANIFEST.MF
+++ b/dsf/org.eclipse.cdt.dsf.ui/META-INF/MANIFEST.MF
@@ -3,7 +3,7 @@ Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-Vendor: %providerName
Bundle-SymbolicName: org.eclipse.cdt.dsf.ui;singleton:=true
-Bundle-Version: 2.5.100.qualifier
+Bundle-Version: 2.5.200.qualifier
Bundle-Activator: org.eclipse.cdt.dsf.internal.ui.DsfUIPlugin
Bundle-Localization: plugin
Require-Bundle: org.eclipse.ui;bundle-version="3.5.0",
@@ -15,7 +15,7 @@ Require-Bundle: org.eclipse.ui;bundle-version="3.5.0",
org.eclipse.cdt.debug.ui;bundle-version="6.1.0",
org.eclipse.jface.text;bundle-version="3.4.0",
org.eclipse.ui.editors;bundle-version="3.4.0",
- org.eclipse.ui.ide;bundle-version="3.5.0",
+ org.eclipse.ui.ide;bundle-version="3.16.0",
org.eclipse.cdt.ui;bundle-version="5.1.0",
org.eclipse.core.expressions;bundle-version="3.4.0",
org.eclipse.core.filesystem;bundle-version="1.2.0",
diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/sourcelookup/DsfSourceDisplayAdapter.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/sourcelookup/DsfSourceDisplayAdapter.java
index 016b6c9b95..a1c5fd9cbe 100644
--- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/sourcelookup/DsfSourceDisplayAdapter.java
+++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/sourcelookup/DsfSourceDisplayAdapter.java
@@ -28,7 +28,6 @@ import org.eclipse.cdt.core.CCorePlugin;
import org.eclipse.cdt.core.CCorePreferenceConstants;
import org.eclipse.cdt.core.model.ITranslationUnit;
import org.eclipse.cdt.debug.internal.core.sourcelookup.CSourceNotFoundElement;
-import org.eclipse.cdt.debug.internal.ui.CDebugUIUtils;
import org.eclipse.cdt.debug.internal.ui.sourcelookup.CSourceNotFoundEditorInput;
import org.eclipse.cdt.debug.ui.ICDebugUIConstants;
import org.eclipse.cdt.dsf.concurrent.DataRequestMonitor;
@@ -281,7 +280,7 @@ public class DsfSourceDisplayAdapter implements ISourceDisplay, ISteppingControl
private String getEditorIdForFileStore(IFileStore fileStore) {
try {
- return CDebugUIUtils.getEditorId(fileStore, false);
+ return IDE.getEditorDescriptorForFileStore(fileStore, false).getId();
} catch (PartInitException exc) {
DsfUIPlugin.log(exc);
}

Back to the top