*
* @return The line separator to use.
*/
private static String getLineSeparator(IResource r) {
if(r != null) {
final IPreferencesService prefs = Platform.getPreferencesService();
IScopeContext[] scopeContext = new IScopeContext[] { new ProjectScope(r.getProject()) };
String lineSeparator = prefs.getString(
Platform.PI_RUNTIME, Platform.PREF_LINE_SEPARATOR, null, scopeContext);
if(lineSeparator != null)
return lineSeparator;
// line delimiter in workspace preference
scopeContext = new IScopeContext[] { InstanceScope.INSTANCE };
lineSeparator = prefs.getString(Platform.PI_RUNTIME, Platform.PREF_LINE_SEPARATOR, null, scopeContext);
if(lineSeparator != null)
return lineSeparator;
}
return getLineSeparator();
}