/** * Returns that part of the indentation of <code>line</code> that makes up * a multiple of indentation units. * * @param line the line to scan * @param tabWidth the size of one tab in space equivalents * @param indentWidth the size of the indent in space equivalents * @return the indent part of <code>line</code>, but no odd spaces * @since 3.1 */ public static String getIndentString(String line, int tabWidth, int indentWidth) { return IndentManipulation.extractIndentString(line, tabWidth, indentWidth); }
/** * Returns that part of the indentation of <code>line</code> that makes up * a multiple of indentation units. * * @param line the line to scan * @param tabWidth the size of one tab in space equivalents * @param indentWidth the size of the indent in space equivalents * @return the indent part of <code>line</code>, but no odd spaces * @since 3.1 */ public static String getIndentString(String line, int tabWidth, int indentWidth) { return IndentManipulation.extractIndentString(line, tabWidth, indentWidth); }
public String getIndentString(String currentLine) { return IndentManipulation.extractIndentString(currentLine, this.tabWidth, this.indentWidth); }
/** * Returns that part of the indentation of <code>line</code> that makes up * a multiple of indentation units. * * @param line the line to scan * @param tabWidth the size of one tab in space equivalents * @param indentWidth the size of the indent in space equivalents * @return the indent part of <code>line</code>, but no odd spaces * @since 3.1 */ public static String getIndentString(String line, int tabWidth, int indentWidth) { return IndentManipulation.extractIndentString(line, tabWidth, indentWidth); }
public String getIndentString(String currentLine) { return IndentManipulation.extractIndentString(currentLine, this.tabWidth, this.indentWidth); }
public String getIndentString(String currentLine) { return IndentManipulation.extractIndentString(currentLine, this.tabWidth, this.indentWidth); }
public String getIndentString(String currentLine) { return IndentManipulation.extractIndentString(currentLine, this.tabWidth, this.indentWidth); }
public String getIndentString(String currentLine) { return IndentManipulation.extractIndentString(currentLine, this.tabWidth, this.indentWidth); }
public String getIndentString(String currentLine) { return IndentManipulation.extractIndentString(currentLine, this.tabWidth, this.indentWidth); }
/** * Returns that part of the indentation of <code>line</code> that makes up * a multiple of indentation units. * * @param line the line to scan * @param project the java project from which to get the formatter * preferences, or <code>null</code> for global preferences * @return the indent part of <code>line</code>, but no odd spaces * @since 3.1 */ public static String getIndentString(String line, IJavaProject project) { return IndentManipulation.extractIndentString(line, CodeFormatterUtil.getTabWidth(project), CodeFormatterUtil.getIndentWidth(project)); }
/** * Returns that part of the indentation of <code>line</code> that makes up * a multiple of indentation units. * * @param line the line to scan * @param project the java project from which to get the formatter * preferences, or <code>null</code> for global preferences * @return the indent part of <code>line</code>, but no odd spaces * @since 3.1 */ public static String getIndentString(String line, IJavaProject project) { return IndentManipulation.extractIndentString(line, CodeFormatterUtil.getTabWidth(project), CodeFormatterUtil.getIndentWidth(project)); }
/** * Returns that part of the indentation of <code>line</code> that makes up * a multiple of indentation units. * * @param line the line to scan * @param project the java project from which to get the formatter * preferences, or <code>null</code> for global preferences * @return the indent part of <code>line</code>, but no odd spaces * @since 3.1 */ public static String getIndentString(String line, IJavaProject project) { return IndentManipulation.extractIndentString(line, CodeFormatterUtil.getTabWidth(project), CodeFormatterUtil.getIndentWidth(project)); }
private static String getIndentAt(IDocument document, int offset, CodeGenerationSettings settings) { try { IRegion region= document.getLineInformationOfOffset(offset); return IndentManipulation.extractIndentString(document.get(region.getOffset(), region.getLength()), settings.tabWidth, settings.indentWidth); } catch (BadLocationException e) { return ""; //$NON-NLS-1$ } }
private static String getIndentAt(IDocument document, int offset, CodeGenerationSettings settings) { try { IRegion region= document.getLineInformationOfOffset(offset); return IndentManipulation.extractIndentString(document.get(region.getOffset(), region.getLength()), settings.tabWidth, settings.indentWidth); } catch (BadLocationException e) { return ""; //$NON-NLS-1$ } }
private static String getIndentAt(IDocument document, int offset, CodeGenerationSettings settings) { try { IRegion region= document.getLineInformationOfOffset(offset); return IndentManipulation.extractIndentString(document.get(region.getOffset(), region.getLength()), settings.tabWidth, settings.indentWidth); } catch (BadLocationException e) { return ""; //$NON-NLS-1$ } }
private static String getIndentAt(final IDocument document, final int offset, final CodeGenerationSettings settings) { try { IRegion region = document.getLineInformationOfOffset(offset); return IndentManipulation.extractIndentString(document.get(region.getOffset(), region.getLength()), settings.tabWidth, settings.indentWidth); } catch (BadLocationException e) { return ""; } }
IRegion region= contents.getLineInformationOfOffset(getReplacementOffset()); ITrackedNodePosition position= rewrite.track(stub); String indent= IndentManipulation.extractIndentString(contents.get(region.getOffset(), region.getLength()), settings.tabWidth, settings.indentWidth); try { rewrite.rewriteAST(contents, fJavaProject.getOptions(true)).apply(contents, TextEdit.UPDATE_REGIONS);