aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorzzhongwei2013-01-03 09:10:36 (EST)
committerzzhongwei2013-01-03 09:15:03 (EST)
commit6528249ea3ae3368d6349aa621079289787eb16b (patch)
treebe71908b37f332b22e209216e0e83f1d75bdbcb1
parentbe02c1342a3cb485352b33be43d56d8008168fed (diff)
downloadorg.eclipse.pdt-6528249ea3ae3368d6349aa621079289787eb16b.zip
org.eclipse.pdt-6528249ea3ae3368d6349aa621079289787eb16b.tar.gz
org.eclipse.pdt-6528249ea3ae3368d6349aa621079289787eb16b.tar.bz2
397372: Indentation char not updated when importing a formatter
https://bugs.eclipse.org/bugs/show_bug.cgi?id=397372
-rw-r--r--plugins/org.eclipse.php.ui/src/org/eclipse/php/internal/ui/autoEdit/TabAutoEditStrategy.java13
-rw-r--r--plugins/org.eclipse.php.ui/src/org/eclipse/php/internal/ui/editor/configuration/PHPStructuredTextViewerConfiguration.java9
2 files changed, 14 insertions, 8 deletions
diff --git a/plugins/org.eclipse.php.ui/src/org/eclipse/php/internal/ui/autoEdit/TabAutoEditStrategy.java b/plugins/org.eclipse.php.ui/src/org/eclipse/php/internal/ui/autoEdit/TabAutoEditStrategy.java
index 7d95781..26b2c25 100644
--- a/plugins/org.eclipse.php.ui/src/org/eclipse/php/internal/ui/autoEdit/TabAutoEditStrategy.java
+++ b/plugins/org.eclipse.php.ui/src/org/eclipse/php/internal/ui/autoEdit/TabAutoEditStrategy.java
@@ -13,7 +13,8 @@
package org.eclipse.php.internal.ui.autoEdit;
import org.eclipse.jface.text.*;
-import org.eclipse.php.internal.core.format.FormatPreferencesSupport;
+import org.eclipse.php.internal.core.format.FormatterUtils;
+import org.eclipse.php.internal.core.format.IFormatterCommonPrferences;
import org.eclipse.php.internal.ui.Logger;
import org.eclipse.php.internal.ui.PHPUiPlugin;
import org.eclipse.php.internal.ui.preferences.PreferenceConstants;
@@ -46,8 +47,8 @@ public class TabAutoEditStrategy implements IAutoEditStrategy {
this.document = (IStructuredDocument) document;
boolean isAutoIndent = PHPUiPlugin.getDefault()
- .getPreferenceStore().getBoolean(
- PreferenceConstants.EDITOR_SMART_TAB);
+ .getPreferenceStore()
+ .getBoolean(PreferenceConstants.EDITOR_SMART_TAB);
if (!isAutoIndent) {
applyTabRule();
return;
@@ -248,11 +249,13 @@ public class TabAutoEditStrategy implements IAutoEditStrategy {
// This method applies the standard Tab rule and will perform a regular tab
private void applyTabRule() {
- char indentChar = FormatPreferencesSupport.getInstance()
+ IFormatterCommonPrferences formatterCommonPrferences = FormatterUtils
+ .getFormatterCommonPrferences();
+ char indentChar = formatterCommonPrferences
.getIndentationChar(document);
if (indentChar == ' ') {
- int indentSize = FormatPreferencesSupport.getInstance()
+ int indentSize = formatterCommonPrferences
.getIndentationSize(document);
command.text += getIndentationString(indentSize);
} else {
diff --git a/plugins/org.eclipse.php.ui/src/org/eclipse/php/internal/ui/editor/configuration/PHPStructuredTextViewerConfiguration.java b/plugins/org.eclipse.php.ui/src/org/eclipse/php/internal/ui/editor/configuration/PHPStructuredTextViewerConfiguration.java
index 850e574..ee84658 100644
--- a/plugins/org.eclipse.php.ui/src/org/eclipse/php/internal/ui/editor/configuration/PHPStructuredTextViewerConfiguration.java
+++ b/plugins/org.eclipse.php.ui/src/org/eclipse/php/internal/ui/editor/configuration/PHPStructuredTextViewerConfiguration.java
@@ -36,7 +36,8 @@ import org.eclipse.php.internal.core.PHPCorePlugin;
import org.eclipse.php.internal.core.documentModel.partitioner.PHPPartitionTypes;
import org.eclipse.php.internal.core.documentModel.partitioner.PHPStructuredTextPartitioner;
import org.eclipse.php.internal.core.documentModel.provisional.contenttype.ContentTypeIdForPHP;
-import org.eclipse.php.internal.core.format.FormatPreferencesSupport;
+import org.eclipse.php.internal.core.format.FormatterUtils;
+import org.eclipse.php.internal.core.format.IFormatterCommonPrferences;
import org.eclipse.php.internal.core.format.PhpFormatProcessorImpl;
import org.eclipse.php.internal.ui.PHPUiPlugin;
import org.eclipse.php.internal.ui.autoEdit.CloseTagAutoEditStrategyPHP;
@@ -463,9 +464,11 @@ public class PHPStructuredTextViewerConfiguration extends
Vector<String> vector = new Vector<String>();
// prefix[0] is either '\t' or ' ' x tabWidth, depending on preference
- char indentCharPref = FormatPreferencesSupport.getInstance()
+ IFormatterCommonPrferences formatterCommonPrferences = FormatterUtils
+ .getFormatterCommonPrferences();
+ char indentCharPref = formatterCommonPrferences
.getIndentationChar(sourceViewer.getDocument());
- int indentationSize = FormatPreferencesSupport.getInstance()
+ int indentationSize = formatterCommonPrferences
.getIndentationSize(sourceViewer.getDocument());
for (int i = 0; i <= indentationSize; i++) {