Mercurial > projects > dwt-addons
diff dwtx/jface/text/AbstractInformationControlManager.d @ 159:7926b636c282
...
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Wed, 27 Aug 2008 01:57:58 +0200 |
parents | a9566845f1cb |
children | 3678e4f1a766 |
line wrap: on
line diff
--- a/dwtx/jface/text/AbstractInformationControlManager.d Tue Aug 26 02:46:34 2008 +0200 +++ b/dwtx/jface/text/AbstractInformationControlManager.d Wed Aug 27 01:57:58 2008 +0200 @@ -320,16 +320,21 @@ } /** Internal anchor list. */ - private const static Anchor[] ANCHORS= { new Anchor(DWT.TOP), new Anchor(DWT.BOTTOM), new Anchor(DWT.LEFT), new Anchor(DWT.RIGHT) }; + private static Anchor[] ANCHORS_; + private static Anchor[] ANCHORS() { + if( ANCHORS_ is null ) ANCHORS_= [ new Anchor(DWT.TOP), new Anchor(DWT.BOTTOM), new Anchor(DWT.LEFT), new Anchor(DWT.RIGHT) ]; + return ANCHORS_; + } + /** Anchor representing the top of the information area */ - public const static Anchor ANCHOR_TOP= ANCHORS[0]; + public static Anchor ANCHOR_TOP() { return ANCHORS()[0]; } /** Anchor representing the bottom of the information area */ - public const static Anchor ANCHOR_BOTTOM= ANCHORS[1]; + public static Anchor ANCHOR_BOTTOM() { return ANCHORS()[1]; } /** Anchor representing the left side of the information area */ - public const static Anchor ANCHOR_LEFT= ANCHORS[2]; + public static Anchor ANCHOR_LEFT() { return ANCHORS()[2]; } /** Anchor representing the right side of the information area */ - public const static Anchor ANCHOR_RIGHT= ANCHORS[3]; + public static Anchor ANCHOR_RIGHT() { return ANCHORS()[3]; } /** * Anchor representing the middle of the subject control * @since 2.1 @@ -364,7 +369,15 @@ * </p> * @since 3.4 */ - protected static final bool DEBUG= "true".equalsIgnoreCase(Platform.getDebugOption("dwtx.jface.text/debug/AbstractInformationControlManager")); //$NON-NLS-1$//$NON-NLS-2$ + private static bool DEBUG_; + private static bool DEBUG_init = false; + protected static bool DEBUG(){ + if( !DEBUG_init ){ + DEBUG_init = true; + DEBUG_ = "true".equalsIgnoreCase(Platform.getDebugOption("dwtx.jface.text/debug/AbstractInformationControlManager")); //$NON-NLS-1$//$NON-NLS-2$ + } + return DEBUG_; + } /** The subject control of the information control */ @@ -444,7 +457,7 @@ private bool fEnforceAsMaximalSize= false; /** The anchor for laying out the information control in relation to the subject control */ - private Anchor fAnchor= ANCHOR_BOTTOM; + private Anchor fAnchor; /** * The anchor sequence used to layout the information control if the original anchor @@ -459,8 +472,7 @@ * * @see #fAnchor */ - private Anchor[] fFallbackAnchors= ANCHORS; - + private Anchor[] fFallbackAnchors; /** * The custom information control creator. * @since 3.0 @@ -524,6 +536,8 @@ * @param creator the information control creator */ protected this(IInformationControlCreator creator) { + fAnchor= ANCHOR_BOTTOM(); + fFallbackAnchors= ANCHORS(); Assert.isNotNull(creator); fInformationControlCreator= creator; }