/** * Installs this projection support on its viewer. */ public void install() { fViewer.setProjectionSummary(createProjectionSummary()); fProjectionListener= new ProjectionListener(); fViewer.addProjectionListener(fProjectionListener); }
private void internalInvalidateTextPresentation(int offset, int length) { if (fCommandQueue != null) { fCommandQueue.add(new ProjectionCommand(offset, length)); } else { invalidateTextPresentation(offset, length); } }
/** * Disables the projection mode. */ public final void disableProjection() { if (isProjectionMode()) { removeProjectionAnnotationModel(getVisualAnnotationModel()); fProjectionAnnotationModel.removeAllAnnotations(); fFindReplaceDocumentAdapter= null; fireProjectionDisabled(); } }
private void internalUpdateSummaries(IProgressMonitor monitor) { IAnnotationModel visualAnnotationModel= fProjectionViewer.getVisualAnnotationModel(); if (visualAnnotationModel == null) return; removeSummaries(monitor, visualAnnotationModel); if (isCanceled(monitor)) return; createSummaries(monitor, visualAnnotationModel); }
@Override protected void mouseClicked(int line) { clearCurrentAnnotation(); if (fMouseDownLine != line) return; ProjectionAnnotation annotation= findAnnotation(line, true); if (annotation != null) { ProjectionAnnotationModel model= (ProjectionAnnotationModel) getModel(); model.toggleExpansionState(annotation); } }
@Override protected void mouseDoubleClicked(int rulerLine) { if (findAnnotation(rulerLine, true) != null) return; ProjectionAnnotation annotation= findAnnotation(rulerLine, false); if (annotation != null) { ProjectionAnnotationModel model= (ProjectionAnnotationModel)getModel(); model.toggleExpansionState(annotation); } }
private void processModelChanged(IAnnotationModel model, AnnotationModelEvent event) { if (model == fProjectionAnnotationModel) { if (fProjectionSummary != null) fProjectionSummary.updateSummaries(); processCatchupRequest(event); } else if (model == getAnnotationModel() && fProjectionSummary != null) fProjectionSummary.updateSummaries(); } }
/** * Replace the visible document with the given document. Maintains the * scroll offset and the selection. * * @param slave the visible document */ private void replaceVisibleDocument(IDocument slave) { if (fReplaceVisibleDocumentExecutionTrigger != null) { ReplaceVisibleDocumentExecutor executor= new ReplaceVisibleDocumentExecutor(slave); executor.install(fReplaceVisibleDocumentExecutionTrigger); } else executeReplaceVisibleDocument(slave); }
/** * Forces an updated of the annotation summary. */ public void updateSummaries() { synchronized (fLock) { if (fConfiguredAnnotationTypes != null) { if (fSummarizer == null) fSummarizer= new Summarizer(); fSummarizer.reset(); } } }
/** * Returns the drawing strategy to be used by the support's annotation painter. * * @return the drawing strategy to be used by the support's annotation painter * @since 3.1 */ private AnnotationPainter.IDrawingStrategy getDrawingStrategy() { if (fDrawingStrategy == null) fDrawingStrategy= new ProjectionDrawingStrategy(); return fDrawingStrategy; }
private boolean clearCurrentAnnotation() { if (fCurrentAnnotation != null) { fCurrentAnnotation.setRangeIndication(false); fCurrentAnnotation= null; return true; } return false; }
/** * 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); }
/** * Disables the projection mode. */ public final void disableProjection() { if (isProjectionMode()) { removeProjectionAnnotationModel(getVisualAnnotationModel()); fProjectionAnnotationModel.removeAllAnnotations(); fFindReplaceDocumentAdapter= null; fireProjectionDisabled(); } }
/** * Installs this projection support on its viewer. */ public void install() { fViewer.setProjectionSummary(createProjectionSummary()); fProjectionListener= new ProjectionListener(); fViewer.addProjectionListener(fProjectionListener); }
private void internalUpdateSummaries(IProgressMonitor monitor) { IAnnotationModel visualAnnotationModel= fProjectionViewer.getVisualAnnotationModel(); if (visualAnnotationModel == null) return; removeSummaries(monitor, visualAnnotationModel); if (isCanceled(monitor)) return; createSummaries(monitor, visualAnnotationModel); }
@Override protected void mouseClicked(int line) { clearCurrentAnnotation(); if (fMouseDownLine != line) return; ProjectionAnnotation annotation= findAnnotation(line, true); if (annotation != null) { ProjectionAnnotationModel model= (ProjectionAnnotationModel) getModel(); model.toggleExpansionState(annotation); } }
private void internalInvalidateTextPresentation(int offset, int length) { if (fCommandQueue != null) { fCommandQueue.add(new ProjectionCommand(offset, length)); } else { invalidateTextPresentation(offset, length); } }
@Override protected void mouseDoubleClicked(int rulerLine) { if (findAnnotation(rulerLine, true) != null) return; ProjectionAnnotation annotation= findAnnotation(rulerLine, false); if (annotation != null) { ProjectionAnnotationModel model= (ProjectionAnnotationModel)getModel(); model.toggleExpansionState(annotation); } }
private void processModelChanged(IAnnotationModel model, AnnotationModelEvent event) { if (model == fProjectionAnnotationModel) { if (fProjectionSummary != null) fProjectionSummary.updateSummaries(); processCatchupRequest(event); } else if (model == getAnnotationModel() && fProjectionSummary != null) fProjectionSummary.updateSummaries(); } }
/** * Replace the visible document with the given document. Maintains the * scroll offset and the selection. * * @param slave the visible document */ private void replaceVisibleDocument(IDocument slave) { if (fReplaceVisibleDocumentExecutionTrigger != null) { ReplaceVisibleDocumentExecutor executor= new ReplaceVisibleDocumentExecutor(slave); executor.install(fReplaceVisibleDocumentExecutionTrigger); } else executeReplaceVisibleDocument(slave); }