Package com.intellij.openapi.command

Examples of com.intellij.openapi.command.WriteCommandAction


          }
        }, ",\n") + bindingsEx + ".";

      try {
        PsiFile file = first.getContainingFile();
        new WriteCommandAction(editor.getProject(), "Extract function", file) {
          @Override
          protected void run(@NotNull Result result) throws Throwable {
            ErlangFunction newFunction = ErlangElementFactory.createFunctionFromText(project, functionText);

            PsiElement functionParent = function.getParent();
View Full Code Here


            final Project project = editor.getProject();
            final int indent = indentHelper.getIndent(project, JavaFileType.INSTANCE, node);
            final String spaces = IndentHelperImpl.fillIndent(project, JavaFileType.INSTANCE, indent);
            final String newText = before + "\n" + spaces + after;

            new WriteCommandAction(JavaREPLConsoleExecuteActionHandler.this.project) {
                @Override
                protected void run(Result result) throws Throwable {
                    console.setInputText(newText);
                    caretModel.moveToOffset(offset + indent + 1);
                }
View Full Code Here

  }

  private void doTest(String before, String after) {
    myFixture.configureByText("a.erl", before);
    final List<SmartEnterProcessor> processors = SmartEnterProcessors.INSTANCE.forKey(ErlangLanguage.INSTANCE);
    new WriteCommandAction(myFixture.getProject()) {
      @Override
      protected void run(Result result) throws Throwable {
        Editor editor = myFixture.getEditor();
        for (SmartEnterProcessor processor : processors) {
          processor.process(myFixture.getProject(), editor, myFixture.getFile());
View Full Code Here

      final Project project = editor.getProject();
      final int indent = myIndentHelper.getIndent(project, ClojureFileType.CLOJURE_FILE_TYPE, node);
      final String spaces = IndentHelperImpl.fillIndent(project, ClojureFileType.CLOJURE_FILE_TYPE, indent);
      final String newText = before + "\n" + spaces + after;

      new WriteCommandAction(myProject) {
        @Override
        protected void run(Result result) throws Throwable {
          console.setInputText(newText);
          caretModel.moveToOffset(offset + indent + 1);
        }
View Full Code Here

                        final Integer offset = hashMap.get(keyValue);
                        if (offset != null) {
                            clearSelection();
                            moveCaret(offset);
                            new WriteCommandAction(project) {
                                @Override
                                protected void run(Result result) throws Throwable {
                                    applyModifier(e);
                                }
                            }.execute();
View Full Code Here

    installPopup(ActionPlaces.J2EE_ATTRIBUTES_VIEW_POPUP, group);
  }

  protected void wrapValueSetting(@NotNull final DomElement domElement, final Runnable valueSetter) {
    if (domElement.isValid()) {
      new WriteCommandAction(getProject(), domElement.getRoot().getFile()) {
        protected void run(final Result result) throws Throwable {
          valueSetter.run();
        }
      }.execute();
      fireChanged();
View Full Code Here

    if (myCommitting) return;
    myCommitting = true;
    try {
      final CommitListener multicaster = myDispatcher.getMulticaster();
      multicaster.beforeCommit(this);
      new WriteCommandAction(getProject(), getDomWrapper().getFile()) {
        protected void run(Result result) throws Throwable {
          doCommit(value);
        }
      }.execute();
      multicaster.afterCommit(this);
View Full Code Here

              if (xmlFile != null) {
                changedFiles.add(xmlFile);
              }
            }
        }
        new WriteCommandAction(project, changedFiles.toArray(new PsiFile[changedFiles.size()])) {
          protected void run(Result result) throws Throwable {
            for (EditedElementDescription description : descriptions) {
              final DomElement editedElement = myDomElements.get(description);
              DomElement element = description.addElement();
              element.copyFrom(editedElement);
View Full Code Here

      manager.openDomElementEditor(t);
    }
  }

  protected void doRemove(final List<T> toDelete) {
    new WriteCommandAction(getProject()) {
      protected void run(Result result) throws Throwable {
        for (final T t : toDelete) {
          if (t.isValid()) {
            t.undefine();
          }
View Full Code Here

  protected final GenerateDomElementProvider myProvider;

  public GenerateDomElementAction(final GenerateDomElementProvider generateProvider) {
    super(new CodeInsightActionHandler() {
      public void invoke(final Project project, final Editor editor, final PsiFile file) {
        new WriteCommandAction(project, file) {
          protected void run(final Result result) throws Throwable {
            final DomElement element = generateProvider.generate(project, editor, file);
            generateProvider.navigate(element);
          }
        }.execute();
View Full Code Here

TOP

Related Classes of com.intellij.openapi.command.WriteCommandAction

Copyright © 2018 www.massapicom. 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.