use of org.eclipse.ui.IEditorRegistry in project jbosstools-openshift by jbosstools.
the class EditResourceHandler method openInEditor.
private void openInEditor(IWorkbenchWindow window, Connection connection, IResource resource) throws PartInitException {
IStorageEditorInput input = new OpenShiftResourceInput(connection, resource);
IWorkbenchPage page = window.getActivePage();
if (page != null) {
IEditorRegistry editorRegistry = PlatformUI.getWorkbench().getEditorRegistry();
String defaultJsonEditorId = getDefaultJSONEditorDescriptorId(editorRegistry);
page.openEditor(input, defaultJsonEditorId);
}
}
use of org.eclipse.ui.IEditorRegistry in project egit by eclipse.
the class EgitUiEditorUtils method getEditorId.
private static String getEditorId(String fileName, IContentType type) {
IEditorRegistry registry = PlatformUI.getWorkbench().getEditorRegistry();
IEditorDescriptor descriptor = registry.getDefaultEditor(fileName, type);
String id;
if (descriptor == null || descriptor.isOpenExternal()) {
id = EditorsUI.DEFAULT_TEXT_EDITOR_ID;
} else {
id = descriptor.getId();
}
return id;
}
use of org.eclipse.ui.IEditorRegistry in project InformationSystem by ObeoNetwork.
the class BindingTreeEditor method getEditorDescriptor.
/**
* Retrieves the descriptor for this editor.
*
* @return the editor descriptor
*/
protected final IEditorDescriptor getEditorDescriptor() {
final IEditorRegistry editorRegistry = PlatformUI.getWorkbench().getEditorRegistry();
final IEditorDescriptor editorDesc = editorRegistry.findEditor(getSite().getId());
return editorDesc;
}
use of org.eclipse.ui.IEditorRegistry in project ecf by eclipse.
the class EditorHelper method getEditorIdForFile.
protected String getEditorIdForFile(IFile file) {
final IWorkbench wb = getWorkbenchWindow().getWorkbench();
final IEditorRegistry er = wb.getEditorRegistry();
final IEditorDescriptor desc = er.getDefaultEditor(file.getName());
if (desc != null)
return desc.getId();
else
return EditorsUI.DEFAULT_TEXT_EDITOR_ID;
}
Aggregations