/** * Removes the given master range from the given projection document. While the * modification is processed, the viewer no longer handles projection * changes, as it is causing them. * * @param projection the projection document * @param offset the offset in the master document * @param length the length in the master document * @throws BadLocationException in case the specified range is invalid * * @see ProjectionDocument#removeMasterDocumentRange(int, int) */ private void removeMasterDocumentRange(ProjectionDocument projection, int offset, int length) throws BadLocationException { if (fCommandQueue != null) { fCommandQueue.add(new ProjectionCommand(projection, ProjectionCommand.REMOVE, offset, length)); } else { try { fHandleProjectionChanges= false; // https://bugs.eclipse.org/bugs/show_bug.cgi?id=108258 // make sure the document range is strictly line based int end= offset + length; offset= toLineStart(projection.getMasterDocument(), offset, false); length= toLineStart(projection.getMasterDocument(), end, true) - offset; projection.removeMasterDocumentRange(offset, length); } finally { fHandleProjectionChanges= true; } } }
/** * Adds the given master range to the given projection document. While the * modification is processed, the viewer no longer handles projection * changes, as it is causing them. * * @param projection the projection document * @param offset the offset in the master document * @param length the length in the master document * @throws BadLocationException in case the specified range is invalid * * @see ProjectionDocument#addMasterDocumentRange(int, int) */ private void addMasterDocumentRange(ProjectionDocument projection, int offset, int length) throws BadLocationException { if (fCommandQueue != null) { fCommandQueue.add(new ProjectionCommand(projection, ProjectionCommand.ADD, offset, length)); } else { try { fHandleProjectionChanges= false; // https://bugs.eclipse.org/bugs/show_bug.cgi?id=108258 // make sure the document range is strictly line based int end= offset + length; offset= toLineStart(projection.getMasterDocument(), offset, false); length= toLineStart(projection.getMasterDocument(), end, true) - offset; projection.addMasterDocumentRange(offset, length); } finally { fHandleProjectionChanges= true; } } }
/** * Adds the given master range to the given projection document. While the * modification is processed, the viewer no longer handles projection * changes, as it is causing them. * * @param projection the projection document * @param offset the offset in the master document * @param length the length in the master document * @throws BadLocationException in case the specified range is invalid * * @see ProjectionDocument#addMasterDocumentRange(int, int) */ private void addMasterDocumentRange(ProjectionDocument projection, int offset, int length) throws BadLocationException { if (fCommandQueue != null) { fCommandQueue.add(new ProjectionCommand(projection, ProjectionCommand.ADD, offset, length)); } else { try { fHandleProjectionChanges= false; // https://bugs.eclipse.org/bugs/show_bug.cgi?id=108258 // make sure the document range is strictly line based int end= offset + length; offset= toLineStart(projection.getMasterDocument(), offset, false); length= toLineStart(projection.getMasterDocument(), end, true) - offset; projection.addMasterDocumentRange(offset, length); } finally { fHandleProjectionChanges= true; } } }
/** * Removes the given master range from the given projection document. While the * modification is processed, the viewer no longer handles projection * changes, as it is causing them. * * @param projection the projection document * @param offset the offset in the master document * @param length the length in the master document * @throws BadLocationException in case the specified range is invalid * * @see ProjectionDocument#removeMasterDocumentRange(int, int) */ private void removeMasterDocumentRange(ProjectionDocument projection, int offset, int length) throws BadLocationException { if (fCommandQueue != null) { fCommandQueue.add(new ProjectionCommand(projection, ProjectionCommand.REMOVE, offset, length)); } else { try { fHandleProjectionChanges= false; // https://bugs.eclipse.org/bugs/show_bug.cgi?id=108258 // make sure the document range is strictly line based int end= offset + length; offset= toLineStart(projection.getMasterDocument(), offset, false); length= toLineStart(projection.getMasterDocument(), end, true) - offset; projection.removeMasterDocumentRange(offset, length); } finally { fHandleProjectionChanges= true; } } }
private void internalInvalidateTextPresentation(int offset, int length) { if (fCommandQueue != null) { fCommandQueue.add(new ProjectionCommand(offset, length)); } else { invalidateTextPresentation(offset, length); } }
private void internalInvalidateTextPresentation(int offset, int length) { if (fCommandQueue != null) { fCommandQueue.add(new ProjectionCommand(offset, length)); } else { invalidateTextPresentation(offset, length); } }