private IEditorPart showWithoutReuse(IFile file, IWorkbenchPage wbPage, String editorID, boolean activate) throws PartInitException { return IDE.openEditor(wbPage, file, editorID, activate); }
public static IEditorDescriptor getEditorDescriptor(String name) throws PartInitException { return getEditorDescriptor(name, true);
@Override public boolean selectReveal(Object object) { if (object instanceof IMarker) { IDE.gotoMarker(this, (IMarker) object); return true; } return false; }
@Override public IStatus runInUIThread(IProgressMonitor monitor) { IEditorDescriptor edesc = null; try { edesc = IDE.getEditorDescriptor(index.getName()); IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow(); IDE.openEditor(window.getActivePage(), index.toURI(), edesc.getId(), true); } catch (PartInitException e) { e.printStackTrace(); } return Status.OK_STATUS; } };
editor = openEditor(page, file, activate); } else { editor = page.openEditor(new FileEditorInput(file), editorDesc gotoMarker(editor, marker);
/** * Returns the resolutions for the given marker. * * @param marker the marker for which to obtain resolutions * @return the resolutions for the selected marker */ private IMarkerResolution[] getResolutions(IMarker marker) { return IDE.getMarkerHelpRegistry().getResolutions(marker); }
return getEditorDescriptor(file.getName(), PlatformUI.getWorkbench() .getEditorRegistry(), getDefaultEditor(file, determineContentType));
defaultEditor = getEditorDescriptor(name, editorReg, defaultEditor); return overrideDefaultEditorAssociation(name, contentType, defaultEditor);
case SWT.Selection: if (menuItem.getSelection()) { IDE.setDefaultEditor(file, null); try { openEditor(IDE.getEditorDescriptor(file, true, true), false); } catch (PartInitException e) { DialogUtil.openError(page.getWorkbenchWindow()
/** * Save all dirty editors in the workbench that are open on files that may * be affected by this operation. Opens a dialog to prompt the user if * <code>confirm</code> is true. Return true if successful. Return false * if the user has canceled the command. Must be called from the UI thread. * @param resources the root resources being operated on * @param confirm prompt the user if true * @return boolean false if the operation was canceled. */ public final boolean saveAllEditors(IResource[] resources, boolean confirm) { return IDE.saveAllEditors(resources, confirm); }
public IStatus runInUIThread(IProgressMonitor monitor) { IEditorDescriptor edesc = null; try { edesc = IDE.getEditorDescriptor(index.getName()); IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow(); IDE.openEditor(window.getActivePage(), index.toURI(), edesc.getId(), true); } catch (PartInitException e) { e.printStackTrace(); } return Status.OK_STATUS; } };
public static List<IMarkerResolution> getResolutions(IMarker marker) { IMarkerResolution[] resolutions = IDE.getMarkerHelpRegistry().getResolutions(marker); List<IMarkerResolution> sortedResolutions = Arrays.asList(resolutions); Collections.sort(sortedResolutions, Comparator.<IMarkerResolution, Integer> comparing(MavenProblemResolution::getOrder) .thenComparing(IMarkerResolution::getLabel)); return sortedResolutions; }
/** * Performs the save of the editor parts returned by getScopedResources */ protected void doSave() { if(fSaves != null) { IDE.saveAllEditors(fSaves, false); } }
@Override public void run() { try { IDE.openEditor(activePage, resource, true); } catch (PartInitException e) { JavaPlugin.log(e); } } });
/** * Opens external file, the editor that is used is based on best guess from * file name. * * @param file * the external file */ protected void openExternalFile(File file) { try { boolean activate = OpenStrategy.activateOnOpen(); IEditorDescriptor desc = IDE.getEditorDescriptor(file.getName()); IDE.openEditor(getWorkbenchPage(), file.toURI(), desc.getId(), activate); } catch (PartInitException e) { ErrorDialog.openError(getWorkbenchPage().getWorkbenchWindow() .getShell(), UIText.OpenWorkingFileAction_openWorkingFileShellTitle, e .getMessage(), e.getStatus()); } }
return getEditorDescriptor(file, true);
public void run() { IDE.gotoMarker(editor, selectedMarker); } };
public static boolean hasResolutions(IMarker marker) { return IDE.getMarkerHelpRegistry().hasResolutions(marker); } }
/** * Save all dirty editors in the workbench that are open on files that may * be affected by this operation. Opens a dialog to prompt the user if * <code>confirm</code> is true. Return true if successful. Return false * if the user has canceled the command. Must be called from the UI thread. * @param resources the root resources being operated on * @param confirm prompt the user if true * @return boolean false if the operation was canceled. */ public final boolean saveAllEditors(IResource[] resources, boolean confirm) { return IDE.saveAllEditors(resources, confirm); }
public void run() { try { IDE.openEditor(activePage, resource, true); } catch (PartInitException e) { JavaPlugin.log(e); } } });