/** * @see ISourceReference#getSource() */ public String getSource() throws JavaModelException { IBuffer buffer = getBuffer(); if (buffer == null) return ""; //$NON-NLS-1$ return buffer.getContents(); } /**
/** * @see ISourceReference#getSource() */ @Override public String getSource() throws JavaModelException { IBuffer buffer = getBuffer(); if (buffer == null) return ""; //$NON-NLS-1$ return buffer.getContents(); } /**
/** * @see ISourceReference#getSource() */ public String getSource() throws JavaModelException { IBuffer buffer = getBuffer(); if (buffer == null) return ""; //$NON-NLS-1$ return buffer.getContents(); } /**
/** * @see ISourceReference#getSource() */ public String getSource() throws JavaModelException { IBuffer buffer = getBuffer(); if (buffer == null) return ""; //$NON-NLS-1$ return buffer.getContents(); } /**
/** * @see ISourceReference#getSource() */ public String getSource() throws JavaModelException { IBuffer buffer = getBuffer(); if (buffer == null) return ""; //$NON-NLS-1$ return buffer.getContents(); } /**
/** * @see ISourceReference#getSource() */ public String getSource() throws JavaModelException { IBuffer buffer = getBuffer(); if (buffer == null) return ""; //$NON-NLS-1$ return buffer.getContents(); } /**
@Override public IBuffer getBuffer() throws JavaModelException { if (isWorkingCopy()) return super.getBuffer(); else return this.classFile.getBuffer(); }
public IBuffer getBuffer() throws JavaModelException { if (isWorkingCopy()) return super.getBuffer(); else return this.classFile.getBuffer(); }
public IBuffer getBuffer() throws JavaModelException { if (isWorkingCopy()) return super.getBuffer(); else return this.classFile.getBuffer(); }
public IBuffer getBuffer() throws JavaModelException { if (isWorkingCopy()) return super.getBuffer(); else return this.classFile.getBuffer(); }
public IBuffer getBuffer() throws JavaModelException { if (isWorkingCopy()) return super.getBuffer(); else return this.classFile.getBuffer(); }
public IBuffer getBuffer() throws JavaModelException { if (isWorkingCopy()) return super.getBuffer(); else return this.classFile.getBuffer(); }
public UndoEdit applyTextEdit(TextEdit edit, IProgressMonitor monitor) throws JavaModelException { IBuffer buffer = getBuffer(); if (buffer instanceof IBuffer.ITextEditCapability) { return ((IBuffer.ITextEditCapability) buffer).applyTextEdit(edit, monitor); } else if (buffer != null) { IDocument document = buffer instanceof IDocument ? (IDocument) buffer : new DocumentAdapter(buffer); try { UndoEdit undoEdit= edit.apply(document); return undoEdit; } catch (MalformedTreeException e) { throw new JavaModelException(e, IJavaModelStatusConstants.BAD_TEXT_EDIT_LOCATION); } catch (BadLocationException e) { throw new JavaModelException(e, IJavaModelStatusConstants.BAD_TEXT_EDIT_LOCATION); } } return null; // can not happen, there are no compilation units without buffer }
@Override public UndoEdit applyTextEdit(TextEdit edit, IProgressMonitor monitor) throws JavaModelException { IBuffer buffer = getBuffer(); if (buffer instanceof IBuffer.ITextEditCapability) { return ((IBuffer.ITextEditCapability) buffer).applyTextEdit(edit, monitor); } else if (buffer != null) { IDocument document = buffer instanceof IDocument ? (IDocument) buffer : new DocumentAdapter(buffer); try { UndoEdit undoEdit= edit.apply(document); return undoEdit; } catch (MalformedTreeException e) { throw new JavaModelException(e, IJavaModelStatusConstants.BAD_TEXT_EDIT_LOCATION); } catch (BadLocationException e) { throw new JavaModelException(e, IJavaModelStatusConstants.BAD_TEXT_EDIT_LOCATION); } } return null; // can not happen, there are no compilation units without buffer }
public void restore() throws JavaModelException { if (!isWorkingCopy()) return; CompilationUnit original = (CompilationUnit) getOriginalElement(); IBuffer buffer = getBuffer(); if (buffer == null) return; buffer.setContents(original.getContents()); updateTimeStamp(original); makeConsistent(null); } /**
public void restore() throws JavaModelException { if (!isWorkingCopy()) return; CompilationUnit original = (CompilationUnit) getOriginalElement(); IBuffer buffer = getBuffer(); if (buffer == null) return; buffer.setContents(original.getContents()); updateTimeStamp(original); makeConsistent(null); } /**
@Override public void restore() throws JavaModelException { if (!isWorkingCopy()) return; CompilationUnit original = (CompilationUnit) getOriginalElement(); IBuffer buffer = getBuffer(); if (buffer == null) return; buffer.setContents(original.getContents()); updateTimeStamp(original); makeConsistent(null); } /**
public void restore() throws JavaModelException { if (!isWorkingCopy()) return; CompilationUnit original = (CompilationUnit) getOriginalElement(); IBuffer buffer = getBuffer(); if (buffer == null) return; buffer.setContents(original.getContents()); updateTimeStamp(original); makeConsistent(null); } /**
public void restore() throws JavaModelException { if (!isWorkingCopy()) return; CompilationUnit original = (CompilationUnit) getOriginalElement(); IBuffer buffer = getBuffer(); if (buffer == null) return; buffer.setContents(original.getContents()); updateTimeStamp(original); makeConsistent(null); } /**
public void restore() throws JavaModelException { if (!isWorkingCopy()) return; CompilationUnit original = (CompilationUnit) getOriginalElement(); IBuffer buffer = getBuffer(); if (buffer == null) return; buffer.setContents(original.getContents()); updateTimeStamp(original); makeConsistent(null); } /**