Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 71271 | Differences between
and this patch

Collapse All | Expand All

(-)src/org/eclipse/wst/css/core/internal/formatter/AbstractCSSSourceFormatter.java (-5 / +5 lines)
Lines 938-958 Link Here
938
	}
938
	}
939
939
940
	private String getIndentString() {
940
	private String getIndentString() {
941
		String indent = ""; //$NON-NLS-1$
941
		StringBuffer indent = new StringBuffer();
942
942
943
		Preferences preferences = CSSCorePlugin.getDefault().getPluginPreferences();
943
		Preferences preferences = CSSCorePlugin.getDefault().getPluginPreferences();
944
		if (preferences != null) {
944
		if (preferences != null) {
945
			String indentChar = " "; //$NON-NLS-1$
945
			char indentChar = ' ';
946
			String indentCharPref = preferences.getString(CSSCorePreferenceNames.INDENTATION_CHAR);
946
			String indentCharPref = preferences.getString(CSSCorePreferenceNames.INDENTATION_CHAR);
947
			if (CSSCorePreferenceNames.TAB.equals(indentCharPref)) {
947
			if (CSSCorePreferenceNames.TAB.equals(indentCharPref)) {
948
				indentChar = "\t"; //$NON-NLS-1$
948
				indentChar = '\t';
949
			}
949
			}
950
			int indentationWidth = preferences.getInt(CSSCorePreferenceNames.INDENTATION_SIZE);
950
			int indentationWidth = preferences.getInt(CSSCorePreferenceNames.INDENTATION_SIZE);
951
951
952
			for (int i = 0; i < indentationWidth; i++) {
952
			for (int i = 0; i < indentationWidth; i++) {
953
				indent += indentChar;
953
				indent.append(indentChar);
954
			}
954
			}
955
		}
955
		}
956
		return indent;
956
		return indent.toString();
957
	}
957
	}
958
}
958
}
(-)src/org/eclipse/wst/css/core/internal/formatter/StyleDeclItemFormatter.java (-5 / +5 lines)
Lines 379-399 Link Here
379
	}
379
	}
380
380
381
	private String getIndentString() {
381
	private String getIndentString() {
382
		String indent = ""; //$NON-NLS-1$
382
		StringBuffer indent = new StringBuffer();
383
383
384
		Preferences preferences = CSSCorePlugin.getDefault().getPluginPreferences();
384
		Preferences preferences = CSSCorePlugin.getDefault().getPluginPreferences();
385
		if (preferences != null) {
385
		if (preferences != null) {
386
			String indentChar = " "; //$NON-NLS-1$
386
			char indentChar = ' ';
387
			String indentCharPref = preferences.getString(CSSCorePreferenceNames.INDENTATION_CHAR);
387
			String indentCharPref = preferences.getString(CSSCorePreferenceNames.INDENTATION_CHAR);
388
			if (CSSCorePreferenceNames.TAB.equals(indentCharPref)) {
388
			if (CSSCorePreferenceNames.TAB.equals(indentCharPref)) {
389
				indentChar = "\t"; //$NON-NLS-1$
389
				indentChar = '\t';
390
			}
390
			}
391
			int indentationWidth = preferences.getInt(CSSCorePreferenceNames.INDENTATION_SIZE);
391
			int indentationWidth = preferences.getInt(CSSCorePreferenceNames.INDENTATION_SIZE);
392
392
393
			for (int i = 0; i < indentationWidth; i++) {
393
			for (int i = 0; i < indentationWidth; i++) {
394
				indent += indentChar;
394
				indent.append(indentChar);
395
			}
395
			}
396
		}
396
		}
397
		return indent;
397
		return indent.toString();
398
	}
398
	}
399
}
399
}
(-)src/org/eclipse/wst/css/core/internal/provisional/preferences/CSSPreferenceHelper.java (-5 / +5 lines)
Lines 41-62 Link Here
41
	 * 
41
	 * 
42
	 */
42
	 */
43
	public String getIndentString() {
43
	public String getIndentString() {
44
		String indent = ""; //$NON-NLS-1$
44
		StringBuffer indent = new StringBuffer();
45
		
45
		
46
		Preferences preferences = getPreferences();
46
		Preferences preferences = getPreferences();
47
		if (preferences != null) {
47
		if (preferences != null) {
48
			String indentChar = " "; //$NON-NLS-1$
48
			char indentChar = ' ';
49
			String indentCharPref = preferences.getString(CSSCorePreferenceNames.INDENTATION_CHAR);
49
			String indentCharPref = preferences.getString(CSSCorePreferenceNames.INDENTATION_CHAR);
50
			if (CSSCorePreferenceNames.TAB.equals(indentCharPref)) {
50
			if (CSSCorePreferenceNames.TAB.equals(indentCharPref)) {
51
				indentChar = "\t"; //$NON-NLS-1$
51
				indentChar = '\t';
52
			}
52
			}
53
			int indentationWidth = preferences.getInt(CSSCorePreferenceNames.INDENTATION_SIZE);
53
			int indentationWidth = preferences.getInt(CSSCorePreferenceNames.INDENTATION_SIZE);
54
	
54
	
55
			for (int i = 0; i < indentationWidth; i++) {
55
			for (int i = 0; i < indentationWidth; i++) {
56
				indent += indentChar;
56
				indent.append(indentChar);
57
			}
57
			}
58
		}
58
		}
59
		return indent;
59
		return indent.toString();
60
	}
60
	}
61
61
62
	/**
62
	/**

Return to bug 71271