mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-19 15:05:36 +02:00
This commit is contained in:
parent
d8328fb061
commit
9f85daf44b
2 changed files with 16 additions and 3 deletions
|
@ -2,7 +2,7 @@ Manifest-Version: 1.0
|
|||
Bundle-ManifestVersion: 2
|
||||
Bundle-Name: %pluginName
|
||||
Bundle-SymbolicName: org.eclipse.cdt.ui; singleton:=true
|
||||
Bundle-Version: 8.1.400.qualifier
|
||||
Bundle-Version: 8.1.500.qualifier
|
||||
Bundle-Activator: org.eclipse.cdt.ui.CUIPlugin
|
||||
Bundle-Vendor: %providerName
|
||||
Bundle-Localization: plugin
|
||||
|
|
|
@ -97,6 +97,7 @@ import org.eclipse.ui.IEditorInput;
|
|||
import org.eclipse.ui.IEditorPart;
|
||||
import org.eclipse.ui.IEditorRegistry;
|
||||
import org.eclipse.ui.IFileEditorInput;
|
||||
import org.eclipse.ui.IURIEditorInput;
|
||||
import org.eclipse.ui.IWorkbench;
|
||||
import org.eclipse.ui.IWorkbenchPage;
|
||||
import org.eclipse.ui.IWorkbenchWindow;
|
||||
|
@ -676,8 +677,20 @@ public class EditorUtility {
|
|||
contentType = Platform.getContentTypeManager().getContentType(CCorePlugin.CONTENT_TYPE_BINARYFILE);
|
||||
}
|
||||
}
|
||||
IEditorRegistry registry = PlatformUI.getWorkbench().getEditorRegistry();
|
||||
IEditorDescriptor desc = registry.getDefaultEditor(input.getName(), contentType);
|
||||
IEditorDescriptor desc = null;
|
||||
if (input instanceof IURIEditorInput uriEditorInput) {
|
||||
try {
|
||||
IFileStore fileStore = EFS.getStore(uriEditorInput.getURI());
|
||||
// get editor by considering overridden default editor association via IEditorAssociationOverride:
|
||||
desc = IDE.getEditorDescriptorForFileStore(fileStore, false);
|
||||
} catch (CoreException e) {
|
||||
CUIPlugin.log(e);
|
||||
}
|
||||
}
|
||||
if (desc == null) {
|
||||
IEditorRegistry registry = PlatformUI.getWorkbench().getEditorRegistry();
|
||||
desc = registry.getDefaultEditor(input.getName(), contentType);
|
||||
}
|
||||
if (desc != null) {
|
||||
String editorID = desc.getId();
|
||||
if (input instanceof IFileEditorInput) {
|
||||
|
|
Loading…
Add table
Reference in a new issue