|
Lines 20-25
Link Here
|
| 20 |
import org.eclipse.core.internal.resources.Workspace; |
20 |
import org.eclipse.core.internal.resources.Workspace; |
| 21 |
import org.eclipse.core.resources.*; |
21 |
import org.eclipse.core.resources.*; |
| 22 |
import org.eclipse.core.runtime.*; |
22 |
import org.eclipse.core.runtime.*; |
|
|
23 |
import org.eclipse.core.runtime.preferences.DefaultScope; |
| 23 |
import org.eclipse.core.runtime.preferences.InstanceScope; |
24 |
import org.eclipse.core.runtime.preferences.InstanceScope; |
| 24 |
import org.eclipse.osgi.util.NLS; |
25 |
import org.eclipse.osgi.util.NLS; |
| 25 |
import org.osgi.service.prefs.BackingStoreException; |
26 |
import org.osgi.service.prefs.BackingStoreException; |
|
Lines 181-186
Link Here
|
| 181 |
* <li> Line separator currently used in that file. |
182 |
* <li> Line separator currently used in that file. |
| 182 |
* <li> Line separator defined in project preferences. |
183 |
* <li> Line separator defined in project preferences. |
| 183 |
* <li> Line separator defined in instance preferences. |
184 |
* <li> Line separator defined in instance preferences. |
|
|
185 |
* <li> Line separator defined in default preferences. |
| 184 |
* <li> Operating system default line separator. |
186 |
* <li> Operating system default line separator. |
| 185 |
* </ol> |
187 |
* </ol> |
| 186 |
* @param file the file for which line separator should be returned |
188 |
* @param file the file for which line separator should be returned |
|
Lines 219-224
Link Here
|
| 219 |
value = getLineSeparatorFromPreferences(rootNode.node(InstanceScope.SCOPE)); |
221 |
value = getLineSeparatorFromPreferences(rootNode.node(InstanceScope.SCOPE)); |
| 220 |
if (value != null) |
222 |
if (value != null) |
| 221 |
return value; |
223 |
return value; |
|
|
224 |
// try with default preferences |
| 225 |
value = getLineSeparatorFromPreferences(rootNode.node(DefaultScope.SCOPE)); |
| 226 |
if (value != null) |
| 227 |
return value; |
| 222 |
// if there is no preference set, fall back to OS default value |
228 |
// if there is no preference set, fall back to OS default value |
| 223 |
return System.getProperty("line.separator"); //$NON-NLS-1$ |
229 |
return System.getProperty("line.separator"); //$NON-NLS-1$ |
| 224 |
} |
230 |
} |