/** * Applies the <code>org.eclipse.ui.ide.editorAssociationOverride</code> extensions to the given * input. * * @param fileName the name of the file for which to choose the editor * @param contentType the content type of the input or <code>null</code> if not available * @param editorDescriptors the current association for the given input * @return the editor descriptors to be used for the given input - can be * <code>editorDescriptors</code>. The order is not relevant. * @see IEditorAssociationOverride#overrideEditors(IEditorInput, IContentType, * IEditorDescriptor[]) * @since 3.8 */ public static IEditorDescriptor[] overrideEditorAssociations(String fileName, IContentType contentType, IEditorDescriptor[] editorDescriptors) { IEditorAssociationOverride[] overrides = getEditorAssociationOverrides(); for (int i = 0; i < overrides.length; i++) { editorDescriptors = overrides[i].overrideEditors(fileName, contentType, editorDescriptors); } return removeNullEntries(editorDescriptors); }
/** * Applies the <code>org.eclipse.ui.ide.editorAssociationOverride</code> extensions to the given * input. * * @param editorInput the editor input for the editor * @param contentType the content type of the input or <code>null</code> if not available * @param editorDescriptors the current association for the given input * @return the editor descriptors to be used for the given input - can be * <code>editorDescriptors</code>. The order is not relevant. * @see IEditorAssociationOverride#overrideEditors(IEditorInput, IContentType, * IEditorDescriptor[]) * @since 3.8 */ public static IEditorDescriptor[] overrideEditorAssociations(IEditorInput editorInput, IContentType contentType, IEditorDescriptor[] editorDescriptors) { IEditorAssociationOverride[] overrides = getEditorAssociationOverrides(); for (int i = 0; i < overrides.length; i++) { editorDescriptors = overrides[i].overrideEditors(editorInput, contentType, editorDescriptors); } return removeNullEntries(editorDescriptors); }