/** * Expands all annotations that overlap with the given range and are collapsed. * * @param offset the range offset * @param length the range length * @return <code>true</code> if any annotation has been expanded, <code>false</code> otherwise */ public boolean expandAll(int offset, int length) { return expandAll(offset, length, true); }
/** * Expands all annotations that overlap with the given range and are collapsed. * * @param offset the range offset * @param length the range length * @return <code>true</code> if any annotation has been expanded, <code>false</code> otherwise */ public boolean expandAll(int offset, int length) { return expandAll(offset, length, true); }
private void expandAll() { int offset= 0; IDocument doc= getDocument(); int length= doc == null ? 0 : doc.getLength(); if (isProjectionMode()) { fProjectionAnnotationModel.expandAll(offset, length); } }
private void expandAll() { int offset= 0; IDocument doc= getDocument(); int length= doc == null ? 0 : doc.getLength(); if (isProjectionMode()) { fProjectionAnnotationModel.expandAll(offset, length); } }
@Override public boolean exposeModelRange(IRegion modelRange) { if (isProjectionMode()) return fProjectionAnnotationModel.expandAll(modelRange.getOffset(), modelRange.getLength()); if (!overlapsWithVisibleRegion(modelRange.getOffset(), modelRange.getLength())) { resetVisibleRegion(); return true; } return false; }
@Override public boolean exposeModelRange(IRegion modelRange) { if (isProjectionMode()) return fProjectionAnnotationModel.expandAll(modelRange.getOffset(), modelRange.getLength()); if (!overlapsWithVisibleRegion(modelRange.getOffset(), modelRange.getLength())) { resetVisibleRegion(); return true; } return false; }
@Override protected void handleVisibleDocumentChanged(DocumentEvent event) { if (fHandleProjectionChanges && event instanceof ProjectionDocumentEvent && isProjectionMode()) { ProjectionDocumentEvent e= (ProjectionDocumentEvent) event; DocumentEvent master= e.getMasterEvent(); if (master != null) fReplaceVisibleDocumentExecutionTrigger= master.getDocument(); try { int replaceLength= e.getText() == null ? 0 : e.getText().length(); if (ProjectionDocumentEvent.PROJECTION_CHANGE == e.getChangeType()) { if (e.getLength() == 0 && replaceLength != 0) fProjectionAnnotationModel.expandAll(e.getMasterOffset(), e.getMasterLength()); } else if (master != null && (replaceLength > 0 || fDeletedLines > 1)) { try { int numberOfLines= e.getDocument().getNumberOfLines(e.getOffset(), replaceLength); if (numberOfLines > 1 || fDeletedLines > 1) fProjectionAnnotationModel.expandAll(master.getOffset(), replaceLength); } catch (BadLocationException x) { } } } finally { fReplaceVisibleDocumentExecutionTrigger= null; } } }
@Override protected void handleVisibleDocumentChanged(DocumentEvent event) { if (fHandleProjectionChanges && event instanceof ProjectionDocumentEvent && isProjectionMode()) { ProjectionDocumentEvent e= (ProjectionDocumentEvent) event; DocumentEvent master= e.getMasterEvent(); if (master != null) fReplaceVisibleDocumentExecutionTrigger= master.getDocument(); try { int replaceLength= e.getText() == null ? 0 : e.getText().length(); if (ProjectionDocumentEvent.PROJECTION_CHANGE == e.getChangeType()) { if (e.getLength() == 0 && replaceLength != 0) fProjectionAnnotationModel.expandAll(e.getMasterOffset(), e.getMasterLength()); } else if (master != null && (replaceLength > 0 || fDeletedLines > 1)) { try { int numberOfLines= e.getDocument().getNumberOfLines(e.getOffset(), replaceLength); if (numberOfLines > 1 || fDeletedLines > 1) fProjectionAnnotationModel.expandAll(master.getOffset(), replaceLength); } catch (BadLocationException x) { } } } finally { fReplaceVisibleDocumentExecutionTrigger= null; } } }