/** * Executes the given runnable in the Display thread */ protected void async(Runnable r) { Control control= getVerticalRuler().getControl(); if (!control.isDisposed()) { control.getDisplay().asyncExec(r); } }
@Override protected void createControl(Composite parent, int styles) { if (fVerticalRuler != null || fOverviewRuler != null) { styles= (styles & ~SWT.BORDER); fComposite= new Canvas(parent, SWT.NONE); fComposite.setLayout(createLayout()); parent= fComposite; } super.createControl(parent, styles); if (fVerticalRuler != null) fVerticalRuler.createControl(fComposite, this); if (fOverviewRuler != null) fOverviewRuler.createControl(fComposite, this); }
@Override protected Point computeSize(Composite composite, int wHint, int hHint, boolean flushCache) { Control[] children= composite.getChildren(); Point s= children[children.length - 1].computeSize(SWT.DEFAULT, SWT.DEFAULT, flushCache); if (fVerticalRuler != null && fIsVerticalRulerVisible) s.x += fVerticalRuler.getWidth() + fGap; return s; }
final boolean hScrollVisible= horizontalBar != null && horizontalBar.getVisible(); if (fVerticalRuler != null && fIsVerticalRulerVisible) { int verticalRulerWidth= fVerticalRuler.getWidth(); final Control verticalRulerControl= fVerticalRuler.getControl(); int oldWidth= verticalRulerControl.getBounds().width; int rulerHeight= clArea.height - topTrim;
@Override public void update() { //bug 38745 IDocument document= getDocument(); if (document != null) { int line= getVerticalRuler().getLineOfLastMouseButtonActivity() + 1; if (line > document.getNumberOfLines()) { setEnabled(false); setText(fAddLabel); } else { fMarkers= getMarkers(); setEnabled(getResource() != null && (fMarkers.isEmpty() || markersUserEditable(fMarkers))); setText(fMarkers.isEmpty() ? fAddLabel : fRemoveLabel); } } }
@Override public void setDocument(IDocument document, IAnnotationModel annotationModel, int modelRangeOffset, int modelRangeLength) { disposeVisualAnnotationModel(); if (annotationModel != null && document != null) { fVisualAnnotationModel= createVisualAnnotationModel(annotationModel); // Make sure the visual model uses the same lock as the underlying model if (annotationModel instanceof ISynchronizable && fVisualAnnotationModel instanceof ISynchronizable) { ISynchronizable sync= (ISynchronizable)fVisualAnnotationModel; sync.setLockObject(((ISynchronizable)annotationModel).getLockObject()); } fVisualAnnotationModel.connect(document); } if (modelRangeOffset == -1 && modelRangeLength == -1) super.setDocument(document); else super.setDocument(document, modelRangeOffset, modelRangeLength); if (fVerticalRuler != null) fVerticalRuler.setModel(fVisualAnnotationModel); if (fOverviewRuler != null) fOverviewRuler.setModel(fVisualAnnotationModel); }
final boolean hScrollVisible= horizontalBar != null && horizontalBar.getVisible(); if (fVerticalRuler != null && fIsVerticalRulerVisible) { int verticalRulerWidth= fVerticalRuler.getWidth(); final Control verticalRulerControl= fVerticalRuler.getControl(); int oldWidth= verticalRulerControl.getBounds().width; int rulerHeight= clArea.height - topTrim;
public void update() { //bug 38745 int line= getVerticalRuler().getLineOfLastMouseButtonActivity() + 1; IDocument document= getDocument(); if (document != null) { if (line > getDocument().getNumberOfLines()) { setEnabled(false); setText(fAddLabel); } else { fMarkers= getMarkers(); setEnabled(getResource() != null && (fMarkers.isEmpty() || markersUserEditable(fMarkers))); setText(fMarkers.isEmpty() ? fAddLabel : fRemoveLabel); } } }
@Override public void setDocument(IDocument document, IAnnotationModel annotationModel, int modelRangeOffset, int modelRangeLength) { disposeVisualAnnotationModel(); if (annotationModel != null && document != null) { fVisualAnnotationModel= createVisualAnnotationModel(annotationModel); // Make sure the visual model uses the same lock as the underlying model if (annotationModel instanceof ISynchronizable && fVisualAnnotationModel instanceof ISynchronizable) { ISynchronizable sync= (ISynchronizable)fVisualAnnotationModel; sync.setLockObject(((ISynchronizable)annotationModel).getLockObject()); } fVisualAnnotationModel.connect(document); } if (modelRangeOffset == -1 && modelRangeLength == -1) super.setDocument(document); else super.setDocument(document, modelRangeOffset, modelRangeLength); if (fVerticalRuler != null) fVerticalRuler.setModel(fVisualAnnotationModel); if (fOverviewRuler != null) fOverviewRuler.setModel(fVisualAnnotationModel); }
fVerticalRuler.update();
/** * After this method has been executed the caller knows that any installed annotation hover has been installed. */ protected void ensureAnnotationHoverManagerInstalled() { if (fVerticalRuler != null && (fAnnotationHover != null || !isVerticalRulerOnlyShowingAnnotations()) && fVerticalRulerHoveringController == null && fHoverControlCreator != null) { fVerticalRulerHoveringController= new AnnotationBarHoverManager(fVerticalRuler, this, fAnnotationHover, fHoverControlCreator); fVerticalRulerHoveringController.install(fVerticalRuler.getControl()); fVerticalRulerHoveringController.getInternalAccessor().setInformationControlReplacer(new StickyHoverManager(this)); } }
@Override protected Point computeSize(Composite composite, int wHint, int hHint, boolean flushCache) { Control[] children= composite.getChildren(); Point s= children[children.length - 1].computeSize(SWT.DEFAULT, SWT.DEFAULT, flushCache); if (fVerticalRuler != null && fIsVerticalRulerVisible) s.x += fVerticalRuler.getWidth() + fGap; return s; }
@Override protected void createControl(Composite parent, int styles) { if (fVerticalRuler != null || fOverviewRuler != null) { styles= (styles & ~SWT.BORDER); fComposite= new Canvas(parent, SWT.NONE); fComposite.setLayout(createLayout()); parent= fComposite; } super.createControl(parent, styles); if (fVerticalRuler != null) fVerticalRuler.createControl(fComposite, this); if (fOverviewRuler != null) fOverviewRuler.createControl(fComposite, this); }
/** * After this method has been executed the caller knows that any installed annotation hover has been installed. */ protected void ensureAnnotationHoverManagerInstalled() { if (fVerticalRuler != null && (fAnnotationHover != null || !isVerticalRulerOnlyShowingAnnotations()) && fVerticalRulerHoveringController == null && fHoverControlCreator != null) { fVerticalRulerHoveringController= new AnnotationBarHoverManager(fVerticalRuler, this, fAnnotationHover, fHoverControlCreator); fVerticalRulerHoveringController.install(fVerticalRuler.getControl()); fVerticalRulerHoveringController.getInternalAccessor().setInformationControlReplacer(new StickyHoverManager(this)); } }
manager.addMenuListener(getContextMenuListener()); Control rulerControl= fVerticalRuler.getControl(); fRulerContextMenu= manager.createContextMenu(rulerControl); rulerControl.setMenu(fRulerContextMenu);
manager.addMenuListener(getContextMenuListener()); Control rulerControl= fVerticalRuler.getControl(); fRulerContextMenu= manager.createContextMenu(rulerControl); rulerControl.setMenu(fRulerContextMenu);
manager.addMenuListener(getContextMenuListener()); Control rulerControl= fVerticalRuler.getControl(); fRulerContextMenu= manager.createContextMenu(rulerControl); rulerControl.setMenu(fRulerContextMenu);