@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 public void mouseExit(MouseEvent e) { if (clearCurrentAnnotation()) redraw(); } });
@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); } }
/** * Enables projection mode. If not yet done, installs the projection ruler * column in the viewer's vertical ruler and installs a painter that * indicate the locations of collapsed regions. * */ protected void doEnableProjection() { if (fPainter == null) { fPainter= new ProjectionAnnotationsPainter(fViewer, fAnnotationAccess); fPainter.addDrawingStrategy(PROJECTION, getDrawingStrategy()); fPainter.addAnnotationType(ProjectionAnnotation.TYPE, PROJECTION); fPainter.setAnnotationTypeColor(ProjectionAnnotation.TYPE, fSharedTextColors.getColor(getColor())); fViewer.addPainter(fPainter); } if (fColumn == null) { fColumn= new ProjectionRulerColumn(9, fAnnotationAccess); fColumn.addAnnotationType(ProjectionAnnotation.TYPE); fColumn.setHover(createProjectionAnnotationHover()); fViewer.addVerticalRulerColumn(fColumn); } fColumn.setModel(fViewer.getVisualAnnotationModel()); }
IAnnotationModel model= getModel(); if (model != null) { IDocument document= getCachedTextViewer().getDocument(); continue; int distance= getDistance(annotation, p, document, line); if (distance == -1) continue;
@Override public void mouseMove(MouseEvent e) { boolean redraw= false; ProjectionAnnotation annotation= findAnnotation(toDocumentLineNumber(e.y), false); if (annotation != fCurrentAnnotation) { if (fCurrentAnnotation != null) { fCurrentAnnotation.setRangeIndication(false); redraw= true; } fCurrentAnnotation= annotation; if (fCurrentAnnotation != null && !fCurrentAnnotation.isCollapsed()) { fCurrentAnnotation.setRangeIndication(true); redraw= true; } } if (redraw) redraw(); } });
@Override protected boolean hasAnnotation(int lineNumber) { return findAnnotation(lineNumber, true) != null; } }
Color background= getCachedTextViewer().getTextWidget().getBackground(); control.setBackground(background);
/** * Enables projection mode. If not yet done, installs the projection ruler * column in the viewer's vertical ruler and installs a painter that * indicate the locations of collapsed regions. * */ protected void doEnableProjection() { if (fPainter == null) { fPainter= new ProjectionAnnotationsPainter(fViewer, fAnnotationAccess); fPainter.addDrawingStrategy(PROJECTION, getDrawingStrategy()); fPainter.addAnnotationType(ProjectionAnnotation.TYPE, PROJECTION); fPainter.setAnnotationTypeColor(ProjectionAnnotation.TYPE, fSharedTextColors.getColor(getColor())); fViewer.addPainter(fPainter); } if (fColumn == null) { fColumn= new ProjectionRulerColumn(9, fAnnotationAccess); fColumn.addAnnotationType(ProjectionAnnotation.TYPE); fColumn.setHover(createProjectionAnnotationHover()); fViewer.addVerticalRulerColumn(fColumn); } fColumn.setModel(fViewer.getVisualAnnotationModel()); }
IAnnotationModel model= getModel(); if (model != null) { IDocument document= getCachedTextViewer().getDocument(); continue; int distance= getDistance(annotation, p, document, line); if (distance == -1) continue;
@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); } }
@Override public void mouseMove(MouseEvent e) { boolean redraw= false; ProjectionAnnotation annotation= findAnnotation(toDocumentLineNumber(e.y), false); if (annotation != fCurrentAnnotation) { if (fCurrentAnnotation != null) { fCurrentAnnotation.setRangeIndication(false); redraw= true; } fCurrentAnnotation= annotation; if (fCurrentAnnotation != null && !fCurrentAnnotation.isCollapsed()) { fCurrentAnnotation.setRangeIndication(true); redraw= true; } } if (redraw) redraw(); } });
@Override protected boolean hasAnnotation(int lineNumber) { return findAnnotation(lineNumber, true) != null; } }
Color background= getCachedTextViewer().getTextWidget().getBackground(); control.setBackground(background);
@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 public void mouseExit(MouseEvent e) { if (clearCurrentAnnotation()) redraw(); } });