Examples of reformat()


Examples of com.iisigroup.cap.formatter.IFormatter.reformat()

          val = "";
        }
        if (reformat != null && reformat.containsKey(str)) {
          IFormatter callback = reformat.get(str);
          if (callback instanceof IBeanFormatter) {
            val = callback.reformat(this);
          } else {
            val = callback.reformat(val);
          }
        } else if (val instanceof Timestamp) {
          val = new ADDateTimeFormatter().reformat(val);
View Full Code Here

Examples of com.iisigroup.cap.formatter.IFormatter.reformat()

        if (reformat != null && reformat.containsKey(str)) {
          IFormatter callback = reformat.get(str);
          if (callback instanceof IBeanFormatter) {
            val = callback.reformat(this);
          } else {
            val = callback.reformat(val);
          }
        } else if (val instanceof Timestamp) {
          val = new ADDateTimeFormatter().reformat(val);
        } else if (val instanceof Date || val instanceof Calendar) {
          val = new ADDateFormatter().reformat(val);
View Full Code Here

Examples of com.intellij.psi.codeStyle.CodeStyleManager.reformat()

  public TextRange surroundElements(@NotNull final Project project, @NotNull final Editor editor, final Expression element) throws IncorrectOperationException {
    MathematicaPsiElementFactory factory = new MathematicaPsiElementFactory(project);
    CodeStyleManager codeStyleManager = CodeStyleManager.getInstance(project);

    Expression parExpr = factory.createExpressionFromText(myOpener + element.getText() + myCloser);
    parExpr = (Expression) codeStyleManager.reformat(parExpr);
    final PsiElement replace = element.replace(parExpr);
    return TextRange.from(replace.getTextOffset() + replace.getTextLength(), 0);
  }

  @Override
View Full Code Here

Examples of com.intellij.psi.codeStyle.CodeStyleManager.reformat()

    stringBuilder.append("\n]");

    final PsiFile file = factory.createFileFromText("dummy.m", MathematicaFileType.INSTANCE, stringBuilder);
    final FunctionCall[] func = PsiTreeUtil.getChildrenOfType(file, FunctionCall.class);
    assert func != null && func[0] != null;
    func[0] = (FunctionCall) codeStyleManager.reformat(func[0]);
    PsiElement newElement = e.replace(func[0]);

    final List<PsiElement> arguments = MathematicaPsiUtilities.getArguments(newElement);
    if (arguments.isEmpty()) {
      return null;
View Full Code Here

Examples of com.intellij.psi.codeStyle.CodeStyleManager.reformat()

        PsiFileFactory fileFactory = PsiFileFactory.getInstance( directory.getProject() );
        PsiFile file = fileFactory.createFileFromText( fileName, text );

        // Reformat the file according to project/default style
        CodeStyleManager codeStyleManager = CodeStyleManager.getInstance( psiManager );
        codeStyleManager.reformat( file );

        // Add newly created file to directory
        return (PsiFile) directory.add( file );
    }
}
View Full Code Here

Examples of com.intellij.psi.codeStyle.CodeStyleManager.reformat()

                                                                   actionClass);

      final JavaCodeStyleManager javaCodeStyleManager = JavaCodeStyleManager.getInstance(project);
      actionMethod = (PsiMethod) javaCodeStyleManager.shortenClassReferences(actionMethod);
      final CodeStyleManager codestylemanager = CodeStyleManager.getInstance(project);
      actionMethod = (PsiMethod) codestylemanager.reformat(actionMethod);

      final PsiMethod element = (PsiMethod) actionClass.add(actionMethod);

      //noinspection ConstantConditions
      OpenSourceUtil.navigate((Navigatable) element.getBody().getNavigationElement());
View Full Code Here

Examples of com.intellij.psi.codeStyle.CodeStyleManager.reformat()

      if (newVariable != null) {
        final GherkinScenarioOutline scenario = PsiTreeUtil.getParentOfType(newVariable, GherkinScenarioOutline.class);

        if (scenario != null) {
          final CodeStyleManager csManager = CodeStyleManager.getInstance(newVariable.getProject());
          csManager.reformat(scenario);
        }
      }
    }
  }
}
View Full Code Here

Examples of com.intellij.psi.codeStyle.CodeStyleManager.reformat()

      buffer.append("=");
      buffer.append(parameterName);
      buffer.append(";\n}");
      PsiCodeBlock body = factory.createCodeBlockFromText(buffer.toString(), null);
      setMethod.getBody().replace(body);
      setMethod = (PsiMethod)codeStyleManager.reformat(setMethod);
      return setMethod;
    }
    catch (IncorrectOperationException e) {
      LOG.error(e);
      return null;
View Full Code Here

Examples of net.sourceforge.squirrel_sql.fw.codereformat.CodeReformator.reformat()

      String statementSep = getSession().getQueryTokenizer().getSQLStatementSeparator();

      CodeReformator cr = new CodeReformator(statementSep, commentSpecs);

      sqls = cr.reformat(sqls) + "\n";
      return sqls;
   }


   private void scrollEntryPlanel(String allSqls)
View Full Code Here

Examples of net.sourceforge.squirrel_sql.fw.codereformat.CodeReformator.reformat()

    String statementSep = _session.getQueryTokenizer().getSQLStatementSeparator();
   
    CodeReformator cr = new CodeReformator(statementSep, commentSpecs);

    String reformatedText = cr.reformat(textToReformat);

      api.getSQLEntryPanel().setSelectionStart(bounds[0]);
      api.getSQLEntryPanel().setSelectionEnd(bounds[1]);
      api.getSQLEntryPanel().replaceSelection(reformatedText);
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.