Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ This removes Rollup warnings about missing global names for externalized peer de
- [releng] Reduce the log of the frontend tasks `format-lint` and `build-dev` by default to make tasks such as `build` or `start` less verbose.
- [cleanup] Use only one border node description provider for all item border nodes.
- https://github.com/eclipse-syson/syson/issues/2452[#2352] [diagram] Decouple SysON tools from Sirius Web's DefaultToolsFactory: SysON now defines its own `DiagramDefaultToolsFactory` providing show/hide tools.
- https://github.com/eclipse-syson/syson/issues/2453[#2453] [diagrams] Add the Show/Hide section and associated tools to the group palette.

=== New features

Expand Down

Large diffs are not rendered by default.

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;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
import org.eclipse.sirius.components.view.diagram.NodeTool;
import org.eclipse.sirius.components.view.diagram.ToolSection;
import org.eclipse.sirius.components.view.emf.diagram.ViewDiagramDescriptionConverter;
import org.eclipse.syson.diagram.common.view.DiagramDefaultGroupToolsFactory;
import org.eclipse.syson.diagram.common.view.ViewDiagramElementFinder;
import org.eclipse.syson.diagram.common.view.edges.AnnotationEdgeDescriptionProvider;
import org.eclipse.syson.diagram.common.view.nodes.ActionFlowCompartmentNodeDescriptionProvider;
Expand Down Expand Up @@ -431,6 +432,7 @@ private List<ToolSection> createGroupToolSections() {
.build();
groupToolSections.add(viewAsToolSection);
groupToolSections.add(this.toolDescriptionService.relatedElementsGroupToolSection());
groupToolSections.add(new DiagramDefaultGroupToolsFactory().createDefaultHideRevealNodeToolSection());
return groupToolSections;
}

Expand Down

Copy link
Copy Markdown
Contributor Author

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

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,11 @@ image::release-notes-hierarchical-requirements-table-view.png[Hierarchical requi
+
image::release-notes-hierarchical-requirements-table-view-create-nested-requirement.png[New sub-requirement in row action menu, width=90%,height=90%]

** When selecting multiple graphical nodes, the group palette now displays the _Show/Hide_ section just like the single selection palette.
The associated tools are the same ones: _Hide_; _Hide all content_; _Show all content_; _Reset content_; _Show valued content_.
+
image::release-notes-show-hide-section-group-palette.png[New Show/Hide section in group palette, width=90%,height=90%]

== Technical details

* For technical details on this {product} release, including breaking changes, please refer to the https://github.com/eclipse-syson/syson/blob/main/CHANGELOG.adoc[changelog].
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,12 @@ image::manage-group-element-toolbar.png[Group element toolbar]
User can still used basic tools such as :

* Hide elements,
* Hide all their content,
* Show their valued content,
* Fade elements,
* Pin elements.

A new tool section appears in this toolbar.
A layout tool section appears in this toolbar.
Many tools acting on selected elements layout can be found in this tool section :

* Align left,
Expand Down
Loading