Mercurial > projects > dwt-addons
diff dwtx/jface/text/TextViewerUndoManager.d @ 156:a9566845f1cb
...
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Mon, 25 Aug 2008 19:03:46 +0200 |
parents | eb21d3dfc767 |
children | 1a5b8f8129df |
line wrap: on
line diff
--- a/dwtx/jface/text/TextViewerUndoManager.d Mon Aug 25 00:45:19 2008 +0200 +++ b/dwtx/jface/text/TextViewerUndoManager.d Mon Aug 25 19:03:46 2008 +0200 @@ -190,20 +190,20 @@ * <p> * This class is not intended to be subclassed. * </p> - * + * * @see ITextViewer * @see ITextInputListener * @see IDocumentUndoManager * @see MouseListener * @see KeyListener * @see DocumentUndoManager - * + * * @since 3.2 * @noextend This class is not intended to be subclassed by clients. */ public class TextViewerUndoManager : IUndoManager, IUndoManagerExtension { - + /** * Internal listener to mouse and key events. */ @@ -287,7 +287,7 @@ */ public void documentUndoNotification(DocumentUndoEvent event ){ if (!isConnected()) return; - + int eventType= event.getEventType(); if (((eventType & DocumentUndoEvent.ABOUT_TO_UNDO) !is 0) || ((eventType & DocumentUndoEvent.ABOUT_TO_REDO) !is 0)) { if (event.isCompound()) { @@ -304,7 +304,7 @@ (cast(TextViewer)fTextViewer).ignoreAutoEditStrategies(true); } }); - + } else if (((eventType & DocumentUndoEvent.UNDONE) !is 0) || ((eventType & DocumentUndoEvent.REDONE) !is 0)) { fTextViewer.getTextWidget().getDisplay().syncExec(new class() Runnable { public void run() { @@ -320,7 +320,7 @@ if (extension !is null) extension.setRedraw(true); } - + // Reveal the change if this manager's viewer has the focus. if (fTextViewer !is null) { StyledText widget= fTextViewer.getTextWidget(); @@ -340,16 +340,16 @@ /** The text viewer the undo manager is connected to */ private ITextViewer fTextViewer; - + /** The undo level */ private int fUndoLevel; - + /** The document undo manager that is active. */ private IDocumentUndoManager fDocumentUndoManager; - + /** The document that is active. */ private IDocument fDocument; - + /** The document undo listener */ private IDocumentUndoListener fDocumentUndoListener; @@ -428,7 +428,7 @@ * @param title the dialog title * @param ex the exception */ - 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(); @@ -439,16 +439,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((Shell finalShell_, String title_, Exception ex_ ) { + MessageDialog.openError(finalShell_, title_, ex_.getLocalizedMessage()); + },finalShell, title, ex )); } } @@ -491,7 +489,7 @@ public void reset() { if (isConnected()) fDocumentUndoManager.reset(); - + } /* @@ -564,7 +562,7 @@ } return null; } - + private void connectDocumentUndoManager(IDocument document) { disconnectDocumentUndoManager(); if (document !is null) {