Package org.eclipse.wst.sse.core.internal.provisional

Examples of org.eclipse.wst.sse.core.internal.provisional.IStructuredModel.beginRecording()


        try {
          model = StructuredModelManager.getModelManager().getExistingModelForEdit(editor.getDocumentProvider().getDocument(editor.getEditorInput()));
          if (model != null) {
            // begin recording
            ITextSelection selection = (ITextSelection) editor.getSelectionProvider().getSelection();
            model.beginRecording(this, SSEUIMessages.Cleanup_Document_UI_, SSEUIMessages.Cleanup_Document_UI_, selection.getOffset(), selection.getLength());

            // tell the model that we are about to make a big
            // model change
            model.aboutToChangeModel();
View Full Code Here


     
      model = StructuredModelManager.getModelManager().getModelForEdit(document);
      if (model != null) {
        //makes it so one undo will undo all the edits to the document
        model.beginRecording(this, SSEUIMessages.ToggleComment_label, SSEUIMessages.ToggleComment_description);
       
        //keeps listeners from doing anything until updates are all done
        model.aboutToChangeModel();
        if(document instanceof IDocumentExtension4) {
          session = ((IDocumentExtension4)document).startRewriteSession(DocumentRewriteSessionType.UNRESTRICTED);
View Full Code Here

          IStructuredModel model = editor.getModel();
          if (model != null) {
            try {
              // begin recording
              ITextSelection selection = (ITextSelection) editor.getSelectionProvider().getSelection();
              model.beginRecording(this, SSEUIMessages.Cleanup_Document_UI_, SSEUIMessages.Cleanup_Document_UI_, selection.getOffset(), selection.getLength()); //$NON-NLS-1$ //$NON-NLS-2$

              // tell the model that we are about to make a big
              // model change
              model.aboutToChangeModel();
View Full Code Here

    try {
      model = StructuredModelManager.getModelManager().getModelForEdit(document);
     
      if(model != null) {
        //makes it so one undo will undo all the edits to the document
        model.beginRecording(this, SSEUIMessages.RemoveBlockComment_label,
            SSEUIMessages.RemoveBlockComment_label);
       
        //keeps listeners from doing anything until updates are all done
        model.aboutToChangeModel();
        if(document instanceof IDocumentExtension4) {
View Full Code Here

   
    try {
      model = StructuredModelManager.getModelManager().getModelForEdit(document);
      if(model != null) {
        //makes it so one undo will undo all the edits to the document
        model.beginRecording(this, SSEUIMessages.AddBlockComment_label, SSEUIMessages.AddBlockComment_description);
       
        //keeps listeners from doing anything until updates are all done
        model.aboutToChangeModel();
        if(document instanceof IDocumentExtension4) {
          session = ((IDocumentExtension4)document).startRewriteSession(DocumentRewriteSessionType.UNRESTRICTED);
View Full Code Here

        try {
          model = StructuredModelManager.getModelManager().getExistingModelForEdit(textEditor.getDocumentProvider().getDocument(textEditor.getEditorInput()));
          if (model != null) {
            // begin recording
            ITextSelection selection = (ITextSelection) textEditor.getSelectionProvider().getSelection();
            model.beginRecording(this, SSEUIMessages.Cleanup_Document_UI_, SSEUIMessages.Cleanup_Document_UI_, selection.getOffset(), selection.getLength());

            // tell the model that we are about to make a big
            // model change
            model.aboutToChangeModel();
View Full Code Here

      }
      else if (getOperation() == DND.DROP_COPY) {
        undoDesc = XMLUIMessages.DragNodeCommand_1;
      }

      structuredModel.beginRecording(this, undoDesc);
      if (batchUpdate) {
        // structuredModel.aboutToChangeModel();
      }
    }
  }
View Full Code Here

  private void processAction(IDocument document, int selectionStartLine, int selectionEndLine) {
    IStructuredModel model = StructuredModelManager.getModelManager().getExistingModelForEdit(document);
    if (model != null) {
      try {
        model.beginRecording(this, XMLUIMessages.ToggleComment_tooltip);
        model.aboutToChangeModel();

        for (int i = selectionStartLine; i <= selectionEndLine; i++) {
          try {
            if (document.getLineLength(i) > 0) {
View Full Code Here

        if ((textSelection.getLength() == 0) && (selectionStartIndexedRegion instanceof CommentImpl)) {
          return;
        }

        model.beginRecording(this, XMLUIMessages.AddBlockComment_tooltip);
        model.aboutToChangeModel();

        try {
          document.replace(openCommentOffset, 0, OPEN_COMMENT);
          document.replace(closeCommentOffset, 0, CLOSE_COMMENT);
View Full Code Here

        }

        int openCommentOffset = selectionStartIndexedRegion.getStartOffset();
        int closeCommentOffset = selectionEndIndexedRegion.getEndOffset() - OPEN_COMMENT.length() - CLOSE_COMMENT.length();

        model.beginRecording(this, XMLUIMessages.RemoveBlockComment_tooltip);
        model.aboutToChangeModel();

        try {
          if (textSelection.getLength() == 0) {
            if (selectionStartIndexedRegion instanceof CommentImpl) {
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.