Examples of IDocumentUndoManager


Examples of org.eclipse.text.undo.IDocumentUndoManager

    TextEdit edit = saveActions.createSaveAction(document, changedRegions);
    if (edit == null) {
      return;
    }
    try {
      IDocumentUndoManager manager = getDocumentUndoManager(document);
      manager.beginCompoundChange();
      edit.apply(document);
      manager.endCompoundChange();
    } catch (Throwable t) {
      throw new CoreException(error(t));
    }
  }
View Full Code Here

Examples of org.eclipse.text.undo.IDocumentUndoManager

            if (movedElement == null || movedElement instanceof IEditorInput) {
              rememberSelection();

              final IDocumentProvider d= getDocumentProvider();
              final String previousContent;
              IDocumentUndoManager previousUndoManager=null;
              IDocument changed= null;
              boolean wasDirty= isDirty();
              changed= d.getDocument(getEditorInput());
              if (changed != null) {
                if (wasDirty)
                  previousContent= changed.get();
                else
                  previousContent= null;
               
                previousUndoManager= DocumentUndoManagerRegistry.getDocumentUndoManager(changed);
                if (previousUndoManager != null)
                  previousUndoManager.connect(this);
              }
              else
                previousContent= null;
             
              setInput((IEditorInput) movedElement);
             
              // The undo manager needs to be replaced with one for the new document.
              // Transfer the undo history and then disconnect from the old undo manager.
              if (previousUndoManager != null) {
                IDocument newDocument= getDocumentProvider().getDocument(movedElement);
                if (newDocument != null) {
                  IDocumentUndoManager newUndoManager= DocumentUndoManagerRegistry.getDocumentUndoManager(newDocument);
                  if (newUndoManager != null)
                    newUndoManager.transferUndoHistory(previousUndoManager);
                }
                previousUndoManager.disconnect(this);
              }

              if (wasDirty && changed != null) {
View Full Code Here

Examples of org.eclipse.text.undo.IDocumentUndoManager

            if (movedElement == null || movedElement instanceof IEditorInput) {
              rememberSelection();

              final IDocumentProvider d= getDocumentProvider();
              final String previousContent;
              IDocumentUndoManager previousUndoManager=null;
              IDocument changed= null;
              boolean wasDirty= isDirty();
              changed= d.getDocument(getEditorInput());
              if (changed != null) {
                if (wasDirty)
                  previousContent= changed.get();
                else
                  previousContent= null;

                previousUndoManager= DocumentUndoManagerRegistry.getDocumentUndoManager(changed);
                if (previousUndoManager != null)
                  previousUndoManager.connect(this);
              }
              else
                previousContent= null;

              setInput((IEditorInput) movedElement);

              // The undo manager needs to be replaced with one for the new document.
              // Transfer the undo history and then disconnect from the old undo manager.
              if (previousUndoManager != null) {
                IDocument newDocument= getDocumentProvider().getDocument(movedElement);
                if (newDocument != null) {
                  IDocumentUndoManager newUndoManager= DocumentUndoManagerRegistry.getDocumentUndoManager(newDocument);
                  if (newUndoManager != null)
                    newUndoManager.transferUndoHistory(previousUndoManager);
                }
                previousUndoManager.disconnect(this);
              }

              if (wasDirty && changed != null) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.