diff dwtx/jface/text/contentassist/CompletionProposalPopup.d @ 159:7926b636c282

...
author Frank Benoit <benoit@tionex.de>
date Wed, 27 Aug 2008 01:57:58 +0200
parents 25f1f92fa3df
children 1a5b8f8129df
line wrap: on
line diff
--- a/dwtx/jface/text/contentassist/CompletionProposalPopup.d	Tue Aug 26 02:46:34 2008 +0200
+++ b/dwtx/jface/text/contentassist/CompletionProposalPopup.d	Wed Aug 27 01:57:58 2008 +0200
@@ -132,8 +132,15 @@
      *      More details see also: https://bugs.eclipse.org/bugs/show_bug.cgi?id=98585#c36
      * @since 3.1
      */
-    private static const bool USE_VIRTUAL= !"motif".equals(DWT.getPlatform()); //$NON-NLS-1$
-
+    private static bool USE_VIRTUAL_;
+    private static bool USE_VIRTUAL_init = false;;
+    private static bool USE_VIRTUAL(){
+        if( !USE_VIRTUAL_init ){
+            USE_VIRTUAL_init = true;
+            USE_VIRTUAL_ = !"motif".equals(DWT.getPlatform()); //$NON-NLS-1$
+        }
+        return USE_VIRTUAL_;
+    }
 
     /**
      * Completion proposal selection handler.
@@ -145,8 +152,8 @@
         /**
          * Selection operation codes.
          */
-        static final int SELECT_NEXT= 1;
-        static final int SELECT_PREVIOUS= 2;
+        static const int SELECT_NEXT= 1;
+        static const int SELECT_PREVIOUS= 2;
 
 
         private int fOperationCode;
@@ -322,7 +329,7 @@
     /** The used additional info controller. */
     private AdditionalInfoController fAdditionalInfoController;
     /** The closing strategy for this completion proposal popup. */
-    private PopupCloser fPopupCloser= new PopupCloser();
+    private PopupCloser fPopupCloser;
     /** The popup shell. */
     private Shell fProposalShell;
     /** The proposal table. */
@@ -332,7 +339,7 @@
     /** The key listener to control navigation. */
     private ProposalSelectionListener fKeyListener;
     /** List of document events used for filtering proposals. */
-    private List fDocumentEvents= new ArrayList();
+    private List fDocumentEvents;
     /** Listener filling the document event queue. */
     private IDocumentListener fDocumentListener;
     /** The filter list of proposals. */
@@ -385,8 +392,9 @@
      *
      * @since 3.1.1
      */
-    private final Runnable fFilterRunnable= new class()  Runnable {
-        public void run() {
+    private Runnable fFilterRunnable;
+    private void fFilterRunnableInit(){
+        fFilterRunnable = dgRunnable( {
             if (!fIsFilterPending)
                 return;
 
@@ -412,8 +420,9 @@
                 setProposals(proposals, fIsFilteredSubset);
             else
                 hide();
-        }
-    };
+        });
+    }
+
     /**
      * <code>true</code> if <code>fFilterRunnable</code> has been
      * posted, <code>false</code> if not.
@@ -445,7 +454,7 @@
      *
      * @since 3.2
      */
-    private const EmptyProposal fEmptyProposal= new EmptyProposal();
+    private EmptyProposal fEmptyProposal;
     /**
      * The text for the empty proposal, or <code>null</code> to use the default text.
      *
@@ -470,6 +479,12 @@
      * @since 2.0
      */
     public this(ContentAssistant contentAssistant, ITextViewer viewer, AdditionalInfoController infoController) {
+        // DWT instance init
+        fDocumentEvents= new ArrayList();
+        fPopupCloser= new PopupCloser();
+        if( fEmptyProposal is null ) fEmptyProposal= new EmptyProposal();
+        fFilterRunnableInit();
+
         fContentAssistant= contentAssistant;
         fViewer= viewer;
         fAdditionalInfoController= infoController;
@@ -485,6 +500,12 @@
      * @since 3.0
      */
     public this(ContentAssistant contentAssistant, IContentAssistSubjectControl contentAssistSubjectControl, AdditionalInfoController infoController) {
+        // DWT instance init
+        fDocumentEvents= new ArrayList();
+        fPopupCloser= new PopupCloser();
+        if( fEmptyProposal is null ) fEmptyProposal= new EmptyProposal();
+        fFilterRunnableInit();
+
         fContentAssistant= contentAssistant;
         fContentAssistSubjectControl= contentAssistSubjectControl;
         fAdditionalInfoController= infoController;