Adding two small options for code formatter (zhil's patch). These features are being...
[phpeclipse.git] / net.sourceforge.phpeclipse / src / net / sourceforge / phpdt / internal / formatter / impl / FormatterOptions.java
index b379e6a..5297a14 100644 (file)
@@ -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;