X-Git-Url: http://git.phpeclipse.com diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/formatter/impl/FormatterOptions.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/formatter/impl/FormatterOptions.java index b379e6a..7790d79 100644 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/formatter/impl/FormatterOptions.java +++ b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/formatter/impl/FormatterOptions.java @@ -31,6 +31,10 @@ public class FormatterOptions { public static final String OPTION_CompactAssignment = "net.sourceforge.phpeclipse.formatter.style.assignment"; //$NON-NLS-1$ + public static final String OPTION_CompactStringConcatenation = "net.sourceforge.phpeclipse.formatter.style.compactStringConcatenation"; //$NON-NLS-1$ + + public static final String OPTION_CompactArrays = "net.sourceforge.phpeclipse.formatter.style.compactArrays"; //$NON-NLS-1$ + public static final String OPTION_TabulationChar = "net.sourceforge.phpeclipse.formatter.tabulation.char"; //$NON-NLS-1$ public static final String OPTION_TabulationSize = "net.sourceforge.phpeclipse.formatter.tabulation.size"; //$NON-NLS-1$ @@ -69,7 +73,11 @@ public class FormatterOptions { public int maxLineLength = 80; public boolean compactAssignmentMode = false; + + public boolean compactStringConcatenation = false; + public boolean compactArrays = false; + // if isTrue, assignments look like x= 12 (not like x = 12); public boolean compactDereferencingMode = true; @@ -170,6 +178,22 @@ public class FormatterOptions { } continue; } + if (optionID.equals(OPTION_CompactArrays)) { + if (optionValue.equals(COMPACT)) { + this.compactArrays = true; + } else if (optionValue.equals(NORMAL)) { + this.compactArrays = false; + } + continue; + } + if (optionID.equals(OPTION_CompactStringConcatenation)) { + if (optionValue.equals(COMPACT)) { + this.compactStringConcatenation = true; + } else if (optionValue.equals(NORMAL)) { + this.compactStringConcatenation = false; + } + continue; + } if (optionID.equals(OPTION_TabulationChar)) { if (optionValue.equals(TAB)) { this.indentWithTab = true; @@ -193,44 +217,44 @@ public class FormatterOptions { * * @return int */ - public int getMaxLineLength() { - return maxLineLength; - } +// public int getMaxLineLength() { +// return maxLineLength; +// } - public int getTabSize() { - return tabSize; - } +// public int getTabSize() { +// return tabSize; +// } - public boolean isAddingNewLineBeforeOpeningBrace() { - return newLineBeforeOpeningBraceMode; - } +// public boolean isAddingNewLineBeforeOpeningBrace() { +// return newLineBeforeOpeningBraceMode; +// } - public boolean isAddingNewLineInControlStatement() { - return newlineInControlStatementMode; - } +// public boolean isAddingNewLineInControlStatement() { +// return newlineInControlStatementMode; +// } - public boolean isAddingNewLineInEmptyBlock() { - return newLineInEmptyBlockMode; - } +// public boolean isAddingNewLineInEmptyBlock() { +// return newLineInEmptyBlockMode; +// } - public boolean isClearingAllBlankLines() { - return clearAllBlankLinesMode; - } +// public boolean isClearingAllBlankLines() { +// return clearAllBlankLinesMode; +// } - public boolean isCompactingAssignment() { - return compactAssignmentMode; - } +// public boolean isCompactingAssignment() { +// return compactAssignmentMode; +// } - public boolean isCompactingDereferencing() { - return compactDereferencingMode; - } +// public boolean isCompactingDereferencing() { +// return compactDereferencingMode; +// } // public boolean isCompactingElseIf() { // return compactElseIfMode; // } - public boolean isUsingTabForIndenting() { - return indentWithTab; - } +// public boolean isUsingTabForIndenting() { +// return indentWithTab; +// } public void setLineSeparator(String lineSeparator) { lineSeparatorSequence = lineSeparator.toCharArray(); @@ -239,9 +263,9 @@ public class FormatterOptions { /** * @deprecated - should use a Map when creating the options. */ - public void setMaxLineLength(int maxLineLength) { - this.maxLineLength = maxLineLength; - } +// public void setMaxLineLength(int maxLineLength) { +// this.maxLineLength = maxLineLength; +// } /** * @deprecated - should use a Map when creating the options. */