public String createIndentString(int indentationUnits) { return ToolFactory.createCodeFormatter(this.options).createIndentationString(indentationUnits); }
public String createIndentString(int indentationUnits) { return ToolFactory.createCodeFormatter(this.options).createIndentationString(indentationUnits); }
public String createIndentString(int indentationUnits) { return ToolFactory.createCodeFormatter(this.options).createIndentationString(indentationUnits); }
public String createIndentString(int indentationUnits) { return ToolFactory.createCodeFormatter(this.options).createIndentationString(indentationUnits); }
public String createIndentString(int indentationUnits) { return ToolFactory.createCodeFormatter(this.options).createIndentationString(indentationUnits); }
public String createIndentString(int indentationUnits) { return ToolFactory.createCodeFormatter(this.options).createIndentationString(indentationUnits); }
private String getInitialIndent(String result) { // BUG188636 - just get initial indent from code formatter String indent = getCodeFormatter().createIndentationString(1); // // get indent after 2nd line break // String indent = ""; //$NON-NLS-1$ // StringTokenizer st = new StringTokenizer(result, "\r\n", false); // //$NON-NLS-1$ // if (st.countTokens() > 1) { // String tok = st.nextToken(); // tok = st.nextToken(); // int index = 0; // if (tok != null) { // while (tok.charAt(index) == ' ' || tok.charAt(index) == '\t') { // indent += tok.charAt(index); // index++; // } // } // } return indent; }
String level1 = getCodeFormatter().createIndentationString(1); String level3 = getCodeFormatter().createIndentationString(3); String theOld = "\n" + level3; //$NON-NLS-1$ String theNew = "\n" + level1; //$NON-NLS-1$
/** * Creates a string that represents the given number of indentation units. * The returned string can contain tabs and/or spaces depending on the core * formatter preferences. * * @param indentationUnits the number of indentation units to generate * @param project the project from which to get the formatter settings, * <code>null</code> if the workspace default should be used * @return the indent string */ public static String createIndentString(int indentationUnits, IJavaProject project) { Map options= project != null ? project.getOptions(true) : JavaCore.getOptions(); return ToolFactory.createCodeFormatter(options).createIndentationString(indentationUnits); }
/** * Creates a string that represents the given number of indentation units. * The returned string can contain tabs and/or spaces depending on the core formatter preferences. * * @param indentationUnits * the number of indentation units to generate * @param project * the project from which to get the formatter settings, * <code>null</code> if the workspace default should be used * @return the indent string */ public static String createIndentString(int indentationUnits, IJavaProject project) { Map<String, String> options= project != null ? project.getOptions(true) : JavaCore.getOptions(); return ToolFactory.createCodeFormatter(options).createIndentationString(indentationUnits); }
/** * Creates a string that represents the given number of indentation units. * The returned string can contain tabs and/or spaces depending on the core formatter preferences. * * @param indentationUnits * the number of indentation units to generate * @param project * the project from which to get the formatter settings, * <code>null</code> if the workspace default should be used * @return the indent string */ public static String createIndentString(int indentationUnits, IJavaProject project) { Map<String, String> options= project != null ? project.getOptions(true) : JavaCore.getOptions(); return ToolFactory.createCodeFormatter(options).createIndentationString(indentationUnits); }