diff options
author | Vincent Lorenzo | 2018-01-25 09:55:47 +0000 |
---|---|---|
committer | vincent lorenzo | 2018-02-13 12:16:23 +0000 |
commit | cdd8be15a6787f5536a9d462b722152c4fb9aabb (patch) | |
tree | 89606772c568143b18f54d286590a648ee26a99f /plugins/doc | |
parent | 720b4dde8e141f3428e44ad4a9c2a6f00227b724 (diff) | |
download | org.eclipse.papyrus-cdd8be15a6787f5536a9d462b722152c4fb9aabb.tar.gz org.eclipse.papyrus-cdd8be15a6787f5536a9d462b722152c4fb9aabb.tar.xz org.eclipse.papyrus-cdd8be15a6787f5536a9d462b722152c4fb9aabb.zip |
bug 530155: [Performance] NamedElementUtil.computeDefaultNameWithIncrementFromBase must be improved and provide a naming strategy
- implements a preference
- add the documentation
- update JUnit tests to force concerned tests to use the previous behavior
Change-Id: I5e68fafc37299ffc4c1a0e18f4b1960e7ce8f010
Signed-off-by: Vincent Lorenzo <vincent.lorenzo@cea.fr>
Diffstat (limited to 'plugins/doc')
6 files changed, 65 insertions, 0 deletions
diff --git a/plugins/doc/org.eclipse.papyrus.uml.doc/plugin.xml b/plugins/doc/org.eclipse.papyrus.uml.doc/plugin.xml index 02c10a7fe7c..c273d3be375 100644 --- a/plugins/doc/org.eclipse.papyrus.uml.doc/plugin.xml +++ b/plugins/doc/org.eclipse.papyrus.uml.doc/plugin.xml @@ -11,6 +11,22 @@ file="target/generated-eclipse-help/PapyrusStarterGuide-toc.xml" primary="false"> </toc> + <toc + file="target/generated-eclipse-help/namingStrategy-userDoc-main-toc.xml" + primary="false"> + </toc> + <toc + file="target/generated-eclipse-help/namingStrategy-userDoc-toc.xml" + primary="false"> + </toc> + <toc + file="target/generated-eclipse-help/namingStrategy-devDoc-main-toc.xml" + primary="false"> + </toc> + <toc + file="target/generated-eclipse-help/namingStrategy-devDoc-toc.xml" + primary="false"> + </toc> </extension> </plugin> diff --git a/plugins/doc/org.eclipse.papyrus.uml.doc/resource/images/nameStrategy-userDoc/NamingStrategyPreferencePage.png b/plugins/doc/org.eclipse.papyrus.uml.doc/resource/images/nameStrategy-userDoc/NamingStrategyPreferencePage.png Binary files differnew file mode 100644 index 00000000000..ee5ffd2d64d --- /dev/null +++ b/plugins/doc/org.eclipse.papyrus.uml.doc/resource/images/nameStrategy-userDoc/NamingStrategyPreferencePage.png diff --git a/plugins/doc/org.eclipse.papyrus.uml.doc/resource/namingStrategy-devDoc-main-toc.xml b/plugins/doc/org.eclipse.papyrus.uml.doc/resource/namingStrategy-devDoc-main-toc.xml new file mode 100644 index 00000000000..156ccccc173 --- /dev/null +++ b/plugins/doc/org.eclipse.papyrus.uml.doc/resource/namingStrategy-devDoc-main-toc.xml @@ -0,0 +1,8 @@ +<?xml version='1.0' encoding='utf-8' ?> +<toc label="UML" link_to="../org.eclipse.papyrus.infra.doc/toc.xml#PapyrusDocDev"> + <topic label="UML" > + <topic label="Element's name initialization" > + <link toc="target/generated-eclipse-help/namingStrategy-devDoc-toc.xml"/> + </topic> + </topic> +</toc> diff --git a/plugins/doc/org.eclipse.papyrus.uml.doc/resource/namingStrategy-devDoc.mediawiki b/plugins/doc/org.eclipse.papyrus.uml.doc/resource/namingStrategy-devDoc.mediawiki new file mode 100644 index 00000000000..15f245e7900 --- /dev/null +++ b/plugins/doc/org.eclipse.papyrus.uml.doc/resource/namingStrategy-devDoc.mediawiki @@ -0,0 +1,21 @@ +=Naming Strategies= +==History== +Until Papyrus Oxygen.3, the created NamedElement were automatically named. The name was found according to the element's UML Metaclass, suffixed by an index. This index was found crossing all the elements in the owner until to build a unique name (''Metaclass' name + index''). This strategy cost many time for huge model and most of the time, the found name is replaced by the user just after the element's creation. + +Since Papyrus Oxygen.3, we implement new strategies, to reduce the time consumption. +*'''no index''': the created element is named according to its Metaclass. We have no warranty about the uniqueness of its name. +*'''quick index''': the created element is named according to its Metaclass. This name is suffixed by an index (typically, the number of the elements already contained by its parent +1). We don't check the unicity of the name. +*'''unique index''': the initial Papyrus strategy + + +==How does it work?== +Papyrus uses the '''quick index''' strategy by default. +*The preference key to use to get the behavior to implements is : '''org.eclipse.papyrus.uml.tools.utils.internal.preferences.NameElementNamingStrategyPreferenceInitializer.NAMED_ELEMENT_INDEX_INITIALIZATION''' has been created to allow to the user to choose the naming. +*All the code providing the preferences is in the plugin '''org.eclipse.papyrus.uml.tools.utils'''. +*The class in charge of the calculus of the name is and using the preference is '''NamedElementUtil'''. +*Excepted some classes (which should probably be refactored), we think that the call to the methods used to get the new element's name must provide to an ''EditHelperAdvice''. +*The best example of clean usage is '''org.eclipse.papyrus.uml.service.types.helper.advice.NamedElementInitializerHelperAdvice''' which call '''NamedElementUtil''' + + + + diff --git a/plugins/doc/org.eclipse.papyrus.uml.doc/resource/namingStrategy-userDoc-main-toc.xml b/plugins/doc/org.eclipse.papyrus.uml.doc/resource/namingStrategy-userDoc-main-toc.xml new file mode 100644 index 00000000000..ee4e13612b2 --- /dev/null +++ b/plugins/doc/org.eclipse.papyrus.uml.doc/resource/namingStrategy-userDoc-main-toc.xml @@ -0,0 +1,7 @@ +<?xml version='1.0' encoding='utf-8' ?> +<toc label="Papyrus Modeling Tools" link_to="../org.eclipse.papyrus.infra.doc/toc.xml#PapyrusTipsAndTricks"> + <topic label="Element's name initialization"> + + <link toc="target/generated-eclipse-help/namingStrategy-userDoc-toc.xml"/> +</topic> +</toc> diff --git a/plugins/doc/org.eclipse.papyrus.uml.doc/resource/namingStrategy-userDoc.mediawiki b/plugins/doc/org.eclipse.papyrus.uml.doc/resource/namingStrategy-userDoc.mediawiki new file mode 100644 index 00000000000..c6a543e7ce4 --- /dev/null +++ b/plugins/doc/org.eclipse.papyrus.uml.doc/resource/namingStrategy-userDoc.mediawiki @@ -0,0 +1,13 @@ +=Naming Strategies= +Until Papyrus Oxygen.3, the created NamedElement were automatically named. The name was found according to the element's UML Metaclass, suffixed by an index. This index was found crossing all the elements in the owner until to build a unique name (''Metaclass' name + index''). This strategy cost many time for huge model and most of the time, the found name is replaced by the user just after the element's creation. + +Since Papyrus Oxygen.3, we implement new strategies, to reduce the time consumption. +*'''no index''': the created element is named according to its Metaclass. We have no warranty about the uniqueness of its name. +*'''quick index''': the created element is named according to its Metaclass. This name is suffixed by an index (typically, the number of the elements already contained by its parent +1). We don't check the unicity of the name. +*'''unique index''': the initial Papyrus strategy + + +Papyrus uses the '''quick index''' strategy by default. + +A preference has been created to allow to the user to choose the naming. To change it, go into '''Window > Preferences > Papyrus > UML Naming Strategy'''. +[[Image:images/nameStrategy-userDoc/NamingStrategyPreferencePage.png]] |