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 @@ -51,6 +51,7 @@ Users should use the dedicated tools to edit expressions instead, as they ensure
- https://github.com/eclipse-syson/syson/issues/2301[#2301] [diagram] Constraint nodes now display their corresponding expression directly in their label if it is set.
- https://github.com/eclipse-syson/syson/issues/2292[#2292] [diagrams] Add inheritance of "Behavior" and "Step" graphical elements in list items.
It concerns, at least, _actions_ and _items_ compartments list items.
- https://github.com/eclipse-syson/syson/issues/2284[#2284] [diagrams] The expression-related tools in diagram palette are now available in the default _Edit_ section.

=== New features

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,9 @@ public class ExpressionsPaletteToolsProvider implements IPaletteToolsProvider {

private static final String DELETE_EXPRESSION_TOOL_LABEL = "Delete expression";

private static final String EXPRESSION_TOOL_SECTION_ID = "toolSection_expression";
private static final String EXPRESSION_TOOL_SECTION_ID = "edit-section";

private static final String EXPRESSION_TOOL_SECTION_LABEL = "Expression";
private static final String EXPRESSION_TOOL_SECTION_LABEL = "Edit";

private final IObjectSearchService objectSearchService;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2023, 2024 Obeo.
* Copyright (c) 2023, 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
Expand All @@ -25,7 +25,7 @@
@Service
public class ImagePathService implements IImagePathService {

private static final List<String> IMAGES_PATHS = List.of("/img", "/images", "/icons");
private static final List<String> IMAGES_PATHS = List.of("/img", "/images", "/icons", "/palette");

@Override
public List<String> getPaths() {
Expand Down
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 @@ -113,8 +113,8 @@ public void testQueryPaletteAndExecuteTools() {
assertThat(quickToolsLabels).hasSize(4);
assertThat(quickToolsLabels).containsSequence("Pin", "Adjust size", "Fade", "Hide");
List<String> paletteEntriesLabels = JsonPath.read(result.data(), "$.data.viewer.editingContext.representation.description.palette.paletteEntries[*].label");
assertThat(paletteEntriesLabels).hasSize(6);
assertThat(paletteEntriesLabels).containsSequence("Requirements", "Structure", "Show/Hide", "Related Elements", "Edit", "Expression");
assertThat(paletteEntriesLabels).hasSize(5);
assertThat(paletteEntriesLabels).containsSequence("Requirements", "Structure", "Show/Hide", "Related Elements", "Edit");

List<String> paletteRequirementsSectionToolsLabels = JsonPath.read(result.data(), "$.data.viewer.editingContext.representation.description.palette.paletteEntries[0].tools[*].label");
assertThat(paletteRequirementsSectionToolsLabels).hasSize(1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ To _create_ an expression, invoke the _New expression_ action on a compatible el
The action is only available on elements which _can_ own an expression but do not have one yet.

* In the {explorer} view, this is available in the element's context menu.
* In a _Diagram_, it is available in the _Expression_ section of the element's palette (if applicable).
* In a _Diagram_, it is available in the _Edit_ section of the element's palette (if applicable).
* In the {details} view, it is available as a `+` button on the _Expression value_ widget (if present).

A modal will open where you can enter the textual representation of the expression to create.
Expand All @@ -46,7 +46,7 @@ image::edit-expression-modal-error.png[Edit expression modal showing an error me

To edit an already existing expression, invoke the _Edit expression_ action directly on the existing expression or on its parent element.
In the {explorer} view, this is available in the element's context menu.
In a _Diagram_, it is avilable in the _Expression_ section of the element's palette (if applicable).
In a _Diagram_, it is avilable in the _Edit_ section of the element's palette (if applicable).

The same modal as for expression creation will open, but with the current textual representation of the expression pre-filled.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,9 @@
* Contributors:
* Obeo - initial API and implementation
*******************************************************************************/
import { useDeletionConfirmationDialog } from '@eclipse-sirius/sirius-components-core';
import { IconOverlay, useDeletionConfirmationDialog } from '@eclipse-sirius/sirius-components-core';
import { DiagramContext, DiagramContextValue, EdgeData, NodeData } from '@eclipse-sirius/sirius-components-diagrams';
import { PaletteToolContributionComponentProps, usePalette } from '@eclipse-sirius/sirius-components-palette';
import DeleteIcon from '@mui/icons-material/Delete';
import ListItemButton from '@mui/material/ListItemButton';
import ListItemIcon from '@mui/material/ListItemIcon';
import ListItemText from '@mui/material/ListItemText';
Expand Down Expand Up @@ -76,6 +75,9 @@ export const DeleteExpressionDiagramToolOverriddenContribution = ({
});
};

const toolLabel = 'Delete Expression';
const toolIconURL = '/api/images/diagram-images/semanticDelete.svg';

return (
<ListItemButton
key="overridden_tool_delete_expression"
Expand All @@ -84,9 +86,9 @@ export const DeleteExpressionDiagramToolOverriddenContribution = ({
disabled={readOnly}
className={classes.listItemButton}>
<ListItemIcon className={classes.listItemIcon}>
<DeleteIcon fontSize="small" />
<IconOverlay iconURLs={[toolIconURL]} alt={toolLabel} customIconHeight={16} customIconWidth={16} />
</ListItemIcon>
<ListItemText primary={'Delete expression'} className={classes.listItemText} />
<ListItemText primary={toolLabel} className={classes.listItemText} />
</ListItemButton>
);
};
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
* Contributors:
* Obeo - initial API and implementation
*******************************************************************************/
import { IconOverlay } from '@eclipse-sirius/sirius-components-core';
import { DiagramContext, DiagramContextValue, EdgeData, NodeData } from '@eclipse-sirius/sirius-components-diagrams';
import { PaletteToolContributionComponentProps, usePalette } from '@eclipse-sirius/sirius-components-palette';
import EditIcon from '@mui/icons-material/Edit';
import ListItemButton from '@mui/material/ListItemButton';
import ListItemIcon from '@mui/material/ListItemIcon';
import ListItemText from '@mui/material/ListItemText';
Expand Down Expand Up @@ -84,6 +84,9 @@ export const EditExpressionDiagramToolOverriddenContribution = ({
);
}

const toolLabel = 'Edit Expression';
const toolIconURL = '/api/images/diagram-images/edit.svg';

return (
<Fragment key="overridden_tool_edit_expression">
<ListItemButton
Expand All @@ -92,9 +95,9 @@ export const EditExpressionDiagramToolOverriddenContribution = ({
disabled={readOnly}
className={classes.listItemButton}>
<ListItemIcon className={classes.listItemIcon}>
<EditIcon fontSize="small" />
<IconOverlay iconURLs={[toolIconURL]} alt={toolLabel} customIconHeight={16} customIconWidth={16} />
</ListItemIcon>
<ListItemText primary="Edit expression" className={classes.listItemText} />
<ListItemText primary={toolLabel} className={classes.listItemText} />
</ListItemButton>
{modalElement}
</Fragment>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
* Contributors:
* Obeo - initial API and implementation
*******************************************************************************/
import { IconOverlay } from '@eclipse-sirius/sirius-components-core';
import { DiagramContext, DiagramContextValue, EdgeData, NodeData } from '@eclipse-sirius/sirius-components-diagrams';
import { PaletteToolContributionComponentProps, usePalette } from '@eclipse-sirius/sirius-components-palette';
import AddIcon from '@mui/icons-material/Add';
import ListItemButton from '@mui/material/ListItemButton';
import ListItemIcon from '@mui/material/ListItemIcon';
import ListItemText from '@mui/material/ListItemText';
Expand Down Expand Up @@ -84,6 +84,9 @@ export const NewExpressionDiagramToolOverriddenContribution = ({
);
}

const toolLabel = 'New Expression';
const toolIconURL = '/api/images/palette/create.svg';

return (
<Fragment key="new-overridden_tool_new_expression-modal-contribution">
<ListItemButton
Expand All @@ -92,9 +95,9 @@ export const NewExpressionDiagramToolOverriddenContribution = ({
disabled={readOnly}
className={classes.listItemButton}>
<ListItemIcon className={classes.listItemIcon}>
<AddIcon fontSize="small" />
<IconOverlay iconURLs={[toolIconURL]} alt={toolLabel} customIconHeight={16} customIconWidth={16} />
</ListItemIcon>
<ListItemText primary={'New Expression'} className={classes.listItemText} />
<ListItemText primary={toolLabel} className={classes.listItemText} />
</ListItemButton>
{modalElement}
</Fragment>
Expand Down
Loading