diff dwtx/jface/internal/text/link/contentassist/ContextInformationPopup2.d @ 162:1a5b8f8129df

...
author Frank Benoit <benoit@tionex.de>
date Mon, 08 Sep 2008 00:51:37 +0200
parents 25f1f92fa3df
children
line wrap: on
line diff
--- a/dwtx/jface/internal/text/link/contentassist/ContextInformationPopup2.d	Wed Aug 27 14:49:30 2008 +0200
+++ b/dwtx/jface/internal/text/link/contentassist/ContextInformationPopup2.d	Mon Sep 08 00:51:37 2008 +0200
@@ -88,7 +88,7 @@
     private ITextViewer fViewer;
     private ContentAssistant2 fContentAssistant;
 
-    private PopupCloser2 fPopupCloser= new PopupCloser2();
+    private PopupCloser2 fPopupCloser;
     private Shell fContextSelectorShell;
     private Table fContextSelectorTable;
     private IContextInformation[] fContextSelectorInput;
@@ -98,7 +98,7 @@
     private StyledText fContextInfoText;
     private TextPresentation fTextPresentation;
 
-    private Stack fContextFrameStack= new Stack();
+    private Stack fContextFrameStack;
 
 
     /**
@@ -108,6 +108,8 @@
      * @param viewer the viewer on top of which the context information is shown
      */
     public this(ContentAssistant2 contentAssistant, ITextViewer viewer) {
+        fPopupCloser= new PopupCloser2();
+        fContextFrameStack= new Stack();
         fContentAssistant= contentAssistant;
         fViewer= viewer;
     }
@@ -319,7 +321,7 @@
         }
 
         if (fContextInfoPopup is null)
-            fContentAssistant.contextInformationClosed();
+            fContentAssistant.contextInformationClosed_package();
     }
 
     /**
@@ -438,7 +440,7 @@
         }
 
         if (!Helper2.okToUse(fContextInfoPopup))
-            fContentAssistant.contextInformationClosed();
+            fContentAssistant.contextInformationClosed_package();
     }
 
     /**
@@ -627,21 +629,19 @@
          * Otherwise, we'd validate the context information based on the
          * pre-key-stroke state.
          */
-        fContextInfoPopup.getDisplay().asyncExec(new class()  Runnable {
+        fContextInfoPopup.getDisplay().asyncExec(dgRunnable( (ContextFrame fFrame_) {
 
-            private ContextFrame fFrame= cast(ContextFrame) fContextFrameStack.peek();
+            ContextFrame fFrame= fFrame_;
 
-            public void run() {
-                if (Helper2.okToUse(fContextInfoPopup) && fFrame is fContextFrameStack.peek()) {
-                    int offset= fViewer.getSelectedRange().x;
-                    if (fFrame.fValidator is null || !fFrame.fValidator.isContextInformationValid(offset)) {
-                        hideContextInfoPopup();
-                    } else if (fFrame.fPresenter !is null && fFrame.fPresenter.updatePresentation(offset, fTextPresentation)) {
-                        TextPresentation.applyTextPresentation(fTextPresentation, fContextInfoText);
-                        resize();
-                    }
+            if (Helper2.okToUse(fContextInfoPopup) && fFrame is fContextFrameStack.peek()) {
+                int offset= fViewer.getSelectedRange().x;
+                if (fFrame.fValidator is null || !fFrame.fValidator.isContextInformationValid(offset)) {
+                    hideContextInfoPopup();
+                } else if (fFrame.fPresenter !is null && fFrame.fPresenter.updatePresentation(offset, fTextPresentation)) {
+                    TextPresentation.applyTextPresentation(fTextPresentation, fContextInfoText);
+                    resize();
                 }
             }
-        });
+        }, cast(ContextFrame) fContextFrameStack.peek()));
     }
 }