Skip to content
Snippets Groups Projects
Commit 6a2787a1 authored by Sebastian Bergemann's avatar Sebastian Bergemann
Browse files

Improve performance of context menu creation

Issue-Ref: 4323
Issue-Url: af3#4323



Signed-off-by: default avatarSebastian Bergemann <bergemann@fortiss.org>
parent 2aaa2d1f
No related branches found
No related tags found
1 merge request!208Fix bad display of element choices in the in-editor context menu
Pipeline #39099 failed
ReuseLibraryModelElementFactory.java 4ee3eb7449e212643992a3dec6cfb8f4278efb70 GREEN
ReuseLibraryUtilsBasics.java c5206709acec88ef1281a270472bc4cc1a8f7436 YELLOW
ReuseLibraryUtilsBasics.java c077150bba8303aecbde635e35117cc247d0c07e YELLOW
ReuseLibraryUtilsManipulation.java 77a646db5a63ba7c61664dbcaf34a9036003fde5 GREEN
......@@ -119,9 +119,9 @@ public class ReuseLibraryUtilsBasics {
* @return Display name as string (with UUID!) or empty string
*/
public static String getIDNameOfFirstRelatedLibrary(EObject element) {
ReuseLibrary library = getFirstSourceLibraryOfElement(element);
if(library != null) {
return getLibraryIDName(library);
ReuseElementSpec spec = getFirstReuseSpec(element);
if(spec != null) {
return getLibraryIDNameFormat(spec.getSourceLibUUID(), spec.getSourceLibName());
}
return "";
}
......@@ -137,9 +137,9 @@ public class ReuseLibraryUtilsBasics {
* @return Display name as string or empty string
*/
public static String getNameOfFirstRelatedLibrary(EObject element) {
ReuseLibrary library = getFirstSourceLibraryOfElement(element);
if(library != null) {
return library.getName();
ReuseElementSpec spec = getFirstReuseSpec(element);
if(spec != null) {
return spec.getSourceLibName();
}
return "";
}
......@@ -451,14 +451,14 @@ public class ReuseLibraryUtilsBasics {
}
/**
* Returns the first {@link ReuseElementSpec}s of the given element to a
* Returns the first {@link ReuseElementSpec} of the given element to a
* {@link ReuseLibrary}. If none exist, null will be returned.
*
* @param element
* The target reuse element
* @return The first reuse element specification (or null)
*/
public static ReuseElementSpec getFirstReuseSpecs(EObject element) {
public static ReuseElementSpec getFirstReuseSpec(EObject element) {
List<ReuseElementSpec> specs = getAllReuseSpecs(element);
if(!specs.isEmpty()) {
// get(0) safe due to empty check above
......@@ -555,7 +555,7 @@ public class ReuseLibraryUtilsBasics {
* @return The requested reuse library (or null)
*/
public static ReuseLibrary getFirstSourceLibraryOfElement(EObject element) {
ReuseElementSpec spec = getFirstReuseSpecs(element);
ReuseElementSpec spec = getFirstReuseSpec(element);
if(spec != null) {
String libraryUUID = spec.getSourceLibUUID();
return getLocalReuseLibraryByID(libraryUUID);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment