diff dwtx/jface/text/DocumentCommand.d @ 162:1a5b8f8129df

...
author Frank Benoit <benoit@tionex.de>
date Mon, 08 Sep 2008 00:51:37 +0200
parents 7926b636c282
children
line wrap: on
line diff
--- a/dwtx/jface/text/DocumentCommand.d	Wed Aug 27 14:49:30 2008 +0200
+++ b/dwtx/jface/text/DocumentCommand.d	Mon Sep 08 00:51:37 2008 +0200
@@ -18,9 +18,14 @@
 import dwtx.jface.text.IRegion; // packageimport
 import dwtx.jface.text.IDocumentListener; // packageimport
 import dwtx.jface.text.IDocument; // packageimport
+import dwtx.jface.text.BadLocationException; // packageimport
+import dwtx.jface.text.DefaultPositionUpdater; // packageimport
+import dwtx.jface.text.Position; // packageimport
+import dwtx.jface.text.BadPositionCategoryException; // packageimport
 
 import dwt.dwthelper.utils;
 import dwtx.dwtxhelper.Collection;
+import tango.core.Exception;
 
 import dwt.events.VerifyEvent;
 import dwtx.core.runtime.Assert;
@@ -62,7 +67,7 @@
          */
         public this(int offset, int length, String text, IDocumentListener owner) {
             if (offset < 0 || length < 0)
-                throw new IllegalArgumentException();
+                throw new IllegalArgumentException(null);
             fOffset= offset;
             fLength= length;
             fText= text;
@@ -75,7 +80,7 @@
          * @return the length delta for this command
          */
         public int getDeltaLength() {
-            return (fText is null ? 0 : fText.length()) - fLength;
+            return (fText is null ? 0 : fText.length) - fLength;
         }
 
         /**
@@ -141,7 +146,7 @@
          */
         public this(ListIterator listIterator) {
             if (listIterator is null)
-                throw new IllegalArgumentException();
+                throw new IllegalArgumentException(null);
             fListIterator= listIterator;
         }
 
@@ -190,7 +195,7 @@
          */
         public this(List commands, Command command, bool forward) {
             if (commands is null || command is null)
-                throw new IllegalArgumentException();
+                throw new IllegalArgumentException(null);
             fIterator= forward ? commands.iterator() : new ReverseListIterator(commands.listIterator(commands.size()));
             fCommand= command;
             fForward= forward;
@@ -209,7 +214,7 @@
         public Object next() {
 
             if (!hasNext())
-                throw new NoSuchElementException();
+                throw new NoSuchElementException(null);
 
             if (fCommand is null)
                 return fIterator.next();
@@ -232,7 +237,7 @@
                 return tempCommand;
 
             } else {
-                throw new IllegalArgumentException();
+                throw new IllegalArgumentException(null);
             }
         }
 
@@ -266,7 +271,7 @@
      * Additional document commands.
      * @since 2.1
      */
-    private const List fCommands= new ArrayList();
+    private const List fCommands;
     /**
      * Indicates whether the caret should be shifted by this command.
      * @since 3.0
@@ -277,7 +282,8 @@
     /**
      * Creates a new document command.
      */
-    protected this() {
+    /+protected+/ this() {
+        fCommands= new ArrayList();
     }
 
     /**
@@ -435,6 +441,7 @@
         } catch (BadPositionCategoryException e) {
             // ignore
         } finally {
+            delegate(){
             if (updateCaret()) {
                 document.removePositionUpdater(updater);
                 try {
@@ -444,6 +451,7 @@
                 }
                 caretOffset= caretPosition.getOffset();
             }
+            }();
         }
     }