org.eclipse.xtext.common.types.shared.jdt38
Class OriginalEditorSelector

java.lang.Object
  extended by org.eclipse.xtext.common.types.shared.jdt38.OriginalEditorSelector
All Implemented Interfaces:
IEditorAssociationOverride

public class OriginalEditorSelector
extends java.lang.Object
implements IEditorAssociationOverride

Author:
Sebastian Zarnekow - Initial contribution and API

Constructor Summary
OriginalEditorSelector()
           
 
Method Summary
 org.eclipse.ui.IEditorDescriptor findXbaseEditor(org.eclipse.ui.IEditorInput editorInput)
           
 org.eclipse.ui.IEditorDescriptor overrideDefaultEditor(org.eclipse.ui.IEditorInput editorInput, org.eclipse.core.runtime.content.IContentType contentType, org.eclipse.ui.IEditorDescriptor editorDescriptor)
          Allows to override the given editor descriptor for the given editor input with a different one.
 org.eclipse.ui.IEditorDescriptor overrideDefaultEditor(java.lang.String fileName, org.eclipse.core.runtime.content.IContentType contentType, org.eclipse.ui.IEditorDescriptor editorDescriptor)
          Allows to override the given editor descriptor for the given input with a different one.
 org.eclipse.ui.IEditorDescriptor[] overrideEditors(org.eclipse.ui.IEditorInput editorInput, org.eclipse.core.runtime.content.IContentType contentType, org.eclipse.ui.IEditorDescriptor[] editorDescriptors)
          Allows to override the given editor descriptors for the given editor input with different ones.
 org.eclipse.ui.IEditorDescriptor[] overrideEditors(java.lang.String fileName, org.eclipse.core.runtime.content.IContentType contentType, org.eclipse.ui.IEditorDescriptor[] editorDescriptors)
          Allows to override the given editor descriptors for the given file name with different ones.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OriginalEditorSelector

public OriginalEditorSelector()
Method Detail

overrideEditors

public org.eclipse.ui.IEditorDescriptor[] overrideEditors(org.eclipse.ui.IEditorInput editorInput,
                                                          org.eclipse.core.runtime.content.IContentType contentType,
                                                          org.eclipse.ui.IEditorDescriptor[] editorDescriptors)
Description copied from interface: IEditorAssociationOverride
Allows to override the given editor descriptors for the given editor input with different ones.

Specified by:
overrideEditors in interface IEditorAssociationOverride
Parameters:
editorInput - the editor input for the editor
contentType - the content type of the input or null if not available
editorDescriptors - the current association for the given input
Returns:
the editor descriptors to be used for the given input - can be editorDescriptors. The order is not relevant.

overrideEditors

public org.eclipse.ui.IEditorDescriptor[] overrideEditors(java.lang.String fileName,
                                                          org.eclipse.core.runtime.content.IContentType contentType,
                                                          org.eclipse.ui.IEditorDescriptor[] editorDescriptors)
Description copied from interface: IEditorAssociationOverride
Allows to override the given editor descriptors for the given file name with different ones.

Specified by:
overrideEditors in interface IEditorAssociationOverride
Parameters:
fileName - the name of the file for which to choose the editor
contentType - the content type of the input or null if not available
editorDescriptors - the current association for the given input
Returns:
the editor descriptors to be used for the given input - can be editorDescriptors. The order is not relevant.

overrideDefaultEditor

public org.eclipse.ui.IEditorDescriptor overrideDefaultEditor(org.eclipse.ui.IEditorInput editorInput,
                                                              org.eclipse.core.runtime.content.IContentType contentType,
                                                              org.eclipse.ui.IEditorDescriptor editorDescriptor)
Description copied from interface: IEditorAssociationOverride
Allows to override the given editor descriptor for the given editor input with a different one. Normally, this is used to override the default editor for the given input.

Though possible, it is advised not to override an editor that has been explicitly chosen by the user for the given input. This is the case when IFile#getPersistentProperty(IDE.EDITOR_KEY) != null.

Specified by:
overrideDefaultEditor in interface IEditorAssociationOverride
Parameters:
editorInput - the editor input for the editor
contentType - the content type of the input or null if not available
editorDescriptor - the current association for the given input or null if none
Returns:
the editor descriptor to be used for the given input or null if none. Can be editorDescriptor.

overrideDefaultEditor

public org.eclipse.ui.IEditorDescriptor overrideDefaultEditor(java.lang.String fileName,
                                                              org.eclipse.core.runtime.content.IContentType contentType,
                                                              org.eclipse.ui.IEditorDescriptor editorDescriptor)
Description copied from interface: IEditorAssociationOverride
Allows to override the given editor descriptor for the given input with a different one. Normally, this is used to override the default editor for the given input.

Specified by:
overrideDefaultEditor in interface IEditorAssociationOverride
Parameters:
fileName - the name of the file for which to choose the editor
contentType - the content type of the input or null if not available
editorDescriptor - the current association for the given input or null if none
Returns:
the editor descriptor to be used for the given input or null if none. Can be editorDescriptor.

findXbaseEditor

public org.eclipse.ui.IEditorDescriptor findXbaseEditor(org.eclipse.ui.IEditorInput editorInput)