/** * Undo the change described by this change. */ protected void undoTextChange() { try { if (fDocumentUndoManager.fDocument instanceof IDocumentExtension4) ((IDocumentExtension4) fDocumentUndoManager.fDocument).replace(fStart, fText .length(), fPreservedText, fUndoModificationStamp); else fDocumentUndoManager.fDocument.replace(fStart, fText.length(), fPreservedText); } catch (BadLocationException x) { } }
/** * Re-applies the change described by this change. */ protected void redoTextChange() { try { if (fDocumentUndoManager.fDocument instanceof IDocumentExtension4) ((IDocumentExtension4) fDocumentUndoManager.fDocument).replace(fStart, fEnd - fStart, fText, fRedoModificationStamp); else fDocumentUndoManager.fDocument.replace(fStart, fEnd - fStart, fText); } catch (BadLocationException x) { } }
/** * Re-applies the change described by this change. */ protected void redoTextChange() { try { if (fDocumentUndoManager.fDocument instanceof IDocumentExtension4) ((IDocumentExtension4) fDocumentUndoManager.fDocument).replace(fStart, fEnd - fStart, fText, fRedoModificationStamp); else fDocumentUndoManager.fDocument.replace(fStart, fEnd - fStart, fText); } catch (BadLocationException x) { } }
/** * Undo the change described by this change. */ protected void undoTextChange() { try { if (fDocumentUndoManager.fDocument instanceof IDocumentExtension4) ((IDocumentExtension4) fDocumentUndoManager.fDocument).replace(fStart, fText .length(), fPreservedText, fUndoModificationStamp); else fDocumentUndoManager.fDocument.replace(fStart, fText.length(), fPreservedText); } catch (BadLocationException x) { } }
/** * Undo the change described by this command. * * @since 2.0 */ protected void undoTextChange() { try { IDocument document= fTextViewer.getDocument(); if (document instanceof IDocumentExtension4) ((IDocumentExtension4)document).replace(fStart, fText.length(), fPreservedText, fUndoModificationStamp); else document.replace(fStart, fText.length(), fPreservedText); } catch (BadLocationException x) { } }
/** * Undo the change described by this command. * * @since 2.0 */ protected void undoTextChange() { try { IDocument document= fTextViewer.getDocument(); if (document instanceof IDocumentExtension4) ((IDocumentExtension4)document).replace(fStart, fText.length(), fPreservedText, fUndoModificationStamp); else document.replace(fStart, fText.length(), fPreservedText); } catch (BadLocationException x) { } }
private void performEdit(IDocument document, long oldFileValue, LinkedList<UndoEdit> editCollector, long[] oldDocValue, boolean[] setContentStampSuccess) throws MalformedTreeException, BadLocationException, CoreException { if (document instanceof IDocumentExtension4) { oldDocValue[0]= ((IDocumentExtension4)document).getModificationStamp(); } else { oldDocValue[0]= oldFileValue; } // perform the changes for (int index= 0; index < fUndos.length; index++) { UndoEdit edit= fUndos[index]; UndoEdit redo= edit.apply(document, TextEdit.CREATE_UNDO); editCollector.addFirst(redo); } if (document instanceof IDocumentExtension4 && fDocumentStamp != IDocumentExtension4.UNKNOWN_MODIFICATION_STAMP) { try { ((IDocumentExtension4)document).replace(0, 0, "", fDocumentStamp); //$NON-NLS-1$ setContentStampSuccess[0]= true; } catch (BadLocationException e) { throw wrapBadLocationException(e); } } } }
private void performEdit(IDocument document, long oldFileValue, LinkedList<UndoEdit> editCollector, long[] oldDocValue, boolean[] setContentStampSuccess) throws MalformedTreeException, BadLocationException, CoreException { if (document instanceof IDocumentExtension4) { oldDocValue[0]= ((IDocumentExtension4)document).getModificationStamp(); } else { oldDocValue[0]= oldFileValue; } // perform the changes for (int index= 0; index < fUndos.length; index++) { UndoEdit edit= fUndos[index]; UndoEdit redo= edit.apply(document, TextEdit.CREATE_UNDO); editCollector.addFirst(redo); } if (document instanceof IDocumentExtension4 && fDocumentStamp != IDocumentExtension4.UNKNOWN_MODIFICATION_STAMP) { try { ((IDocumentExtension4)document).replace(0, 0, "", fDocumentStamp); //$NON-NLS-1$ setContentStampSuccess[0]= true; } catch (BadLocationException e) { throw wrapBadLocationException(e); } } } }
public static boolean set(IDocument document, ContentStamp s) throws CoreException { if (!(s instanceof ContentStampImpl)) return false; ContentStampImpl stamp= (ContentStampImpl)s; if (document instanceof IDocumentExtension4 && stamp.isDocumentStamp()) { try { ((IDocumentExtension4)document).replace(0, 0, "", stamp.getValue()); //$NON-NLS-1$ return true; } catch (BadLocationException e) { throw Changes.asCoreException(e); } } return false; } }
public static boolean set(IDocument document, ContentStamp s) throws CoreException { if (!(s instanceof ContentStampImpl)) return false; ContentStampImpl stamp= (ContentStampImpl)s; if (document instanceof IDocumentExtension4 && stamp.isDocumentStamp()) { try { ((IDocumentExtension4)document).replace(0, 0, "", stamp.getValue()); //$NON-NLS-1$ return true; } catch (BadLocationException e) { throw Changes.asCoreException(e); } } return false; } }
/** * Re-applies the change described by this command. * * @since 2.0 */ protected void redoTextChange() { try { IDocument document= fTextViewer.getDocument(); if (document instanceof IDocumentExtension4) ((IDocumentExtension4)document).replace(fStart, fEnd - fStart, fText, fRedoModificationStamp); else fTextViewer.getDocument().replace(fStart, fEnd - fStart, fText); } catch (BadLocationException x) { } }
/** * Re-applies the change described by this command. * * @since 2.0 */ protected void redoTextChange() { try { IDocument document= fTextViewer.getDocument(); if (document instanceof IDocumentExtension4) ((IDocumentExtension4)document).replace(fStart, fEnd - fStart, fText, fRedoModificationStamp); else fTextViewer.getDocument().replace(fStart, fEnd - fStart, fText); } catch (BadLocationException x) { } }
public static boolean set(IDocument document, ContentStamp s) throws CoreException { if (!(s instanceof ContentStampImpl)) return false; ContentStampImpl stamp= (ContentStampImpl)s; if (document instanceof IDocumentExtension4 && stamp.isDocumentStamp()) { try { ((IDocumentExtension4)document).replace(0, 0, "", stamp.getValue()); //$NON-NLS-1$ return true; } catch (BadLocationException e) { throw Changes.asCoreException(e); } } return false; } }
((IDocumentExtension4)document).replace(0, 0, "", fDocumentStamp); //$NON-NLS-1$ stampSetted= true; } catch (BadLocationException e) {