diff options
author | Kenn Hussey | 2014-01-16 01:27:29 +0000 |
---|---|---|
committer | Kenn Hussey | 2014-01-16 01:27:29 +0000 |
commit | 751553a6120d448873ff35ccea5eef3bee7404ca (patch) | |
tree | 7d8bd59971c4d91754a8aace4222971ee7a2a8b7 | |
parent | f8a68b30d630bb918d102f001e196cd6c8ab054b (diff) | |
download | org.eclipse.uml2-751553a6120d448873ff35ccea5eef3bee7404ca.tar.gz org.eclipse.uml2-751553a6120d448873ff35ccea5eef3bee7404ca.tar.xz org.eclipse.uml2-751553a6120d448873ff35ccea5eef3bee7404ca.zip |
[424568] Exposing line separator as UML to Ecore converter option.
4 files changed, 47 insertions, 17 deletions
diff --git a/plugins/org.eclipse.uml2.common.edit/META-INF/MANIFEST.MF b/plugins/org.eclipse.uml2.common.edit/META-INF/MANIFEST.MF index bf45df008..eaa02f2df 100644 --- a/plugins/org.eclipse.uml2.common.edit/META-INF/MANIFEST.MF +++ b/plugins/org.eclipse.uml2.common.edit/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.eclipse.uml2.common.edit; singleton:=true -Bundle-Version: 1.6.0.qualifier +Bundle-Version: 2.0.0.qualifier Bundle-ClassPath: . Bundle-Vendor: %providerName Bundle-Localization: plugin diff --git a/plugins/org.eclipse.uml2.common/META-INF/MANIFEST.MF b/plugins/org.eclipse.uml2.common/META-INF/MANIFEST.MF index 6aec62969..3a855f4bc 100644 --- a/plugins/org.eclipse.uml2.common/META-INF/MANIFEST.MF +++ b/plugins/org.eclipse.uml2.common/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.eclipse.uml2.common; singleton:=true -Bundle-Version: 1.8.100.qualifier +Bundle-Version: 2.0.0.qualifier Bundle-ClassPath: . Bundle-Vendor: %providerName Bundle-Localization: plugin diff --git a/plugins/org.eclipse.uml2.common/src/org/eclipse/uml2/common/util/UML2Util.java b/plugins/org.eclipse.uml2.common/src/org/eclipse/uml2/common/util/UML2Util.java index 98a108148..aa32848e8 100644 --- a/plugins/org.eclipse.uml2.common/src/org/eclipse/uml2/common/util/UML2Util.java +++ b/plugins/org.eclipse.uml2.common/src/org/eclipse/uml2/common/util/UML2Util.java @@ -9,7 +9,7 @@ * IBM - initial API and implementation * Kenn Hussey (Embarcadero Technologies) - 204200, 247980 * Keith Campbell (IBM) - 343783 - * Kenn Hussey (CEA) - 316165, 322715, 212765, 421756 + * Kenn Hussey (CEA) - 316165, 322715, 212765, 421756, 424568 * Christian W. Damus (CEA) - 405065 * */ @@ -258,8 +258,8 @@ public class UML2Util { /** * The platform line separator. */ - protected static final String LINE_SEPARATOR = System.getProperties() - .getProperty("line.separator"); //$NON-NLS-1$ + protected static final String LINE_SEPARATOR = System + .getProperty(Platform.PREF_LINE_SEPARATOR); /** * The scheme for platform URIs. @@ -1000,17 +1000,22 @@ public class UML2Util { } protected static void addDocumentation(EModelElement eModelElement, - String text) { + String text, String lineSeparator) { if (!isEmpty(text)) { String documentation = EcoreUtil.getDocumentation(eModelElement); EcoreUtil.setDocumentation(eModelElement, documentation == null ? text - : documentation + LINE_SEPARATOR + text); + : documentation + lineSeparator + text); } } + protected static void addDocumentation(EModelElement eModelElement, + String text) { + addDocumentation(eModelElement, text, LINE_SEPARATOR); + } + protected static Collection<EObject> getRootContainers( Collection<? extends EObject> eObjects) { Collection<EObject> rootContainers = new UniqueEList.FastCompare<EObject>(); @@ -1316,7 +1321,7 @@ public class UML2Util { * empty, or was already present; {@code true} if the setting * delegate was added to the package * - * @since 5.0 + * @since 2.0 */ protected static boolean addSettingDelegate(EPackage ePackage, String settingDelegate) { diff --git a/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/util/UMLUtil.java b/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/util/UMLUtil.java index c89c70333..af6dcfb3f 100644 --- a/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/util/UMLUtil.java +++ b/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/util/UMLUtil.java @@ -10,7 +10,7 @@ * Kenn Hussey (Embarcadero Technologies) - 199624, 184249, 204406, 208125, 204200, 213218, 213903, 220669, 208016, 226396, 271470 * Nicolas Rouquette (JPL) - 260120, 313837 * Kenn Hussey - 286329, 313601, 314971, 344907, 236184, 335125 - * Kenn Hussey (CEA) - 327039, 358792, 364419, 366350, 307343, 382637, 273949, 389542, 389495, 316165, 392833, 399544, 322715, 163556, 212765, 397324, 204658, 408612, 411731, 269598, 422000, 416833 + * Kenn Hussey (CEA) - 327039, 358792, 364419, 366350, 307343, 382637, 273949, 389542, 389495, 316165, 392833, 399544, 322715, 163556, 212765, 397324, 204658, 408612, 411731, 269598, 422000, 416833, 424568 * Yann Tanguy (CEA) - 350402 * Christian W. Damus (CEA) - 392833, 251963, 405061, 409396, 176998, 180744, 403374, 416833, 420338, 405065 * E.D.Willink - 420338 @@ -3848,6 +3848,15 @@ public class UMLUtil */ public static final String OPTION__PROPERTY_DEFAULT_EXPRESSIONS = "PROPERTY_DEFAULT_EXPRESSIONS"; //$NON-NLS-1$ + /** + * The option for specifying the line separator to use when processing + * text. If unspecified, the system's 'line.separator' property will be + * used as a default. + * + * @since 5.0 + */ + public static final String OPTION__LINE_SEPARATOR = "LINE_SEPARATOR"; //$NON-NLS-1$ + private static final int DIAGNOSTIC_CODE_OFFSET = 2000; /** @@ -4461,8 +4470,8 @@ public class UMLUtil && options != null && OPTION__PROCESS .equals(options.get(OPTION__OPERATION_BODIES)))) { - addDocumentation(eModelElement, specification - .stringValue()); + addDocumentation(eModelElement, + specification.stringValue(), getLineSeparator()); } return eModelElement; @@ -5230,6 +5239,19 @@ public class UMLUtil return result; } + private String getLineSeparator() { + + if (options != null) { + String lineSeparator = options.get(OPTION__LINE_SEPARATOR); + + if (!isEmpty(lineSeparator)) { + return lineSeparator; + } + } + + return LINE_SEPARATOR; + } + protected void processEcoreTaggedValue(EModelElement eModelElement, EStructuralFeature eStructuralFeature, Element element, Stereotype stereotype, String propertyName, @@ -7234,7 +7256,7 @@ public class UMLUtil new Object[]{eModelElement})); } - addDocumentation(eModelElement, comment); + addDocumentation(eModelElement, comment, getLineSeparator()); } else if (OPTION__REPORT.equals(options.get(OPTION__COMMENTS)) && diagnostics != null) { @@ -7462,8 +7484,9 @@ public class UMLUtil eOperation.getEParameters().add(eParameter); setName(eParameter, "diagnostics", false); //$NON-NLS-1$ - addDocumentation(eParameter, - "The chain of diagnostics to which problems are to be appended."); //$NON-NLS-1$ + addDocumentation( + eParameter, + "The chain of diagnostics to which problems are to be appended.", getLineSeparator()); //$NON-NLS-1$ eParameter .setEType(EcorePackage.Literals.EDIAGNOSTIC_CHAIN); @@ -7473,8 +7496,9 @@ public class UMLUtil eOperation.getEParameters().add(eParameter); setName(eParameter, "context", false); //$NON-NLS-1$ - addDocumentation(eParameter, - "The cache of context-specific information."); //$NON-NLS-1$ + addDocumentation( + eParameter, + "The cache of context-specific information.", getLineSeparator()); //$NON-NLS-1$ EGenericType eGenericType = EcoreFactory.eINSTANCE .createEGenericType(); @@ -7784,7 +7808,8 @@ public class UMLUtil .format( "<p>From package %s (URI {@literal %s}).</p>", //$NON-NLS-1$ capName, capURI); - addDocumentation(ecore, doc); + addDocumentation(ecore, doc, + getLineSeparator()); } } } |