From dc6f1cddc36561a9ce35c0a19a94e390a5ad224b Mon Sep 17 00:00:00 2001 From: Simon Barner <barner@fortiss.org> Date: Tue, 27 Jun 2023 17:29:36 +0200 Subject: [PATCH] GREEN Issue-ref: 4290 Issue-Url: https://git.fortiss.org/af3/af3/-/issues/4290 Signed-off-by: Simon Barner <barner@fortiss.org> --- .../base/ui/editor/fx/controller/.ratings | 8 +++---- .../tooling/kernel/ui/internal/.ratings | 2 +- .../ui/internal/ContextMenuService.java | 22 +++++++++---------- .../tooling/kernel/ui/service/.ratings | 2 +- 4 files changed, 16 insertions(+), 18 deletions(-) diff --git a/org.fortiss.tooling.base.ui/src/org/fortiss/tooling/base/ui/editor/fx/controller/.ratings b/org.fortiss.tooling.base.ui/src/org/fortiss/tooling/base/ui/editor/fx/controller/.ratings index 7276915ba..8a7655448 100644 --- a/org.fortiss.tooling.base.ui/src/org/fortiss/tooling/base/ui/editor/fx/controller/.ratings +++ b/org.fortiss.tooling.base.ui/src/org/fortiss/tooling/base/ui/editor/fx/controller/.ratings @@ -1,9 +1,9 @@ CurvedLinkLayoutedContentAnchorangeController.java 249629c966a1f92fc28294ef62117439799d7315 GREEN CurvedLinkLayoutedDiagramAnchorangeController.java de1ab32e11205435cf7a89d2dcc352683ef8b39e GREEN -EObjectDiagramController.java 4b51e73023a8e5dd7f5ae12b495b25f22c1b58bd YELLOW -EObjectEllipticResizableContentControllerBase.java 7021ae2cadf40bdd099964908cc881644ad9ffb3 YELLOW +EObjectDiagramController.java 4b51e73023a8e5dd7f5ae12b495b25f22c1b58bd GREEN +EObjectEllipticResizableContentControllerBase.java 7021ae2cadf40bdd099964908cc881644ad9ffb3 GREEN EObjectModelChangeProvider.java f4b60cebb088a5c81ca92a41614e1a5d40030502 GREEN -EObjectRectangularResizableContentControllerBase.java dbeb8371fdac0838c9a23b9dcff63f81aae1265b YELLOW +EObjectRectangularResizableContentControllerBase.java dbeb8371fdac0838c9a23b9dcff63f81aae1265b GREEN KernelServiceBasedModelChangeProviderBase.java 8d1f8ef79ecd383ff74e5a2bbcf24345aabe70af GREEN LayoutedContentAnchorageController.java 83f066a151dd2984c4bef64daf8165a0cd53b00f GREEN LayoutedCurveLinkBendPointController.java d963a5e227de7bd8ba910c733df2ac7acf4fa1fa GREEN @@ -12,5 +12,5 @@ LayoutedEllipticResizableContentController.java 00037188773eb65866863ab89331bc98 LayoutedLineLinkBendPointController.java 8022cc66c4d33d7bf357ceb4c9ca1694f4f2fda8 GREEN LayoutedLinkBendPointController.java d3f22ffb43426da62e849074a9d5a64e4d70a7ad GREEN LayoutedRectangularResizableContentController.java 341f4a7da0d69360d7026af6d9b3d44dfd7d9bb1 GREEN -ModelElementFXEditorUIProviderBase.java 1ab1d053029e14510ff97c84821a62ddeaf595e7 YELLOW +ModelElementFXEditorUIProviderBase.java 1ab1d053029e14510ff97c84821a62ddeaf595e7 GREEN NamedCommentedLayoutModelChangeProvider.java 223e82c1b1cba842f6fae115182f5d0c6acb44b0 GREEN diff --git a/org.fortiss.tooling.kernel.ui/src/org/fortiss/tooling/kernel/ui/internal/.ratings b/org.fortiss.tooling.kernel.ui/src/org/fortiss/tooling/kernel/ui/internal/.ratings index cb17ac9e2..47adba827 100644 --- a/org.fortiss.tooling.kernel.ui/src/org/fortiss/tooling/kernel/ui/internal/.ratings +++ b/org.fortiss.tooling.kernel.ui/src/org/fortiss/tooling/kernel/ui/internal/.ratings @@ -1,5 +1,5 @@ ActionService.java e29126b5947c9fd2f1d82bb87001b9d0ead50c3b GREEN -ContextMenuService.java 95c41cf4519b07b18223acfa06919e04725ce67b YELLOW +ContextMenuService.java 752ecb95721c4ff31583095bdb06b71ef28c4dcf GREEN MarkerService.java 0bfe2c67638db4e506ea5dc7680765f2a8d632e1 GREEN ModelEditorBindingService.java f304addb514cd2de443997e0b52cef7a3a9897bf GREEN ModelElementHandlerService.java 34adeef844bf98c69f1b9a7252f34d0a2b741b54 GREEN diff --git a/org.fortiss.tooling.kernel.ui/src/org/fortiss/tooling/kernel/ui/internal/ContextMenuService.java b/org.fortiss.tooling.kernel.ui/src/org/fortiss/tooling/kernel/ui/internal/ContextMenuService.java index 95c41cf45..752ecb957 100644 --- a/org.fortiss.tooling.kernel.ui/src/org/fortiss/tooling/kernel/ui/internal/ContextMenuService.java +++ b/org.fortiss.tooling.kernel.ui/src/org/fortiss/tooling/kernel/ui/internal/ContextMenuService.java @@ -85,8 +85,7 @@ public class ContextMenuService implements IContextMenuService, IIntrospectiveKe private static final String HANDLER_CLASS_ATTRIBUTE_NAME = "contributor"; /** Stores the registered context menu contributors. */ - private final List<IContextMenuContributor> contextMenuContributorList = - new ArrayList<IContextMenuContributor>(); + private final List<IContextMenuContributor> contextMenuContributorList = new ArrayList<>(); /** An ordered list of all menu sections from top to bottom. */ private static final String[] MENU_SECTIONS = {TOP_MOST_MENU_SECTION_ID, @@ -173,15 +172,14 @@ public class ContextMenuService implements IContextMenuService, IIntrospectiveKe addContributions(menu, contextProvider); + IActionService as = IActionService.getInstance(); if(!ITutorialService.getInstance().isTutorialActive()) { - IActionService.getInstance().addGlobalDefaultActionSectionToMenu(menu); + as.addGlobalDefaultActionSectionToMenu(menu); } else { - - IActionService.getInstance().addGlobalEditingActionsToMenu(menu, - ITutorialUIService.getInstance().globalCopyPasteActionsVisible(), - ITutorialUIService.getInstance().globalDeleteActionVisible(), - ITutorialUIService.getInstance().globalRenameActionVisible(), - ITutorialUIService.getInstance().globalSelectAllActionVisible()); + ITutorialUIService tsUI = ITutorialUIService.getInstance(); + as.addGlobalEditingActionsToMenu(menu, tsUI.globalCopyPasteActionsVisible(), + tsUI.globalDeleteActionVisible(), tsUI.globalRenameActionVisible(), + tsUI.globalSelectAllActionVisible()); } } } @@ -284,13 +282,14 @@ public class ContextMenuService implements IContextMenuService, IIntrospectiveKe // get contributions from contributor List<IContributionItem> items = null; + boolean isTutorialActive = ITutorialService.getInstance().isTutorialActive(); if(selectedElements.size() == 1) { // Size checked. EObject selectedElement = selectedElements.get(0); items = contributor.getContributedItems(selectedElement, contextProvider); // active tutorial may filter contributions - if(ITutorialService.getInstance().isTutorialActive()) { + if(isTutorialActive) { ITutorialUIService service = ITutorialUIService.getInstance(); Predicate<? super IContributionItem> isVisible = i -> service.contextMenuContributionVisible(selectedElement, i); @@ -299,14 +298,13 @@ public class ContextMenuService implements IContextMenuService, IIntrospectiveKe } else if(selectedElements.size() > 1 && contributor instanceof IContextMenuMultiSelectionContributor) { // active tutorial does not support multiple selections - if(ITutorialService.getInstance().isTutorialActive()) { + if(isTutorialActive) { continue; } IContextMenuMultiSelectionContributor multiContributor = (IContextMenuMultiSelectionContributor)contributor; items = multiContributor.getContributedItems(selectedElements, contextProvider); - } if(items == null) { diff --git a/org.fortiss.tooling.kernel.ui/src/org/fortiss/tooling/kernel/ui/service/.ratings b/org.fortiss.tooling.kernel.ui/src/org/fortiss/tooling/kernel/ui/service/.ratings index 64987c1e5..d8e3a77f8 100644 --- a/org.fortiss.tooling.kernel.ui/src/org/fortiss/tooling/kernel/ui/service/.ratings +++ b/org.fortiss.tooling.kernel.ui/src/org/fortiss/tooling/kernel/ui/service/.ratings @@ -1,5 +1,5 @@ IActionService.java 22eafafc8708cbff7f855f7b1b9bef042c127f25 GREEN -IContextMenuService.java 10fdd339b5e902c99578caa98d631f2d551a6e29 YELLOW +IContextMenuService.java 10fdd339b5e902c99578caa98d631f2d551a6e29 GREEN IMarkerService.java 82486a5656cd907926fcdf1ca1ab801290f8514c GREEN IModelEditorBindingService.java ce2ae1957e2232bb0fac1d1d262103f9adfc5266 GREEN IModelElementHandlerService.java 23353de6b85af0e9d44a1c926174fa4ed5152af0 GREEN -- GitLab