private void unsetRegistration(IFile file) { // If the default editor for this file is not the Struts config. editor, // then we're done. IEditorRegistry registry = PlatformUI.getWorkbench().getEditorRegistry(); IEditorDescriptor userEditor = registry.getDefaultEditor(file.getFullPath().toString()); if ((userEditor == null) || !FacesConfigPlugin.FACES_CONFIG_EDITOR_ID.equals(userEditor.getId())) { traceFiner(file, "Not unsetting: Default already not Faces config. editor"); return; } // Make the Struts config. editor the default. traceFiner(file, "Unsetting."); IEditorDescriptor[] editors = registry.getEditors(file.getFullPath().toString()); if (editors.length > 1) { registry.setDefaultEditor(file.getFullPath().toString(), editors[1].getId()); } }