diff dwtx/jface/internal/text/link/contentassist/CompletionProposalPopup2.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/internal/text/link/contentassist/CompletionProposalPopup2.d	Tue Aug 26 02:46:34 2008 +0200
+++ b/dwtx/jface/internal/text/link/contentassist/CompletionProposalPopup2.d	Wed Aug 27 01:57:58 2008 +0200
@@ -125,34 +125,39 @@
      */
     private bool fIsColoredLabelsSupportEnabled= false;
 
-    private final IEditingSupport fFocusEditingSupport= new class()  IEditingSupport {
-
-        public bool isOriginator(DocumentEvent event, IRegion focus) {
-            return false;
-        }
+    private IEditingSupport fFocusEditingSupport;
+    private void fFocusEditingSupport_init() {
+        fFocusEditingSupport = new class() IEditingSupport {
 
-        public bool ownsFocusShell() {
-            return Helper2.okToUse(fProposalShell) && fProposalShell.isFocusControl()
-                    || Helper2.okToUse(fProposalTable) && fProposalTable.isFocusControl();
-        }
+            public bool isOriginator(DocumentEvent event, IRegion focus) {
+                return false;
+            }
 
-    };
-    private final IEditingSupport fModificationEditingSupport= new class()  IEditingSupport {
+            public bool ownsFocusShell() {
+                return Helper2.okToUse(fProposalShell) && fProposalShell.isFocusControl()
+                        || Helper2.okToUse(fProposalTable) && fProposalTable.isFocusControl();
+            }
 
-        public bool isOriginator(DocumentEvent event, IRegion focus) {
-            if (fViewer !is null) {
-                Point selection= fViewer.getSelectedRange();
-                return selection.x <= focus.getOffset() + focus.getLength() && selection.x + selection.y >= focus.getOffset();
+        };
+    }
+    private IEditingSupport fModificationEditingSupport;
+    private void fModificationEditingSupport_init() {
+        fModificationEditingSupport = new class()  IEditingSupport {
+
+            public bool isOriginator(DocumentEvent event, IRegion focus) {
+                if (fViewer !is null) {
+                    Point selection= fViewer.getSelectedRange();
+                    return selection.x <= focus.getOffset() + focus.getLength() && selection.x + selection.y >= focus.getOffset();
+                }
+                return false;
             }
-            return false;
-        }
 
-        public bool ownsFocusShell() {
-            return false;
-        }
+            public bool ownsFocusShell() {
+                return false;
+            }
 
-    };
-
+        };
+    }
 
     /**
      * Creates a new completion proposal popup for the given elements.
@@ -163,6 +168,10 @@
      * @since 2.0
      */
     public this(ContentAssistant2 contentAssistant, ITextViewer viewer, AdditionalInfoController2 infoController) {
+
+        fModificationEditingSupport_init();
+        fFocusEditingSupport_init();
+
         fContentAssistant= contentAssistant;
         fViewer= viewer;
         fAdditionalInfoController= infoController;