mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-22 06:02:11 +02:00
Support IEditorAssociationOverride (#341)
This commit is contained in:
parent
6cf3e03c35
commit
d2a5a57d01
1 changed files with 6 additions and 0 deletions
|
@ -75,6 +75,7 @@ import org.eclipse.core.runtime.IPath;
|
||||||
import org.eclipse.core.runtime.IProgressMonitor;
|
import org.eclipse.core.runtime.IProgressMonitor;
|
||||||
import org.eclipse.core.runtime.ISafeRunnable;
|
import org.eclipse.core.runtime.ISafeRunnable;
|
||||||
import org.eclipse.core.runtime.IStatus;
|
import org.eclipse.core.runtime.IStatus;
|
||||||
|
import org.eclipse.core.runtime.OperationCanceledException;
|
||||||
import org.eclipse.core.runtime.Path;
|
import org.eclipse.core.runtime.Path;
|
||||||
import org.eclipse.core.runtime.Platform;
|
import org.eclipse.core.runtime.Platform;
|
||||||
import org.eclipse.core.runtime.SafeRunner;
|
import org.eclipse.core.runtime.SafeRunner;
|
||||||
|
@ -617,6 +618,11 @@ public class EditorUtility {
|
||||||
if (input instanceof IFileEditorInput) {
|
if (input instanceof IFileEditorInput) {
|
||||||
IFileEditorInput editorInput = (IFileEditorInput) input;
|
IFileEditorInput editorInput = (IFileEditorInput) input;
|
||||||
IFile file = editorInput.getFile();
|
IFile file = editorInput.getFile();
|
||||||
|
try {
|
||||||
|
return IDE.getEditorDescriptor(file, true, false).getId();
|
||||||
|
} catch (PartInitException | OperationCanceledException e) {
|
||||||
|
// do nothing
|
||||||
|
}
|
||||||
// Try file specific editor.
|
// Try file specific editor.
|
||||||
try {
|
try {
|
||||||
String editorID = file.getPersistentProperty(IDE.EDITOR_KEY);
|
String editorID = file.getPersistentProperty(IDE.EDITOR_KEY);
|
||||||
|
|
Loading…
Add table
Reference in a new issue