public static IWorkbench getActiveWorkbench() { CompareUIPlugin plugin= getDefault(); if (plugin == null) return null; return plugin.getWorkbench(); }
public static IWorkbench getActiveWorkbench() { CompareUIPlugin plugin= getDefault(); if (plugin == null) return null; return plugin.getWorkbench(); }
/** * Returns an array of all editors that have an unsaved content. If the identical content is * presented in more than one editor, only one of those editor parts is part of the result. * * @return an array of all dirty editor parts. */ public static IEditorPart[] getDirtyEditors() { Set inputs= new HashSet(); List result= new ArrayList(0); IWorkbench workbench= getDefault().getWorkbench(); IWorkbenchWindow[] windows= workbench.getWorkbenchWindows(); for (int i= 0; i < windows.length; i++) { IWorkbenchPage[] pages= windows[i].getPages(); for (int x= 0; x < pages.length; x++) { IEditorPart[] editors= pages[x].getDirtyEditors(); for (int z= 0; z < editors.length; z++) { IEditorPart ep= editors[z]; IEditorInput input= ep.getEditorInput(); if (!inputs.contains(input)) { inputs.add(input); result.add(ep); } } } } return (IEditorPart[])result.toArray(new IEditorPart[result.size()]); }
/** * Returns an array of all editors that have an unsaved content. If the identical content is * presented in more than one editor, only one of those editor parts is part of the result. * * @return an array of all dirty editor parts. */ public static IEditorPart[] getDirtyEditors() { Set<IEditorInput> inputs= new HashSet<IEditorInput>(); List<IEditorPart> result= new ArrayList<IEditorPart>(0); IWorkbench workbench= getDefault().getWorkbench(); IWorkbenchWindow[] windows= workbench.getWorkbenchWindows(); for (int i= 0; i < windows.length; i++) { IWorkbenchPage[] pages= windows[i].getPages(); for (int x= 0; x < pages.length; x++) { IEditorPart[] editors= pages[x].getDirtyEditors(); for (int z= 0; z < editors.length; z++) { IEditorPart ep= editors[z]; IEditorInput input= ep.getEditorInput(); if (!inputs.contains(input)) { inputs.add(input); result.add(ep); } } } } return result.toArray(new IEditorPart[result.size()]); }
private static Image createWorkbenchImage(String type) { IEditorRegistry er= getDefault().getWorkbench().getEditorRegistry(); ImageDescriptor id= er.getImageDescriptor("foo." + type); //$NON-NLS-1$ return id.createImage(); }
private static Image createWorkbenchImage(String type) { IEditorRegistry er= getDefault().getWorkbench().getEditorRegistry(); ImageDescriptor id= er.getImageDescriptor("foo." + type); //$NON-NLS-1$ return id.createImage(); }
if (fgComparePlugin != null) { if (ITypedElement.FOLDER_TYPE.equals(type)) { image= getDefault().getWorkbench().getSharedImages().getImage(ISharedImages.IMG_OBJ_FOLDER);
if (fgComparePlugin != null) { if (ITypedElement.FOLDER_TYPE.equals(type)) { image= getDefault().getWorkbench().getSharedImages().getImage(ISharedImages.IMG_OBJ_FOLDER);