diff dwtx/jface/text/DefaultUndoManager.d @ 156:a9566845f1cb

...
author Frank Benoit <benoit@tionex.de>
date Mon, 25 Aug 2008 19:03:46 +0200
parents f70d9508c95c
children 7926b636c282
line wrap: on
line diff
--- a/dwtx/jface/text/DefaultUndoManager.d	Mon Aug 25 00:45:19 2008 +0200
+++ b/dwtx/jface/text/DefaultUndoManager.d	Mon Aug 25 19:03:46 2008 +0200
@@ -875,37 +875,35 @@
     class HistoryListener : IOperationHistoryListener {
         private IUndoableOperation fOperation;
 
-        public void historyNotification(final OperationHistoryEvent event) {
-            final int type= event.getEventType();
+        public void historyNotification(OperationHistoryEvent event) {
+            int type= event.getEventType();
             switch (type) {
             case OperationHistoryEvent.ABOUT_TO_UNDO:
             case OperationHistoryEvent.ABOUT_TO_REDO:
                 // if this is one of our operations
                 if (event.getOperation().hasContext(fUndoContext)) {
-                    fTextViewer.getTextWidget().getDisplay().syncExec(new class()  Runnable {
-                        public void run() {
-                            // if we are undoing/redoing a command we generated, then ignore
-                            // the document changes associated with this undo or redo.
-                            if (cast(TextCommand)event.getOperation() ) {
-                                if ( cast(TextViewer)fTextViewer )
-                                    (cast(TextViewer)fTextViewer).ignoreAutoEditStrategies(true);
-                                listenToTextChanges(false);
+                    fTextViewer.getTextWidget().getDisplay().syncExec(dgRunnable((Event event_, int type_ ) {
+                        // if we are undoing/redoing a command we generated, then ignore
+                        // the document changes associated with this undo or redo.
+                        if (cast(TextCommand)event_.getOperation() ) {
+                            if ( cast(TextViewer)fTextViewer )
+                                (cast(TextViewer)fTextViewer).ignoreAutoEditStrategies(true);
+                            listenToTextChanges(false);
 
-                                // in the undo case only, make sure compounds are closed
-                                if (type is OperationHistoryEvent.ABOUT_TO_UNDO) {
-                                    if (fFoldingIntoCompoundChange) {
-                                        endCompoundChange();
-                                    }
+                            // in the undo case only, make sure compounds are closed
+                            if (type_ is OperationHistoryEvent.ABOUT_TO_UNDO) {
+                                if (fFoldingIntoCompoundChange) {
+                                    endCompoundChange();
                                 }
-                            } else {
-                                // the undo or redo has our context, but it is not one of
-                                // our commands.  We will listen to the changes, but will
-                                // reset the state that tracks the undo/redo history.
-                                commit();
-                                fLastAddedCommand= null;
                             }
+                        } else {
+                            // the undo or redo has our context, but it is not one of
+                            // our commands.  We will listen to the changes, but will
+                            // reset the state that tracks the undo/redo history.
+                            commit();
+                            fLastAddedCommand= null;
                         }
-                    });
+                    }, event, type ));
                     fOperation= event.getOperation();
                 }
                 break;
@@ -1321,7 +1319,7 @@
      * @param ex the exception
      * @since 3.1
      */
-    private void openErrorDialog(final String title, final Exception ex) {
+    private void openErrorDialog(String title, Exception ex) {
         Shell shell= null;
         if (isConnected()) {
             StyledText st= fTextViewer.getTextWidget();
@@ -1332,16 +1330,14 @@
             MessageDialog.openError(shell, title, ex.getLocalizedMessage());
         else {
             Display display;
-            final Shell finalShell= shell;
+            Shell finalShell= shell;
             if (finalShell !is null)
                 display= finalShell.getDisplay();
             else
                 display= Display.getDefault();
-            display.syncExec(new class()  Runnable {
-                public void run() {
-                    MessageDialog.openError(finalShell, title, ex.getLocalizedMessage());
-                }
-            });
+            display.syncExec(dgRunnable( {
+                MessageDialog.openError(finalShell, title, ex.getLocalizedMessage());
+            }));
         }
     }