diff dwtx/jface/text/source/AbstractRulerColumn.d @ 159:7926b636c282

...
author Frank Benoit <benoit@tionex.de>
date Wed, 27 Aug 2008 01:57:58 +0200
parents 000f9136b8f7
children
line wrap: on
line diff
--- a/dwtx/jface/text/source/AbstractRulerColumn.d	Tue Aug 26 02:46:34 2008 +0200
+++ b/dwtx/jface/text/source/AbstractRulerColumn.d	Wed Aug 27 01:57:58 2008 +0200
@@ -209,9 +209,9 @@
     /* Listeners */
 
     /** The viewport listener. */
-    private const InternalListener fInternalListener= new InternalListener();
+    private const InternalListener fInternalListener;
     /** The mouse handler. */
-    private const MouseHandler fMouseHandler= new MouseHandler();
+    private const MouseHandler fMouseHandler;
 
     /*
      * Implementation and context of this ruler - created and set in createControl(), disposed of in
@@ -253,6 +253,8 @@
      * Creates a new ruler.
      */
     protected this() {
+        fMouseHandler= new MouseHandler();
+        fInternalListener= new InternalListener();
     }
 
     /*
@@ -296,7 +298,7 @@
      * <p>
      * Clients may reimplement this method to create a canvas with their
      * desired style bits.</p>
-     * 
+     *
      * @return the DWT style bits, or <code>DWT.NONE</code> if none
      */
     protected int getCanvasStyle() {
@@ -336,7 +338,7 @@
     /**
      * Returns the parent ruler, <code>null</code> before
      * {@link #createControl(CompositeRuler, Composite)} has been called.
-     * 
+     *
      * @return the parent ruler or <code>null</code>
      */
     protected final CompositeRuler getParentRuler() {
@@ -345,7 +347,7 @@
 
     /**
      * {@inheritDoc}
-     * 
+     *
      * @param font the font or <code>null</code> to use the default font
      */
     public final void setFont(Font font) {
@@ -358,7 +360,7 @@
     /**
      * Returns the current font. If a font has not been explicitly set, the widget's font is
      * returned.
-     * 
+     *
      * @return the font used to render text on the ruler.
      */
     protected final Font getFont() {
@@ -371,7 +373,7 @@
 
     /**
      * Sets the text inset (padding) used to draw text in {@link #paintLine(GC, int, int, int, int)}.
-     * 
+     *
      * @param textInset the new text inset
      */
     protected final void setTextInset(int textInset) {
@@ -384,7 +386,7 @@
     /**
      * Returns the text inset for text drawn by {@link #paintLine(GC, int, int, int, int)}. The
      * <code>DEFAULT_TEXT_INSET</code> constant specifies the default inset in pixels.
-     * 
+     *
      * @return the text inset for text
      */
     protected final int getTextInset() {
@@ -412,7 +414,7 @@
      * Sets the default background color for this column. The default background is used as default
      * implementation of {@link #computeBackground(int)} and also to paint the area of the ruler
      * that does not correspond to any lines (when the viewport is not entirely filled with lines).
-     * 
+     *
      * @param background the default background color, <code>null</code> to use the text widget's
      *        background
      */
@@ -427,7 +429,7 @@
 
     /**
      * Returns the background color. May return <code>null</code> if the system is shutting down.
-     * 
+     *
      * @return the background color
      */
     protected final Color getDefaultBackground() {
@@ -447,7 +449,7 @@
 
     /**
      * Sets the annotation hover.
-     * 
+     *
      * @param hover the annotation hover, <code>null</code> for no hover
      */
     protected final void setHover(IAnnotationHover hover) {
@@ -496,7 +498,7 @@
 
     /**
      * Marks the region covered by <code>lines</code> as needing to be redrawn.
-     * 
+     *
      * @param lines the lines to be redrawn in document coordinates
      */
     protected final void redraw(ILineRange lines) {
@@ -515,7 +517,7 @@
 
     /**
      * Paints the ruler column.
-     * 
+     *
      * @param event the paint event
      */
     private void paintControl(PaintEvent event) {
@@ -541,7 +543,7 @@
 
     /**
      * Computes the widget lines that need repainting given the clipping region of a paint event.
-     * 
+     *
      * @param event the paint event
      * @return the lines in widget coordinates that need repainting
      */
@@ -559,7 +561,7 @@
      * Subclasses may replace or extend. The default implementation calls
      * {@link #paintLine(GC, int, int, int, int)} for every visible line.
      * </p>
-     * 
+     *
      * @param gc the graphics context to paint on
      * @param lines the lines to paint in widget coordinates
      */
@@ -584,7 +586,7 @@
      * the entire width using the {@link #computeBackground(int) background color}. The text is
      * drawn {@link #getTextInset()} pixels to the right of the left border.
      * </p>
-     * 
+     *
      * @param gc the graphics context to paint on
      * @param modelLine the model line (based on document coordinates)
      * @param widgetLine the line in the text widget corresponding to <code>modelLine</code>
@@ -607,7 +609,7 @@
      * <p>
      * Subclasses may replace or extend.
      * </p>
-     * 
+     *
      * @param line the document line number
      * @return the text to be drawn for the given line, <code>null</code> for no text
      */
@@ -622,7 +624,7 @@
      * <p>
      * Subclasses may replace or extend.
      * </p>
-     * 
+     *
      * @param line the document line number
      * @return the background color for drawn for the given line
      */
@@ -637,7 +639,7 @@
      * <p>
      * Subclasses may replace or extend.
      * </p>
-     * 
+     *
      * @param line the document line number
      * @return the foreground color for drawn for the given line
      */
@@ -676,7 +678,7 @@
     /**
      * Scrolls the canvas vertically (adapted from
      * {@linkplain StyledText StyledText.scrollVertical()}).
-     * 
+     *
      * @param pixels the number of pixels to scroll (negative to scroll upwards)
      * @return <code>true</code> if the widget was scrolled, <code>false</code> if the widget
      *         was not scrolled