Mercurial > projects > dwt2
diff org.eclipse.jface.text/src/org/eclipse/jface/text/source/IOverviewRuler.d @ 12:bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Sat, 14 Mar 2009 18:23:29 +0100 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/org.eclipse.jface.text/src/org/eclipse/jface/text/source/IOverviewRuler.d Sat Mar 14 18:23:29 2009 +0100 @@ -0,0 +1,185 @@ +/******************************************************************************* + * Copyright (c) 2000, 2005 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + * Port to the D programming language: + * Frank Benoit <benoit@tionex.de> + *******************************************************************************/ +module org.eclipse.jface.text.source.IOverviewRuler; + +import org.eclipse.jface.text.source.ISharedTextColors; // packageimport +import org.eclipse.jface.text.source.ILineRange; // packageimport +import org.eclipse.jface.text.source.IAnnotationPresentation; // packageimport +import org.eclipse.jface.text.source.IVerticalRulerInfoExtension; // packageimport +import org.eclipse.jface.text.source.ICharacterPairMatcher; // packageimport +import org.eclipse.jface.text.source.TextInvocationContext; // packageimport +import org.eclipse.jface.text.source.LineChangeHover; // packageimport +import org.eclipse.jface.text.source.IChangeRulerColumn; // packageimport +import org.eclipse.jface.text.source.IAnnotationMap; // packageimport +import org.eclipse.jface.text.source.IAnnotationModelListenerExtension; // packageimport +import org.eclipse.jface.text.source.ISourceViewerExtension2; // packageimport +import org.eclipse.jface.text.source.IAnnotationHover; // packageimport +import org.eclipse.jface.text.source.ContentAssistantFacade; // packageimport +import org.eclipse.jface.text.source.IAnnotationAccess; // packageimport +import org.eclipse.jface.text.source.IVerticalRulerExtension; // packageimport +import org.eclipse.jface.text.source.IVerticalRulerColumn; // packageimport +import org.eclipse.jface.text.source.LineNumberRulerColumn; // packageimport +import org.eclipse.jface.text.source.MatchingCharacterPainter; // packageimport +import org.eclipse.jface.text.source.IAnnotationModelExtension; // packageimport +import org.eclipse.jface.text.source.ILineDifferExtension; // packageimport +import org.eclipse.jface.text.source.DefaultCharacterPairMatcher; // packageimport +import org.eclipse.jface.text.source.LineNumberChangeRulerColumn; // packageimport +import org.eclipse.jface.text.source.IAnnotationAccessExtension; // packageimport +import org.eclipse.jface.text.source.ISourceViewer; // packageimport +import org.eclipse.jface.text.source.AnnotationModel; // packageimport +import org.eclipse.jface.text.source.ILineDifferExtension2; // packageimport +import org.eclipse.jface.text.source.IAnnotationModelListener; // packageimport +import org.eclipse.jface.text.source.IVerticalRuler; // packageimport +import org.eclipse.jface.text.source.DefaultAnnotationHover; // packageimport +import org.eclipse.jface.text.source.SourceViewer; // packageimport +import org.eclipse.jface.text.source.SourceViewerConfiguration; // packageimport +import org.eclipse.jface.text.source.AnnotationBarHoverManager; // packageimport +import org.eclipse.jface.text.source.CompositeRuler; // packageimport +import org.eclipse.jface.text.source.ImageUtilities; // packageimport +import org.eclipse.jface.text.source.VisualAnnotationModel; // packageimport +import org.eclipse.jface.text.source.IAnnotationModel; // packageimport +import org.eclipse.jface.text.source.ISourceViewerExtension3; // packageimport +import org.eclipse.jface.text.source.ILineDiffInfo; // packageimport +import org.eclipse.jface.text.source.VerticalRulerEvent; // packageimport +import org.eclipse.jface.text.source.ChangeRulerColumn; // packageimport +import org.eclipse.jface.text.source.ILineDiffer; // packageimport +import org.eclipse.jface.text.source.AnnotationModelEvent; // packageimport +import org.eclipse.jface.text.source.AnnotationColumn; // packageimport +import org.eclipse.jface.text.source.AnnotationRulerColumn; // packageimport +import org.eclipse.jface.text.source.IAnnotationHoverExtension; // packageimport +import org.eclipse.jface.text.source.AbstractRulerColumn; // packageimport +import org.eclipse.jface.text.source.ISourceViewerExtension; // packageimport +import org.eclipse.jface.text.source.AnnotationMap; // packageimport +import org.eclipse.jface.text.source.IVerticalRulerInfo; // packageimport +import org.eclipse.jface.text.source.IAnnotationModelExtension2; // packageimport +import org.eclipse.jface.text.source.LineRange; // packageimport +import org.eclipse.jface.text.source.IAnnotationAccessExtension2; // packageimport +import org.eclipse.jface.text.source.VerticalRuler; // packageimport +import org.eclipse.jface.text.source.JFaceTextMessages; // packageimport +import org.eclipse.jface.text.source.Annotation; // packageimport +import org.eclipse.jface.text.source.IVerticalRulerListener; // packageimport +import org.eclipse.jface.text.source.ISourceViewerExtension4; // packageimport +import org.eclipse.jface.text.source.AnnotationPainter; // packageimport +import org.eclipse.jface.text.source.IAnnotationHoverExtension2; // packageimport +import org.eclipse.jface.text.source.OverviewRuler; // packageimport +import org.eclipse.jface.text.source.OverviewRulerHoverManager; // packageimport + + +import java.lang.all; +import java.util.Set; + +import org.eclipse.swt.graphics.Color; +import org.eclipse.swt.widgets.Control; + +/** + * This interface defines a visual component which may serve + * text viewers as an overview annotation presentation area. This means, + * presentation of annotations is independent from the actual view port of + * the text viewer. The annotations of the viewer's whole document are + * visible in the overview ruler. + * <p> + * This interfaces embodies three contracts: + * <ul> + * <li> The overview ruler retrieves the annotations it presents from an annotation model. + * <li> The ruler is a visual component which must be integrated in a hierarchy of SWT controls. + * <li> The ruler provides interested clients with mapping and + * interaction information. This covers the mapping between + * coordinates of the ruler's control and line numbers based + * on the connected text viewer's document (<code>IVerticalRulerInfo</code>). + * </ul></p> + * <p> + * Clients may implement this interface or use the default implementation provided + * by <code>OverviewlRuler</code>.</p> + * + * @see org.eclipse.jface.text.ITextViewer + * @since 2.1 + */ +public interface IOverviewRuler : IVerticalRuler { + + /** + * Returns whether there is an annotation an the given vertical coordinate. This + * method takes the compression factor of the overview ruler into account. + * + * @param y the y-coordinate + * @return <code>true</code> if there is an annotation, <code>false</code> otherwise + */ + bool hasAnnotation(int y); + + /** + * Returns the height of the visual presentation of an annotation in this + * overview ruler. Assumes that all annotations are represented using the + * same height. + * + * @return int the visual height of an annotation + */ + int getAnnotationHeight(); + + /** + * Sets the color for the given annotation type in this overview ruler. + * + * @param annotationType the annotation type + * @param color the color + */ + void setAnnotationTypeColor(Object annotationType, Color color); + + /** + * Sets the drawing layer for the given annotation type in this overview ruler. + * + * @param annotationType the annotation type + * @param layer the drawing layer + */ + void setAnnotationTypeLayer(Object annotationType, int layer); + + /** + * Adds the given annotation type to this overview ruler. Starting with this + * call, annotations of the given type are shown in the overview ruler. + * + * @param annotationType the annotation type + */ + void addAnnotationType(Object annotationType); + + /** + * Removes the given annotation type from this overview ruler. Annotations + * of the given type are no longer shown in the overview ruler. + * + * @param annotationType the annotation type + */ + void removeAnnotationType(Object annotationType); + + /** + * Adds the given annotation type to the header of this ruler. Starting with + * this call, the presence of annotations is tracked and the header is drawn + * in the configured color. + * + * @param annotationType the annotation type to be tracked + */ + void addHeaderAnnotationType(Object annotationType); + + /** + * Removes the given annotation type from the header of this ruler. The + * presence of annotations of the given type is no longer tracked and the + * header is drawn in the default color, depending on the other configured + * configured annotation types. + * + * @param annotationType the annotation type to be removed + */ + void removeHeaderAnnotationType(Object annotationType); + + /** + * Returns this rulers header control. This is the little area between the + * top of the text widget and the top of this overview ruler. + * + * @return the header control of this overview ruler. + */ + Control getHeaderControl(); +}