/** * Returns the working copy remembered for the compilation unit encoded in the * given editor input. * <p> * Note: This method must not be part of the public {@link IWorkingCopyManager} API. * </p> * * @param input the editor input * @param primaryOnly if <code>true</code> only primary working copies will be returned * @return the working copy of the compilation unit, or <code>null</code> if the * input does not encode an editor input, or if there is no remembered working * copy for this compilation unit * @since 3.2 */ public ICompilationUnit getWorkingCopy(IEditorInput input, boolean primaryOnly) { ICompilationUnit unit= fMap == null ? null : (ICompilationUnit) fMap.get(input); if (unit == null) unit= fDocumentProvider.getWorkingCopy(input); if (unit != null && (!primaryOnly || JavaModelUtil.isPrimary(unit))) return unit; return null; }
/** * Returns the working copy remembered for the compilation unit encoded in the * given editor input. * <p> * Note: This method must not be part of the public {@link IWorkingCopyManager} API. * </p> * * @param input the editor input * @param primaryOnly if <code>true</code> only primary working copies will be returned * @return the working copy of the compilation unit, or <code>null</code> if the * input does not encode an editor input, or if there is no remembered working * copy for this compilation unit * @since 3.2 */ public ICompilationUnit getWorkingCopy(IEditorInput input, boolean primaryOnly) { ICompilationUnit unit= fMap == null ? null : fMap.get(input); if (unit == null) unit= fDocumentProvider.getWorkingCopy(input); if (unit != null && (!primaryOnly || JavaModelUtil.isPrimary(unit))) return unit; return null; }
/** * Returns the working copy remembered for the compilation unit encoded in the * given editor input. * <p> * Note: This method must not be part of the public {@link IWorkingCopyManager} API. * </p> * * @param input the editor input * @param primaryOnly if <code>true</code> only primary working copies will be returned * @return the working copy of the compilation unit, or <code>null</code> if the * input does not encode an editor input, or if there is no remembered working * copy for this compilation unit * @since 3.2 */ public ICompilationUnit getWorkingCopy(IEditorInput input, boolean primaryOnly) { ICompilationUnit unit= fMap == null ? null : fMap.get(input); if (unit == null) unit= fDocumentProvider.getWorkingCopy(input); if (unit != null && (!primaryOnly || JavaModelUtil.isPrimary(unit))) return unit; return null; }
private IJavaProject getProject() { ITextEditor editor= getEditor(); if (editor == null) return null; IJavaElement element= null; IEditorInput input= editor.getEditorInput(); IDocumentProvider provider= editor.getDocumentProvider(); if (provider instanceof ICompilationUnitDocumentProvider) { ICompilationUnitDocumentProvider cudp= (ICompilationUnitDocumentProvider) provider; element= cudp.getWorkingCopy(input); } else if (input instanceof IClassFileEditorInput) { IClassFileEditorInput cfei= (IClassFileEditorInput) input; element= cfei.getClassFile(); } if (element == null) return null; return element.getJavaProject(); }
private IJavaProject getProject() { ITextEditor editor= getEditor(); if (editor == null) return null; IJavaElement element= null; IEditorInput input= editor.getEditorInput(); IDocumentProvider provider= editor.getDocumentProvider(); if (provider instanceof ICompilationUnitDocumentProvider) { ICompilationUnitDocumentProvider cudp= (ICompilationUnitDocumentProvider) provider; element= cudp.getWorkingCopy(input); } else if (input instanceof IClassFileEditorInput) { IClassFileEditorInput cfei= (IClassFileEditorInput) input; element= cfei.getClassFile(); } if (element == null) return null; return element.getJavaProject(); }
private IJavaProject getProject() { ITextEditor editor= getEditor(); if (editor == null) return null; IJavaElement element= null; IEditorInput input= editor.getEditorInput(); IDocumentProvider provider= editor.getDocumentProvider(); if (provider instanceof ICompilationUnitDocumentProvider) { ICompilationUnitDocumentProvider cudp= (ICompilationUnitDocumentProvider) provider; element= cudp.getWorkingCopy(input); } else if (input instanceof IClassFileEditorInput) { IClassFileEditorInput cfei= (IClassFileEditorInput) input; element= cfei.getClassFile(); } if (element == null) return null; return element.getJavaProject(); }