-
Notifications
You must be signed in to change notification settings - Fork 104
[2453] Add Show/Hide section in the group palette #2456
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
AxelRICHARD
merged 1 commit into
eclipse-syson:main
from
theogiraudet:tgi/enh/group_tool_palette
Aug 24, 2026
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
335 changes: 335 additions & 0 deletions
335
...syson/application/controllers/diagrams/general/view/GVGroupPaletteShowHideToolsTests.java
Large diffs are not rendered by default.
Oops, something went wrong.
97 changes: 97 additions & 0 deletions
97
.../src/main/java/org/eclipse/syson/diagram/common/view/DiagramDefaultGroupToolsFactory.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,97 @@ | ||
| /******************************************************************************* | ||
| * Copyright (c) 2026 Obeo. | ||
| * This program and the accompanying materials | ||
| * are made available under the terms of the Eclipse Public License v2.0 | ||
| * which accompanies this distribution, and is available at | ||
| * https://www.eclipse.org/legal/epl-2.0/ | ||
| * | ||
| * SPDX-License-Identifier: EPL-2.0 | ||
| * | ||
| * Contributors: | ||
| * Obeo - initial API and implementation | ||
| *******************************************************************************/ | ||
|
|
||
| package org.eclipse.syson.diagram.common.view; | ||
|
|
||
| import org.eclipse.sirius.components.view.ChangeContext; | ||
| import org.eclipse.sirius.components.view.ViewFactory; | ||
| import org.eclipse.sirius.components.view.diagram.DiagramFactory; | ||
| import org.eclipse.sirius.components.view.diagram.NodeTool; | ||
| import org.eclipse.sirius.components.view.diagram.NodeToolSection; | ||
|
|
||
| /** | ||
| * Factory to create generic group tool descriptions which invoke the default/canonical behaviors. | ||
| * | ||
| * @author tgiraudet | ||
| */ | ||
| public class DiagramDefaultGroupToolsFactory { | ||
|
|
||
| private static final String HAS_CHILDREN_EXPRESSION = "aql:selectedNodes.getChildNodes()->notEmpty() or selectedNodes.getBorderNodes()->notEmpty()"; | ||
|
|
||
| private static final String HAS_HIDDEN_CHILDREN_EXPRESSION = "aql:selectedNodes.getChildNodes()->union(selectedNodes.getBorderNodes())->select(n | n.isHidden())->notEmpty()"; | ||
|
|
||
| public NodeToolSection createDefaultHideRevealNodeToolSection() { | ||
| NodeToolSection nodeToolSection = DiagramFactory.eINSTANCE.createNodeToolSection(); | ||
| nodeToolSection.setName("Show/Hide"); | ||
| nodeToolSection.getNodeTools().add(this.createDefaultHideNodeTool()); | ||
| nodeToolSection.getNodeTools().add(this.createDefaultHideAllChildrenNodeTool()); | ||
| nodeToolSection.getNodeTools().add(this.createDefaultRevealAllChildrenNodeTool()); | ||
| nodeToolSection.getNodeTools().add(this.createDefaultResetAllChildrenVisibilityModifiersNodeTool()); | ||
| nodeToolSection.getNodeTools().add(this.createDefaultRevealChildrenWithValueNodeTool()); | ||
| return nodeToolSection; | ||
| } | ||
|
|
||
| public NodeTool createDefaultHideNodeTool() { | ||
| NodeTool newNodeTool = DiagramFactory.eINSTANCE.createNodeTool(); | ||
| newNodeTool.setName("Hide"); | ||
| ChangeContext body = ViewFactory.eINSTANCE.createChangeContext(); | ||
| body.setExpression("aql:diagramServices.hide(selectedNodes)"); | ||
| newNodeTool.getBody().add(body); | ||
| newNodeTool.setIconURLsExpression("aql:'/icons/full/obj16/HideTool.svg'"); | ||
| return newNodeTool; | ||
| } | ||
|
|
||
| public NodeTool createDefaultHideAllChildrenNodeTool() { | ||
| NodeTool newNodeTool = DiagramFactory.eINSTANCE.createNodeTool(); | ||
| newNodeTool.setName("Hide all content"); | ||
| ChangeContext body = ViewFactory.eINSTANCE.createChangeContext(); | ||
| body.setExpression("aql:diagramServices.hide(selectedNodes.getChildNodes()->union(selectedNodes.getBorderNodes()))"); | ||
| newNodeTool.getBody().add(body); | ||
| newNodeTool.setIconURLsExpression("aql:'/icons/full/obj16/HideTool.svg'"); | ||
| newNodeTool.setPreconditionExpression("aql:selectedNodes.getChildNodes()->notEmpty() or selectedNodes.getBorderNodes()->notEmpty()"); | ||
| return newNodeTool; | ||
| } | ||
|
|
||
| public NodeTool createDefaultRevealAllChildrenNodeTool() { | ||
| NodeTool newNodeTool = DiagramFactory.eINSTANCE.createNodeTool(); | ||
| newNodeTool.setName("Show all content"); | ||
| ChangeContext body = ViewFactory.eINSTANCE.createChangeContext(); | ||
| body.setExpression("aql:diagramServices.reveal(selectedNodes.getChildNodes()->union(selectedNodes.getBorderNodes()))"); | ||
| newNodeTool.getBody().add(body); | ||
| newNodeTool.setIconURLsExpression("aql:'/icons/full/obj16/ShowTool.svg'"); | ||
| newNodeTool.setPreconditionExpression("aql:selectedNodes.getChildNodes()->union(selectedNodes.getBorderNodes())->select(n | n.isHidden())->notEmpty()"); | ||
| return newNodeTool; | ||
| } | ||
|
|
||
| public NodeTool createDefaultResetAllChildrenVisibilityModifiersNodeTool() { | ||
| NodeTool newNodeTool = DiagramFactory.eINSTANCE.createNodeTool(); | ||
| newNodeTool.setName("Reset content"); | ||
| ChangeContext body = ViewFactory.eINSTANCE.createChangeContext(); | ||
| body.setExpression("aql:diagramServices.resetViewModifiers(selectedNodes.getChildNodes()->union(selectedNodes.getBorderNodes()))"); | ||
| newNodeTool.getBody().add(body); | ||
| newNodeTool.setIconURLsExpression("aql:'/icons/full/obj16/ShowTool.svg'"); | ||
| newNodeTool.setPreconditionExpression(HAS_CHILDREN_EXPRESSION); | ||
| return newNodeTool; | ||
| } | ||
|
|
||
| public NodeTool createDefaultRevealChildrenWithValueNodeTool() { | ||
| NodeTool newNodeTool = DiagramFactory.eINSTANCE.createNodeTool(); | ||
| newNodeTool.setName("Show valued content"); | ||
| ChangeContext body = ViewFactory.eINSTANCE.createChangeContext(); | ||
| body.setExpression("aql:diagramServices.reveal(selectedNodes.getChildNodes()->union(selectedNodes.getBorderNodes())->select(n | n.getChildNodes()->notEmpty() or n.getBorderNodes()->notEmpty()))"); | ||
| newNodeTool.getBody().add(body); | ||
| newNodeTool.setIconURLsExpression("aql:'/icons/full/obj16/ShowTool.svg'"); | ||
| newNodeTool.setPreconditionExpression(HAS_HIDDEN_CHILDREN_EXPRESSION); | ||
| return newNodeTool; | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file modified
BIN
-7.28 KB
(65%)
doc/content/modules/user-manual/assets/images/manage-group-element-toolbar.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+30.2 KB
...les/user-manual/assets/images/release-notes-show-hide-section-group-palette.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This image was out-to-date, so I took the liberty of updating it