diff --git a/CHANGELOG.adoc b/CHANGELOG.adoc index d65431b7c9..383c182a72 100644 --- a/CHANGELOG.adoc +++ b/CHANGELOG.adoc @@ -15,6 +15,9 @@ === Breaking changes +- https://github.com/eclipse-sirius/sirius-web/issues/4373[#4373] [trees] `onExpand` and `onExpandAll` is removed from `Tree` and all the tree components. +It is now possible to expand a tree item by using `onExpandedElementChange`. +The expand all entry (and its implementation) has been moved to Sirius Web as a contribution. === Dependency update @@ -43,6 +46,10 @@ Specifiers can contribute dedicated AQL services for this feature using implemen - https://github.com/eclipse-sirius/sirius-web/issues/4368[#4368] [sirius-web] Add GraphQL subscription exception handler - [charts] Make the npm package `sirius-components-charts` use the strict version of our TypeScript configuration - [trees] Make the npm package `sirius-components-trees` use the strict version of our TypeScript configuration +- https://github.com/eclipse-sirius/sirius-web/issues/4373[#4373] [trees] Allow backend definition of ExpandAll tool in the explorer +Specifiers can now create `CustomTreeItemContextMenuEntry` instances in the view DSL to indicate to use a frontend component with a given identifier as contextual menu entry. +This information is passed to the frontend via a dedicated identifier in `SingleClickTreeItemContextMenuEntry#id`. +The _ExpandAll_ tool is now a Sirius Web contribution that can be enabled via this mechanism. == v2025.1.0 diff --git a/packages/forms/frontend/sirius-components-widget-reference/src/components/ModelBrowserTreeView.tsx b/packages/forms/frontend/sirius-components-widget-reference/src/components/ModelBrowserTreeView.tsx index 669c493378..bf56eb2504 100644 --- a/packages/forms/frontend/sirius-components-widget-reference/src/components/ModelBrowserTreeView.tsx +++ b/packages/forms/frontend/sirius-components-widget-reference/src/components/ModelBrowserTreeView.tsx @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2023, 2024 Obeo. + * Copyright (c) 2023, 2025 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 @@ -11,10 +11,16 @@ * Obeo - initial API and implementation *******************************************************************************/ -import { TreeItemActionProps, TreeView } from '@eclipse-sirius/sirius-components-trees'; +import { + GQLGetExpandAllTreePathVariables, + GQLTreeItem, + TreeItemActionProps, + TreeView, + useExpandAll, +} from '@eclipse-sirius/sirius-components-trees'; import UnfoldMoreIcon from '@mui/icons-material/UnfoldMore'; import IconButton from '@mui/material/IconButton'; -import { useState } from 'react'; +import { useState, useEffect } from 'react'; import { makeStyles } from 'tss-react/mui'; import { ModelBrowserFilterBar } from './ModelBrowserFilterBar'; import { ModelBrowserTreeViewProps, ModelBrowserTreeViewState } from './ModelBrowserTreeView.types'; @@ -92,8 +98,40 @@ export const ModelBrowserTreeView = ({ ); }; -const WidgetReferenceTreeItemAction = ({ onExpandAll, item, isHovered }: TreeItemActionProps) => { - if (!onExpandAll || !item || !item.hasChildren || !isHovered) { +const WidgetReferenceTreeItemAction = ({ + editingContextId, + treeId, + item, + isHovered, + expanded, + maxDepth, + onExpandedElementChange, +}: TreeItemActionProps) => { + const { + getExpandAllTreePath, + expanded: newExpanded, + maxDepth: newMaxDepth, + loading, + } = useExpandAll(expanded, maxDepth); + + useEffect(() => { + if (!loading) { + if (newExpanded && newMaxDepth >= 0) { + onExpandedElementChange(newExpanded, newMaxDepth); + } + } + }, [newExpanded, newMaxDepth, loading]); + + const onExpandAll = (treeItem: GQLTreeItem) => { + const variables: GQLGetExpandAllTreePathVariables = { + editingContextId, + treeId, + treeItemId: treeItem.id, + }; + getExpandAllTreePath({ variables }); + }; + + if (!item || !isHovered) { return null; } return ( diff --git a/packages/selection/frontend/sirius-components-selection/src/SelectionDialogTreeView.tsx b/packages/selection/frontend/sirius-components-selection/src/SelectionDialogTreeView.tsx index 98a8e85abb..75509357e6 100644 --- a/packages/selection/frontend/sirius-components-selection/src/SelectionDialogTreeView.tsx +++ b/packages/selection/frontend/sirius-components-selection/src/SelectionDialogTreeView.tsx @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2024 Obeo. + * Copyright (c) 2024, 2025 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 @@ -11,10 +11,16 @@ * Obeo - initial API and implementation *******************************************************************************/ import { DiagramDialogVariable } from '@eclipse-sirius/sirius-components-diagrams'; -import { TreeItemActionProps, TreeView } from '@eclipse-sirius/sirius-components-trees'; +import { + GQLGetExpandAllTreePathVariables, + GQLTreeItem, + TreeItemActionProps, + TreeView, + useExpandAll, +} from '@eclipse-sirius/sirius-components-trees'; import UnfoldMoreIcon from '@mui/icons-material/UnfoldMore'; import IconButton from '@mui/material/IconButton'; -import { useState } from 'react'; +import { useState, useEffect } from 'react'; import { makeStyles } from 'tss-react/mui'; import { SelectionDialogTreeViewProps, SelectionDialogTreeViewState } from './SelectionDialogTreeView.types'; import { useSelectionDialogTreeSubscription } from './useSelectionDialogTreeSubscription'; @@ -73,8 +79,40 @@ export const SelectionDialogTreeView = ({ ); }; -const SelectionDialogTreeItemAction = ({ onExpandAll, item, isHovered }: TreeItemActionProps) => { - if (!onExpandAll || !item || !item.hasChildren || !isHovered) { +const SelectionDialogTreeItemAction = ({ + editingContextId, + treeId, + item, + isHovered, + expanded, + maxDepth, + onExpandedElementChange, +}: TreeItemActionProps) => { + const { + getExpandAllTreePath, + expanded: newExpanded, + maxDepth: newMaxDepth, + loading, + } = useExpandAll(expanded, maxDepth); + + useEffect(() => { + if (!loading) { + if (newExpanded && newMaxDepth >= 0) { + onExpandedElementChange(newExpanded, newMaxDepth); + } + } + }, [newExpanded, newMaxDepth, loading]); + + const onExpandAll = (treeItem: GQLTreeItem) => { + const variables: GQLGetExpandAllTreePathVariables = { + editingContextId, + treeId, + treeItemId: treeItem.id, + }; + getExpandAllTreePath({ variables }); + }; + + if (!item || !isHovered) { return null; } return ( diff --git a/packages/sirius-web/backend/sirius-web-application/src/main/java/org/eclipse/sirius/web/application/representation/services/PersistentRepresentationMetadataProvider.java b/packages/sirius-web/backend/sirius-web-application/src/main/java/org/eclipse/sirius/web/application/representation/services/PersistentRepresentationMetadataProvider.java index 6d22424776..af558a422a 100644 --- a/packages/sirius-web/backend/sirius-web-application/src/main/java/org/eclipse/sirius/web/application/representation/services/PersistentRepresentationMetadataProvider.java +++ b/packages/sirius-web/backend/sirius-web-application/src/main/java/org/eclipse/sirius/web/application/representation/services/PersistentRepresentationMetadataProvider.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2024 Obeo. + * Copyright (c) 2024, 2025 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 @@ -38,7 +38,8 @@ public PersistentRepresentationMetadataProvider(IRepresentationMetadataSearchSer @Override public Optional getMetadata(String representationId) { - return new UUIDParser().parse(representationId) + // Remove the parameters from the representationId to extract the actual UUID. + return new UUIDParser().parse(representationId.split("\\?")[0]) .flatMap(this.representationMetadataSearchService::findMetadataById) .map(representation -> RepresentationMetadata.newRepresentationMetadata(representation.getId().toString()) .kind(representation.getKind()) diff --git a/packages/sirius-web/backend/sirius-web-application/src/main/java/org/eclipse/sirius/web/application/studio/services/representations/DomainViewTreeDescriptionProvider.java b/packages/sirius-web/backend/sirius-web-application/src/main/java/org/eclipse/sirius/web/application/studio/services/representations/DomainViewTreeDescriptionProvider.java index c07eb45bee..d79d56b6f1 100644 --- a/packages/sirius-web/backend/sirius-web-application/src/main/java/org/eclipse/sirius/web/application/studio/services/representations/DomainViewTreeDescriptionProvider.java +++ b/packages/sirius-web/backend/sirius-web-application/src/main/java/org/eclipse/sirius/web/application/studio/services/representations/DomainViewTreeDescriptionProvider.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2024 Obeo. + * Copyright (c) 2024, 2025 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 @@ -250,6 +250,11 @@ private List getContextMenuEntries() { .body(callService.build()) .build(); - return List.of(helpMenuEntry, toggleAbstractMenuEntry); + var expandAllMenuEntry = new TreeBuilders().newCustomTreeItemContextMenuEntry() + .contributionId("siriusweb_treeItem#backendContextMenuEntry_expandAll") + .preconditionExpression(AQL_TRUE) + .build(); + + return List.of(expandAllMenuEntry, helpMenuEntry, toggleAbstractMenuEntry); } } diff --git a/packages/sirius-web/backend/sirius-web-application/src/main/java/org/eclipse/sirius/web/application/views/explorer/services/ExplorerTreeItemContextMenuEntryProvider.java b/packages/sirius-web/backend/sirius-web-application/src/main/java/org/eclipse/sirius/web/application/views/explorer/services/ExplorerTreeItemContextMenuEntryProvider.java new file mode 100644 index 0000000000..17455db2d2 --- /dev/null +++ b/packages/sirius-web/backend/sirius-web-application/src/main/java/org/eclipse/sirius/web/application/views/explorer/services/ExplorerTreeItemContextMenuEntryProvider.java @@ -0,0 +1,50 @@ +/******************************************************************************* + * Copyright (c) 2025 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.sirius.web.application.views.explorer.services; + +import java.util.List; +import java.util.Objects; + +import org.eclipse.sirius.components.collaborative.trees.api.ITreeItemContextMenuEntryProvider; +import org.eclipse.sirius.components.collaborative.trees.dto.ITreeItemContextMenuEntry; +import org.eclipse.sirius.components.collaborative.trees.dto.SingleClickTreeItemContextMenuEntry; +import org.eclipse.sirius.components.core.api.IEditingContext; +import org.eclipse.sirius.components.trees.Tree; +import org.eclipse.sirius.components.trees.TreeItem; +import org.eclipse.sirius.components.trees.description.TreeDescription; +import org.springframework.stereotype.Service; + +/** + * Provides the context menu entries for tree items in the explorer. + * + * @author gdaniel + */ +@Service +public class ExplorerTreeItemContextMenuEntryProvider implements ITreeItemContextMenuEntryProvider { + + @Override + public boolean canHandle(IEditingContext editingContext, TreeDescription treeDescription, Tree tree, TreeItem treeItem) { + return tree.getId().startsWith(ExplorerDescriptionProvider.PREFIX) + && Objects.equals(tree.getDescriptionId(), ExplorerDescriptionProvider.DESCRIPTION_ID); + } + + @Override + public List getTreeItemContextMenuEntries(IEditingContext editingContext, TreeDescription treeDescription, Tree tree, TreeItem treeItem) { + if (treeItem.isHasChildren()) { + return List.of(new SingleClickTreeItemContextMenuEntry("siriusweb_treeItem#backendContextMenuEntry_expandAll", "", List.of())); + } else { + return List.of(); + } + } + +} diff --git a/packages/sirius-web/backend/sirius-web-application/src/main/java/org/eclipse/sirius/web/application/views/tree/DomainTreeItemContextMenuEntryProvider.java b/packages/sirius-web/backend/sirius-web-application/src/main/java/org/eclipse/sirius/web/application/views/tree/DomainTreeItemContextMenuEntryProvider.java new file mode 100644 index 0000000000..bda0cebdcb --- /dev/null +++ b/packages/sirius-web/backend/sirius-web-application/src/main/java/org/eclipse/sirius/web/application/views/tree/DomainTreeItemContextMenuEntryProvider.java @@ -0,0 +1,48 @@ +/******************************************************************************* + * Copyright (c) 2025 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.sirius.web.application.views.tree; + +import java.util.List; + +import org.eclipse.sirius.components.collaborative.trees.api.ITreeItemContextMenuEntryProvider; +import org.eclipse.sirius.components.collaborative.trees.dto.ITreeItemContextMenuEntry; +import org.eclipse.sirius.components.collaborative.trees.dto.SingleClickTreeItemContextMenuEntry; +import org.eclipse.sirius.components.core.api.IEditingContext; +import org.eclipse.sirius.components.trees.Tree; +import org.eclipse.sirius.components.trees.TreeItem; +import org.eclipse.sirius.components.trees.description.TreeDescription; +import org.springframework.stereotype.Service; + +/** + * Provides the context menu entries for tree items in the domain explorer. + * + * @author gdaniel + */ +@Service +public class DomainTreeItemContextMenuEntryProvider implements ITreeItemContextMenuEntryProvider { + + @Override + public boolean canHandle(IEditingContext editingContext, TreeDescription treeDescription, Tree tree, TreeItem treeItem) { + return treeDescription.getId().equals(DomainTreeRepresentationDescriptionProvider.DESCRIPTION_ID); + } + + @Override + public List getTreeItemContextMenuEntries(IEditingContext editingContext, TreeDescription treeDescription, Tree tree, TreeItem treeItem) { + if (treeItem.isHasChildren()) { + return List.of(new SingleClickTreeItemContextMenuEntry("siriusweb_treeItem#backendContextMenuEntry_expandAll", "", List.of())); + } else { + return List.of(); + } + } + +} diff --git a/packages/sirius-web/frontend/sirius-web-application/src/extension/DefaultExtensionRegistry.tsx b/packages/sirius-web/frontend/sirius-web-application/src/extension/DefaultExtensionRegistry.tsx index af13cf7359..5df130e30a 100644 --- a/packages/sirius-web/frontend/sirius-web-application/src/extension/DefaultExtensionRegistry.tsx +++ b/packages/sirius-web/frontend/sirius-web-application/src/extension/DefaultExtensionRegistry.tsx @@ -38,7 +38,11 @@ import { OmniboxButton } from '@eclipse-sirius/sirius-components-omnibox'; import { PortalRepresentation } from '@eclipse-sirius/sirius-components-portals'; import { SelectionDialog } from '@eclipse-sirius/sirius-components-selection'; import { TableRepresentation } from '@eclipse-sirius/sirius-components-tables'; -import { TreeRepresentation, treeItemContextMenuEntryExtensionPoint } from '@eclipse-sirius/sirius-components-trees'; +import { + TreeRepresentation, + treeItemContextMenuEntryExtensionPoint, + treeItemBackendContextMenuEntryExtensionPoint, +} from '@eclipse-sirius/sirius-components-trees'; import { ValidationView } from '@eclipse-sirius/sirius-components-validation'; import { GQLReferenceWidget, @@ -62,6 +66,7 @@ import { NavigationBarRightContributionProps } from '../navigationBar/Navigation import { navigationBarRightContributionExtensionPoint } from '../navigationBar/NavigationBarExtensionPoints'; import { OnboardArea } from '../onboarding/OnboardArea'; import { DiagramTreeItemContextMenuContribution } from '../views/edit-project/DiagramTreeItemContextMenuContribution'; +import { ExpandAllTreeItemContextMenuContribution } from '../views/edit-project/ExpandAllTreeItemContextMenuContribution'; import { DocumentTreeItemContextMenuContribution } from '../views/edit-project/DocumentTreeItemContextMenuContribution'; import { DownloadProjectMenuEntryContribution } from '../views/edit-project/EditProjectNavbar/DownloadProjectMenuEntryContribution'; import { editProjectNavbarMenuEntryExtensionPoint } from '../views/edit-project/EditProjectNavbar/EditProjectNavbarMenuExtensionPoints'; @@ -275,6 +280,18 @@ defaultExtensionRegistry.addComponent(treeItemContextMenuEntryExtensionPoint, { Component: DiagramTreeItemContextMenuContribution, }); +/******************************************************************************* + * + * Tree item backend context menu + * + * Used to register new components in the tree item context menu that will be displayed by the backend + * + *******************************************************************************/ +defaultExtensionRegistry.addComponent(treeItemBackendContextMenuEntryExtensionPoint, { + identifier: `siriusweb_${treeItemBackendContextMenuEntryExtensionPoint.identifier}_expandAll`, + Component: ExpandAllTreeItemContextMenuContribution, +}); + /******************************************************************************* * * Apollo client options configurer diff --git a/packages/sirius-web/frontend/sirius-web-application/src/views/edit-project/ExpandAllTreeItemContextMenuContribution.tsx b/packages/sirius-web/frontend/sirius-web-application/src/views/edit-project/ExpandAllTreeItemContextMenuContribution.tsx new file mode 100644 index 0000000000..d1e8376b3a --- /dev/null +++ b/packages/sirius-web/frontend/sirius-web-application/src/views/edit-project/ExpandAllTreeItemContextMenuContribution.tsx @@ -0,0 +1,83 @@ +/******************************************************************************* + * Copyright (c) 2025 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 + *******************************************************************************/ +import { + GQLGetExpandAllTreePathVariables, + GQLTreeItem, + TreeItemContextMenuComponentProps, + useExpandAll, +} from '@eclipse-sirius/sirius-components-trees'; +import UnfoldMore from '@mui/icons-material/UnfoldMore'; +import ListItemIcon from '@mui/material/ListItemIcon'; +import ListItemText from '@mui/material/ListItemText'; +import MenuItem from '@mui/material/MenuItem'; +import { Fragment, forwardRef, useEffect } from 'react'; + +export const ExpandAllTreeItemContextMenuContribution = forwardRef( + ( + { + editingContextId, + treeId, + item, + readOnly, + onExpandedElementChange, + onClose, + expanded, + maxDepth, + }: TreeItemContextMenuComponentProps, + ref: React.ForwardedRef + ) => { + const { + getExpandAllTreePath, + expanded: newExpanded, + maxDepth: newMaxDepth, + loading, + } = useExpandAll(expanded, maxDepth); + + useEffect(() => { + if (!loading) { + if (newExpanded && newMaxDepth >= 0) { + onExpandedElementChange(newExpanded, newMaxDepth); + onClose(); + } + } + }, [newExpanded, newMaxDepth, loading]); + + const onExpandAll = (treeItem: GQLTreeItem) => { + const variables: GQLGetExpandAllTreePathVariables = { + editingContextId, + treeId, + treeItemId: treeItem.id, + }; + getExpandAllTreePath({ variables }); + }; + + return ( + + { + onExpandAll(item); + }} + disabled={readOnly} + ref={ref} + aria-disabled> + + + + + + + ); + } +); diff --git a/packages/trees/frontend/sirius-components-trees/src/index.ts b/packages/trees/frontend/sirius-components-trees/src/index.ts index 11aa353bf1..8a1656fc50 100644 --- a/packages/trees/frontend/sirius-components-trees/src/index.ts +++ b/packages/trees/frontend/sirius-components-trees/src/index.ts @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2022, 2024 Obeo and others. + * Copyright (c) 2022, 2025 Obeo and others. * 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 @@ -30,3 +30,5 @@ export * from './views/TreeView'; export * from './views/TreeView.types'; export * from './views/TreeViewExtensionPoints'; export * from './views/useTreeFilters'; +export * from './views/useExpandAll'; +export * from './views/useExpandAll.types'; diff --git a/packages/trees/frontend/sirius-components-trees/src/treeitems/TreeItem.tsx b/packages/trees/frontend/sirius-components-trees/src/treeitems/TreeItem.tsx index 87e7f76dfb..e5e86db29e 100644 --- a/packages/trees/frontend/sirius-components-trees/src/treeitems/TreeItem.tsx +++ b/packages/trees/frontend/sirius-components-trees/src/treeitems/TreeItem.tsx @@ -114,8 +114,9 @@ export const TreeItem = ({ item, itemIndex, depth, - onExpand, - onExpandAll, + expanded, + maxDepth, + onExpandedElementChange, readOnly, textToHighlight, textToFilter, @@ -170,8 +171,9 @@ export const TreeItem = ({ item={childItem} itemIndex={index} depth={depth + 1} - onExpand={onExpand} - onExpandAll={onExpandAll} + expanded={expanded} + maxDepth={maxDepth} + onExpandedElementChange={onExpandedElementChange} enableMultiSelection={enableMultiSelection} readOnly={readOnly} textToHighlight={textToHighlight} @@ -320,6 +322,16 @@ export const TreeItem = ({ event.preventDefault(); }; + const onExpand = (id: string, depth: number) => { + if (expanded.includes(id)) { + const newExpanded = [...expanded]; + newExpanded.splice(newExpanded.indexOf(id), 1); + onExpandedElementChange(newExpanded, Math.max(maxDepth, depth)); + } else { + onExpandedElementChange([...expanded, id], Math.max(maxDepth, depth)); + } + }; + let tooltipText = ''; if (item.kind.startsWith('siriusComponents://semantic')) { const query = item.kind.substring(item.kind.indexOf('?') + 1, item.kind.length); @@ -391,8 +403,9 @@ export const TreeItem = ({ treeId: treeId, item: item, depth: depth, - onExpand: onExpand, - onExpandAll: onExpandAll, + expanded: expanded, + maxDepth: maxDepth, + onExpandedElementChange: onExpandedElementChange, readOnly: readOnly, onEnterEditingMode: enterEditingMode, isHovered: state.partHovered === 'item', @@ -403,8 +416,9 @@ export const TreeItem = ({ treeId={treeId} item={item} depth={depth} - onExpand={onExpand} - onExpandAll={onExpandAll} + expanded={expanded} + maxDepth={maxDepth} + onExpandedElementChange={onExpandedElementChange} readOnly={readOnly} onEnterEditingMode={enterEditingMode} isHovered={state.partHovered === 'item'} diff --git a/packages/trees/frontend/sirius-components-trees/src/treeitems/TreeItem.types.ts b/packages/trees/frontend/sirius-components-trees/src/treeitems/TreeItem.types.ts index 16998f43ab..3927e06130 100644 --- a/packages/trees/frontend/sirius-components-trees/src/treeitems/TreeItem.types.ts +++ b/packages/trees/frontend/sirius-components-trees/src/treeitems/TreeItem.types.ts @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2021, 2024 Obeo. + * Copyright (c) 2021, 2025 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 @@ -19,8 +19,9 @@ export interface TreeItemProps { item: GQLTreeItem; itemIndex: number; depth: number; - onExpand: (id: string, depth: number) => void; - onExpandAll: (treeItem: GQLTreeItem) => void; + expanded: string[]; + maxDepth: number; + onExpandedElementChange: (expanded: string[], maxDepth: number) => void; readOnly: boolean; textToHighlight: string | null; textToFilter: string | null; diff --git a/packages/trees/frontend/sirius-components-trees/src/treeitems/TreeItemAction.tsx b/packages/trees/frontend/sirius-components-trees/src/treeitems/TreeItemAction.tsx index 1c317a08c2..075a6ad13e 100644 --- a/packages/trees/frontend/sirius-components-trees/src/treeitems/TreeItemAction.tsx +++ b/packages/trees/frontend/sirius-components-trees/src/treeitems/TreeItemAction.tsx @@ -35,8 +35,9 @@ export const TreeItemAction = ({ item, readOnly, depth, - onExpand, - onExpandAll, + expanded, + maxDepth, + onExpandedElementChange, onEnterEditingMode, }: TreeItemActionProps) => { const { classes } = useTreeItemActionStyle(); @@ -82,8 +83,9 @@ export const TreeItemAction = ({ item={item} readOnly={readOnly} depth={depth} - onExpand={onExpand} - onExpandAll={onExpandAll} + expanded={expanded} + maxDepth={maxDepth} + onExpandedElementChange={onExpandedElementChange} enterEditingMode={enterEditingMode} onClose={closeContextMenu} /> diff --git a/packages/trees/frontend/sirius-components-trees/src/treeitems/TreeItemAction.types.ts b/packages/trees/frontend/sirius-components-trees/src/treeitems/TreeItemAction.types.ts index 5d6f79a8a4..7c587b4abb 100644 --- a/packages/trees/frontend/sirius-components-trees/src/treeitems/TreeItemAction.types.ts +++ b/packages/trees/frontend/sirius-components-trees/src/treeitems/TreeItemAction.types.ts @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2024 Obeo. + * Copyright (c) 2024, 2025 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 @@ -17,8 +17,9 @@ export interface TreeItemActionProps { treeId: string; item: GQLTreeItem; depth: number; - onExpand: (id: string, depth: number) => void; - onExpandAll: (treeItem: GQLTreeItem) => void; + expanded: string[]; + maxDepth: number; + onExpandedElementChange: (expanded: string[], maxDepth: number) => void; onEnterEditingMode: () => void; readOnly: boolean; isHovered: boolean; diff --git a/packages/trees/frontend/sirius-components-trees/src/treeitems/TreeItemContextMenu.tsx b/packages/trees/frontend/sirius-components-trees/src/treeitems/TreeItemContextMenu.tsx index ef33832856..9756cdca60 100644 --- a/packages/trees/frontend/sirius-components-trees/src/treeitems/TreeItemContextMenu.tsx +++ b/packages/trees/frontend/sirius-components-trees/src/treeitems/TreeItemContextMenu.tsx @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2019, 2024 Obeo. + * Copyright (c) 2019, 2025 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 @@ -20,7 +20,6 @@ import { } from '@eclipse-sirius/sirius-components-core'; import DeleteIcon from '@mui/icons-material/Delete'; import EditIcon from '@mui/icons-material/Edit'; -import UnfoldMore from '@mui/icons-material/UnfoldMore'; import ListItemIcon from '@mui/material/ListItemIcon'; import ListItemText from '@mui/material/ListItemText'; import Menu from '@mui/material/Menu'; @@ -42,7 +41,10 @@ import { TreeItemContextMenuState, } from './TreeItemContextMenu.types'; import { TreeItemContextMenuComponentProps } from './TreeItemContextMenuEntry.types'; -import { treeItemContextMenuEntryExtensionPoint } from './TreeItemContextMenuEntryExtensionPoints'; +import { + treeItemContextMenuEntryExtensionPoint, + treeItemBackendContextMenuEntryExtensionPoint, +} from './TreeItemContextMenuEntryExtensionPoints'; import { useContextMenuEntries } from './useContextMenuEntries'; const deleteTreeItemMutation = gql` @@ -101,8 +103,9 @@ export const TreeItemContextMenu = ({ item, readOnly, depth, - onExpand, - onExpandAll, + expanded, + maxDepth, + onExpandedElementChange, enterEditingMode, onClose, }: TreeItemContextMenuProps) => { @@ -118,9 +121,13 @@ export const TreeItemContextMenu = ({ treeItemContextMenuEntryExtensionPoint ); + const treeItemBackendMenuContextComponents: ComponentExtension[] = useComponents( + treeItemBackendContextMenuEntryExtensionPoint + ); + const expandItem = () => { if (!item.expanded && item.hasChildren) { - onExpand(item.id, depth); + onExpandedElementChange([...expanded, item.id], Math.max(depth, maxDepth)); } }; @@ -235,6 +242,7 @@ export const TreeItemContextMenu = ({ invokeSingleClick(menuEntry.id); onClose(); } + // Do not handle ContributedTreeItemContextMenuEntry, it is done in the contributed component. }; return ( @@ -257,27 +265,14 @@ export const TreeItemContextMenu = ({ item={item} readOnly={readOnly} onClose={onClose} + onExpandedElementChange={onExpandedElementChange} expandItem={expandItem} key={index.toString()} treeId={treeId} + expanded={expanded} + maxDepth={maxDepth} /> ))} - {item.hasChildren ? ( - { - onExpandAll(item); - onClose(); - }} - disabled={readOnly} - aria-disabled> - - - - - - ) : null} {item.editable ? ( ) : null} - {state.menuEntries.map((entry) => ( - invokeContextMenuEntry(entry)} - data-testid={`context-menu-entry-${entry.label}`} - disabled={readOnly} - aria-disabled> - - {entry.iconURL.length > 0 ? ( - - ) : ( -
- )} - - - - ))} + {state.menuEntries.map((entry) => { + const contributedTreeItemMenuContextComponents = treeItemBackendMenuContextComponents.filter( + (c) => c.identifier === entry.id + ); + if (contributedTreeItemMenuContextComponents.length > 0) { + return contributedTreeItemMenuContextComponents.map( + ({ Component: TreeItemMenuContextComponent }, index) => ( + + ) + ); + } else { + return ( + invokeContextMenuEntry(entry)} + data-testid={`context-menu-entry-${entry.label}`} + disabled={readOnly} + aria-disabled> + + {entry.iconURL.length > 0 ? ( + + ) : ( +
+ )} + + + + ); + } + })} ); diff --git a/packages/trees/frontend/sirius-components-trees/src/treeitems/TreeItemContextMenu.types.ts b/packages/trees/frontend/sirius-components-trees/src/treeitems/TreeItemContextMenu.types.ts index 1b1cbc12c8..e828a21218 100644 --- a/packages/trees/frontend/sirius-components-trees/src/treeitems/TreeItemContextMenu.types.ts +++ b/packages/trees/frontend/sirius-components-trees/src/treeitems/TreeItemContextMenu.types.ts @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2021, 2024 Obeo. + * Copyright (c) 2021, 2025 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 @@ -19,8 +19,9 @@ export interface TreeItemContextMenuProps { treeId: string; readOnly: boolean; depth: number; - onExpand: (id: string, depth: number) => void; - onExpandAll: (treeItem: GQLTreeItem) => void; + expanded: string[]; + maxDepth: number; + onExpandedElementChange: (expanded: string[], maxDepth: number) => void; enterEditingMode: () => void; onClose: () => void; } diff --git a/packages/trees/frontend/sirius-components-trees/src/treeitems/TreeItemContextMenuEntry.types.ts b/packages/trees/frontend/sirius-components-trees/src/treeitems/TreeItemContextMenuEntry.types.ts index 6057659a56..14aa779b51 100644 --- a/packages/trees/frontend/sirius-components-trees/src/treeitems/TreeItemContextMenuEntry.types.ts +++ b/packages/trees/frontend/sirius-components-trees/src/treeitems/TreeItemContextMenuEntry.types.ts @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2024 Obeo. + * Copyright (c) 2024, 2025 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 @@ -18,6 +18,9 @@ export interface TreeItemContextMenuComponentProps { item: GQLTreeItem; readOnly: boolean; expandItem: () => void; + onExpandedElementChange: (expanded: string[], maxDepth: number) => void; onClose: () => void; key: string; + expanded: string[]; + maxDepth: number; } diff --git a/packages/trees/frontend/sirius-components-trees/src/treeitems/TreeItemContextMenuEntryExtensionPoints.ts b/packages/trees/frontend/sirius-components-trees/src/treeitems/TreeItemContextMenuEntryExtensionPoints.ts index ecf778fc91..26319a4a4e 100644 --- a/packages/trees/frontend/sirius-components-trees/src/treeitems/TreeItemContextMenuEntryExtensionPoints.ts +++ b/packages/trees/frontend/sirius-components-trees/src/treeitems/TreeItemContextMenuEntryExtensionPoints.ts @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2024 Obeo. + * Copyright (c) 2024, 2025 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 @@ -18,3 +18,9 @@ export const treeItemContextMenuEntryExtensionPoint: ComponentExtensionPoint null, }; + +export const treeItemBackendContextMenuEntryExtensionPoint: ComponentExtensionPoint = + { + identifier: 'treeItem#backendContextMenuEntry', + FallbackComponent: () => null, + }; diff --git a/packages/trees/frontend/sirius-components-trees/src/trees/Tree.tsx b/packages/trees/frontend/sirius-components-trees/src/trees/Tree.tsx index 14cfa8cc9e..7067e9c8d8 100644 --- a/packages/trees/frontend/sirius-components-trees/src/trees/Tree.tsx +++ b/packages/trees/frontend/sirius-components-trees/src/trees/Tree.tsx @@ -26,8 +26,9 @@ const useTreeStyle = makeStyles()((_) => ({ export const Tree = ({ editingContextId, tree, - onExpand, - onExpandAll, + expanded, + maxDepth, + onExpandedElementChange, readOnly, enableMultiSelection = true, textToHighlight, @@ -62,7 +63,9 @@ export const Tree = ({ switch (event.key) { case 'ArrowLeft': if (hasChildren && isExpanded) { - onExpand(id, depth); + const newExpanded = [...expanded]; + newExpanded.splice(newExpanded.indexOf(id), 1); + onExpandedElementChange(newExpanded, Math.max(depth, maxDepth)); } else if (index > 0) { const parentDepth = (depth - 1).toString(); @@ -75,7 +78,7 @@ export const Tree = ({ break; case 'ArrowRight': if (hasChildren && !isExpanded) { - onExpand(id, depth); + onExpandedElementChange([...expanded, id], Math.max(depth, maxDepth)); } else if (index < treeItemDomElements.length - 1) { treeItemDomElements[index + 1]?.click(); } @@ -105,7 +108,7 @@ export const Tree = ({ }; } return () => {}; - }, [treeElement, onExpand]); + }, [treeElement, onExpandedElementChange]); return ( <> @@ -119,8 +122,9 @@ export const Tree = ({ item={item} itemIndex={index} depth={1} - onExpand={onExpand} - onExpandAll={onExpandAll} + expanded={expanded} + maxDepth={maxDepth} + onExpandedElementChange={onExpandedElementChange} enableMultiSelection={enableMultiSelection} readOnly={readOnly} textToHighlight={textToHighlight} diff --git a/packages/trees/frontend/sirius-components-trees/src/trees/Tree.types.ts b/packages/trees/frontend/sirius-components-trees/src/trees/Tree.types.ts index fee5521ca0..4e111785bf 100644 --- a/packages/trees/frontend/sirius-components-trees/src/trees/Tree.types.ts +++ b/packages/trees/frontend/sirius-components-trees/src/trees/Tree.types.ts @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2021, 2024 Obeo. + * Copyright (c) 2021, 2025 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 @@ -10,14 +10,15 @@ * Contributors: * Obeo - initial API and implementation *******************************************************************************/ -import { GQLTree, GQLTreeItem } from '../views/TreeView.types'; +import { GQLTree } from '../views/TreeView.types'; import { TreeItemActionProps } from '../treeitems/TreeItemAction.types'; export interface TreeProps { editingContextId: string; tree: GQLTree; - onExpand: (id: string, depth: number) => void; - onExpandAll: (treeItem: GQLTreeItem) => void; + expanded: string[]; + maxDepth: number; + onExpandedElementChange: (expanded: string[], maxDepth: number) => void; readOnly: boolean; enableMultiSelection: boolean; textToHighlight: string | null; diff --git a/packages/trees/frontend/sirius-components-trees/src/views/TreeView.tsx b/packages/trees/frontend/sirius-components-trees/src/views/TreeView.tsx index f9c4c684cf..5e620a3b82 100644 --- a/packages/trees/frontend/sirius-components-trees/src/views/TreeView.tsx +++ b/packages/trees/frontend/sirius-components-trees/src/views/TreeView.tsx @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2019, 2024 Obeo. + * Copyright (c) 2019, 2025 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 @@ -12,19 +12,9 @@ *******************************************************************************/ import { gql, useLazyQuery } from '@apollo/client'; import { DataExtension, useData, useMultiToast, useSelection } from '@eclipse-sirius/sirius-components-core'; -import { useEffect, useState } from 'react'; +import { useEffect } from 'react'; import { Tree } from '../trees/Tree'; -import { - GQLGetExpandAllTreePathData, - GQLGetExpandAllTreePathVariables, - GQLGetTreePathData, - GQLGetTreePathVariables, - GQLTree, - GQLTreeItem, - TreeConverter, - TreeViewProps, - TreeViewState, -} from './TreeView.types'; +import { GQLGetTreePathData, GQLGetTreePathVariables, GQLTree, TreeConverter, TreeViewProps } from './TreeView.types'; import { treeViewTreeConverterExtensionPoint } from './TreeViewExtensionPoints'; const getTreePathQuery = gql` @@ -40,19 +30,6 @@ const getTreePathQuery = gql` } `; -const getExpandAllTreePathQuery = gql` - query getExpandAllTreePath($editingContextId: ID!, $treeId: ID!, $treeItemId: ID!) { - viewer { - editingContext(editingContextId: $editingContextId) { - expandAllTreePath(treeId: $treeId, treeItemId: $treeItemId) { - treeItemIdsToExpand - maxDepth - } - } - } - } -`; - export const TreeView = ({ editingContextId, readOnly, @@ -68,10 +45,6 @@ export const TreeView = ({ expanded, maxDepth, }: TreeViewProps) => { - const [state, setState] = useState({ - expanded: expanded, - maxDepth: maxDepth, - }); const { selection } = useSelection(); const [getTreePath, { loading: treePathLoading, data: treePathData, error: treePathError }] = useLazyQuery< @@ -79,11 +52,6 @@ export const TreeView = ({ GQLGetTreePathVariables >(getTreePathQuery); - const [ - getExpandAllTreePath, - { loading: expandAllTreePathLoading, data: expandAllTreePathData, error: expandAllTreePathError }, - ] = useLazyQuery(getExpandAllTreePathQuery); - // If we should auto-expand to reveal the selection, we need to compute the tree path to expand const selectionKey: string = selection?.entries .map((entry) => entry.id) @@ -103,7 +71,6 @@ export const TreeView = ({ useEffect(() => { if (!treePathLoading) { if (treePathData) { - const { expanded, maxDepth } = state; if (treePathData.viewer?.editingContext?.treePath) { const { treeItemIdsToExpand, maxDepth: expandedMaxDepth } = treePathData.viewer.editingContext.treePath; const newExpanded: string[] = [...expanded]; @@ -113,82 +80,19 @@ export const TreeView = ({ newExpanded.push(itemToExpand); } }); - setState((prevState) => ({ - ...prevState, - expanded: newExpanded, - maxDepth: Math.max(expandedMaxDepth, maxDepth), - })); + onExpandedElementChange(newExpanded, Math.max(expandedMaxDepth, maxDepth)); } } } }, [treePathLoading, treePathData]); - useEffect(() => { - if (!expandAllTreePathLoading) { - if (expandAllTreePathData) { - const { expanded, maxDepth } = state; - if (expandAllTreePathData.viewer?.editingContext?.expandAllTreePath) { - const { treeItemIdsToExpand, maxDepth: expandedMaxDepth } = - expandAllTreePathData.viewer.editingContext.expandAllTreePath; - const newExpanded: string[] = [...expanded]; - - treeItemIdsToExpand?.forEach((itemToExpand) => { - if (!expanded.includes(itemToExpand)) { - newExpanded.push(itemToExpand); - } - }); - setState((prevState) => ({ - ...prevState, - expanded: newExpanded, - maxDepth: Math.max(expandedMaxDepth, maxDepth), - })); - } - } - } - }, [expandAllTreePathLoading, expandAllTreePathData]); - const { addErrorMessage } = useMultiToast(); - useEffect(() => { - if (expandAllTreePathError) { - addErrorMessage(expandAllTreePathError.message); - } - }, [expandAllTreePathError]); useEffect(() => { if (treePathError) { addErrorMessage(treePathError.message); } }, [treePathError]); - const onExpand = (id: string, depth: number) => { - const { expanded, maxDepth } = state; - - if (expanded.includes(id)) { - const newExpanded = [...expanded]; - newExpanded.splice(newExpanded.indexOf(id), 1); - - setState((prevState) => ({ - ...prevState, - expanded: newExpanded, - maxDepth: Math.max(maxDepth, depth), - })); - } else { - setState((prevState) => ({ ...prevState, expanded: [...expanded, id], maxDepth: Math.max(maxDepth, depth) })); - } - }; - - useEffect(() => { - onExpandedElementChange(state.expanded, state.maxDepth); - }, [state.expanded, state.maxDepth]); - - const onExpandAll = (treeItem: GQLTreeItem) => { - const variables: GQLGetExpandAllTreePathVariables = { - editingContextId, - treeId: tree.id, - treeItemId: treeItem.id, - }; - getExpandAllTreePath({ variables }); - }; - const { data: treeConverters }: DataExtension = useData(treeViewTreeConverterExtensionPoint); let convertedTree: GQLTree = tree; @@ -201,8 +105,9 @@ export const TreeView = ({ { + const [getExpandAllTreePath, { loading, data, error }] = useLazyQuery< + GQLGetExpandAllTreePathData, + GQLGetExpandAllTreePathVariables + >(getExpandAllTreePathQuery); + + const [state, setState] = useState({ expanded: null, maxDepth: -1 }); + + const { addErrorMessage } = useMultiToast(); + useEffect(() => { + if (error) { + addErrorMessage(error.message); + } + }, [error]); + + const treePath = data?.viewer.editingContext.expandAllTreePath; + + useEffect(() => { + if (!loading) { + if (treePath) { + const newExpanded: string[] = [...expanded]; + treePath.treeItemIdsToExpand.forEach((itemToExpand) => { + if (!expanded.includes(itemToExpand)) { + newExpanded.push(itemToExpand); + } + }); + setState({ + expanded: newExpanded, + maxDepth: Math.max(treePath.maxDepth, maxDepth), + }); + } + } + }, [treePath, loading]); + + return { + getExpandAllTreePath, + expanded: state.expanded, + maxDepth: state.maxDepth, + loading, + }; +}; diff --git a/packages/trees/frontend/sirius-components-trees/src/views/useExpandAll.types.ts b/packages/trees/frontend/sirius-components-trees/src/views/useExpandAll.types.ts new file mode 100644 index 0000000000..63d65822c6 --- /dev/null +++ b/packages/trees/frontend/sirius-components-trees/src/views/useExpandAll.types.ts @@ -0,0 +1,26 @@ +/******************************************************************************* + * Copyright (c) 2025 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 + *******************************************************************************/ +import { LazyQueryExecFunction } from '@apollo/client'; +import { GQLGetExpandAllTreePathData, GQLGetExpandAllTreePathVariables } from './TreeView.types'; + +export interface UseExpandAllValue { + getExpandAllTreePath: LazyQueryExecFunction; + expanded: string[] | null; + maxDepth: number; + loading: boolean; +} + +export interface UseExpandAllState { + expanded: string[] | null; + maxDepth: number; +} diff --git a/packages/view/backend/sirius-components-view-builder/src/main/java/org/eclipse/sirius/components/view/builder/generated/tree/CustomTreeItemContextMenuEntryBuilder.java b/packages/view/backend/sirius-components-view-builder/src/main/java/org/eclipse/sirius/components/view/builder/generated/tree/CustomTreeItemContextMenuEntryBuilder.java new file mode 100644 index 0000000000..447ccaa7b9 --- /dev/null +++ b/packages/view/backend/sirius-components-view-builder/src/main/java/org/eclipse/sirius/components/view/builder/generated/tree/CustomTreeItemContextMenuEntryBuilder.java @@ -0,0 +1,74 @@ +/******************************************************************************* + * Copyright (c) 2023, 2025 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.sirius.components.view.builder.generated.tree; + +/** + * Builder for CustomTreeItemContextMenuEntryBuilder. + * + * @author BuilderGenerator + * @generated + */ +public class CustomTreeItemContextMenuEntryBuilder { + + /** + * Create instance org.eclipse.sirius.components.view.tree.CustomTreeItemContextMenuEntry. + * @generated + */ + private org.eclipse.sirius.components.view.tree.CustomTreeItemContextMenuEntry customTreeItemContextMenuEntry = org.eclipse.sirius.components.view.tree.TreeFactory.eINSTANCE.createCustomTreeItemContextMenuEntry(); + + /** + * Return instance org.eclipse.sirius.components.view.tree.CustomTreeItemContextMenuEntry. + * @generated + */ + protected org.eclipse.sirius.components.view.tree.CustomTreeItemContextMenuEntry getCustomTreeItemContextMenuEntry() { + return this.customTreeItemContextMenuEntry; + } + + /** + * Return instance org.eclipse.sirius.components.view.tree.CustomTreeItemContextMenuEntry. + * @generated + */ + public org.eclipse.sirius.components.view.tree.CustomTreeItemContextMenuEntry build() { + return this.getCustomTreeItemContextMenuEntry(); + } + + /** + * Setter for Name. + * + * @generated + */ + public CustomTreeItemContextMenuEntryBuilder name(java.lang.String value) { + this.getCustomTreeItemContextMenuEntry().setName(value); + return this; + } + /** + * Setter for PreconditionExpression. + * + * @generated + */ + public CustomTreeItemContextMenuEntryBuilder preconditionExpression(java.lang.String value) { + this.getCustomTreeItemContextMenuEntry().setPreconditionExpression(value); + return this; + } + /** + * Setter for ContributionId. + * + * @generated + */ + public CustomTreeItemContextMenuEntryBuilder contributionId(java.lang.String value) { + this.getCustomTreeItemContextMenuEntry().setContributionId(value); + return this; + } + +} + diff --git a/packages/view/backend/sirius-components-view-builder/src/main/java/org/eclipse/sirius/components/view/builder/generated/tree/TreeBuilders.java b/packages/view/backend/sirius-components-view-builder/src/main/java/org/eclipse/sirius/components/view/builder/generated/tree/TreeBuilders.java index 88989fc896..30cd14b15d 100644 --- a/packages/view/backend/sirius-components-view-builder/src/main/java/org/eclipse/sirius/components/view/builder/generated/tree/TreeBuilders.java +++ b/packages/view/backend/sirius-components-view-builder/src/main/java/org/eclipse/sirius/components/view/builder/generated/tree/TreeBuilders.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2023, 2024 Obeo. + * Copyright (c) 2023, 2025 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 @@ -69,5 +69,15 @@ public FetchTreeItemContextMenuEntryBuilder newFetchTreeItemContextMenuEntry() { return new FetchTreeItemContextMenuEntryBuilder(); } + /** + * Instantiate a CustomTreeItemContextMenuEntryBuilder . + * + * @author BuilderGenerator + * @generated + */ + public CustomTreeItemContextMenuEntryBuilder newCustomTreeItemContextMenuEntry() { + return new CustomTreeItemContextMenuEntryBuilder(); + } + } diff --git a/packages/view/backend/sirius-components-view-builder/src/main/java/org/eclipse/sirius/components/view/builder/generated/tree/TreeItemContextMenuEntryBuilder.java b/packages/view/backend/sirius-components-view-builder/src/main/java/org/eclipse/sirius/components/view/builder/generated/tree/TreeItemContextMenuEntryBuilder.java index 200f6635ef..fa62ccbc9e 100644 --- a/packages/view/backend/sirius-components-view-builder/src/main/java/org/eclipse/sirius/components/view/builder/generated/tree/TreeItemContextMenuEntryBuilder.java +++ b/packages/view/backend/sirius-components-view-builder/src/main/java/org/eclipse/sirius/components/view/builder/generated/tree/TreeItemContextMenuEntryBuilder.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2023, 2024 Obeo. + * Copyright (c) 2023, 2025 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 @@ -35,24 +35,6 @@ public TreeItemContextMenuEntryBuilder name(java.lang.String value) { this.getTreeItemContextMenuEntry().setName(value); return this; } - /** - * Setter for LabelExpression. - * - * @generated - */ - public TreeItemContextMenuEntryBuilder labelExpression(java.lang.String value) { - this.getTreeItemContextMenuEntry().setLabelExpression(value); - return this; - } - /** - * Setter for IconURLExpression. - * - * @generated - */ - public TreeItemContextMenuEntryBuilder iconURLExpression(java.lang.String value) { - this.getTreeItemContextMenuEntry().setIconURLExpression(value); - return this; - } /** * Setter for PreconditionExpression. * diff --git a/packages/view/backend/sirius-components-view-emf/src/main/java/org/eclipse/sirius/components/view/emf/ViewAQLInterpreterFactory.java b/packages/view/backend/sirius-components-view-emf/src/main/java/org/eclipse/sirius/components/view/emf/ViewAQLInterpreterFactory.java index fbe829c0bf..3583394542 100644 --- a/packages/view/backend/sirius-components-view-emf/src/main/java/org/eclipse/sirius/components/view/emf/ViewAQLInterpreterFactory.java +++ b/packages/view/backend/sirius-components-view-emf/src/main/java/org/eclipse/sirius/components/view/emf/ViewAQLInterpreterFactory.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2024 Obeo. + * Copyright (c) 2024, 2025 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 @@ -25,6 +25,7 @@ import org.eclipse.sirius.components.diagrams.Node; import org.eclipse.sirius.components.emf.services.api.IEMFEditingContext; import org.eclipse.sirius.components.interpreter.AQLInterpreter; +import org.eclipse.sirius.components.trees.TreeItem; import org.eclipse.sirius.components.view.View; import org.eclipse.sirius.components.view.emf.api.IViewAQLInterpreterFactory; import org.slf4j.Logger; @@ -52,7 +53,8 @@ public ViewAQLInterpreterFactory(List javaServiceProviders this.javaServiceProviders = new ArrayList<>(); this.javaServiceProviders.addAll(Objects.requireNonNull(javaServiceProviders)); IServiceProvider nodeServiceProvider = (IReadOnlyQueryEnvironment queryEnvironment, boolean forWorkspace) -> ServiceUtils.getReceiverServices(null, Node.class).stream().toList(); - this.javaServiceProviders.add((View view) -> List.of(CanonicalServices.class, DiagramServices.class, nodeServiceProvider.getClass())); + IServiceProvider treeItemServiceProvider = (IReadOnlyQueryEnvironment queryEnvironment, boolean forWorkspace) -> ServiceUtils.getReceiverServices(null, TreeItem.class).stream().toList(); + this.javaServiceProviders.add((View view) -> List.of(CanonicalServices.class, DiagramServices.class, nodeServiceProvider.getClass(), treeItemServiceProvider.getClass())); this.applicationContext = Objects.requireNonNull(applicationContext); } diff --git a/packages/view/backend/sirius-components-view-emf/src/main/java/org/eclipse/sirius/components/view/emf/ViewConverter.java b/packages/view/backend/sirius-components-view-emf/src/main/java/org/eclipse/sirius/components/view/emf/ViewConverter.java index 28d96495ed..0566274c69 100644 --- a/packages/view/backend/sirius-components-view-emf/src/main/java/org/eclipse/sirius/components/view/emf/ViewConverter.java +++ b/packages/view/backend/sirius-components-view-emf/src/main/java/org/eclipse/sirius/components/view/emf/ViewConverter.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2021, 2024 Obeo. + * Copyright (c) 2021, 2025 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 @@ -30,6 +30,7 @@ import org.eclipse.sirius.components.diagrams.Node; import org.eclipse.sirius.components.interpreter.AQLInterpreter; import org.eclipse.sirius.components.representations.IRepresentationDescription; +import org.eclipse.sirius.components.trees.TreeItem; import org.eclipse.sirius.components.view.RepresentationDescription; import org.eclipse.sirius.components.view.View; import org.eclipse.sirius.components.view.diagram.DiagramDescription; @@ -64,7 +65,8 @@ public ViewConverter(List javaServiceProviders, List(); this.javaServiceProviders.addAll(Objects.requireNonNull(javaServiceProviders)); IServiceProvider nodeServiceProvider = (IReadOnlyQueryEnvironment queryEnvironment, boolean forWorkspace) -> ServiceUtils.getReceiverServices(null, Node.class).stream().toList(); - this.javaServiceProviders.add((View view) -> List.of(CanonicalServices.class, DiagramServices.class, nodeServiceProvider.getClass())); + IServiceProvider treeItemServiceProvider = (IReadOnlyQueryEnvironment queryEnvironment, boolean forWorkspace) -> ServiceUtils.getReceiverServices(null, TreeItem.class).stream().toList(); + this.javaServiceProviders.add((View view) -> List.of(CanonicalServices.class, DiagramServices.class, nodeServiceProvider.getClass(), treeItemServiceProvider.getClass())); this.representationDescriptionConverters = Objects.requireNonNull(representationDescriptionConverters); this.applicationContext = Objects.requireNonNull(applicationContext); this.dialogDescriptionConverts = Objects.requireNonNull(dialogDescriptionConverts); diff --git a/packages/view/backend/sirius-components-view-emf/src/main/java/org/eclipse/sirius/components/view/emf/tree/ViewTreeItemContextMenuEntryProvider.java b/packages/view/backend/sirius-components-view-emf/src/main/java/org/eclipse/sirius/components/view/emf/tree/ViewTreeItemContextMenuEntryProvider.java index 6a0728a1ff..3c20687ffb 100644 --- a/packages/view/backend/sirius-components-view-emf/src/main/java/org/eclipse/sirius/components/view/emf/tree/ViewTreeItemContextMenuEntryProvider.java +++ b/packages/view/backend/sirius-components-view-emf/src/main/java/org/eclipse/sirius/components/view/emf/tree/ViewTreeItemContextMenuEntryProvider.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2024 Obeo. + * Copyright (c) 2024, 2025 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 @@ -33,6 +33,7 @@ import org.eclipse.sirius.components.view.emf.IViewRepresentationDescriptionSearchService; import org.eclipse.sirius.components.view.emf.ViewRepresentationDescriptionPredicate; import org.eclipse.sirius.components.view.emf.api.IViewAQLInterpreterFactory; +import org.eclipse.sirius.components.view.tree.CustomTreeItemContextMenuEntry; import org.eclipse.sirius.components.view.tree.FetchTreeItemContextMenuEntry; import org.eclipse.sirius.components.view.tree.SingleClickTreeItemContextMenuEntry; import org.eclipse.sirius.components.view.tree.TreeItemContextMenuEntry; @@ -83,7 +84,7 @@ public List getTreeItemContextMenuEntries(IEditingCon variableManager.put(TreeDescription.ID, treeItem.getId()); var semanticTreeItemObject = treeDescription.getTreeItemObjectProvider().apply(variableManager); variableManager.put(VariableManager.SELF, semanticTreeItemObject); - + return viewTreeDescription.getContextMenuEntries().stream() .filter(viewAction -> this.isValidActionPrecondition(viewAction, variableManager, interpreter)) .map(treeItemContextMenuEntry -> this.convertContextAction(treeItemContextMenuEntry, variableManager, interpreter)) @@ -95,12 +96,17 @@ public List getTreeItemContextMenuEntries(IEditingCon private ITreeItemContextMenuEntry convertContextAction(TreeItemContextMenuEntry viewTreeItemContextAction, VariableManager variableManager, AQLInterpreter interpreter) { ITreeItemContextMenuEntry result = null; var id = this.idProvider.apply(viewTreeItemContextAction).toString(); - var label = this.evaluateString(variableManager, interpreter, viewTreeItemContextAction.getLabelExpression()); - var iconURL = this.evaluateStringList(variableManager, interpreter, viewTreeItemContextAction.getIconURLExpression()); - if (viewTreeItemContextAction instanceof SingleClickTreeItemContextMenuEntry) { + if (viewTreeItemContextAction instanceof SingleClickTreeItemContextMenuEntry singleClickTreeItemContextMenuEntry) { + var label = this.evaluateString(variableManager, interpreter, singleClickTreeItemContextMenuEntry.getLabelExpression()); + var iconURL = this.evaluateStringList(variableManager, interpreter, singleClickTreeItemContextMenuEntry.getIconURLExpression()); result = new org.eclipse.sirius.components.collaborative.trees.dto.SingleClickTreeItemContextMenuEntry(id, label, iconURL); - } else if (viewTreeItemContextAction instanceof FetchTreeItemContextMenuEntry) { + } else if (viewTreeItemContextAction instanceof FetchTreeItemContextMenuEntry fetchTreeItemContextMenuEntry) { + var label = this.evaluateString(variableManager, interpreter, fetchTreeItemContextMenuEntry.getLabelExpression()); + var iconURL = this.evaluateStringList(variableManager, interpreter, fetchTreeItemContextMenuEntry.getIconURLExpression()); result = new org.eclipse.sirius.components.collaborative.trees.dto.FetchTreeItemContextMenuEntry(id, label, iconURL); + } else if (viewTreeItemContextAction instanceof CustomTreeItemContextMenuEntry customTreeItemContextMenuEntry) { + // Use a SingleClickTreeItemContextMenuEntry instance with a dedicated ID to pass the information to the frontend. + result = new org.eclipse.sirius.components.collaborative.trees.dto.SingleClickTreeItemContextMenuEntry(customTreeItemContextMenuEntry.getContributionId(), "", List.of()); } return result; } diff --git a/packages/view/backend/sirius-components-view-tree-edit/src/main/java/org/eclipse/sirius/components/view/tree/provider/CustomTreeItemContextMenuEntryItemProvider.java b/packages/view/backend/sirius-components-view-tree-edit/src/main/java/org/eclipse/sirius/components/view/tree/provider/CustomTreeItemContextMenuEntryItemProvider.java new file mode 100644 index 0000000000..1302be1c6a --- /dev/null +++ b/packages/view/backend/sirius-components-view-tree-edit/src/main/java/org/eclipse/sirius/components/view/tree/provider/CustomTreeItemContextMenuEntryItemProvider.java @@ -0,0 +1,132 @@ +/******************************************************************************* + * Copyright (c) 2025 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.sirius.components.view.tree.provider; + +import java.util.Collection; +import java.util.List; + +import org.eclipse.emf.common.notify.AdapterFactory; +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; +import org.eclipse.emf.edit.provider.IItemPropertyDescriptor; +import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; +import org.eclipse.emf.edit.provider.ViewerNotification; +import org.eclipse.sirius.components.view.tree.CustomTreeItemContextMenuEntry; +import org.eclipse.sirius.components.view.tree.TreePackage; + +/** + * This is the item provider adapter for a + * {@link org.eclipse.sirius.components.view.tree.CustomTreeItemContextMenuEntry} object. + * + * @generated + */ +public class CustomTreeItemContextMenuEntryItemProvider extends TreeItemContextMenuEntryItemProvider { + /** + * This constructs an instance from a factory and a notifier. + * + * @generated + */ + public CustomTreeItemContextMenuEntryItemProvider(AdapterFactory adapterFactory) { + super(adapterFactory); + } + + /** + * This returns the property descriptors for the adapted class. + * + * @generated + */ + @Override + public List getPropertyDescriptors(Object object) { + if (this.itemPropertyDescriptors == null) { + super.getPropertyDescriptors(object); + + this.addContributionIdPropertyDescriptor(object); + } + return this.itemPropertyDescriptors; + } + + /** + * This adds a property descriptor for the Contribution Id feature. + * + * @generated + */ + protected void addContributionIdPropertyDescriptor(Object object) { + this.itemPropertyDescriptors.add(this.createItemPropertyDescriptor(((ComposeableAdapterFactory) this.adapterFactory).getRootAdapterFactory(), this.getResourceLocator(), + this.getString("_UI_CustomTreeItemContextMenuEntry_contributionId_feature"), + this.getString("_UI_PropertyDescriptor_description", "_UI_CustomTreeItemContextMenuEntry_contributionId_feature", "_UI_CustomTreeItemContextMenuEntry_type"), + TreePackage.Literals.CUSTOM_TREE_ITEM_CONTEXT_MENU_ENTRY__CONTRIBUTION_ID, true, false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); + } + + /** + * This returns CustomTreeItemContextMenuEntry.gif. + * + * @generated + */ + @Override + public Object getImage(Object object) { + return this.overlayImage(object, this.getResourceLocator().getImage("full/obj16/CustomTreeItemContextMenuEntry.svg")); + } + + /** + * + * + * @generated + */ + @Override + protected boolean shouldComposeCreationImage() { + return true; + } + + /** + * This returns the label text for the adapted class. + * + * @generated + */ + @Override + public String getText(Object object) { + String label = ((CustomTreeItemContextMenuEntry) object).getName(); + return label == null || label.length() == 0 ? this.getString("_UI_CustomTreeItemContextMenuEntry_type") : this.getString("_UI_CustomTreeItemContextMenuEntry_type") + " " + label; + } + + /** + * This handles model notifications by calling {@link #updateChildren} to update any cached children and by creating + * a viewer notification, which it passes to {@link #fireNotifyChanged}. + * + * @generated + */ + @Override + public void notifyChanged(Notification notification) { + this.updateChildren(notification); + + switch (notification.getFeatureID(CustomTreeItemContextMenuEntry.class)) { + case TreePackage.CUSTOM_TREE_ITEM_CONTEXT_MENU_ENTRY__CONTRIBUTION_ID: + this.fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true)); + return; + } + super.notifyChanged(notification); + } + + /** + * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children that can be created + * under this object. + * + * @generated + */ + @Override + protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { + super.collectNewChildDescriptors(newChildDescriptors, object); + } + +} diff --git a/packages/view/backend/sirius-components-view-tree-edit/src/main/java/org/eclipse/sirius/components/view/tree/provider/FetchTreeItemContextMenuEntryItemProvider.java b/packages/view/backend/sirius-components-view-tree-edit/src/main/java/org/eclipse/sirius/components/view/tree/provider/FetchTreeItemContextMenuEntryItemProvider.java index a7604e5ae9..1cb65506fd 100644 --- a/packages/view/backend/sirius-components-view-tree-edit/src/main/java/org/eclipse/sirius/components/view/tree/provider/FetchTreeItemContextMenuEntryItemProvider.java +++ b/packages/view/backend/sirius-components-view-tree-edit/src/main/java/org/eclipse/sirius/components/view/tree/provider/FetchTreeItemContextMenuEntryItemProvider.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2024 Obeo. + * Copyright (c) 2024, 2025 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 @@ -25,8 +25,7 @@ import org.eclipse.sirius.components.view.tree.TreePackage; /** - * This is the item provider adapter for a - * {@link org.eclipse.sirius.components.view.tree.FetchTreeItemContextMenuEntry} + * This is the item provider adapter for a {@link org.eclipse.sirius.components.view.tree.FetchTreeItemContextMenuEntry} * object. * * @generated @@ -34,8 +33,7 @@ public class FetchTreeItemContextMenuEntryItemProvider extends TreeItemContextMenuEntryItemProvider { /** - * This constructs an instance from a factory and a notifier. + * This constructs an instance from a factory and a notifier. * * @generated */ @@ -44,8 +42,7 @@ public FetchTreeItemContextMenuEntryItemProvider(AdapterFactory adapterFactory) } /** - * This returns the property descriptors for the adapted class. + * This returns the property descriptors for the adapted class. * * @generated */ @@ -56,53 +53,69 @@ public List getPropertyDescriptors(Object object) { this.addUrlExressionPropertyDescriptor(object); this.addKindPropertyDescriptor(object); + this.addLabelExpressionPropertyDescriptor(object); + this.addIconURLExpressionPropertyDescriptor(object); } return this.itemPropertyDescriptors; } /** - * This adds a property descriptor for the Url Exression feature. + * This adds a property descriptor for the Url Exression feature. * * @generated */ protected void addUrlExressionPropertyDescriptor(Object object) { - this.itemPropertyDescriptors - .add(this.createItemPropertyDescriptor(((ComposeableAdapterFactory) this.adapterFactory).getRootAdapterFactory(), - this.getResourceLocator(), this.getString("_UI_FetchTreeItemContextMenuEntry_urlExression_feature"), - this.getString("_UI_PropertyDescriptor_description", - "_UI_FetchTreeItemContextMenuEntry_urlExression_feature", - "_UI_FetchTreeItemContextMenuEntry_type"), - TreePackage.Literals.FETCH_TREE_ITEM_CONTEXT_MENU_ENTRY__URL_EXRESSION, true, false, false, - ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); + this.itemPropertyDescriptors.add(this.createItemPropertyDescriptor(((ComposeableAdapterFactory) this.adapterFactory).getRootAdapterFactory(), this.getResourceLocator(), + this.getString("_UI_FetchTreeItemContextMenuEntry_urlExression_feature"), + this.getString("_UI_PropertyDescriptor_description", "_UI_FetchTreeItemContextMenuEntry_urlExression_feature", "_UI_FetchTreeItemContextMenuEntry_type"), + TreePackage.Literals.FETCH_TREE_ITEM_CONTEXT_MENU_ENTRY__URL_EXRESSION, true, false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); } /** - * This adds a property descriptor for the Kind feature. - * + * This adds a property descriptor for the Kind feature. * * @generated */ protected void addKindPropertyDescriptor(Object object) { - this.itemPropertyDescriptors.add(this.createItemPropertyDescriptor( - ((ComposeableAdapterFactory) this.adapterFactory).getRootAdapterFactory(), this.getResourceLocator(), + this.itemPropertyDescriptors.add(this.createItemPropertyDescriptor(((ComposeableAdapterFactory) this.adapterFactory).getRootAdapterFactory(), this.getResourceLocator(), this.getString("_UI_FetchTreeItemContextMenuEntry_kind_feature"), - this.getString("_UI_PropertyDescriptor_description", "_UI_FetchTreeItemContextMenuEntry_kind_feature", - "_UI_FetchTreeItemContextMenuEntry_type"), - TreePackage.Literals.FETCH_TREE_ITEM_CONTEXT_MENU_ENTRY__KIND, true, false, false, - ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); + this.getString("_UI_PropertyDescriptor_description", "_UI_FetchTreeItemContextMenuEntry_kind_feature", "_UI_FetchTreeItemContextMenuEntry_type"), + TreePackage.Literals.FETCH_TREE_ITEM_CONTEXT_MENU_ENTRY__KIND, true, false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); } /** - * This returns FetchTreeItemContextMenuEntry.gif. + * This adds a property descriptor for the Label Expression feature. + * + * @generated + */ + protected void addLabelExpressionPropertyDescriptor(Object object) { + this.itemPropertyDescriptors.add(this.createItemPropertyDescriptor(((ComposeableAdapterFactory) this.adapterFactory).getRootAdapterFactory(), this.getResourceLocator(), + this.getString("_UI_FetchTreeItemContextMenuEntry_labelExpression_feature"), + this.getString("_UI_PropertyDescriptor_description", "_UI_FetchTreeItemContextMenuEntry_labelExpression_feature", "_UI_FetchTreeItemContextMenuEntry_type"), + TreePackage.Literals.FETCH_TREE_ITEM_CONTEXT_MENU_ENTRY__LABEL_EXPRESSION, true, false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); + } + + /** + * This adds a property descriptor for the Icon URL Expression feature. + * + * @generated + */ + protected void addIconURLExpressionPropertyDescriptor(Object object) { + this.itemPropertyDescriptors.add(this.createItemPropertyDescriptor(((ComposeableAdapterFactory) this.adapterFactory).getRootAdapterFactory(), this.getResourceLocator(), + this.getString("_UI_FetchTreeItemContextMenuEntry_iconURLExpression_feature"), + this.getString("_UI_PropertyDescriptor_description", "_UI_FetchTreeItemContextMenuEntry_iconURLExpression_feature", "_UI_FetchTreeItemContextMenuEntry_type"), + TreePackage.Literals.FETCH_TREE_ITEM_CONTEXT_MENU_ENTRY__ICON_URL_EXPRESSION, true, false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); + } + + /** + * This returns FetchTreeItemContextMenuEntry.gif. * * @generated NOT */ @Override public Object getImage(Object object) { - return this.overlayImage(object, - this.getResourceLocator().getImage("full/obj16/FetchTreeItemContextMenuEntry.svg")); + return this.overlayImage(object, this.getResourceLocator().getImage("full/obj16/FetchTreeItemContextMenuEntry.svg")); } /** @@ -116,22 +129,20 @@ protected boolean shouldComposeCreationImage() { } /** - * This returns the label text for the adapted class. - * + * This returns the label text for the adapted class. * * @generated */ @Override public String getText(Object object) { String label = ((FetchTreeItemContextMenuEntry) object).getName(); - return label == null || label.length() == 0 ? this.getString("_UI_FetchTreeItemContextMenuEntry_type") - : this.getString("_UI_FetchTreeItemContextMenuEntry_type") + " " + label; + return label == null || label.length() == 0 ? this.getString("_UI_FetchTreeItemContextMenuEntry_type") : this.getString("_UI_FetchTreeItemContextMenuEntry_type") + " " + label; } /** - * This handles model notifications by calling {@link #updateChildren} to update - * any cached children and by creating a viewer notification, which it passes to - * {@link #fireNotifyChanged}. + * This handles model notifications by calling {@link #updateChildren} to update any cached children and by creating + * a viewer notification, which it passes to {@link #fireNotifyChanged}. * * @generated */ @@ -142,6 +153,8 @@ public void notifyChanged(Notification notification) { switch (notification.getFeatureID(FetchTreeItemContextMenuEntry.class)) { case TreePackage.FETCH_TREE_ITEM_CONTEXT_MENU_ENTRY__URL_EXRESSION: case TreePackage.FETCH_TREE_ITEM_CONTEXT_MENU_ENTRY__KIND: + case TreePackage.FETCH_TREE_ITEM_CONTEXT_MENU_ENTRY__LABEL_EXPRESSION: + case TreePackage.FETCH_TREE_ITEM_CONTEXT_MENU_ENTRY__ICON_URL_EXPRESSION: this.fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true)); return; } @@ -149,9 +162,8 @@ public void notifyChanged(Notification notification) { } /** - * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing - * the children that can be created under this object. - * + * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children that can be created + * under this object. * * @generated */ diff --git a/packages/view/backend/sirius-components-view-tree-edit/src/main/java/org/eclipse/sirius/components/view/tree/provider/SingleClickTreeItemContextMenuEntryItemProvider.java b/packages/view/backend/sirius-components-view-tree-edit/src/main/java/org/eclipse/sirius/components/view/tree/provider/SingleClickTreeItemContextMenuEntryItemProvider.java index a468433a74..da9ce87d69 100644 --- a/packages/view/backend/sirius-components-view-tree-edit/src/main/java/org/eclipse/sirius/components/view/tree/provider/SingleClickTreeItemContextMenuEntryItemProvider.java +++ b/packages/view/backend/sirius-components-view-tree-edit/src/main/java/org/eclipse/sirius/components/view/tree/provider/SingleClickTreeItemContextMenuEntryItemProvider.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2024 Obeo. + * Copyright (c) 2024, 2025 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 @@ -18,7 +18,9 @@ import org.eclipse.emf.common.notify.AdapterFactory; import org.eclipse.emf.common.notify.Notification; import org.eclipse.emf.ecore.EStructuralFeature; +import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; import org.eclipse.emf.edit.provider.IItemPropertyDescriptor; +import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; import org.eclipse.emf.edit.provider.ViewerNotification; import org.eclipse.sirius.components.view.ViewFactory; import org.eclipse.sirius.components.view.tree.SingleClickTreeItemContextMenuEntry; @@ -26,16 +28,15 @@ /** * This is the item provider adapter for a - * {@link org.eclipse.sirius.components.view.tree.SingleClickTreeItemContextMenuEntry} - * object. + * {@link org.eclipse.sirius.components.view.tree.SingleClickTreeItemContextMenuEntry} object. + * * * @generated */ public class SingleClickTreeItemContextMenuEntryItemProvider extends TreeItemContextMenuEntryItemProvider { /** - * This constructs an instance from a factory and a notifier. + * This constructs an instance from a factory and a notifier. * * @generated */ @@ -44,8 +45,7 @@ public SingleClickTreeItemContextMenuEntryItemProvider(AdapterFactory adapterFac } /** - * This returns the property descriptors for the adapted class. + * This returns the property descriptors for the adapted class. * * @generated */ @@ -54,16 +54,42 @@ public List getPropertyDescriptors(Object object) { if (this.itemPropertyDescriptors == null) { super.getPropertyDescriptors(object); + this.addLabelExpressionPropertyDescriptor(object); + this.addIconURLExpressionPropertyDescriptor(object); } return this.itemPropertyDescriptors; } /** - * This specifies how to implement {@link #getChildren} and is used to deduce an - * appropriate feature for an {@link org.eclipse.emf.edit.command.AddCommand}, - * {@link org.eclipse.emf.edit.command.RemoveCommand} or - * {@link org.eclipse.emf.edit.command.MoveCommand} in {@link #createCommand}. - * + * This adds a property descriptor for the Label Expression feature. + * + * @generated + */ + protected void addLabelExpressionPropertyDescriptor(Object object) { + this.itemPropertyDescriptors.add(this.createItemPropertyDescriptor(((ComposeableAdapterFactory) this.adapterFactory).getRootAdapterFactory(), this.getResourceLocator(), + this.getString("_UI_SingleClickTreeItemContextMenuEntry_labelExpression_feature"), + this.getString("_UI_PropertyDescriptor_description", "_UI_SingleClickTreeItemContextMenuEntry_labelExpression_feature", "_UI_SingleClickTreeItemContextMenuEntry_type"), + TreePackage.Literals.SINGLE_CLICK_TREE_ITEM_CONTEXT_MENU_ENTRY__LABEL_EXPRESSION, true, false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); + } + + /** + * This adds a property descriptor for the Icon URL Expression feature. + * + * @generated + */ + protected void addIconURLExpressionPropertyDescriptor(Object object) { + this.itemPropertyDescriptors.add(this.createItemPropertyDescriptor(((ComposeableAdapterFactory) this.adapterFactory).getRootAdapterFactory(), this.getResourceLocator(), + this.getString("_UI_SingleClickTreeItemContextMenuEntry_iconURLExpression_feature"), + this.getString("_UI_PropertyDescriptor_description", "_UI_SingleClickTreeItemContextMenuEntry_iconURLExpression_feature", "_UI_SingleClickTreeItemContextMenuEntry_type"), + TreePackage.Literals.SINGLE_CLICK_TREE_ITEM_CONTEXT_MENU_ENTRY__ICON_URL_EXPRESSION, true, false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); + } + + /** + * This specifies how to implement {@link #getChildren} and is used to deduce an appropriate feature for an + * {@link org.eclipse.emf.edit.command.AddCommand}, {@link org.eclipse.emf.edit.command.RemoveCommand} or + * {@link org.eclipse.emf.edit.command.MoveCommand} in {@link #createCommand}. * * @generated */ @@ -83,23 +109,20 @@ public Collection getChildrenFeatures(Object objec */ @Override protected EStructuralFeature getChildFeature(Object object, Object child) { - // Check the type of the specified child object and return the proper feature to - // use for + // Check the type of the specified child object and return the proper feature to use for // adding (see {@link AddCommand}) it as a child. return super.getChildFeature(object, child); } /** - * This returns SingleClickTreeItemContextMenuEntry.gif. - * + * This returns SingleClickTreeItemContextMenuEntry.gif. * * @generated NOT */ @Override public Object getImage(Object object) { - return this.overlayImage(object, - this.getResourceLocator().getImage("full/obj16/SingleClickTreeItemContextMenuEntry.svg")); + return this.overlayImage(object, this.getResourceLocator().getImage("full/obj16/SingleClickTreeItemContextMenuEntry.svg")); } /** @@ -113,22 +136,20 @@ protected boolean shouldComposeCreationImage() { } /** - * This returns the label text for the adapted class. - * + * This returns the label text for the adapted class. * * @generated */ @Override public String getText(Object object) { String label = ((SingleClickTreeItemContextMenuEntry) object).getName(); - return label == null || label.length() == 0 ? this.getString("_UI_SingleClickTreeItemContextMenuEntry_type") - : this.getString("_UI_SingleClickTreeItemContextMenuEntry_type") + " " + label; + return label == null || label.length() == 0 ? this.getString("_UI_SingleClickTreeItemContextMenuEntry_type") : this.getString("_UI_SingleClickTreeItemContextMenuEntry_type") + " " + label; } /** - * This handles model notifications by calling {@link #updateChildren} to update - * any cached children and by creating a viewer notification, which it passes to - * {@link #fireNotifyChanged}. + * This handles model notifications by calling {@link #updateChildren} to update any cached children and by creating + * a viewer notification, which it passes to {@link #fireNotifyChanged}. * * @generated */ @@ -137,6 +158,10 @@ public void notifyChanged(Notification notification) { this.updateChildren(notification); switch (notification.getFeatureID(SingleClickTreeItemContextMenuEntry.class)) { + case TreePackage.SINGLE_CLICK_TREE_ITEM_CONTEXT_MENU_ENTRY__LABEL_EXPRESSION: + case TreePackage.SINGLE_CLICK_TREE_ITEM_CONTEXT_MENU_ENTRY__ICON_URL_EXPRESSION: + this.fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true)); + return; case TreePackage.SINGLE_CLICK_TREE_ITEM_CONTEXT_MENU_ENTRY__BODY: this.fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, false)); return; @@ -145,9 +170,8 @@ public void notifyChanged(Notification notification) { } /** - * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing - * the children that can be created under this object. - * + * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children that can be created + * under this object. * * @generated */ @@ -155,37 +179,21 @@ public void notifyChanged(Notification notification) { protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { super.collectNewChildDescriptors(newChildDescriptors, object); - newChildDescriptors - .add(this.createChildParameter(TreePackage.Literals.SINGLE_CLICK_TREE_ITEM_CONTEXT_MENU_ENTRY__BODY, - ViewFactory.eINSTANCE.createChangeContext())); + newChildDescriptors.add(this.createChildParameter(TreePackage.Literals.SINGLE_CLICK_TREE_ITEM_CONTEXT_MENU_ENTRY__BODY, ViewFactory.eINSTANCE.createChangeContext())); - newChildDescriptors - .add(this.createChildParameter(TreePackage.Literals.SINGLE_CLICK_TREE_ITEM_CONTEXT_MENU_ENTRY__BODY, - ViewFactory.eINSTANCE.createCreateInstance())); + newChildDescriptors.add(this.createChildParameter(TreePackage.Literals.SINGLE_CLICK_TREE_ITEM_CONTEXT_MENU_ENTRY__BODY, ViewFactory.eINSTANCE.createCreateInstance())); - newChildDescriptors - .add(this.createChildParameter(TreePackage.Literals.SINGLE_CLICK_TREE_ITEM_CONTEXT_MENU_ENTRY__BODY, - ViewFactory.eINSTANCE.createSetValue())); + newChildDescriptors.add(this.createChildParameter(TreePackage.Literals.SINGLE_CLICK_TREE_ITEM_CONTEXT_MENU_ENTRY__BODY, ViewFactory.eINSTANCE.createSetValue())); - newChildDescriptors - .add(this.createChildParameter(TreePackage.Literals.SINGLE_CLICK_TREE_ITEM_CONTEXT_MENU_ENTRY__BODY, - ViewFactory.eINSTANCE.createUnsetValue())); + newChildDescriptors.add(this.createChildParameter(TreePackage.Literals.SINGLE_CLICK_TREE_ITEM_CONTEXT_MENU_ENTRY__BODY, ViewFactory.eINSTANCE.createUnsetValue())); - newChildDescriptors - .add(this.createChildParameter(TreePackage.Literals.SINGLE_CLICK_TREE_ITEM_CONTEXT_MENU_ENTRY__BODY, - ViewFactory.eINSTANCE.createDeleteElement())); + newChildDescriptors.add(this.createChildParameter(TreePackage.Literals.SINGLE_CLICK_TREE_ITEM_CONTEXT_MENU_ENTRY__BODY, ViewFactory.eINSTANCE.createDeleteElement())); - newChildDescriptors - .add(this.createChildParameter(TreePackage.Literals.SINGLE_CLICK_TREE_ITEM_CONTEXT_MENU_ENTRY__BODY, - ViewFactory.eINSTANCE.createLet())); + newChildDescriptors.add(this.createChildParameter(TreePackage.Literals.SINGLE_CLICK_TREE_ITEM_CONTEXT_MENU_ENTRY__BODY, ViewFactory.eINSTANCE.createLet())); - newChildDescriptors - .add(this.createChildParameter(TreePackage.Literals.SINGLE_CLICK_TREE_ITEM_CONTEXT_MENU_ENTRY__BODY, - ViewFactory.eINSTANCE.createIf())); + newChildDescriptors.add(this.createChildParameter(TreePackage.Literals.SINGLE_CLICK_TREE_ITEM_CONTEXT_MENU_ENTRY__BODY, ViewFactory.eINSTANCE.createIf())); - newChildDescriptors - .add(this.createChildParameter(TreePackage.Literals.SINGLE_CLICK_TREE_ITEM_CONTEXT_MENU_ENTRY__BODY, - ViewFactory.eINSTANCE.createFor())); + newChildDescriptors.add(this.createChildParameter(TreePackage.Literals.SINGLE_CLICK_TREE_ITEM_CONTEXT_MENU_ENTRY__BODY, ViewFactory.eINSTANCE.createFor())); } } diff --git a/packages/view/backend/sirius-components-view-tree-edit/src/main/java/org/eclipse/sirius/components/view/tree/provider/TreeDescriptionItemProvider.java b/packages/view/backend/sirius-components-view-tree-edit/src/main/java/org/eclipse/sirius/components/view/tree/provider/TreeDescriptionItemProvider.java index a1ecba1f8e..4110bfc61d 100644 --- a/packages/view/backend/sirius-components-view-tree-edit/src/main/java/org/eclipse/sirius/components/view/tree/provider/TreeDescriptionItemProvider.java +++ b/packages/view/backend/sirius-components-view-tree-edit/src/main/java/org/eclipse/sirius/components/view/tree/provider/TreeDescriptionItemProvider.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2024 Obeo. + * Copyright (c) 2024, 2025 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 @@ -28,7 +28,8 @@ import org.eclipse.sirius.components.view.tree.TreePackage; /** - * This is the item provider adapter for a {@link org.eclipse.sirius.components.view.tree.TreeDescription} object. + * This is the item provider adapter for a {@link org.eclipse.sirius.components.view.tree.TreeDescription} object. * * @generated */ @@ -75,103 +76,88 @@ public List getPropertyDescriptors(Object object) { * @generated */ protected void addKindExpressionPropertyDescriptor(Object object) { - this.itemPropertyDescriptors - .add(this.createItemPropertyDescriptor(((ComposeableAdapterFactory) this.adapterFactory).getRootAdapterFactory(), - this.getResourceLocator(), this.getString("_UI_TreeDescription_kindExpression_feature"), - this.getString("_UI_PropertyDescriptor_description", "_UI_TreeDescription_kindExpression_feature", - "_UI_TreeDescription_type"), - TreePackage.Literals.TREE_DESCRIPTION__KIND_EXPRESSION, true, false, false, - ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); + this.itemPropertyDescriptors.add(this.createItemPropertyDescriptor(((ComposeableAdapterFactory) this.adapterFactory).getRootAdapterFactory(), this.getResourceLocator(), + this.getString("_UI_TreeDescription_kindExpression_feature"), + this.getString("_UI_PropertyDescriptor_description", "_UI_TreeDescription_kindExpression_feature", "_UI_TreeDescription_type"), TreePackage.Literals.TREE_DESCRIPTION__KIND_EXPRESSION, + true, false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); } /** - * This adds a property descriptor for the Tree Item Icon Expression feature. + * This adds a property descriptor for the Tree Item Icon Expression feature. * * @generated */ protected void addTreeItemIconExpressionPropertyDescriptor(Object object) { - this.itemPropertyDescriptors.add(this.createItemPropertyDescriptor( - ((ComposeableAdapterFactory) this.adapterFactory).getRootAdapterFactory(), this.getResourceLocator(), + this.itemPropertyDescriptors.add(this.createItemPropertyDescriptor(((ComposeableAdapterFactory) this.adapterFactory).getRootAdapterFactory(), this.getResourceLocator(), this.getString("_UI_TreeDescription_treeItemIconExpression_feature"), - this.getString("_UI_PropertyDescriptor_description", "_UI_TreeDescription_treeItemIconExpression_feature", - "_UI_TreeDescription_type"), - TreePackage.Literals.TREE_DESCRIPTION__TREE_ITEM_ICON_EXPRESSION, true, false, false, - ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); + this.getString("_UI_PropertyDescriptor_description", "_UI_TreeDescription_treeItemIconExpression_feature", "_UI_TreeDescription_type"), + TreePackage.Literals.TREE_DESCRIPTION__TREE_ITEM_ICON_EXPRESSION, true, false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); } /** - * This adds a property descriptor for the Tree Item Id Expression feature. + * This adds a property descriptor for the Tree Item Id Expression feature. * * @generated */ protected void addTreeItemIdExpressionPropertyDescriptor(Object object) { - this.itemPropertyDescriptors.add(this.createItemPropertyDescriptor( - ((ComposeableAdapterFactory) this.adapterFactory).getRootAdapterFactory(), this.getResourceLocator(), + this.itemPropertyDescriptors.add(this.createItemPropertyDescriptor(((ComposeableAdapterFactory) this.adapterFactory).getRootAdapterFactory(), this.getResourceLocator(), this.getString("_UI_TreeDescription_treeItemIdExpression_feature"), - this.getString("_UI_PropertyDescriptor_description", "_UI_TreeDescription_treeItemIdExpression_feature", - "_UI_TreeDescription_type"), - TreePackage.Literals.TREE_DESCRIPTION__TREE_ITEM_ID_EXPRESSION, true, false, false, - ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); + this.getString("_UI_PropertyDescriptor_description", "_UI_TreeDescription_treeItemIdExpression_feature", "_UI_TreeDescription_type"), + TreePackage.Literals.TREE_DESCRIPTION__TREE_ITEM_ID_EXPRESSION, true, false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); } /** - * This adds a property descriptor for the Tree Item Object Expression feature. + * This adds a property descriptor for the Tree Item Object Expression feature. * * @generated */ protected void addTreeItemObjectExpressionPropertyDescriptor(Object object) { - this.itemPropertyDescriptors.add(this.createItemPropertyDescriptor( - ((ComposeableAdapterFactory) this.adapterFactory).getRootAdapterFactory(), this.getResourceLocator(), + this.itemPropertyDescriptors.add(this.createItemPropertyDescriptor(((ComposeableAdapterFactory) this.adapterFactory).getRootAdapterFactory(), this.getResourceLocator(), this.getString("_UI_TreeDescription_treeItemObjectExpression_feature"), - this.getString("_UI_PropertyDescriptor_description", "_UI_TreeDescription_treeItemObjectExpression_feature", - "_UI_TreeDescription_type"), - TreePackage.Literals.TREE_DESCRIPTION__TREE_ITEM_OBJECT_EXPRESSION, true, false, false, - ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); + this.getString("_UI_PropertyDescriptor_description", "_UI_TreeDescription_treeItemObjectExpression_feature", "_UI_TreeDescription_type"), + TreePackage.Literals.TREE_DESCRIPTION__TREE_ITEM_OBJECT_EXPRESSION, true, false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); } /** - * This adds a property descriptor for the Elements Expression feature. + * This adds a property descriptor for the Elements Expression feature. * * @generated */ protected void addElementsExpressionPropertyDescriptor(Object object) { - this.itemPropertyDescriptors.add(this.createItemPropertyDescriptor( - ((ComposeableAdapterFactory) this.adapterFactory).getRootAdapterFactory(), this.getResourceLocator(), + this.itemPropertyDescriptors.add(this.createItemPropertyDescriptor(((ComposeableAdapterFactory) this.adapterFactory).getRootAdapterFactory(), this.getResourceLocator(), this.getString("_UI_TreeDescription_elementsExpression_feature"), - this.getString("_UI_PropertyDescriptor_description", "_UI_TreeDescription_elementsExpression_feature", - "_UI_TreeDescription_type"), - TreePackage.Literals.TREE_DESCRIPTION__ELEMENTS_EXPRESSION, true, false, false, - ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); + this.getString("_UI_PropertyDescriptor_description", "_UI_TreeDescription_elementsExpression_feature", "_UI_TreeDescription_type"), + TreePackage.Literals.TREE_DESCRIPTION__ELEMENTS_EXPRESSION, true, false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); } /** - * This adds a property descriptor for the Has Children Expression feature. + * This adds a property descriptor for the Has Children Expression feature. * * @generated */ protected void addHasChildrenExpressionPropertyDescriptor(Object object) { - this.itemPropertyDescriptors.add(this.createItemPropertyDescriptor( - ((ComposeableAdapterFactory) this.adapterFactory).getRootAdapterFactory(), this.getResourceLocator(), + this.itemPropertyDescriptors.add(this.createItemPropertyDescriptor(((ComposeableAdapterFactory) this.adapterFactory).getRootAdapterFactory(), this.getResourceLocator(), this.getString("_UI_TreeDescription_hasChildrenExpression_feature"), - this.getString("_UI_PropertyDescriptor_description", "_UI_TreeDescription_hasChildrenExpression_feature", - "_UI_TreeDescription_type"), - TreePackage.Literals.TREE_DESCRIPTION__HAS_CHILDREN_EXPRESSION, true, false, false, - ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); + this.getString("_UI_PropertyDescriptor_description", "_UI_TreeDescription_hasChildrenExpression_feature", "_UI_TreeDescription_type"), + TreePackage.Literals.TREE_DESCRIPTION__HAS_CHILDREN_EXPRESSION, true, false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); } /** - * This adds a property descriptor for the Children Expression feature. + * This adds a property descriptor for the Children Expression feature. * * @generated */ protected void addChildrenExpressionPropertyDescriptor(Object object) { - this.itemPropertyDescriptors.add(this.createItemPropertyDescriptor( - ((ComposeableAdapterFactory) this.adapterFactory).getRootAdapterFactory(), this.getResourceLocator(), + this.itemPropertyDescriptors.add(this.createItemPropertyDescriptor(((ComposeableAdapterFactory) this.adapterFactory).getRootAdapterFactory(), this.getResourceLocator(), this.getString("_UI_TreeDescription_childrenExpression_feature"), - this.getString("_UI_PropertyDescriptor_description", "_UI_TreeDescription_childrenExpression_feature", - "_UI_TreeDescription_type"), - TreePackage.Literals.TREE_DESCRIPTION__CHILDREN_EXPRESSION, true, false, false, - ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); + this.getString("_UI_PropertyDescriptor_description", "_UI_TreeDescription_childrenExpression_feature", "_UI_TreeDescription_type"), + TreePackage.Literals.TREE_DESCRIPTION__CHILDREN_EXPRESSION, true, false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); } /** @@ -180,78 +166,69 @@ protected void addChildrenExpressionPropertyDescriptor(Object object) { * @generated */ protected void addParentExpressionPropertyDescriptor(Object object) { - this.itemPropertyDescriptors - .add(this.createItemPropertyDescriptor(((ComposeableAdapterFactory) this.adapterFactory).getRootAdapterFactory(), - this.getResourceLocator(), this.getString("_UI_TreeDescription_parentExpression_feature"), - this.getString("_UI_PropertyDescriptor_description", "_UI_TreeDescription_parentExpression_feature", - "_UI_TreeDescription_type"), - TreePackage.Literals.TREE_DESCRIPTION__PARENT_EXPRESSION, true, false, false, - ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); + this.itemPropertyDescriptors.add(this.createItemPropertyDescriptor(((ComposeableAdapterFactory) this.adapterFactory).getRootAdapterFactory(), this.getResourceLocator(), + this.getString("_UI_TreeDescription_parentExpression_feature"), + this.getString("_UI_PropertyDescriptor_description", "_UI_TreeDescription_parentExpression_feature", "_UI_TreeDescription_type"), + TreePackage.Literals.TREE_DESCRIPTION__PARENT_EXPRESSION, true, false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); } /** - * This adds a property descriptor for the Editable Expression feature. + * This adds a property descriptor for the Editable Expression feature. * * @generated */ protected void addEditableExpressionPropertyDescriptor(Object object) { - this.itemPropertyDescriptors.add(this.createItemPropertyDescriptor( - ((ComposeableAdapterFactory) this.adapterFactory).getRootAdapterFactory(), this.getResourceLocator(), + this.itemPropertyDescriptors.add(this.createItemPropertyDescriptor(((ComposeableAdapterFactory) this.adapterFactory).getRootAdapterFactory(), this.getResourceLocator(), this.getString("_UI_TreeDescription_editableExpression_feature"), - this.getString("_UI_PropertyDescriptor_description", "_UI_TreeDescription_editableExpression_feature", - "_UI_TreeDescription_type"), - TreePackage.Literals.TREE_DESCRIPTION__EDITABLE_EXPRESSION, true, false, false, - ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); + this.getString("_UI_PropertyDescriptor_description", "_UI_TreeDescription_editableExpression_feature", "_UI_TreeDescription_type"), + TreePackage.Literals.TREE_DESCRIPTION__EDITABLE_EXPRESSION, true, false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); } /** - * This adds a property descriptor for the Selectable Expression feature. + * This adds a property descriptor for the Selectable Expression feature. * * @generated */ protected void addSelectableExpressionPropertyDescriptor(Object object) { - this.itemPropertyDescriptors.add(this.createItemPropertyDescriptor( - ((ComposeableAdapterFactory) this.adapterFactory).getRootAdapterFactory(), this.getResourceLocator(), + this.itemPropertyDescriptors.add(this.createItemPropertyDescriptor(((ComposeableAdapterFactory) this.adapterFactory).getRootAdapterFactory(), this.getResourceLocator(), this.getString("_UI_TreeDescription_selectableExpression_feature"), - this.getString("_UI_PropertyDescriptor_description", "_UI_TreeDescription_selectableExpression_feature", - "_UI_TreeDescription_type"), - TreePackage.Literals.TREE_DESCRIPTION__SELECTABLE_EXPRESSION, true, false, false, - ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); + this.getString("_UI_PropertyDescriptor_description", "_UI_TreeDescription_selectableExpression_feature", "_UI_TreeDescription_type"), + TreePackage.Literals.TREE_DESCRIPTION__SELECTABLE_EXPRESSION, true, false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); } /** - * This adds a property descriptor for the Deletable Expression feature. + * This adds a property descriptor for the Deletable Expression feature. * * @generated */ protected void addDeletableExpressionPropertyDescriptor(Object object) { - this.itemPropertyDescriptors.add(this.createItemPropertyDescriptor( - ((ComposeableAdapterFactory) this.adapterFactory).getRootAdapterFactory(), this.getResourceLocator(), + this.itemPropertyDescriptors.add(this.createItemPropertyDescriptor(((ComposeableAdapterFactory) this.adapterFactory).getRootAdapterFactory(), this.getResourceLocator(), this.getString("_UI_TreeDescription_deletableExpression_feature"), - this.getString("_UI_PropertyDescriptor_description", "_UI_TreeDescription_deletableExpression_feature", - "_UI_TreeDescription_type"), - TreePackage.Literals.TREE_DESCRIPTION__DELETABLE_EXPRESSION, true, false, false, - ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); + this.getString("_UI_PropertyDescriptor_description", "_UI_TreeDescription_deletableExpression_feature", "_UI_TreeDescription_type"), + TreePackage.Literals.TREE_DESCRIPTION__DELETABLE_EXPRESSION, true, false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); } /** - * This adds a property descriptor for the Tree Item Label Descriptions feature. + * This adds a property descriptor for the Tree Item Label Descriptions feature. * * @generated */ protected void addTreeItemLabelDescriptionsPropertyDescriptor(Object object) { - this.itemPropertyDescriptors - .add(this.createItemPropertyDescriptor(((ComposeableAdapterFactory) this.adapterFactory).getRootAdapterFactory(), - this.getResourceLocator(), this.getString("_UI_TreeDescription_treeItemLabelDescriptions_feature"), - this.getString("_UI_PropertyDescriptor_description", - "_UI_TreeDescription_treeItemLabelDescriptions_feature", "_UI_TreeDescription_type"), - TreePackage.Literals.TREE_DESCRIPTION__TREE_ITEM_LABEL_DESCRIPTIONS, true, false, true, null, - null, null)); + this.itemPropertyDescriptors.add(this.createItemPropertyDescriptor(((ComposeableAdapterFactory) this.adapterFactory).getRootAdapterFactory(), this.getResourceLocator(), + this.getString("_UI_TreeDescription_treeItemLabelDescriptions_feature"), + this.getString("_UI_PropertyDescriptor_description", "_UI_TreeDescription_treeItemLabelDescriptions_feature", "_UI_TreeDescription_type"), + TreePackage.Literals.TREE_DESCRIPTION__TREE_ITEM_LABEL_DESCRIPTIONS, true, false, true, null, null, null)); } /** - * This specifies how to implement {@link #getChildren} and is used to deduce an appropriate feature for an {@link org.eclipse.emf.edit.command.AddCommand}, - * {@link org.eclipse.emf.edit.command.RemoveCommand} or {@link org.eclipse.emf.edit.command.MoveCommand} in {@link #createCommand}. + * This specifies how to implement {@link #getChildren} and is used to deduce an appropriate feature for an + * {@link org.eclipse.emf.edit.command.AddCommand}, {@link org.eclipse.emf.edit.command.RemoveCommand} or + * {@link org.eclipse.emf.edit.command.MoveCommand} in {@link #createCommand}. * * @generated */ @@ -272,8 +249,7 @@ public Collection getChildrenFeatures(Object objec */ @Override protected EStructuralFeature getChildFeature(Object object, Object child) { - // Check the type of the specified child object and return the proper feature to - // use for + // Check the type of the specified child object and return the proper feature to use for // adding (see {@link AddCommand}) it as a child. return super.getChildFeature(object, child); @@ -307,13 +283,13 @@ protected boolean shouldComposeCreationImage() { @Override public String getText(Object object) { String label = ((TreeDescription) object).getName(); - return label == null || label.length() == 0 ? this.getString("_UI_TreeDescription_type") - : this.getString("_UI_TreeDescription_type") + " " + label; + return label == null || label.length() == 0 ? this.getString("_UI_TreeDescription_type") : this.getString("_UI_TreeDescription_type") + " " + label; } /** - * This handles model notifications by calling {@link #updateChildren} to update any cached children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}. + * This handles model notifications by calling {@link #updateChildren} to update any cached children and by creating + * a viewer notification, which it passes to {@link #fireNotifyChanged}. * * @generated */ @@ -344,7 +320,8 @@ public void notifyChanged(Notification notification) { } /** - * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children that can be created under this object. + * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children that can be created + * under this object. * * @generated */ @@ -352,15 +329,13 @@ public void notifyChanged(Notification notification) { protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { super.collectNewChildDescriptors(newChildDescriptors, object); - newChildDescriptors - .add(this.createChildParameter(TreePackage.Literals.TREE_DESCRIPTION__TREE_ITEM_LABEL_DESCRIPTIONS, - TreeFactory.eINSTANCE.createTreeItemLabelDescription())); + newChildDescriptors.add(this.createChildParameter(TreePackage.Literals.TREE_DESCRIPTION__TREE_ITEM_LABEL_DESCRIPTIONS, TreeFactory.eINSTANCE.createTreeItemLabelDescription())); - newChildDescriptors.add(this.createChildParameter(TreePackage.Literals.TREE_DESCRIPTION__CONTEXT_MENU_ENTRIES, - TreeFactory.eINSTANCE.createSingleClickTreeItemContextMenuEntry())); + newChildDescriptors.add(this.createChildParameter(TreePackage.Literals.TREE_DESCRIPTION__CONTEXT_MENU_ENTRIES, TreeFactory.eINSTANCE.createSingleClickTreeItemContextMenuEntry())); - newChildDescriptors.add(this.createChildParameter(TreePackage.Literals.TREE_DESCRIPTION__CONTEXT_MENU_ENTRIES, - TreeFactory.eINSTANCE.createFetchTreeItemContextMenuEntry())); + newChildDescriptors.add(this.createChildParameter(TreePackage.Literals.TREE_DESCRIPTION__CONTEXT_MENU_ENTRIES, TreeFactory.eINSTANCE.createFetchTreeItemContextMenuEntry())); + + newChildDescriptors.add(this.createChildParameter(TreePackage.Literals.TREE_DESCRIPTION__CONTEXT_MENU_ENTRIES, TreeFactory.eINSTANCE.createCustomTreeItemContextMenuEntry())); } } diff --git a/packages/view/backend/sirius-components-view-tree-edit/src/main/java/org/eclipse/sirius/components/view/tree/provider/TreeEditPlugin.java b/packages/view/backend/sirius-components-view-tree-edit/src/main/java/org/eclipse/sirius/components/view/tree/provider/TreeEditPlugin.java index 62ac6e4753..c9e4a38761 100644 --- a/packages/view/backend/sirius-components-view-tree-edit/src/main/java/org/eclipse/sirius/components/view/tree/provider/TreeEditPlugin.java +++ b/packages/view/backend/sirius-components-view-tree-edit/src/main/java/org/eclipse/sirius/components/view/tree/provider/TreeEditPlugin.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2024 Obeo. + * Copyright (c) 2024, 2025 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 @@ -21,111 +21,103 @@ import org.eclipse.sirius.components.view.provider.ViewEditPlugin; /** - * This is the central singleton for the Tree edit plugin. + * This is the central singleton for the Tree edit plugin. * * @generated */ public final class TreeEditPlugin extends EMFPlugin { - /** - * Keep track of the singleton. - * - * @generated - */ - public static final TreeEditPlugin INSTANCE = new TreeEditPlugin(); + /** + * Keep track of the singleton. + * + * @generated + */ + public static final TreeEditPlugin INSTANCE = new TreeEditPlugin(); - /** - * Keep track of the singleton. - * - * @generated - */ - private static Implementation plugin; + /** + * Keep track of the singleton. + * + * @generated + */ + private static Implementation plugin; - /** - * Create the instance. - * - * @generated - */ - public TreeEditPlugin() { - super(new ResourceLocator[] { ViewEditPlugin.INSTANCE, }); - } + /** + * Create the instance. + * + * @generated + */ + public TreeEditPlugin() { + super(new ResourceLocator[] { ViewEditPlugin.INSTANCE, }); + } - /** - * Returns the singleton instance of the Eclipse plugin. - * - * - * @return the singleton instance. - * @generated - */ - @Override - public ResourceLocator getPluginResourceLocator() { - return plugin; - } + /** + * Returns the singleton instance of the Eclipse plugin. + * + * @return the singleton instance. + * @generated + */ + @Override + public ResourceLocator getPluginResourceLocator() { + return plugin; + } - /** - * Returns the singleton instance of the Eclipse plugin. - * - * - * @return the singleton instance. - * @generated - */ - public static Implementation getPlugin() { - return plugin; - } + /** + * Returns the singleton instance of the Eclipse plugin. + * + * @return the singleton instance. + * @generated + */ + public static Implementation getPlugin() { + return plugin; + } - @Override - protected Object doGetImage(String key) throws IOException { - URL url = new URL(this.getBaseURL() + "icons/" + key + extensionFor(key)); - InputStream inputStream = url.openStream(); - inputStream.close(); - return url; - } + @Override + protected Object doGetImage(String key) throws IOException { + URL url = new URL(this.getBaseURL() + "icons/" + key + extensionFor(key)); + InputStream inputStream = url.openStream(); + inputStream.close(); + return url; + } - /** - * Computes the file extension to be used with the key to specify an image - * resource. - * - * @param key the key for the imagine. - * @return the file extension to be used with the key to specify an image - * resource. - */ - protected static String extensionFor(String key) { - String result = ".gif"; - int index = key.lastIndexOf('.'); - if (index != -1) { - String extension = key.substring(index + 1); - if ("png".equalsIgnoreCase(extension) || "gif".equalsIgnoreCase(extension) - || "bmp".equalsIgnoreCase(extension) || "ico".equalsIgnoreCase(extension) - || "jpg".equalsIgnoreCase(extension) || "jpeg".equalsIgnoreCase(extension) - || "tif".equalsIgnoreCase(extension) || "tiff".equalsIgnoreCase(extension) - || "svg".equalsIgnoreCase(extension)) { - result = ""; - } - } - return result; - } + /** + * Computes the file extension to be used with the key to specify an image resource. + * + * @param key + * the key for the imagine. + * @return the file extension to be used with the key to specify an image resource. + */ + protected static String extensionFor(String key) { + String result = ".gif"; + int index = key.lastIndexOf('.'); + if (index != -1) { + String extension = key.substring(index + 1); + if ("png".equalsIgnoreCase(extension) || "gif".equalsIgnoreCase(extension) || "bmp".equalsIgnoreCase(extension) || "ico".equalsIgnoreCase(extension) || "jpg".equalsIgnoreCase(extension) + || "jpeg".equalsIgnoreCase(extension) || "tif".equalsIgnoreCase(extension) || "tiff".equalsIgnoreCase(extension) || "svg".equalsIgnoreCase(extension)) { + result = ""; + } + } + return result; + } - /** - * The actual implementation of the Eclipse Plugin. - * - * @generated - */ - public static class Implementation extends EclipsePlugin { + /** + * The actual implementation of the Eclipse Plugin. + * + * @generated + */ + public static class Implementation extends EclipsePlugin { - /** - * Creates an instance. - * - * @generated - */ - public Implementation() { - super(); + /** + * Creates an instance. + * + * @generated + */ + public Implementation() { + super(); - // Remember the static instance. - // - plugin = this; - } - } + // Remember the static instance. + // + plugin = this; + } + } } diff --git a/packages/view/backend/sirius-components-view-tree-edit/src/main/java/org/eclipse/sirius/components/view/tree/provider/TreeItemContextMenuEntryItemProvider.java b/packages/view/backend/sirius-components-view-tree-edit/src/main/java/org/eclipse/sirius/components/view/tree/provider/TreeItemContextMenuEntryItemProvider.java index 11848805de..aeb4bde666 100644 --- a/packages/view/backend/sirius-components-view-tree-edit/src/main/java/org/eclipse/sirius/components/view/tree/provider/TreeItemContextMenuEntryItemProvider.java +++ b/packages/view/backend/sirius-components-view-tree-edit/src/main/java/org/eclipse/sirius/components/view/tree/provider/TreeItemContextMenuEntryItemProvider.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2024 Obeo. + * Copyright (c) 2024, 2025 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 @@ -33,18 +33,16 @@ import org.eclipse.sirius.components.view.tree.TreePackage; /** - * This is the item provider adapter for a - * {@link org.eclipse.sirius.components.view.tree.TreeItemContextMenuEntry} + * This is the item provider adapter for a {@link org.eclipse.sirius.components.view.tree.TreeItemContextMenuEntry} * object. * * @generated */ -public class TreeItemContextMenuEntryItemProvider extends ItemProviderAdapter implements IEditingDomainItemProvider, - IStructuredItemContentProvider, ITreeItemContentProvider, IItemLabelProvider, IItemPropertySource { +public class TreeItemContextMenuEntryItemProvider extends ItemProviderAdapter + implements IEditingDomainItemProvider, IStructuredItemContentProvider, ITreeItemContentProvider, IItemLabelProvider, IItemPropertySource { /** - * This constructs an instance from a factory and a notifier. + * This constructs an instance from a factory and a notifier. * * @generated */ @@ -53,8 +51,7 @@ public TreeItemContextMenuEntryItemProvider(AdapterFactory adapterFactory) { } /** - * This returns the property descriptors for the adapted class. + * This returns the property descriptors for the adapted class. * * @generated */ @@ -64,76 +61,34 @@ public List getPropertyDescriptors(Object object) { super.getPropertyDescriptors(object); this.addNamePropertyDescriptor(object); - this.addLabelExpressionPropertyDescriptor(object); - this.addIconURLExpressionPropertyDescriptor(object); this.addPreconditionExpressionPropertyDescriptor(object); } return this.itemPropertyDescriptors; } /** - * This adds a property descriptor for the Name feature. - * + * This adds a property descriptor for the Name feature. * * @generated */ protected void addNamePropertyDescriptor(Object object) { - this.itemPropertyDescriptors.add(this.createItemPropertyDescriptor( - ((ComposeableAdapterFactory) this.adapterFactory).getRootAdapterFactory(), this.getResourceLocator(), + this.itemPropertyDescriptors.add(this.createItemPropertyDescriptor(((ComposeableAdapterFactory) this.adapterFactory).getRootAdapterFactory(), this.getResourceLocator(), this.getString("_UI_TreeItemContextMenuEntry_name_feature"), - this.getString("_UI_PropertyDescriptor_description", "_UI_TreeItemContextMenuEntry_name_feature", - "_UI_TreeItemContextMenuEntry_type"), - TreePackage.Literals.TREE_ITEM_CONTEXT_MENU_ENTRY__NAME, true, false, false, - ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); + this.getString("_UI_PropertyDescriptor_description", "_UI_TreeItemContextMenuEntry_name_feature", "_UI_TreeItemContextMenuEntry_type"), + TreePackage.Literals.TREE_ITEM_CONTEXT_MENU_ENTRY__NAME, true, false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); } /** - * This adds a property descriptor for the Label Expression feature. - * - * @generated - */ - protected void addLabelExpressionPropertyDescriptor(Object object) { - this.itemPropertyDescriptors.add(this.createItemPropertyDescriptor( - ((ComposeableAdapterFactory) this.adapterFactory).getRootAdapterFactory(), this.getResourceLocator(), - this.getString("_UI_TreeItemContextMenuEntry_labelExpression_feature"), - this.getString("_UI_PropertyDescriptor_description", "_UI_TreeItemContextMenuEntry_labelExpression_feature", - "_UI_TreeItemContextMenuEntry_type"), - TreePackage.Literals.TREE_ITEM_CONTEXT_MENU_ENTRY__LABEL_EXPRESSION, true, false, false, - ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); - } - - /** - * This adds a property descriptor for the Icon URL Expression feature. - * - * @generated - */ - protected void addIconURLExpressionPropertyDescriptor(Object object) { - this.itemPropertyDescriptors.add(this.createItemPropertyDescriptor( - ((ComposeableAdapterFactory) this.adapterFactory).getRootAdapterFactory(), this.getResourceLocator(), - this.getString("_UI_TreeItemContextMenuEntry_iconURLExpression_feature"), - this.getString("_UI_PropertyDescriptor_description", - "_UI_TreeItemContextMenuEntry_iconURLExpression_feature", "_UI_TreeItemContextMenuEntry_type"), - TreePackage.Literals.TREE_ITEM_CONTEXT_MENU_ENTRY__ICON_URL_EXPRESSION, true, false, false, - ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); - } - - /** - * This adds a property descriptor for the Precondition Expression feature. + * This adds a property descriptor for the Precondition Expression feature. * * @generated */ protected void addPreconditionExpressionPropertyDescriptor(Object object) { - this.itemPropertyDescriptors - .add(this.createItemPropertyDescriptor(((ComposeableAdapterFactory) this.adapterFactory).getRootAdapterFactory(), - this.getResourceLocator(), this.getString("_UI_TreeItemContextMenuEntry_preconditionExpression_feature"), - this.getString("_UI_PropertyDescriptor_description", - "_UI_TreeItemContextMenuEntry_preconditionExpression_feature", - "_UI_TreeItemContextMenuEntry_type"), - TreePackage.Literals.TREE_ITEM_CONTEXT_MENU_ENTRY__PRECONDITION_EXPRESSION, true, false, false, - ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); + this.itemPropertyDescriptors.add(this.createItemPropertyDescriptor(((ComposeableAdapterFactory) this.adapterFactory).getRootAdapterFactory(), this.getResourceLocator(), + this.getString("_UI_TreeItemContextMenuEntry_preconditionExpression_feature"), + this.getString("_UI_PropertyDescriptor_description", "_UI_TreeItemContextMenuEntry_preconditionExpression_feature", "_UI_TreeItemContextMenuEntry_type"), + TreePackage.Literals.TREE_ITEM_CONTEXT_MENU_ENTRY__PRECONDITION_EXPRESSION, true, false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); } /** @@ -147,22 +102,20 @@ protected boolean shouldComposeCreationImage() { } /** - * This returns the label text for the adapted class. - * + * This returns the label text for the adapted class. * * @generated */ @Override public String getText(Object object) { String label = ((TreeItemContextMenuEntry) object).getName(); - return label == null || label.length() == 0 ? this.getString("_UI_TreeItemContextMenuEntry_type") - : this.getString("_UI_TreeItemContextMenuEntry_type") + " " + label; + return label == null || label.length() == 0 ? this.getString("_UI_TreeItemContextMenuEntry_type") : this.getString("_UI_TreeItemContextMenuEntry_type") + " " + label; } /** - * This handles model notifications by calling {@link #updateChildren} to update - * any cached children and by creating a viewer notification, which it passes to - * {@link #fireNotifyChanged}. + * This handles model notifications by calling {@link #updateChildren} to update any cached children and by creating + * a viewer notification, which it passes to {@link #fireNotifyChanged}. * * @generated */ @@ -172,8 +125,6 @@ public void notifyChanged(Notification notification) { switch (notification.getFeatureID(TreeItemContextMenuEntry.class)) { case TreePackage.TREE_ITEM_CONTEXT_MENU_ENTRY__NAME: - case TreePackage.TREE_ITEM_CONTEXT_MENU_ENTRY__LABEL_EXPRESSION: - case TreePackage.TREE_ITEM_CONTEXT_MENU_ENTRY__ICON_URL_EXPRESSION: case TreePackage.TREE_ITEM_CONTEXT_MENU_ENTRY__PRECONDITION_EXPRESSION: this.fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true)); return; @@ -182,9 +133,8 @@ public void notifyChanged(Notification notification) { } /** - * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing - * the children that can be created under this object. - * + * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children that can be created + * under this object. * * @generated */ @@ -194,8 +144,7 @@ protected void collectNewChildDescriptors(Collection newChildDescriptors } /** - * Return the resource locator for this item provider's resources. + * Return the resource locator for this item provider's resources. * * @generated */ diff --git a/packages/view/backend/sirius-components-view-tree-edit/src/main/java/org/eclipse/sirius/components/view/tree/provider/TreeItemLabelDescriptionItemProvider.java b/packages/view/backend/sirius-components-view-tree-edit/src/main/java/org/eclipse/sirius/components/view/tree/provider/TreeItemLabelDescriptionItemProvider.java index f8adc7af4c..e451fc55a2 100644 --- a/packages/view/backend/sirius-components-view-tree-edit/src/main/java/org/eclipse/sirius/components/view/tree/provider/TreeItemLabelDescriptionItemProvider.java +++ b/packages/view/backend/sirius-components-view-tree-edit/src/main/java/org/eclipse/sirius/components/view/tree/provider/TreeItemLabelDescriptionItemProvider.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2024 Obeo. + * Copyright (c) 2024, 2025 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 @@ -35,188 +35,169 @@ import org.eclipse.sirius.components.view.tree.TreePackage; /** - * This is the item provider adapter for a - * {@link org.eclipse.sirius.components.view.tree.TreeItemLabelDescription} + * This is the item provider adapter for a {@link org.eclipse.sirius.components.view.tree.TreeItemLabelDescription} * object. * * @generated */ -public class TreeItemLabelDescriptionItemProvider extends ItemProviderAdapter implements IEditingDomainItemProvider, - IStructuredItemContentProvider, ITreeItemContentProvider, IItemLabelProvider, IItemPropertySource { - - /** - * This constructs an instance from a factory and a notifier. - * - * @generated - */ - public TreeItemLabelDescriptionItemProvider(AdapterFactory adapterFactory) { - super(adapterFactory); - } - - /** - * This returns the property descriptors for the adapted class. - * - * @generated - */ - @Override - public List getPropertyDescriptors(Object object) { - if (itemPropertyDescriptors == null) { - super.getPropertyDescriptors(object); - - addNamePropertyDescriptor(object); - addPreconditionExpressionPropertyDescriptor(object); - } - return itemPropertyDescriptors; - } - - /** - * This adds a property descriptor for the Name feature. - * - * - * @generated - */ - protected void addNamePropertyDescriptor(Object object) { - itemPropertyDescriptors.add(createItemPropertyDescriptor( - ((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getResourceLocator(), - getString("_UI_TreeItemLabelDescription_name_feature"), - getString("_UI_PropertyDescriptor_description", "_UI_TreeItemLabelDescription_name_feature", - "_UI_TreeItemLabelDescription_type"), - TreePackage.Literals.TREE_ITEM_LABEL_DESCRIPTION__NAME, true, false, false, - ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); - } - - /** - * This adds a property descriptor for the Precondition Expression feature. - * - * @generated - */ - protected void addPreconditionExpressionPropertyDescriptor(Object object) { - itemPropertyDescriptors - .add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), - getResourceLocator(), getString("_UI_TreeItemLabelDescription_preconditionExpression_feature"), - getString("_UI_PropertyDescriptor_description", - "_UI_TreeItemLabelDescription_preconditionExpression_feature", - "_UI_TreeItemLabelDescription_type"), - TreePackage.Literals.TREE_ITEM_LABEL_DESCRIPTION__PRECONDITION_EXPRESSION, true, false, false, - ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); - } - - /** - * This specifies how to implement {@link #getChildren} and is used to deduce an - * appropriate feature for an {@link org.eclipse.emf.edit.command.AddCommand}, - * {@link org.eclipse.emf.edit.command.RemoveCommand} or - * {@link org.eclipse.emf.edit.command.MoveCommand} in {@link #createCommand}. - * - * - * @generated - */ - @Override - public Collection getChildrenFeatures(Object object) { - if (childrenFeatures == null) { - super.getChildrenFeatures(object); - childrenFeatures.add(TreePackage.Literals.TREE_ITEM_LABEL_DESCRIPTION__CHILDREN); - } - return childrenFeatures; - } - - /** - * - * - * @generated - */ - @Override - protected EStructuralFeature getChildFeature(Object object, Object child) { - // Check the type of the specified child object and return the proper feature to - // use for - // adding (see {@link AddCommand}) it as a child. - - return super.getChildFeature(object, child); - } - - /** - * This returns TreeItemLabelDescription.gif. - * - * @generated NOT - */ - @Override - public Object getImage(Object object) { - return this.overlayImage(object, this.getResourceLocator().getImage("full/obj16/TreeItemLabelDescription.svg")); - } - - /** - * - * - * @generated - */ - @Override - protected boolean shouldComposeCreationImage() { - return true; - } - - /** - * This returns the label text for the adapted class. - * - * - * @generated - */ - @Override - public String getText(Object object) { - String label = ((TreeItemLabelDescription) object).getName(); - return label == null || label.length() == 0 ? getString("_UI_TreeItemLabelDescription_type") - : getString("_UI_TreeItemLabelDescription_type") + " " + label; - } - - /** - * This handles model notifications by calling {@link #updateChildren} to update - * any cached children and by creating a viewer notification, which it passes to - * {@link #fireNotifyChanged}. - * - * @generated - */ - @Override - public void notifyChanged(Notification notification) { - updateChildren(notification); - - switch (notification.getFeatureID(TreeItemLabelDescription.class)) { - case TreePackage.TREE_ITEM_LABEL_DESCRIPTION__NAME: - case TreePackage.TREE_ITEM_LABEL_DESCRIPTION__PRECONDITION_EXPRESSION: - fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true)); - return; - case TreePackage.TREE_ITEM_LABEL_DESCRIPTION__CHILDREN: - fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, false)); - return; - } - super.notifyChanged(notification); - } - - /** - * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing - * the children that can be created under this object. - * - * - * @generated - */ - @Override - protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { - super.collectNewChildDescriptors(newChildDescriptors, object); - - newChildDescriptors.add(createChildParameter(TreePackage.Literals.TREE_ITEM_LABEL_DESCRIPTION__CHILDREN, - TreeFactory.eINSTANCE.createTreeItemLabelFragmentDescription())); - } - - /** - * Return the resource locator for this item provider's resources. - * - * @generated - */ - @Override - public ResourceLocator getResourceLocator() { - return ((IChildCreationExtender) adapterFactory).getResourceLocator(); - } +public class TreeItemLabelDescriptionItemProvider extends ItemProviderAdapter + implements IEditingDomainItemProvider, IStructuredItemContentProvider, ITreeItemContentProvider, IItemLabelProvider, IItemPropertySource { + + /** + * This constructs an instance from a factory and a notifier. + * + * @generated + */ + public TreeItemLabelDescriptionItemProvider(AdapterFactory adapterFactory) { + super(adapterFactory); + } + + /** + * This returns the property descriptors for the adapted class. + * + * @generated + */ + @Override + public List getPropertyDescriptors(Object object) { + if (this.itemPropertyDescriptors == null) { + super.getPropertyDescriptors(object); + + this.addNamePropertyDescriptor(object); + this.addPreconditionExpressionPropertyDescriptor(object); + } + return this.itemPropertyDescriptors; + } + + /** + * This adds a property descriptor for the Name feature. + * + * @generated + */ + protected void addNamePropertyDescriptor(Object object) { + this.itemPropertyDescriptors.add(this.createItemPropertyDescriptor(((ComposeableAdapterFactory) this.adapterFactory).getRootAdapterFactory(), this.getResourceLocator(), + this.getString("_UI_TreeItemLabelDescription_name_feature"), + this.getString("_UI_PropertyDescriptor_description", "_UI_TreeItemLabelDescription_name_feature", "_UI_TreeItemLabelDescription_type"), + TreePackage.Literals.TREE_ITEM_LABEL_DESCRIPTION__NAME, true, false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); + } + + /** + * This adds a property descriptor for the Precondition Expression feature. + * + * @generated + */ + protected void addPreconditionExpressionPropertyDescriptor(Object object) { + this.itemPropertyDescriptors.add(this.createItemPropertyDescriptor(((ComposeableAdapterFactory) this.adapterFactory).getRootAdapterFactory(), this.getResourceLocator(), + this.getString("_UI_TreeItemLabelDescription_preconditionExpression_feature"), + this.getString("_UI_PropertyDescriptor_description", "_UI_TreeItemLabelDescription_preconditionExpression_feature", "_UI_TreeItemLabelDescription_type"), + TreePackage.Literals.TREE_ITEM_LABEL_DESCRIPTION__PRECONDITION_EXPRESSION, true, false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); + } + + /** + * This specifies how to implement {@link #getChildren} and is used to deduce an appropriate feature for an + * {@link org.eclipse.emf.edit.command.AddCommand}, {@link org.eclipse.emf.edit.command.RemoveCommand} or + * {@link org.eclipse.emf.edit.command.MoveCommand} in {@link #createCommand}. + * + * @generated + */ + @Override + public Collection getChildrenFeatures(Object object) { + if (this.childrenFeatures == null) { + super.getChildrenFeatures(object); + this.childrenFeatures.add(TreePackage.Literals.TREE_ITEM_LABEL_DESCRIPTION__CHILDREN); + } + return this.childrenFeatures; + } + + /** + * + * + * @generated + */ + @Override + protected EStructuralFeature getChildFeature(Object object, Object child) { + // Check the type of the specified child object and return the proper feature to use for + // adding (see {@link AddCommand}) it as a child. + + return super.getChildFeature(object, child); + } + + /** + * This returns TreeItemLabelDescription.gif. + * + * @generated NOT + */ + @Override + public Object getImage(Object object) { + return this.overlayImage(object, this.getResourceLocator().getImage("full/obj16/TreeItemLabelDescription.svg")); + } + + /** + * + * + * @generated + */ + @Override + protected boolean shouldComposeCreationImage() { + return true; + } + + /** + * This returns the label text for the adapted class. + * + * @generated + */ + @Override + public String getText(Object object) { + String label = ((TreeItemLabelDescription) object).getName(); + return label == null || label.length() == 0 ? this.getString("_UI_TreeItemLabelDescription_type") : this.getString("_UI_TreeItemLabelDescription_type") + " " + label; + } + + /** + * This handles model notifications by calling {@link #updateChildren} to update any cached children and by creating + * a viewer notification, which it passes to {@link #fireNotifyChanged}. + * + * @generated + */ + @Override + public void notifyChanged(Notification notification) { + this.updateChildren(notification); + + switch (notification.getFeatureID(TreeItemLabelDescription.class)) { + case TreePackage.TREE_ITEM_LABEL_DESCRIPTION__NAME: + case TreePackage.TREE_ITEM_LABEL_DESCRIPTION__PRECONDITION_EXPRESSION: + this.fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true)); + return; + case TreePackage.TREE_ITEM_LABEL_DESCRIPTION__CHILDREN: + this.fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, false)); + return; + } + super.notifyChanged(notification); + } + + /** + * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children that can be created + * under this object. + * + * @generated + */ + @Override + protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { + super.collectNewChildDescriptors(newChildDescriptors, object); + + newChildDescriptors.add(this.createChildParameter(TreePackage.Literals.TREE_ITEM_LABEL_DESCRIPTION__CHILDREN, TreeFactory.eINSTANCE.createTreeItemLabelFragmentDescription())); + } + + /** + * Return the resource locator for this item provider's resources. + * + * @generated + */ + @Override + public ResourceLocator getResourceLocator() { + return ((IChildCreationExtender) this.adapterFactory).getResourceLocator(); + } } diff --git a/packages/view/backend/sirius-components-view-tree-edit/src/main/java/org/eclipse/sirius/components/view/tree/provider/TreeItemLabelElementDescriptionItemProvider.java b/packages/view/backend/sirius-components-view-tree-edit/src/main/java/org/eclipse/sirius/components/view/tree/provider/TreeItemLabelElementDescriptionItemProvider.java index f05ad8054d..ce6d60e35a 100644 --- a/packages/view/backend/sirius-components-view-tree-edit/src/main/java/org/eclipse/sirius/components/view/tree/provider/TreeItemLabelElementDescriptionItemProvider.java +++ b/packages/view/backend/sirius-components-view-tree-edit/src/main/java/org/eclipse/sirius/components/view/tree/provider/TreeItemLabelElementDescriptionItemProvider.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2024 Obeo. + * Copyright (c) 2024, 2025 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 @@ -29,94 +29,88 @@ /** * This is the item provider adapter for a - * {@link org.eclipse.sirius.components.view.tree.TreeItemLabelElementDescription} - * object. + * {@link org.eclipse.sirius.components.view.tree.TreeItemLabelElementDescription} object. * * @generated */ public class TreeItemLabelElementDescriptionItemProvider extends ItemProviderAdapter - implements IEditingDomainItemProvider, IStructuredItemContentProvider, ITreeItemContentProvider, - IItemLabelProvider, IItemPropertySource { - /** - * This constructs an instance from a factory and a notifier. - * - * @generated - */ - public TreeItemLabelElementDescriptionItemProvider(AdapterFactory adapterFactory) { - super(adapterFactory); - } + implements IEditingDomainItemProvider, IStructuredItemContentProvider, ITreeItemContentProvider, IItemLabelProvider, IItemPropertySource { + /** + * This constructs an instance from a factory and a notifier. + * + * @generated + */ + public TreeItemLabelElementDescriptionItemProvider(AdapterFactory adapterFactory) { + super(adapterFactory); + } - /** - * This returns the property descriptors for the adapted class. - * - * @generated - */ - @Override - public List getPropertyDescriptors(Object object) { - if (itemPropertyDescriptors == null) { - super.getPropertyDescriptors(object); + /** + * This returns the property descriptors for the adapted class. + * + * @generated + */ + @Override + public List getPropertyDescriptors(Object object) { + if (this.itemPropertyDescriptors == null) { + super.getPropertyDescriptors(object); - } - return itemPropertyDescriptors; - } + } + return this.itemPropertyDescriptors; + } - /** - * - * - * @generated - */ - @Override - protected boolean shouldComposeCreationImage() { - return true; - } + /** + * + * + * @generated + */ + @Override + protected boolean shouldComposeCreationImage() { + return true; + } - /** - * This returns the label text for the adapted class. - * - * - * @generated - */ - @Override - public String getText(Object object) { - return getString("_UI_TreeItemLabelElementDescription_type"); - } + /** + * This returns the label text for the adapted class. + * + * @generated + */ + @Override + public String getText(Object object) { + return this.getString("_UI_TreeItemLabelElementDescription_type"); + } - /** - * This handles model notifications by calling {@link #updateChildren} to update - * any cached children and by creating a viewer notification, which it passes to - * {@link #fireNotifyChanged}. - * - * @generated - */ - @Override - public void notifyChanged(Notification notification) { - updateChildren(notification); - super.notifyChanged(notification); - } + /** + * This handles model notifications by calling {@link #updateChildren} to update any cached children and by creating + * a viewer notification, which it passes to {@link #fireNotifyChanged}. + * + * @generated + */ + @Override + public void notifyChanged(Notification notification) { + this.updateChildren(notification); + super.notifyChanged(notification); + } - /** - * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing - * the children that can be created under this object. - * - * - * @generated - */ - @Override - protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { - super.collectNewChildDescriptors(newChildDescriptors, object); - } + /** + * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children that can be created + * under this object. + * + * @generated + */ + @Override + protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { + super.collectNewChildDescriptors(newChildDescriptors, object); + } - /** - * Return the resource locator for this item provider's resources. - * - * @generated - */ - @Override - public ResourceLocator getResourceLocator() { - return ((IChildCreationExtender) adapterFactory).getResourceLocator(); - } + /** + * Return the resource locator for this item provider's resources. + * + * @generated + */ + @Override + public ResourceLocator getResourceLocator() { + return ((IChildCreationExtender) this.adapterFactory).getResourceLocator(); + } } diff --git a/packages/view/backend/sirius-components-view-tree-edit/src/main/java/org/eclipse/sirius/components/view/tree/provider/TreeItemLabelFragmentDescriptionItemProvider.java b/packages/view/backend/sirius-components-view-tree-edit/src/main/java/org/eclipse/sirius/components/view/tree/provider/TreeItemLabelFragmentDescriptionItemProvider.java index 7bbd965cb5..0127d8b32a 100644 --- a/packages/view/backend/sirius-components-view-tree-edit/src/main/java/org/eclipse/sirius/components/view/tree/provider/TreeItemLabelFragmentDescriptionItemProvider.java +++ b/packages/view/backend/sirius-components-view-tree-edit/src/main/java/org/eclipse/sirius/components/view/tree/provider/TreeItemLabelFragmentDescriptionItemProvider.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2024 Obeo. + * Copyright (c) 2024, 2025 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 @@ -26,136 +26,121 @@ /** * This is the item provider adapter for a - * {@link org.eclipse.sirius.components.view.tree.TreeItemLabelFragmentDescription} - * object. + * {@link org.eclipse.sirius.components.view.tree.TreeItemLabelFragmentDescription} object. * * @generated */ public class TreeItemLabelFragmentDescriptionItemProvider extends TreeItemLabelElementDescriptionItemProvider { - /** - * This constructs an instance from a factory and a notifier. - * - * @generated - */ - public TreeItemLabelFragmentDescriptionItemProvider(AdapterFactory adapterFactory) { - super(adapterFactory); - } + /** + * This constructs an instance from a factory and a notifier. + * + * @generated + */ + public TreeItemLabelFragmentDescriptionItemProvider(AdapterFactory adapterFactory) { + super(adapterFactory); + } - /** - * This returns the property descriptors for the adapted class. - * - * @generated - */ - @Override - public List getPropertyDescriptors(Object object) { - if (itemPropertyDescriptors == null) { - super.getPropertyDescriptors(object); + /** + * This returns the property descriptors for the adapted class. + * + * @generated + */ + @Override + public List getPropertyDescriptors(Object object) { + if (this.itemPropertyDescriptors == null) { + super.getPropertyDescriptors(object); - addLabelExpressionPropertyDescriptor(object); - addStylePropertyDescriptor(object); - } - return itemPropertyDescriptors; - } + this.addLabelExpressionPropertyDescriptor(object); + this.addStylePropertyDescriptor(object); + } + return this.itemPropertyDescriptors; + } - /** - * This adds a property descriptor for the Label Expression feature. - * - * @generated - */ - protected void addLabelExpressionPropertyDescriptor(Object object) { - itemPropertyDescriptors - .add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), - getResourceLocator(), getString("_UI_TreeItemLabelFragmentDescription_labelExpression_feature"), - getString("_UI_PropertyDescriptor_description", - "_UI_TreeItemLabelFragmentDescription_labelExpression_feature", - "_UI_TreeItemLabelFragmentDescription_type"), - TreePackage.Literals.TREE_ITEM_LABEL_FRAGMENT_DESCRIPTION__LABEL_EXPRESSION, true, false, false, - ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); - } + /** + * This adds a property descriptor for the Label Expression feature. + * + * @generated + */ + protected void addLabelExpressionPropertyDescriptor(Object object) { + this.itemPropertyDescriptors.add(this.createItemPropertyDescriptor(((ComposeableAdapterFactory) this.adapterFactory).getRootAdapterFactory(), this.getResourceLocator(), + this.getString("_UI_TreeItemLabelFragmentDescription_labelExpression_feature"), + this.getString("_UI_PropertyDescriptor_description", "_UI_TreeItemLabelFragmentDescription_labelExpression_feature", "_UI_TreeItemLabelFragmentDescription_type"), + TreePackage.Literals.TREE_ITEM_LABEL_FRAGMENT_DESCRIPTION__LABEL_EXPRESSION, true, false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); + } - /** - * This adds a property descriptor for the Style feature. - * - * @generated - */ - protected void addStylePropertyDescriptor(Object object) { - itemPropertyDescriptors.add(createItemPropertyDescriptor( - ((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getResourceLocator(), - getString("_UI_TreeItemLabelFragmentDescription_style_feature"), - getString("_UI_PropertyDescriptor_description", "_UI_TreeItemLabelFragmentDescription_style_feature", - "_UI_TreeItemLabelFragmentDescription_type"), - TreePackage.Literals.TREE_ITEM_LABEL_FRAGMENT_DESCRIPTION__STYLE, true, false, true, null, null, null)); - } + /** + * This adds a property descriptor for the Style feature. + * + * @generated + */ + protected void addStylePropertyDescriptor(Object object) { + this.itemPropertyDescriptors.add(this.createItemPropertyDescriptor(((ComposeableAdapterFactory) this.adapterFactory).getRootAdapterFactory(), this.getResourceLocator(), + this.getString("_UI_TreeItemLabelFragmentDescription_style_feature"), + this.getString("_UI_PropertyDescriptor_description", "_UI_TreeItemLabelFragmentDescription_style_feature", "_UI_TreeItemLabelFragmentDescription_type"), + TreePackage.Literals.TREE_ITEM_LABEL_FRAGMENT_DESCRIPTION__STYLE, true, false, true, null, null, null)); + } - /** - * This returns TreeItemLabelFragmentDescription.gif. - * - * - * @generated NOT - */ - @Override - public Object getImage(Object object) { - return this.overlayImage(object, - this.getResourceLocator().getImage("full/obj16/TreeItemLabelFragmentDescription.svg")); - } + /** + * This returns TreeItemLabelFragmentDescription.gif. + * + * @generated NOT + */ + @Override + public Object getImage(Object object) { + return this.overlayImage(object, this.getResourceLocator().getImage("full/obj16/TreeItemLabelFragmentDescription.svg")); + } - /** - * - * - * @generated - */ - @Override - protected boolean shouldComposeCreationImage() { - return true; - } + /** + * + * + * @generated + */ + @Override + protected boolean shouldComposeCreationImage() { + return true; + } - /** - * This returns the label text for the adapted class. - * - * - * @generated - */ - @Override - public String getText(Object object) { - String label = ((TreeItemLabelFragmentDescription) object).getLabelExpression(); - return label == null || label.length() == 0 ? getString("_UI_TreeItemLabelFragmentDescription_type") - : getString("_UI_TreeItemLabelFragmentDescription_type") + " " + label; - } + /** + * This returns the label text for the adapted class. + * + * @generated + */ + @Override + public String getText(Object object) { + String label = ((TreeItemLabelFragmentDescription) object).getLabelExpression(); + return label == null || label.length() == 0 ? this.getString("_UI_TreeItemLabelFragmentDescription_type") : this.getString("_UI_TreeItemLabelFragmentDescription_type") + " " + label; + } - /** - * This handles model notifications by calling {@link #updateChildren} to update - * any cached children and by creating a viewer notification, which it passes to - * {@link #fireNotifyChanged}. - * - * @generated - */ - @Override - public void notifyChanged(Notification notification) { - updateChildren(notification); + /** + * This handles model notifications by calling {@link #updateChildren} to update any cached children and by creating + * a viewer notification, which it passes to {@link #fireNotifyChanged}. + * + * @generated + */ + @Override + public void notifyChanged(Notification notification) { + this.updateChildren(notification); - switch (notification.getFeatureID(TreeItemLabelFragmentDescription.class)) { - case TreePackage.TREE_ITEM_LABEL_FRAGMENT_DESCRIPTION__LABEL_EXPRESSION: - fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true)); - return; - } - super.notifyChanged(notification); - } + switch (notification.getFeatureID(TreeItemLabelFragmentDescription.class)) { + case TreePackage.TREE_ITEM_LABEL_FRAGMENT_DESCRIPTION__LABEL_EXPRESSION: + this.fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true)); + return; + } + super.notifyChanged(notification); + } - /** - * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing - * the children that can be created under this object. - * - * - * @generated - */ - @Override - protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { - super.collectNewChildDescriptors(newChildDescriptors, object); - } + /** + * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children that can be created + * under this object. + * + * @generated + */ + @Override + protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { + super.collectNewChildDescriptors(newChildDescriptors, object); + } } diff --git a/packages/view/backend/sirius-components-view-tree-edit/src/main/java/org/eclipse/sirius/components/view/tree/provider/TreeItemProviderAdapterFactory.java b/packages/view/backend/sirius-components-view-tree-edit/src/main/java/org/eclipse/sirius/components/view/tree/provider/TreeItemProviderAdapterFactory.java index 3a0d307802..c1126e8cf6 100644 --- a/packages/view/backend/sirius-components-view-tree-edit/src/main/java/org/eclipse/sirius/components/view/tree/provider/TreeItemProviderAdapterFactory.java +++ b/packages/view/backend/sirius-components-view-tree-edit/src/main/java/org/eclipse/sirius/components/view/tree/provider/TreeItemProviderAdapterFactory.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2024 Obeo. + * Copyright (c) 2024, 2025 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 @@ -45,88 +45,85 @@ import org.eclipse.sirius.components.view.util.ViewSwitch; /** - * This is the factory that is used to provide the interfaces needed to support - * Viewers. The adapters generated by this factory convert EMF adapter - * notifications into calls to {@link #fireNotifyChanged fireNotifyChanged}. The - * adapters also support Eclipse property sheets. Note that most of the adapters - * are shared among multiple instances. + * This is the factory that is used to provide the interfaces needed to support Viewers. The adapters generated by this + * factory convert EMF adapter notifications into calls to {@link #fireNotifyChanged fireNotifyChanged}. The adapters + * also support Eclipse property sheets. Note that most of the adapters are shared among multiple instances. * * @generated */ -public class TreeItemProviderAdapterFactory extends TreeAdapterFactory - implements ComposeableAdapterFactory, IChangeNotifier, IDisposable, IChildCreationExtender { +public class TreeItemProviderAdapterFactory extends TreeAdapterFactory implements ComposeableAdapterFactory, IChangeNotifier, IDisposable, IChildCreationExtender { /** - * This keeps track of the root adapter factory that delegates to this adapter - * factory. + * This keeps track of the root adapter factory that delegates to this adapter factory. * * @generated */ protected ComposedAdapterFactory parentAdapterFactory; /** - * This is used to implement - * {@link org.eclipse.emf.edit.provider.IChangeNotifier}. + * This is used to implement {@link org.eclipse.emf.edit.provider.IChangeNotifier}. * * @generated */ protected IChangeNotifier changeNotifier = new ChangeNotifier(); /** - * This helps manage the child creation extenders. + * This helps manage the child creation extenders. * * @generated */ - protected ChildCreationExtenderManager childCreationExtenderManager = new ChildCreationExtenderManager( - TreeEditPlugin.INSTANCE, TreePackage.eNS_URI); + protected ChildCreationExtenderManager childCreationExtenderManager = new ChildCreationExtenderManager(TreeEditPlugin.INSTANCE, TreePackage.eNS_URI); /** - * This keeps track of all the supported types checked by - * {@link #isFactoryForType isFactoryForType}. + * This keeps track of all the supported types checked by {@link #isFactoryForType isFactoryForType}. * * @generated */ protected Collection supportedTypes = new ArrayList<>(); + /** - * This keeps track of the one adapter used for all - * {@link org.eclipse.sirius.components.view.tree.TreeDescription} instances. - * + * This keeps track of the one adapter used for all {@link org.eclipse.sirius.components.view.tree.TreeDescription} + * instances. * * @generated */ protected TreeDescriptionItemProvider treeDescriptionItemProvider; + /** * This keeps track of the one adapter used for all - * {@link org.eclipse.sirius.components.view.tree.TreeItemLabelDescription} - * instances. + * {@link org.eclipse.sirius.components.view.tree.TreeItemLabelDescription} instances. * * @generated */ protected TreeItemLabelDescriptionItemProvider treeItemLabelDescriptionItemProvider; + /** * This keeps track of the one adapter used for all - * {@link org.eclipse.sirius.components.view.tree.TreeItemLabelFragmentDescription} - * instances. + * {@link org.eclipse.sirius.components.view.tree.TreeItemLabelFragmentDescription} instances. * * @generated */ protected TreeItemLabelFragmentDescriptionItemProvider treeItemLabelFragmentDescriptionItemProvider; + /** * This keeps track of the one adapter used for all - * {@link org.eclipse.sirius.components.view.tree.SingleClickTreeItemContextMenuEntry} - * instances. + * {@link org.eclipse.sirius.components.view.tree.SingleClickTreeItemContextMenuEntry} instances. * * @generated */ protected SingleClickTreeItemContextMenuEntryItemProvider singleClickTreeItemContextMenuEntryItemProvider; + /** * This keeps track of the one adapter used for all - * {@link org.eclipse.sirius.components.view.tree.FetchTreeItemContextMenuEntry} - * instances. + * {@link org.eclipse.sirius.components.view.tree.FetchTreeItemContextMenuEntry} instances. + * * * @generated */ @@ -146,8 +143,7 @@ public TreeItemProviderAdapterFactory() { } /** - * This creates an adapter for a - * {@link org.eclipse.sirius.components.view.tree.TreeDescription}. * * @generated @@ -162,9 +158,8 @@ public Adapter createTreeDescriptionAdapter() { } /** - * This creates an adapter for a - * {@link org.eclipse.sirius.components.view.tree.TreeItemLabelDescription}. - * + * This creates an adapter for a {@link org.eclipse.sirius.components.view.tree.TreeItemLabelDescription}. * * @generated */ @@ -178,8 +173,7 @@ public Adapter createTreeItemLabelDescriptionAdapter() { } /** - * This creates an adapter for a - * {@link org.eclipse.sirius.components.view.tree.TreeItemLabelFragmentDescription}. + * This creates an adapter for a {@link org.eclipse.sirius.components.view.tree.TreeItemLabelFragmentDescription}. * * * @generated @@ -195,8 +189,8 @@ public Adapter createTreeItemLabelFragmentDescriptionAdapter() { /** * This creates an adapter for a - * {@link org.eclipse.sirius.components.view.tree.SingleClickTreeItemContextMenuEntry}. - * + * {@link org.eclipse.sirius.components.view.tree.SingleClickTreeItemContextMenuEntry}. * * @generated */ @@ -210,9 +204,8 @@ public Adapter createSingleClickTreeItemContextMenuEntryAdapter() { } /** - * This creates an adapter for a - * {@link org.eclipse.sirius.components.view.tree.FetchTreeItemContextMenuEntry}. - * + * This creates an adapter for a {@link org.eclipse.sirius.components.view.tree.FetchTreeItemContextMenuEntry}. * * @generated */ @@ -226,8 +219,31 @@ public Adapter createFetchTreeItemContextMenuEntryAdapter() { } /** - * This returns the root adapter factory that contains this factory. + * This keeps track of the one adapter used for all + * {@link org.eclipse.sirius.components.view.tree.CustomTreeItemContextMenuEntry} instances. + * + * + * @generated + */ + protected CustomTreeItemContextMenuEntryItemProvider customTreeItemContextMenuEntryItemProvider; + + /** + * This creates an adapter for a {@link org.eclipse.sirius.components.view.tree.CustomTreeItemContextMenuEntry}. + * + * + * @generated + */ + @Override + public Adapter createCustomTreeItemContextMenuEntryAdapter() { + if (this.customTreeItemContextMenuEntryItemProvider == null) { + this.customTreeItemContextMenuEntryItemProvider = new CustomTreeItemContextMenuEntryItemProvider(this); + } + + return this.customTreeItemContextMenuEntryItemProvider; + } + + /** + * This returns the root adapter factory that contains this factory. * * @generated */ @@ -237,8 +253,7 @@ public ComposeableAdapterFactory getRootAdapterFactory() { } /** - * This sets the composed adapter factory that contains this factory. + * This sets the composed adapter factory that contains this factory. * * @generated */ @@ -258,8 +273,8 @@ public boolean isFactoryForType(Object type) { } /** - * This implementation substitutes the factory itself as the key for the - * adapter. + * This implementation substitutes the factory itself as the key for the adapter. * * @generated */ @@ -335,8 +350,8 @@ public void removeListener(INotifyChangedListener notifyChangedListener) { } /** - * This delegates to {@link #changeNotifier} and to - * {@link #parentAdapterFactory}. + * This delegates to {@link #changeNotifier} and to {@link #parentAdapterFactory}. * * @generated */ @@ -350,28 +365,34 @@ public void fireNotifyChanged(Notification notification) { } /** - * This disposes all of the item providers created by this factory. + * This disposes all of the item providers created by this factory. * * @generated */ @Override public void dispose() { - if (this.treeDescriptionItemProvider != null) + if (this.treeDescriptionItemProvider != null) { this.treeDescriptionItemProvider.dispose(); - if (this.treeItemLabelDescriptionItemProvider != null) + } + if (this.treeItemLabelDescriptionItemProvider != null) { this.treeItemLabelDescriptionItemProvider.dispose(); - if (this.treeItemLabelFragmentDescriptionItemProvider != null) + } + if (this.treeItemLabelFragmentDescriptionItemProvider != null) { this.treeItemLabelFragmentDescriptionItemProvider.dispose(); - if (this.singleClickTreeItemContextMenuEntryItemProvider != null) + } + if (this.singleClickTreeItemContextMenuEntryItemProvider != null) { this.singleClickTreeItemContextMenuEntryItemProvider.dispose(); - if (this.fetchTreeItemContextMenuEntryItemProvider != null) + } + if (this.fetchTreeItemContextMenuEntryItemProvider != null) { this.fetchTreeItemContextMenuEntryItemProvider.dispose(); + } + if (this.customTreeItemContextMenuEntryItemProvider != null) { + this.customTreeItemContextMenuEntryItemProvider.dispose(); + } } /** - * A child creation extender for the {@link ViewPackage}. + * A child creation extender for the {@link ViewPackage}. * * @generated */ @@ -400,32 +421,30 @@ public ResourceLocator getResourceLocator() { } /** - * The switch for creating child descriptors specific to each extended class. - * + * The switch for creating child descriptors specific to each extended class. * * @generated */ protected static class CreationSwitch extends ViewSwitch { /** - * The child descriptors being populated. + * The child descriptors being populated. * * @generated */ protected List newChildDescriptors; /** - * The domain in which to create the children. + * The domain in which to create the children. * * @generated */ protected EditingDomain editingDomain; /** - * Creates the a switch for populating child descriptors in the given domain. - * + * Creates the a switch for populating child descriptors in the given domain. * * @generated */ @@ -444,8 +463,7 @@ public Object caseView(View object) { TreeDescription treeDescription = TreeFactory.eINSTANCE.createTreeDescription(); treeDescription.setName("New Tree Description"); treeDescription.setTitleExpression("aql:'New Tree Representation'"); - this.newChildDescriptors - .add(this.createChildParameter(ViewPackage.Literals.VIEW__DESCRIPTIONS, treeDescription)); + this.newChildDescriptors.add(this.createChildParameter(ViewPackage.Literals.VIEW__DESCRIPTIONS, treeDescription)); return null; } diff --git a/packages/view/backend/sirius-components-view-tree-edit/src/main/resources/icons/full/obj16/CustomTreeItemContextMenuEntry.svg b/packages/view/backend/sirius-components-view-tree-edit/src/main/resources/icons/full/obj16/CustomTreeItemContextMenuEntry.svg new file mode 100644 index 0000000000..e87fea7d03 --- /dev/null +++ b/packages/view/backend/sirius-components-view-tree-edit/src/main/resources/icons/full/obj16/CustomTreeItemContextMenuEntry.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/packages/view/backend/sirius-components-view-tree-edit/src/main/resources/plugin.properties b/packages/view/backend/sirius-components-view-tree-edit/src/main/resources/plugin.properties index 70f930dd1a..99d8accbb3 100644 --- a/packages/view/backend/sirius-components-view-tree-edit/src/main/resources/plugin.properties +++ b/packages/view/backend/sirius-components-view-tree-edit/src/main/resources/plugin.properties @@ -1,5 +1,5 @@ ################################################################################ -# Copyright (c) 2024 Obeo. +# Copyright (c) 2024, 2025 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 @@ -28,6 +28,7 @@ _UI_TreeItemLabelDescription_type = Item Label Description _UI_TreeItemLabelFragmentDescription_type = Item Label Fragment Description _UI_TreeItemLabelElementDescription_type = Item Label Element Description _UI_TreeItemContextMenuEntry_type = Item Context Menu Entry +_UI_CustomTreeItemContextMenuEntry_type = Custom Tree Item Context Menu Entry _UI_SingleClickTreeItemContextMenuEntry_type = Single Click Tree Item Context Menu Entry _UI_FetchTreeItemContextMenuEntry_type = Fetch Tree Item Context Menu Entry _UI_Unknown_type = Object @@ -53,10 +54,13 @@ _UI_TreeItemLabelDescription_children_feature = Children _UI_TreeItemLabelFragmentDescription_labelExpression_feature = Label Expression _UI_TreeItemLabelFragmentDescription_style_feature = Style _UI_TreeItemContextMenuEntry_name_feature = Name -_UI_TreeItemContextMenuEntry_labelExpression_feature = Label Expression -_UI_TreeItemContextMenuEntry_iconURLExpression_feature = Icon URL Expression _UI_TreeItemContextMenuEntry_preconditionExpression_feature = Precondition Expression +_UI_CustomTreeItemContextMenuEntry_contributionId_feature = Contribution ID +_UI_SingleClickTreeItemContextMenuEntry_labelExpression_feature = Label Expression +_UI_SingleClickTreeItemContextMenuEntry_iconURLExpression_feature = Icon URL Expression _UI_SingleClickTreeItemContextMenuEntry_body_feature = Body +_UI_FetchTreeItemContextMenuEntry_labelExpression_feature = Label Expression +_UI_FetchTreeItemContextMenuEntry_iconURLExpression_feature = Icon URL Expression _UI_FetchTreeItemContextMenuEntry_urlExression_feature = Url Exression _UI_FetchTreeItemContextMenuEntry_kind_feature = Kind _UI_Unknown_feature = Unspecified diff --git a/packages/view/backend/sirius-components-view-tree/src/main/java/org/eclipse/sirius/components/view/tree/CustomTreeItemContextMenuEntry.java b/packages/view/backend/sirius-components-view-tree/src/main/java/org/eclipse/sirius/components/view/tree/CustomTreeItemContextMenuEntry.java new file mode 100644 index 0000000000..1781732708 --- /dev/null +++ b/packages/view/backend/sirius-components-view-tree/src/main/java/org/eclipse/sirius/components/view/tree/CustomTreeItemContextMenuEntry.java @@ -0,0 +1,56 @@ +/******************************************************************************* + * Copyright (c) 2025 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.sirius.components.view.tree; + +/** + * A representation of the model object 'Custom Tree Item Context Menu Entry'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link org.eclipse.sirius.components.view.tree.CustomTreeItemContextMenuEntry#getContributionId Contribution + * Id}
  • + *
+ * + * @see org.eclipse.sirius.components.view.tree.TreePackage#getCustomTreeItemContextMenuEntry() + * @model + * @generated + */ +public interface CustomTreeItemContextMenuEntry extends TreeItemContextMenuEntry { + /** + * Returns the value of the 'Contribution Id' attribute. + * + * @return the value of the 'Contribution Id' attribute. + * @see #setContributionId(String) + * @see org.eclipse.sirius.components.view.tree.TreePackage#getCustomTreeItemContextMenuEntry_ContributionId() + * @model dataType="org.eclipse.sirius.components.view.Identifier" + * @generated + */ + String getContributionId(); + + /** + * Sets the value of the + * '{@link org.eclipse.sirius.components.view.tree.CustomTreeItemContextMenuEntry#getContributionId Contribution + * Id}' attribute. + * + * @param value + * the new value of the 'Contribution Id' attribute. + * @see #getContributionId() + * @generated + */ + void setContributionId(String value); + +} // CustomTreeItemContextMenuEntry diff --git a/packages/view/backend/sirius-components-view-tree/src/main/java/org/eclipse/sirius/components/view/tree/FetchTreeItemContextMenuEntry.java b/packages/view/backend/sirius-components-view-tree/src/main/java/org/eclipse/sirius/components/view/tree/FetchTreeItemContextMenuEntry.java index 662f01767f..f9e736b54b 100644 --- a/packages/view/backend/sirius-components-view-tree/src/main/java/org/eclipse/sirius/components/view/tree/FetchTreeItemContextMenuEntry.java +++ b/packages/view/backend/sirius-components-view-tree/src/main/java/org/eclipse/sirius/components/view/tree/FetchTreeItemContextMenuEntry.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2024 Obeo. + * Copyright (c) 2024, 2025 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 @@ -23,6 +23,10 @@ *
  • {@link org.eclipse.sirius.components.view.tree.FetchTreeItemContextMenuEntry#getUrlExression Url * Exression}
  • *
  • {@link org.eclipse.sirius.components.view.tree.FetchTreeItemContextMenuEntry#getKind Kind}
  • + *
  • {@link org.eclipse.sirius.components.view.tree.FetchTreeItemContextMenuEntry#getLabelExpression Label + * Expression}
  • + *
  • {@link org.eclipse.sirius.components.view.tree.FetchTreeItemContextMenuEntry#getIconURLExpression Icon URL + * Expression}
  • * * * @see org.eclipse.sirius.components.view.tree.TreePackage#getFetchTreeItemContextMenuEntry() @@ -79,4 +83,52 @@ public interface FetchTreeItemContextMenuEntry extends TreeItemContextMenuEntry */ void setKind(FetchTreeItemContextMenuEntryKind value); + /** + * Returns the value of the 'Label Expression' attribute. + * + * @return the value of the 'Label Expression' attribute. + * @see #setLabelExpression(String) + * @see org.eclipse.sirius.components.view.tree.TreePackage#getFetchTreeItemContextMenuEntry_LabelExpression() + * @model dataType="org.eclipse.sirius.components.view.InterpretedExpression" + * @generated + */ + String getLabelExpression(); + + /** + * Sets the value of the + * '{@link org.eclipse.sirius.components.view.tree.FetchTreeItemContextMenuEntry#getLabelExpression Label + * Expression}' attribute. + * + * @param value + * the new value of the 'Label Expression' attribute. + * @see #getLabelExpression() + * @generated + */ + void setLabelExpression(String value); + + /** + * Returns the value of the 'Icon URL Expression' attribute. + * + * @return the value of the 'Icon URL Expression' attribute. + * @see #setIconURLExpression(String) + * @see org.eclipse.sirius.components.view.tree.TreePackage#getFetchTreeItemContextMenuEntry_IconURLExpression() + * @model dataType="org.eclipse.sirius.components.view.InterpretedExpression" + * @generated + */ + String getIconURLExpression(); + + /** + * Sets the value of the + * '{@link org.eclipse.sirius.components.view.tree.FetchTreeItemContextMenuEntry#getIconURLExpression Icon URL + * Expression}' attribute. + * + * @param value + * the new value of the 'Icon URL Expression' attribute. + * @see #getIconURLExpression() + * @generated + */ + void setIconURLExpression(String value); + } // FetchTreeItemContextMenuEntry diff --git a/packages/view/backend/sirius-components-view-tree/src/main/java/org/eclipse/sirius/components/view/tree/FetchTreeItemContextMenuEntryKind.java b/packages/view/backend/sirius-components-view-tree/src/main/java/org/eclipse/sirius/components/view/tree/FetchTreeItemContextMenuEntryKind.java index b73266549a..fee9bb3bc5 100644 --- a/packages/view/backend/sirius-components-view-tree/src/main/java/org/eclipse/sirius/components/view/tree/FetchTreeItemContextMenuEntryKind.java +++ b/packages/view/backend/sirius-components-view-tree/src/main/java/org/eclipse/sirius/components/view/tree/FetchTreeItemContextMenuEntryKind.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2024 Obeo. + * Copyright (c) 2024, 2025 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 @@ -19,8 +19,8 @@ import org.eclipse.emf.common.util.Enumerator; /** - * A representation of the literals of the enumeration 'Fetch Tree Item Context Menu Entry Kind', and utility methods for working with them. + * A representation of the literals of the enumeration 'Fetch Tree Item Context Menu + * Entry Kind', and utility methods for working with them. * * @model * @generated @@ -30,50 +30,52 @@ public enum FetchTreeItemContextMenuEntryKind implements Enumerator { /** * The 'DOWNLOAD' literal object. * + * @see #DOWNLOAD_VALUE * @generated * @ordered - * @see #DOWNLOAD_VALUE */ DOWNLOAD(0, "DOWNLOAD", "DOWNLOAD"), /** * The 'OPEN' literal object. * + * @see #OPEN_VALUE * @generated * @ordered - * @see #OPEN_VALUE */ OPEN(1, "OPEN", "OPEN"); /** * The 'DOWNLOAD' literal value. * + * @see #DOWNLOAD * @model * @generated * @ordered - * @see #DOWNLOAD */ public static final int DOWNLOAD_VALUE = 0; /** * The 'OPEN' literal value. * + * @see #OPEN * @model * @generated * @ordered - * @see #OPEN */ public static final int OPEN_VALUE = 1; /** - * An array of all the 'Fetch Tree Item Context Menu Entry Kind' enumerators. + * An array of all the 'Fetch Tree Item Context Menu Entry Kind' enumerators. * * @generated */ private static final FetchTreeItemContextMenuEntryKind[] VALUES_ARRAY = new FetchTreeItemContextMenuEntryKind[] { DOWNLOAD, OPEN, }; /** - * A public read-only list of all the 'Fetch Tree Item Context Menu Entry Kind' enumerators. + * A public read-only list of all the 'Fetch Tree Item Context Menu Entry Kind' enumerators. * * @generated */ @@ -112,10 +114,11 @@ private FetchTreeItemContextMenuEntryKind(int value, String name, String literal } /** - * Returns the 'Fetch Tree Item Context Menu Entry Kind' literal with the specified literal value. + * Returns the 'Fetch Tree Item Context Menu Entry Kind' literal with the specified literal value. + * * * @param literal - * the literal. + * the literal. * @return the matching enumerator or null. * @generated */ @@ -130,10 +133,11 @@ public static FetchTreeItemContextMenuEntryKind get(String literal) { } /** - * Returns the 'Fetch Tree Item Context Menu Entry Kind' literal with the specified name. + * Returns the 'Fetch Tree Item Context Menu Entry Kind' literal with the specified name. * * @param name - * the name. + * the name. * @return the matching enumerator or null. * @generated */ @@ -148,10 +152,11 @@ public static FetchTreeItemContextMenuEntryKind getByName(String name) { } /** - * Returns the 'Fetch Tree Item Context Menu Entry Kind' literal with the specified integer value. + * Returns the 'Fetch Tree Item Context Menu Entry Kind' literal with the specified integer value. + * * * @param value - * the integer value. + * the integer value. * @return the matching enumerator or null. * @generated */ @@ -196,7 +201,8 @@ public String getLiteral() { } /** - * Returns the literal value of the enumerator, which is its string representation. + * Returns the literal value of the enumerator, which is its string representation. * * @generated */ diff --git a/packages/view/backend/sirius-components-view-tree/src/main/java/org/eclipse/sirius/components/view/tree/SingleClickTreeItemContextMenuEntry.java b/packages/view/backend/sirius-components-view-tree/src/main/java/org/eclipse/sirius/components/view/tree/SingleClickTreeItemContextMenuEntry.java index 2357cb1414..62f4e465cf 100644 --- a/packages/view/backend/sirius-components-view-tree/src/main/java/org/eclipse/sirius/components/view/tree/SingleClickTreeItemContextMenuEntry.java +++ b/packages/view/backend/sirius-components-view-tree/src/main/java/org/eclipse/sirius/components/view/tree/SingleClickTreeItemContextMenuEntry.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2024 Obeo. + * Copyright (c) 2024, 2025 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 @@ -16,30 +16,83 @@ import org.eclipse.sirius.components.view.Operation; /** - * A representation of the model object 'Single Click Tree Item Context Menu Entry'. + * A representation of the model object 'Single Click Tree Item Context Menu + * Entry'. * *

    * The following features are supported: *

    *
      *
    • {@link org.eclipse.sirius.components.view.tree.SingleClickTreeItemContextMenuEntry#getBody Body}
    • + *
    • {@link org.eclipse.sirius.components.view.tree.SingleClickTreeItemContextMenuEntry#getLabelExpression Label + * Expression}
    • + *
    • {@link org.eclipse.sirius.components.view.tree.SingleClickTreeItemContextMenuEntry#getIconURLExpression Icon + * URL Expression}
    • *
    * + * @see org.eclipse.sirius.components.view.tree.TreePackage#getSingleClickTreeItemContextMenuEntry() * @model * @generated - * @see org.eclipse.sirius.components.view.tree.TreePackage#getSingleClickTreeItemContextMenuEntry() */ public interface SingleClickTreeItemContextMenuEntry extends TreeItemContextMenuEntry { /** - * Returns the value of the 'Body' containment reference list. The list contents are of type {@link org.eclipse.sirius.components.view.Operation}. + * Returns the value of the 'Body' containment reference list. The list contents are of type + * {@link org.eclipse.sirius.components.view.Operation}. * * @return the value of the 'Body' containment reference list. + * @see org.eclipse.sirius.components.view.tree.TreePackage#getSingleClickTreeItemContextMenuEntry_Body() * @model containment="true" * @generated - * @see org.eclipse.sirius.components.view.tree.TreePackage#getSingleClickTreeItemContextMenuEntry_Body() */ EList getBody(); + /** + * Returns the value of the 'Label Expression' attribute. + * + * @return the value of the 'Label Expression' attribute. + * @see #setLabelExpression(String) + * @see org.eclipse.sirius.components.view.tree.TreePackage#getSingleClickTreeItemContextMenuEntry_LabelExpression() + * @model dataType="org.eclipse.sirius.components.view.InterpretedExpression" + * @generated + */ + String getLabelExpression(); + + /** + * Sets the value of the + * '{@link org.eclipse.sirius.components.view.tree.SingleClickTreeItemContextMenuEntry#getLabelExpression Label + * Expression}' attribute. + * + * @param value + * the new value of the 'Label Expression' attribute. + * @see #getLabelExpression() + * @generated + */ + void setLabelExpression(String value); + + /** + * Returns the value of the 'Icon URL Expression' attribute. + * + * @return the value of the 'Icon URL Expression' attribute. + * @see #setIconURLExpression(String) + * @see org.eclipse.sirius.components.view.tree.TreePackage#getSingleClickTreeItemContextMenuEntry_IconURLExpression() + * @model dataType="org.eclipse.sirius.components.view.InterpretedExpression" + * @generated + */ + String getIconURLExpression(); + + /** + * Sets the value of the + * '{@link org.eclipse.sirius.components.view.tree.SingleClickTreeItemContextMenuEntry#getIconURLExpression Icon + * URL Expression}' attribute. + * + * @param value + * the new value of the 'Icon URL Expression' attribute. + * @see #getIconURLExpression() + * @generated + */ + void setIconURLExpression(String value); + } // SingleClickTreeItemContextMenuEntry diff --git a/packages/view/backend/sirius-components-view-tree/src/main/java/org/eclipse/sirius/components/view/tree/TreeDescription.java b/packages/view/backend/sirius-components-view-tree/src/main/java/org/eclipse/sirius/components/view/tree/TreeDescription.java index 69dd7d8488..8c4ff0c7f6 100644 --- a/packages/view/backend/sirius-components-view-tree/src/main/java/org/eclipse/sirius/components/view/tree/TreeDescription.java +++ b/packages/view/backend/sirius-components-view-tree/src/main/java/org/eclipse/sirius/components/view/tree/TreeDescription.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2024 Obeo. + * Copyright (c) 2024, 2025 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 @@ -49,41 +49,44 @@ * Entries} * * + * @see org.eclipse.sirius.components.view.tree.TreePackage#getTreeDescription() * @model * @generated - * @see org.eclipse.sirius.components.view.tree.TreePackage#getTreeDescription() */ public interface TreeDescription extends RepresentationDescription { /** - * Returns the value of the 'Kind Expression' attribute. + * Returns the value of the 'Kind Expression' attribute. * * @return the value of the 'Kind Expression' attribute. - * @model dataType="org.eclipse.sirius.components.view.InterpretedExpression" - * @generated * @see #setKindExpression(String) * @see org.eclipse.sirius.components.view.tree.TreePackage#getTreeDescription_KindExpression() + * @model dataType="org.eclipse.sirius.components.view.InterpretedExpression" + * @generated */ String getKindExpression(); /** - * Sets the value of the '{@link org.eclipse.sirius.components.view.tree.TreeDescription#getKindExpression Kind Expression}' attribute. + * Sets the value of the '{@link org.eclipse.sirius.components.view.tree.TreeDescription#getKindExpression Kind + * Expression}' attribute. * * @param value - * the new value of the 'Kind Expression' attribute. - * @generated + * the new value of the 'Kind Expression' attribute. * @see #getKindExpression() + * @generated */ void setKindExpression(String value); /** - * Returns the value of the 'Tree Item Icon Expression' attribute. + * Returns the value of the 'Tree Item Icon Expression' attribute. * * @return the value of the 'Tree Item Icon Expression' attribute. - * @model dataType="org.eclipse.sirius.components.view.InterpretedExpression" - * @generated * @see #setTreeItemIconExpression(String) * @see org.eclipse.sirius.components.view.tree.TreePackage#getTreeDescription_TreeItemIconExpression() + * @model dataType="org.eclipse.sirius.components.view.InterpretedExpression" + * @generated */ String getTreeItemIconExpression(); @@ -92,20 +95,21 @@ public interface TreeDescription extends RepresentationDescription { * Tree Item Icon Expression}' attribute. * * @param value - * the new value of the 'Tree Item Icon Expression' attribute. - * @generated + * the new value of the 'Tree Item Icon Expression' attribute. * @see #getTreeItemIconExpression() + * @generated */ void setTreeItemIconExpression(String value); /** - * Returns the value of the 'Tree Item Id Expression' attribute. + * Returns the value of the 'Tree Item Id Expression' attribute. * * @return the value of the 'Tree Item Id Expression' attribute. - * @model dataType="org.eclipse.sirius.components.view.InterpretedExpression" - * @generated * @see #setTreeItemIdExpression(String) * @see org.eclipse.sirius.components.view.tree.TreePackage#getTreeDescription_TreeItemIdExpression() + * @model dataType="org.eclipse.sirius.components.view.InterpretedExpression" + * @generated */ String getTreeItemIdExpression(); @@ -114,20 +118,21 @@ public interface TreeDescription extends RepresentationDescription { * Tree Item Id Expression}' attribute. * * @param value - * the new value of the 'Tree Item Id Expression' attribute. - * @generated + * the new value of the 'Tree Item Id Expression' attribute. * @see #getTreeItemIdExpression() + * @generated */ void setTreeItemIdExpression(String value); /** - * Returns the value of the 'Tree Item Object Expression' attribute. + * Returns the value of the 'Tree Item Object Expression' attribute. * * @return the value of the 'Tree Item Object Expression' attribute. - * @model dataType="org.eclipse.sirius.components.view.InterpretedExpression" - * @generated * @see #setTreeItemObjectExpression(String) * @see org.eclipse.sirius.components.view.tree.TreePackage#getTreeDescription_TreeItemObjectExpression() + * @model dataType="org.eclipse.sirius.components.view.InterpretedExpression" + * @generated */ String getTreeItemObjectExpression(); @@ -136,20 +141,21 @@ public interface TreeDescription extends RepresentationDescription { * Tree Item Object Expression}' attribute. * * @param value - * the new value of the 'Tree Item Object Expression' attribute. - * @generated + * the new value of the 'Tree Item Object Expression' attribute. * @see #getTreeItemObjectExpression() + * @generated */ void setTreeItemObjectExpression(String value); /** - * Returns the value of the 'Elements Expression' attribute. + * Returns the value of the 'Elements Expression' attribute. * * @return the value of the 'Elements Expression' attribute. - * @model dataType="org.eclipse.sirius.components.view.InterpretedExpression" - * @generated * @see #setElementsExpression(String) * @see org.eclipse.sirius.components.view.tree.TreePackage#getTreeDescription_ElementsExpression() + * @model dataType="org.eclipse.sirius.components.view.InterpretedExpression" + * @generated */ String getElementsExpression(); @@ -158,20 +164,21 @@ public interface TreeDescription extends RepresentationDescription { * Elements Expression}' attribute. * * @param value - * the new value of the 'Elements Expression' attribute. - * @generated + * the new value of the 'Elements Expression' attribute. * @see #getElementsExpression() + * @generated */ void setElementsExpression(String value); /** - * Returns the value of the 'Has Children Expression' attribute. + * Returns the value of the 'Has Children Expression' attribute. * * @return the value of the 'Has Children Expression' attribute. - * @model dataType="org.eclipse.sirius.components.view.InterpretedExpression" - * @generated * @see #setHasChildrenExpression(String) * @see org.eclipse.sirius.components.view.tree.TreePackage#getTreeDescription_HasChildrenExpression() + * @model dataType="org.eclipse.sirius.components.view.InterpretedExpression" + * @generated */ String getHasChildrenExpression(); @@ -180,20 +187,21 @@ public interface TreeDescription extends RepresentationDescription { * Has Children Expression}' attribute. * * @param value - * the new value of the 'Has Children Expression' attribute. - * @generated + * the new value of the 'Has Children Expression' attribute. * @see #getHasChildrenExpression() + * @generated */ void setHasChildrenExpression(String value); /** - * Returns the value of the 'Children Expression' attribute. + * Returns the value of the 'Children Expression' attribute. * * @return the value of the 'Children Expression' attribute. - * @model dataType="org.eclipse.sirius.components.view.InterpretedExpression" - * @generated * @see #setChildrenExpression(String) * @see org.eclipse.sirius.components.view.tree.TreePackage#getTreeDescription_ChildrenExpression() + * @model dataType="org.eclipse.sirius.components.view.InterpretedExpression" + * @generated */ String getChildrenExpression(); @@ -202,20 +210,21 @@ public interface TreeDescription extends RepresentationDescription { * Children Expression}' attribute. * * @param value - * the new value of the 'Children Expression' attribute. - * @generated + * the new value of the 'Children Expression' attribute. * @see #getChildrenExpression() + * @generated */ void setChildrenExpression(String value); /** - * Returns the value of the 'Parent Expression' attribute. + * Returns the value of the 'Parent Expression' attribute. * * @return the value of the 'Parent Expression' attribute. - * @model dataType="org.eclipse.sirius.components.view.InterpretedExpression" - * @generated * @see #setParentExpression(String) * @see org.eclipse.sirius.components.view.tree.TreePackage#getTreeDescription_ParentExpression() + * @model dataType="org.eclipse.sirius.components.view.InterpretedExpression" + * @generated */ String getParentExpression(); @@ -224,20 +233,21 @@ public interface TreeDescription extends RepresentationDescription { * Parent Expression}' attribute. * * @param value - * the new value of the 'Parent Expression' attribute. - * @generated + * the new value of the 'Parent Expression' attribute. * @see #getParentExpression() + * @generated */ void setParentExpression(String value); /** - * Returns the value of the 'Editable Expression' attribute. + * Returns the value of the 'Editable Expression' attribute. * * @return the value of the 'Editable Expression' attribute. - * @model dataType="org.eclipse.sirius.components.view.InterpretedExpression" - * @generated * @see #setEditableExpression(String) * @see org.eclipse.sirius.components.view.tree.TreePackage#getTreeDescription_EditableExpression() + * @model dataType="org.eclipse.sirius.components.view.InterpretedExpression" + * @generated */ String getEditableExpression(); @@ -246,20 +256,21 @@ public interface TreeDescription extends RepresentationDescription { * Editable Expression}' attribute. * * @param value - * the new value of the 'Editable Expression' attribute. - * @generated + * the new value of the 'Editable Expression' attribute. * @see #getEditableExpression() + * @generated */ void setEditableExpression(String value); /** - * Returns the value of the 'Selectable Expression' attribute. + * Returns the value of the 'Selectable Expression' attribute. * * @return the value of the 'Selectable Expression' attribute. - * @model dataType="org.eclipse.sirius.components.view.InterpretedExpression" - * @generated * @see #setSelectableExpression(String) * @see org.eclipse.sirius.components.view.tree.TreePackage#getTreeDescription_SelectableExpression() + * @model dataType="org.eclipse.sirius.components.view.InterpretedExpression" + * @generated */ String getSelectableExpression(); @@ -268,20 +279,21 @@ public interface TreeDescription extends RepresentationDescription { * Selectable Expression}' attribute. * * @param value - * the new value of the 'Selectable Expression' attribute. - * @generated + * the new value of the 'Selectable Expression' attribute. * @see #getSelectableExpression() + * @generated */ void setSelectableExpression(String value); /** - * Returns the value of the 'Deletable Expression' attribute. + * Returns the value of the 'Deletable Expression' attribute. * * @return the value of the 'Deletable Expression' attribute. - * @model dataType="org.eclipse.sirius.components.view.InterpretedExpression" - * @generated * @see #setDeletableExpression(String) * @see org.eclipse.sirius.components.view.tree.TreePackage#getTreeDescription_DeletableExpression() + * @model dataType="org.eclipse.sirius.components.view.InterpretedExpression" + * @generated */ String getDeletableExpression(); @@ -290,31 +302,33 @@ public interface TreeDescription extends RepresentationDescription { * Deletable Expression}' attribute. * * @param value - * the new value of the 'Deletable Expression' attribute. - * @generated + * the new value of the 'Deletable Expression' attribute. * @see #getDeletableExpression() + * @generated */ void setDeletableExpression(String value); /** - * Returns the value of the 'Tree Item Label Descriptions' containment reference list. The list contents are of type - * {@link org.eclipse.sirius.components.view.tree.TreeItemLabelDescription}. + * Returns the value of the 'Tree Item Label Descriptions' containment reference list. The list + * contents are of type {@link org.eclipse.sirius.components.view.tree.TreeItemLabelDescription}. * * @return the value of the 'Tree Item Label Descriptions' containment reference list. - * @model containment="true" - * @generated * @see org.eclipse.sirius.components.view.tree.TreePackage#getTreeDescription_TreeItemLabelDescriptions() + * @model containment="true" keys="name" + * @generated */ EList getTreeItemLabelDescriptions(); /** - * Returns the value of the 'Context Menu Entries' containment reference list. The list contents are of type - * {@link org.eclipse.sirius.components.view.tree.TreeItemContextMenuEntry}. + * Returns the value of the 'Context Menu Entries' containment reference list. The list contents are + * of type {@link org.eclipse.sirius.components.view.tree.TreeItemContextMenuEntry}. * * @return the value of the 'Context Menu Entries' containment reference list. + * @see org.eclipse.sirius.components.view.tree.TreePackage#getTreeDescription_ContextMenuEntries() * @model containment="true" * @generated - * @see org.eclipse.sirius.components.view.tree.TreePackage#getTreeDescription_ContextMenuEntries() */ EList getContextMenuEntries(); diff --git a/packages/view/backend/sirius-components-view-tree/src/main/java/org/eclipse/sirius/components/view/tree/TreeFactory.java b/packages/view/backend/sirius-components-view-tree/src/main/java/org/eclipse/sirius/components/view/tree/TreeFactory.java index 3bf5d1b5cd..e13351deed 100644 --- a/packages/view/backend/sirius-components-view-tree/src/main/java/org/eclipse/sirius/components/view/tree/TreeFactory.java +++ b/packages/view/backend/sirius-components-view-tree/src/main/java/org/eclipse/sirius/components/view/tree/TreeFactory.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2024 Obeo. + * Copyright (c) 2024, 2025 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 @@ -15,10 +15,11 @@ import org.eclipse.emf.ecore.EFactory; /** - * The Factory for the model. It provides a create method for each non-abstract class of the model. + * The Factory for the model. It provides a create method for each non-abstract class of + * the model. * - * @generated * @see org.eclipse.sirius.components.view.tree.TreePackage + * @generated */ public interface TreeFactory extends EFactory { @@ -46,7 +47,8 @@ public interface TreeFactory extends EFactory { TreeItemLabelDescription createTreeItemLabelDescription(); /** - * Returns a new object of class 'Item Label Fragment Description'. + * Returns a new object of class 'Item Label Fragment Description'. * * @return a new object of class 'Item Label Fragment Description'. * @generated @@ -54,7 +56,8 @@ public interface TreeFactory extends EFactory { TreeItemLabelFragmentDescription createTreeItemLabelFragmentDescription(); /** - * Returns a new object of class 'Single Click Tree Item Context Menu Entry'. + * Returns a new object of class 'Single Click Tree Item Context Menu Entry'. * * @return a new object of class 'Single Click Tree Item Context Menu Entry'. * @generated @@ -62,13 +65,23 @@ public interface TreeFactory extends EFactory { SingleClickTreeItemContextMenuEntry createSingleClickTreeItemContextMenuEntry(); /** - * Returns a new object of class 'Fetch Tree Item Context Menu Entry'. + * Returns a new object of class 'Fetch Tree Item Context Menu Entry'. * * @return a new object of class 'Fetch Tree Item Context Menu Entry'. * @generated */ FetchTreeItemContextMenuEntry createFetchTreeItemContextMenuEntry(); + /** + * Returns a new object of class 'Custom Tree Item Context Menu Entry'. + * + * @return a new object of class 'Custom Tree Item Context Menu Entry'. + * @generated + */ + CustomTreeItemContextMenuEntry createCustomTreeItemContextMenuEntry(); + /** * Returns the package supported by this factory. * diff --git a/packages/view/backend/sirius-components-view-tree/src/main/java/org/eclipse/sirius/components/view/tree/TreeItemContextMenuEntry.java b/packages/view/backend/sirius-components-view-tree/src/main/java/org/eclipse/sirius/components/view/tree/TreeItemContextMenuEntry.java index 6d1e500044..fb6c4e4658 100644 --- a/packages/view/backend/sirius-components-view-tree/src/main/java/org/eclipse/sirius/components/view/tree/TreeItemContextMenuEntry.java +++ b/packages/view/backend/sirius-components-view-tree/src/main/java/org/eclipse/sirius/components/view/tree/TreeItemContextMenuEntry.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2024 Obeo. + * Copyright (c) 2024, 2025 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 @@ -23,10 +23,6 @@ *

    *
      *
    • {@link org.eclipse.sirius.components.view.tree.TreeItemContextMenuEntry#getName Name}
    • - *
    • {@link org.eclipse.sirius.components.view.tree.TreeItemContextMenuEntry#getLabelExpression Label - * Expression}
    • - *
    • {@link org.eclipse.sirius.components.view.tree.TreeItemContextMenuEntry#getIconURLExpression Icon URL - * Expression}
    • *
    • {@link org.eclipse.sirius.components.view.tree.TreeItemContextMenuEntry#getPreconditionExpression * Precondition Expression}
    • *
    @@ -58,53 +54,6 @@ public interface TreeItemContextMenuEntry extends EObject { */ void setName(String value); - /** - * Returns the value of the 'Label Expression' attribute. - * - * @return the value of the 'Label Expression' attribute. - * @see #setLabelExpression(String) - * @see org.eclipse.sirius.components.view.tree.TreePackage#getTreeItemContextMenuEntry_LabelExpression() - * @model dataType="org.eclipse.sirius.components.view.InterpretedExpression" - * @generated - */ - String getLabelExpression(); - - /** - * Sets the value of the '{@link org.eclipse.sirius.components.view.tree.TreeItemContextMenuEntry#getLabelExpression - * Label Expression}' attribute. - * - * @param value - * the new value of the 'Label Expression' attribute. - * @see #getLabelExpression() - * @generated - */ - void setLabelExpression(String value); - - /** - * Returns the value of the 'Icon URL Expression' attribute. - * - * @return the value of the 'Icon URL Expression' attribute. - * @see #setIconURLExpression(String) - * @see org.eclipse.sirius.components.view.tree.TreePackage#getTreeItemContextMenuEntry_IconURLExpression() - * @model dataType="org.eclipse.sirius.components.view.InterpretedExpression" - * @generated - */ - String getIconURLExpression(); - - /** - * Sets the value of the - * '{@link org.eclipse.sirius.components.view.tree.TreeItemContextMenuEntry#getIconURLExpression Icon URL - * Expression}' attribute. - * - * @param value - * the new value of the 'Icon URL Expression' attribute. - * @see #getIconURLExpression() - * @generated - */ - void setIconURLExpression(String value); - /** * Returns the value of the 'Precondition Expression' attribute. diff --git a/packages/view/backend/sirius-components-view-tree/src/main/java/org/eclipse/sirius/components/view/tree/TreePackage.java b/packages/view/backend/sirius-components-view-tree/src/main/java/org/eclipse/sirius/components/view/tree/TreePackage.java index 9fffff4d05..1e0ca84bb7 100644 --- a/packages/view/backend/sirius-components-view-tree/src/main/java/org/eclipse/sirius/components/view/tree/TreePackage.java +++ b/packages/view/backend/sirius-components-view-tree/src/main/java/org/eclipse/sirius/components/view/tree/TreePackage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2024 Obeo. + * Copyright (c) 2024, 2025 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 @@ -30,9 +30,9 @@ * * * + * @see org.eclipse.sirius.components.view.tree.TreeFactory * @model kind="package" * @generated - * @see org.eclipse.sirius.components.view.tree.TreeFactory */ public interface TreePackage extends EPackage { @@ -61,9 +61,9 @@ public interface TreePackage extends EPackage { * The meta object id for the '{@link org.eclipse.sirius.components.view.tree.impl.TreeDescriptionImpl * Description}' class. * - * @generated * @see org.eclipse.sirius.components.view.tree.impl.TreeDescriptionImpl * @see org.eclipse.sirius.components.view.tree.impl.TreePackageImpl#getTreeDescription() + * @generated */ int TREE_DESCRIPTION = 0; @@ -84,7 +84,8 @@ public interface TreePackage extends EPackage { int TREE_DESCRIPTION__DOMAIN_TYPE = ViewPackage.REPRESENTATION_DESCRIPTION__DOMAIN_TYPE; /** - * The feature id for the 'Precondition Expression' attribute. + * The feature id for the 'Precondition Expression' attribute. * * @generated * @ordered @@ -92,7 +93,8 @@ public interface TreePackage extends EPackage { int TREE_DESCRIPTION__PRECONDITION_EXPRESSION = ViewPackage.REPRESENTATION_DESCRIPTION__PRECONDITION_EXPRESSION; /** - * The feature id for the 'Title Expression' attribute. + * The feature id for the 'Title Expression' attribute. * * @generated * @ordered @@ -116,7 +118,8 @@ public interface TreePackage extends EPackage { int TREE_DESCRIPTION__KIND_EXPRESSION = ViewPackage.REPRESENTATION_DESCRIPTION_FEATURE_COUNT + 0; /** - * The feature id for the 'Tree Item Icon Expression' attribute. + * The feature id for the 'Tree Item Icon Expression' attribute. * * @generated * @ordered @@ -124,7 +127,8 @@ public interface TreePackage extends EPackage { int TREE_DESCRIPTION__TREE_ITEM_ICON_EXPRESSION = ViewPackage.REPRESENTATION_DESCRIPTION_FEATURE_COUNT + 1; /** - * The feature id for the 'Tree Item Id Expression' attribute. + * The feature id for the 'Tree Item Id Expression' attribute. * * @generated * @ordered @@ -132,7 +136,8 @@ public interface TreePackage extends EPackage { int TREE_DESCRIPTION__TREE_ITEM_ID_EXPRESSION = ViewPackage.REPRESENTATION_DESCRIPTION_FEATURE_COUNT + 2; /** - * The feature id for the 'Tree Item Object Expression' attribute. + * The feature id for the 'Tree Item Object Expression' attribute. * * @generated * @ordered @@ -140,7 +145,8 @@ public interface TreePackage extends EPackage { int TREE_DESCRIPTION__TREE_ITEM_OBJECT_EXPRESSION = ViewPackage.REPRESENTATION_DESCRIPTION_FEATURE_COUNT + 3; /** - * The feature id for the 'Elements Expression' attribute. + * The feature id for the 'Elements Expression' attribute. * * @generated * @ordered @@ -148,7 +154,8 @@ public interface TreePackage extends EPackage { int TREE_DESCRIPTION__ELEMENTS_EXPRESSION = ViewPackage.REPRESENTATION_DESCRIPTION_FEATURE_COUNT + 4; /** - * The feature id for the 'Has Children Expression' attribute. + * The feature id for the 'Has Children Expression' attribute. * * @generated * @ordered @@ -156,7 +163,8 @@ public interface TreePackage extends EPackage { int TREE_DESCRIPTION__HAS_CHILDREN_EXPRESSION = ViewPackage.REPRESENTATION_DESCRIPTION_FEATURE_COUNT + 5; /** - * The feature id for the 'Children Expression' attribute. + * The feature id for the 'Children Expression' attribute. * * @generated * @ordered @@ -164,7 +172,8 @@ public interface TreePackage extends EPackage { int TREE_DESCRIPTION__CHILDREN_EXPRESSION = ViewPackage.REPRESENTATION_DESCRIPTION_FEATURE_COUNT + 6; /** - * The feature id for the 'Parent Expression' attribute. + * The feature id for the 'Parent Expression' attribute. * * @generated * @ordered @@ -172,7 +181,8 @@ public interface TreePackage extends EPackage { int TREE_DESCRIPTION__PARENT_EXPRESSION = ViewPackage.REPRESENTATION_DESCRIPTION_FEATURE_COUNT + 7; /** - * The feature id for the 'Editable Expression' attribute. + * The feature id for the 'Editable Expression' attribute. * * @generated * @ordered @@ -180,7 +190,8 @@ public interface TreePackage extends EPackage { int TREE_DESCRIPTION__EDITABLE_EXPRESSION = ViewPackage.REPRESENTATION_DESCRIPTION_FEATURE_COUNT + 8; /** - * The feature id for the 'Selectable Expression' attribute. + * The feature id for the 'Selectable Expression' attribute. * * @generated * @ordered @@ -188,7 +199,8 @@ public interface TreePackage extends EPackage { int TREE_DESCRIPTION__SELECTABLE_EXPRESSION = ViewPackage.REPRESENTATION_DESCRIPTION_FEATURE_COUNT + 9; /** - * The feature id for the 'Deletable Expression' attribute. + * The feature id for the 'Deletable Expression' attribute. * * @generated * @ordered @@ -196,7 +208,8 @@ public interface TreePackage extends EPackage { int TREE_DESCRIPTION__DELETABLE_EXPRESSION = ViewPackage.REPRESENTATION_DESCRIPTION_FEATURE_COUNT + 10; /** - * The feature id for the 'Tree Item Label Descriptions' containment reference list. + * The feature id for the 'Tree Item Label Descriptions' containment reference list. * * @generated * @ordered @@ -204,7 +217,8 @@ public interface TreePackage extends EPackage { int TREE_DESCRIPTION__TREE_ITEM_LABEL_DESCRIPTIONS = ViewPackage.REPRESENTATION_DESCRIPTION_FEATURE_COUNT + 11; /** - * The feature id for the 'Context Menu Entries' containment reference list. + * The feature id for the 'Context Menu Entries' containment reference list. + * * * @generated * @ordered @@ -212,7 +226,8 @@ public interface TreePackage extends EPackage { int TREE_DESCRIPTION__CONTEXT_MENU_ENTRIES = ViewPackage.REPRESENTATION_DESCRIPTION_FEATURE_COUNT + 12; /** - * The number of structural features of the 'Description' class. + * The number of structural features of the 'Description' class. * * @generated * @ordered @@ -231,9 +246,9 @@ public interface TreePackage extends EPackage { * The meta object id for the '{@link org.eclipse.sirius.components.view.tree.impl.TreeItemLabelDescriptionImpl * Item Label Description}' class. * - * @generated * @see org.eclipse.sirius.components.view.tree.impl.TreeItemLabelDescriptionImpl * @see org.eclipse.sirius.components.view.tree.impl.TreePackageImpl#getTreeItemLabelDescription() + * @generated */ int TREE_ITEM_LABEL_DESCRIPTION = 1; @@ -246,7 +261,8 @@ public interface TreePackage extends EPackage { int TREE_ITEM_LABEL_DESCRIPTION__NAME = 0; /** - * The feature id for the 'Precondition Expression' attribute. + * The feature id for the 'Precondition Expression' attribute. * * @generated * @ordered @@ -254,7 +270,8 @@ public interface TreePackage extends EPackage { int TREE_ITEM_LABEL_DESCRIPTION__PRECONDITION_EXPRESSION = 1; /** - * The feature id for the 'Children' containment reference list. + * The feature id for the 'Children' containment reference list. * * @generated * @ordered @@ -262,7 +279,8 @@ public interface TreePackage extends EPackage { int TREE_ITEM_LABEL_DESCRIPTION__CHILDREN = 2; /** - * The number of structural features of the 'Item Label Description' class. + * The number of structural features of the 'Item Label Description' class. * * @generated * @ordered @@ -270,7 +288,8 @@ public interface TreePackage extends EPackage { int TREE_ITEM_LABEL_DESCRIPTION_FEATURE_COUNT = 3; /** - * The number of operations of the 'Item Label Description' class. + * The number of operations of the 'Item Label Description' class. * * @generated * @ordered @@ -278,17 +297,19 @@ public interface TreePackage extends EPackage { int TREE_ITEM_LABEL_DESCRIPTION_OPERATION_COUNT = 0; /** - * The meta object id for the '{@link org.eclipse.sirius.components.view.tree.impl.TreeItemLabelElementDescriptionImpl Item Label Element Description}' class. + * The meta object id for the + * '{@link org.eclipse.sirius.components.view.tree.impl.TreeItemLabelElementDescriptionImpl Item Label Element + * Description}' class. * - * @generated * @see org.eclipse.sirius.components.view.tree.impl.TreeItemLabelElementDescriptionImpl * @see org.eclipse.sirius.components.view.tree.impl.TreePackageImpl#getTreeItemLabelElementDescription() + * @generated */ int TREE_ITEM_LABEL_ELEMENT_DESCRIPTION = 3; /** - * The number of structural features of the 'Item Label Element Description' class. + * The number of structural features of the 'Item Label Element Description' class. + * * * @generated * @ordered @@ -296,7 +317,8 @@ public interface TreePackage extends EPackage { int TREE_ITEM_LABEL_ELEMENT_DESCRIPTION_FEATURE_COUNT = 0; /** - * The number of operations of the 'Item Label Element Description' class. + * The number of operations of the 'Item Label Element Description' class. * * @generated * @ordered @@ -304,17 +326,19 @@ public interface TreePackage extends EPackage { int TREE_ITEM_LABEL_ELEMENT_DESCRIPTION_OPERATION_COUNT = 0; /** - * The meta object id for the '{@link org.eclipse.sirius.components.view.tree.impl.TreeItemLabelFragmentDescriptionImpl Item Label Fragment Description}' class. - * + * The meta object id for the + * '{@link org.eclipse.sirius.components.view.tree.impl.TreeItemLabelFragmentDescriptionImpl Item Label Fragment + * Description}' class. * - * @generated * @see org.eclipse.sirius.components.view.tree.impl.TreeItemLabelFragmentDescriptionImpl * @see org.eclipse.sirius.components.view.tree.impl.TreePackageImpl#getTreeItemLabelFragmentDescription() + * @generated */ int TREE_ITEM_LABEL_FRAGMENT_DESCRIPTION = 2; /** - * The feature id for the 'Label Expression' attribute. + * The feature id for the 'Label Expression' attribute. * * @generated * @ordered @@ -330,7 +354,8 @@ public interface TreePackage extends EPackage { int TREE_ITEM_LABEL_FRAGMENT_DESCRIPTION__STYLE = TREE_ITEM_LABEL_ELEMENT_DESCRIPTION_FEATURE_COUNT + 1; /** - * The number of structural features of the 'Item Label Fragment Description' class. + * The number of structural features of the 'Item Label Fragment Description' class. * * @generated * @ordered @@ -338,7 +363,8 @@ public interface TreePackage extends EPackage { int TREE_ITEM_LABEL_FRAGMENT_DESCRIPTION_FEATURE_COUNT = TREE_ITEM_LABEL_ELEMENT_DESCRIPTION_FEATURE_COUNT + 2; /** - * The number of operations of the 'Item Label Fragment Description' class. + * The number of operations of the 'Item Label Fragment Description' class. * * @generated * @ordered @@ -349,9 +375,9 @@ public interface TreePackage extends EPackage { * The meta object id for the '{@link org.eclipse.sirius.components.view.tree.impl.TreeItemContextMenuEntryImpl * Item Context Menu Entry}' class. * - * @generated * @see org.eclipse.sirius.components.view.tree.impl.TreeItemContextMenuEntryImpl * @see org.eclipse.sirius.components.view.tree.impl.TreePackageImpl#getTreeItemContextMenuEntry() + * @generated */ int TREE_ITEM_CONTEXT_MENU_ENTRY = 4; @@ -364,39 +390,26 @@ public interface TreePackage extends EPackage { int TREE_ITEM_CONTEXT_MENU_ENTRY__NAME = 0; /** - * The feature id for the 'Label Expression' attribute. - * - * @generated - * @ordered - */ - int TREE_ITEM_CONTEXT_MENU_ENTRY__LABEL_EXPRESSION = 1; - - /** - * The feature id for the 'Icon URL Expression' attribute. - * - * @generated - * @ordered - */ - int TREE_ITEM_CONTEXT_MENU_ENTRY__ICON_URL_EXPRESSION = 2; - - /** - * The feature id for the 'Precondition Expression' attribute. + * The feature id for the 'Precondition Expression' attribute. * * @generated * @ordered */ - int TREE_ITEM_CONTEXT_MENU_ENTRY__PRECONDITION_EXPRESSION = 3; + int TREE_ITEM_CONTEXT_MENU_ENTRY__PRECONDITION_EXPRESSION = 1; /** - * The number of structural features of the 'Item Context Menu Entry' class. + * The number of structural features of the 'Item Context Menu Entry' class. * * @generated * @ordered */ - int TREE_ITEM_CONTEXT_MENU_ENTRY_FEATURE_COUNT = 4; + int TREE_ITEM_CONTEXT_MENU_ENTRY_FEATURE_COUNT = 2; /** - * The number of operations of the 'Item Context Menu Entry' class. + * The number of operations of the 'Item Context Menu Entry' class. * * @generated * @ordered @@ -404,12 +417,13 @@ public interface TreePackage extends EPackage { int TREE_ITEM_CONTEXT_MENU_ENTRY_OPERATION_COUNT = 0; /** - * The meta object id for the '{@link org.eclipse.sirius.components.view.tree.impl.SingleClickTreeItemContextMenuEntryImpl Single Click Tree Item Context Menu Entry}' class. + * The meta object id for the + * '{@link org.eclipse.sirius.components.view.tree.impl.SingleClickTreeItemContextMenuEntryImpl Single Click + * Tree Item Context Menu Entry}' class. * - * @generated * @see org.eclipse.sirius.components.view.tree.impl.SingleClickTreeItemContextMenuEntryImpl * @see org.eclipse.sirius.components.view.tree.impl.TreePackageImpl#getSingleClickTreeItemContextMenuEntry() + * @generated */ int SINGLE_CLICK_TREE_ITEM_CONTEXT_MENU_ENTRY = 5; @@ -422,47 +436,53 @@ public interface TreePackage extends EPackage { int SINGLE_CLICK_TREE_ITEM_CONTEXT_MENU_ENTRY__NAME = TREE_ITEM_CONTEXT_MENU_ENTRY__NAME; /** - * The feature id for the 'Label Expression' attribute. + * The feature id for the 'Precondition Expression' attribute. * * @generated * @ordered */ - int SINGLE_CLICK_TREE_ITEM_CONTEXT_MENU_ENTRY__LABEL_EXPRESSION = TREE_ITEM_CONTEXT_MENU_ENTRY__LABEL_EXPRESSION; + int SINGLE_CLICK_TREE_ITEM_CONTEXT_MENU_ENTRY__PRECONDITION_EXPRESSION = TREE_ITEM_CONTEXT_MENU_ENTRY__PRECONDITION_EXPRESSION; /** - * The feature id for the 'Icon URL Expression' attribute. + * The feature id for the 'Body' containment reference list. * * @generated * @ordered */ - int SINGLE_CLICK_TREE_ITEM_CONTEXT_MENU_ENTRY__ICON_URL_EXPRESSION = TREE_ITEM_CONTEXT_MENU_ENTRY__ICON_URL_EXPRESSION; + int SINGLE_CLICK_TREE_ITEM_CONTEXT_MENU_ENTRY__BODY = TREE_ITEM_CONTEXT_MENU_ENTRY_FEATURE_COUNT + 0; /** - * The feature id for the 'Precondition Expression' attribute. + * The feature id for the 'Label Expression' attribute. * * @generated * @ordered */ - int SINGLE_CLICK_TREE_ITEM_CONTEXT_MENU_ENTRY__PRECONDITION_EXPRESSION = TREE_ITEM_CONTEXT_MENU_ENTRY__PRECONDITION_EXPRESSION; + int SINGLE_CLICK_TREE_ITEM_CONTEXT_MENU_ENTRY__LABEL_EXPRESSION = TREE_ITEM_CONTEXT_MENU_ENTRY_FEATURE_COUNT + 1; /** - * The feature id for the 'Body' containment reference list. + * The feature id for the 'Icon URL Expression' attribute. * * @generated * @ordered */ - int SINGLE_CLICK_TREE_ITEM_CONTEXT_MENU_ENTRY__BODY = TREE_ITEM_CONTEXT_MENU_ENTRY_FEATURE_COUNT + 0; + int SINGLE_CLICK_TREE_ITEM_CONTEXT_MENU_ENTRY__ICON_URL_EXPRESSION = TREE_ITEM_CONTEXT_MENU_ENTRY_FEATURE_COUNT + 2; /** - * The number of structural features of the 'Single Click Tree Item Context Menu Entry' class. + * The number of structural features of the 'Single Click Tree Item Context Menu Entry' class. * * @generated * @ordered */ - int SINGLE_CLICK_TREE_ITEM_CONTEXT_MENU_ENTRY_FEATURE_COUNT = TREE_ITEM_CONTEXT_MENU_ENTRY_FEATURE_COUNT + 1; + int SINGLE_CLICK_TREE_ITEM_CONTEXT_MENU_ENTRY_FEATURE_COUNT = TREE_ITEM_CONTEXT_MENU_ENTRY_FEATURE_COUNT + 3; /** - * The number of operations of the 'Single Click Tree Item Context Menu Entry' class. + * The number of operations of the 'Single Click Tree Item Context Menu Entry' class. * * @generated * @ordered @@ -473,9 +493,9 @@ public interface TreePackage extends EPackage { * The meta object id for the '{@link org.eclipse.sirius.components.view.tree.impl.FetchTreeItemContextMenuEntryImpl * Fetch Tree Item Context Menu Entry}' class. * - * @generated * @see org.eclipse.sirius.components.view.tree.impl.FetchTreeItemContextMenuEntryImpl * @see org.eclipse.sirius.components.view.tree.impl.TreePackageImpl#getFetchTreeItemContextMenuEntry() + * @generated */ int FETCH_TREE_ITEM_CONTEXT_MENU_ENTRY = 6; @@ -488,70 +508,129 @@ public interface TreePackage extends EPackage { int FETCH_TREE_ITEM_CONTEXT_MENU_ENTRY__NAME = TREE_ITEM_CONTEXT_MENU_ENTRY__NAME; /** - * The feature id for the 'Label Expression' attribute. + * The feature id for the 'Precondition Expression' attribute. * * @generated * @ordered */ - int FETCH_TREE_ITEM_CONTEXT_MENU_ENTRY__LABEL_EXPRESSION = TREE_ITEM_CONTEXT_MENU_ENTRY__LABEL_EXPRESSION; + int FETCH_TREE_ITEM_CONTEXT_MENU_ENTRY__PRECONDITION_EXPRESSION = TREE_ITEM_CONTEXT_MENU_ENTRY__PRECONDITION_EXPRESSION; /** - * The feature id for the 'Icon URL Expression' attribute. + * The feature id for the 'Url Exression' attribute. * * @generated * @ordered */ - int FETCH_TREE_ITEM_CONTEXT_MENU_ENTRY__ICON_URL_EXPRESSION = TREE_ITEM_CONTEXT_MENU_ENTRY__ICON_URL_EXPRESSION; + int FETCH_TREE_ITEM_CONTEXT_MENU_ENTRY__URL_EXRESSION = TREE_ITEM_CONTEXT_MENU_ENTRY_FEATURE_COUNT + 0; /** - * The feature id for the 'Precondition Expression' attribute. + * The feature id for the 'Kind' attribute. * * @generated * @ordered */ - int FETCH_TREE_ITEM_CONTEXT_MENU_ENTRY__PRECONDITION_EXPRESSION = TREE_ITEM_CONTEXT_MENU_ENTRY__PRECONDITION_EXPRESSION; + int FETCH_TREE_ITEM_CONTEXT_MENU_ENTRY__KIND = TREE_ITEM_CONTEXT_MENU_ENTRY_FEATURE_COUNT + 1; /** - * The feature id for the 'Url Exression' attribute. + * The feature id for the 'Label Expression' attribute. * * @generated * @ordered */ - int FETCH_TREE_ITEM_CONTEXT_MENU_ENTRY__URL_EXRESSION = TREE_ITEM_CONTEXT_MENU_ENTRY_FEATURE_COUNT + 0; + int FETCH_TREE_ITEM_CONTEXT_MENU_ENTRY__LABEL_EXPRESSION = TREE_ITEM_CONTEXT_MENU_ENTRY_FEATURE_COUNT + 2; /** - * The feature id for the 'Kind' attribute. + * The feature id for the 'Icon URL Expression' attribute. * * @generated * @ordered */ - int FETCH_TREE_ITEM_CONTEXT_MENU_ENTRY__KIND = TREE_ITEM_CONTEXT_MENU_ENTRY_FEATURE_COUNT + 1; + int FETCH_TREE_ITEM_CONTEXT_MENU_ENTRY__ICON_URL_EXPRESSION = TREE_ITEM_CONTEXT_MENU_ENTRY_FEATURE_COUNT + 3; /** - * The number of structural features of the 'Fetch Tree Item Context Menu Entry' class. + * The number of structural features of the 'Fetch Tree Item Context Menu Entry' class. * * @generated * @ordered */ - int FETCH_TREE_ITEM_CONTEXT_MENU_ENTRY_FEATURE_COUNT = TREE_ITEM_CONTEXT_MENU_ENTRY_FEATURE_COUNT + 2; + int FETCH_TREE_ITEM_CONTEXT_MENU_ENTRY_FEATURE_COUNT = TREE_ITEM_CONTEXT_MENU_ENTRY_FEATURE_COUNT + 4; /** - * The number of operations of the 'Fetch Tree Item Context Menu Entry' class. + * The number of operations of the 'Fetch Tree Item Context Menu Entry' class. * * @generated * @ordered */ int FETCH_TREE_ITEM_CONTEXT_MENU_ENTRY_OPERATION_COUNT = TREE_ITEM_CONTEXT_MENU_ENTRY_OPERATION_COUNT + 0; + /** + * The meta object id for the + * '{@link org.eclipse.sirius.components.view.tree.impl.CustomTreeItemContextMenuEntryImpl Custom Tree Item + * Context Menu Entry}' class. + * + * @see org.eclipse.sirius.components.view.tree.impl.CustomTreeItemContextMenuEntryImpl + * @see org.eclipse.sirius.components.view.tree.impl.TreePackageImpl#getCustomTreeItemContextMenuEntry() + * @generated + */ + int CUSTOM_TREE_ITEM_CONTEXT_MENU_ENTRY = 7; + + /** + * The feature id for the 'Name' attribute. + * + * @generated + * @ordered + */ + int CUSTOM_TREE_ITEM_CONTEXT_MENU_ENTRY__NAME = TREE_ITEM_CONTEXT_MENU_ENTRY__NAME; + + /** + * The feature id for the 'Precondition Expression' attribute. + * + * @generated + * @ordered + */ + int CUSTOM_TREE_ITEM_CONTEXT_MENU_ENTRY__PRECONDITION_EXPRESSION = TREE_ITEM_CONTEXT_MENU_ENTRY__PRECONDITION_EXPRESSION; + + /** + * The feature id for the 'Contribution Id' attribute. + * + * @generated + * @ordered + */ + int CUSTOM_TREE_ITEM_CONTEXT_MENU_ENTRY__CONTRIBUTION_ID = TREE_ITEM_CONTEXT_MENU_ENTRY_FEATURE_COUNT + 0; + + /** + * The number of structural features of the 'Custom Tree Item Context Menu Entry' class. + * + * @generated + * @ordered + */ + int CUSTOM_TREE_ITEM_CONTEXT_MENU_ENTRY_FEATURE_COUNT = TREE_ITEM_CONTEXT_MENU_ENTRY_FEATURE_COUNT + 1; + + /** + * The number of operations of the 'Custom Tree Item Context Menu Entry' class. + * + * + * @generated + * @ordered + */ + int CUSTOM_TREE_ITEM_CONTEXT_MENU_ENTRY_OPERATION_COUNT = TREE_ITEM_CONTEXT_MENU_ENTRY_OPERATION_COUNT + 0; + /** * The meta object id for the '{@link org.eclipse.sirius.components.view.tree.FetchTreeItemContextMenuEntryKind * Fetch Tree Item Context Menu Entry Kind}' enum. * - * @generated * @see org.eclipse.sirius.components.view.tree.FetchTreeItemContextMenuEntryKind * @see org.eclipse.sirius.components.view.tree.impl.TreePackageImpl#getFetchTreeItemContextMenuEntryKind() + * @generated */ - int FETCH_TREE_ITEM_CONTEXT_MENU_ENTRY_KIND = 7; + int FETCH_TREE_ITEM_CONTEXT_MENU_ENTRY_KIND = 8; /** * The singleton instance of the package. @@ -565,151 +644,164 @@ public interface TreePackage extends EPackage { * Description}'. * * @return the meta object for class 'Description'. - * @generated * @see org.eclipse.sirius.components.view.tree.TreeDescription + * @generated */ EClass getTreeDescription(); /** - * Returns the meta object for the attribute '{@link org.eclipse.sirius.components.view.tree.TreeDescription#getKindExpression Kind Expression}'. + * Returns the meta object for the attribute + * '{@link org.eclipse.sirius.components.view.tree.TreeDescription#getKindExpression Kind Expression}'. + * * * @return the meta object for the attribute 'Kind Expression'. - * @generated * @see org.eclipse.sirius.components.view.tree.TreeDescription#getKindExpression() * @see #getTreeDescription() + * @generated */ EAttribute getTreeDescription_KindExpression(); /** - * Returns the meta object for the attribute '{@link org.eclipse.sirius.components.view.tree.TreeDescription#getTreeItemIconExpression Tree Item Icon Expression}'. - * + * Returns the meta object for the attribute + * '{@link org.eclipse.sirius.components.view.tree.TreeDescription#getTreeItemIconExpression Tree Item Icon + * Expression}'. * * @return the meta object for the attribute 'Tree Item Icon Expression'. - * @generated * @see org.eclipse.sirius.components.view.tree.TreeDescription#getTreeItemIconExpression() * @see #getTreeDescription() + * @generated */ EAttribute getTreeDescription_TreeItemIconExpression(); /** - * Returns the meta object for the attribute '{@link org.eclipse.sirius.components.view.tree.TreeDescription#getTreeItemIdExpression Tree Item Id Expression}'. - * + * Returns the meta object for the attribute + * '{@link org.eclipse.sirius.components.view.tree.TreeDescription#getTreeItemIdExpression Tree Item Id + * Expression}'. * * @return the meta object for the attribute 'Tree Item Id Expression'. - * @generated * @see org.eclipse.sirius.components.view.tree.TreeDescription#getTreeItemIdExpression() * @see #getTreeDescription() + * @generated */ EAttribute getTreeDescription_TreeItemIdExpression(); /** - * Returns the meta object for the attribute '{@link org.eclipse.sirius.components.view.tree.TreeDescription#getTreeItemObjectExpression Tree Item Object Expression}'. + * Returns the meta object for the attribute + * '{@link org.eclipse.sirius.components.view.tree.TreeDescription#getTreeItemObjectExpression Tree Item Object + * Expression}'. * * @return the meta object for the attribute 'Tree Item Object Expression'. - * @generated * @see org.eclipse.sirius.components.view.tree.TreeDescription#getTreeItemObjectExpression() * @see #getTreeDescription() + * @generated */ EAttribute getTreeDescription_TreeItemObjectExpression(); /** - * Returns the meta object for the attribute '{@link org.eclipse.sirius.components.view.tree.TreeDescription#getElementsExpression Elements Expression}'. + * Returns the meta object for the attribute + * '{@link org.eclipse.sirius.components.view.tree.TreeDescription#getElementsExpression Elements + * Expression}'. * * @return the meta object for the attribute 'Elements Expression'. - * @generated * @see org.eclipse.sirius.components.view.tree.TreeDescription#getElementsExpression() * @see #getTreeDescription() + * @generated */ EAttribute getTreeDescription_ElementsExpression(); /** - * Returns the meta object for the attribute '{@link org.eclipse.sirius.components.view.tree.TreeDescription#getHasChildrenExpression Has Children Expression}'. - * + * Returns the meta object for the attribute + * '{@link org.eclipse.sirius.components.view.tree.TreeDescription#getHasChildrenExpression Has Children + * Expression}'. * * @return the meta object for the attribute 'Has Children Expression'. - * @generated * @see org.eclipse.sirius.components.view.tree.TreeDescription#getHasChildrenExpression() * @see #getTreeDescription() + * @generated */ EAttribute getTreeDescription_HasChildrenExpression(); /** - * Returns the meta object for the attribute '{@link org.eclipse.sirius.components.view.tree.TreeDescription#getChildrenExpression Children Expression}'. + * Returns the meta object for the attribute + * '{@link org.eclipse.sirius.components.view.tree.TreeDescription#getChildrenExpression Children + * Expression}'. * * @return the meta object for the attribute 'Children Expression'. - * @generated * @see org.eclipse.sirius.components.view.tree.TreeDescription#getChildrenExpression() * @see #getTreeDescription() + * @generated */ EAttribute getTreeDescription_ChildrenExpression(); /** - * Returns the meta object for the attribute '{@link org.eclipse.sirius.components.view.tree.TreeDescription#getParentExpression Parent Expression}'. + * Returns the meta object for the attribute + * '{@link org.eclipse.sirius.components.view.tree.TreeDescription#getParentExpression Parent Expression}'. + * * * @return the meta object for the attribute 'Parent Expression'. - * @generated * @see org.eclipse.sirius.components.view.tree.TreeDescription#getParentExpression() * @see #getTreeDescription() + * @generated */ EAttribute getTreeDescription_ParentExpression(); /** - * Returns the meta object for the attribute '{@link org.eclipse.sirius.components.view.tree.TreeDescription#getEditableExpression Editable Expression}'. + * Returns the meta object for the attribute + * '{@link org.eclipse.sirius.components.view.tree.TreeDescription#getEditableExpression Editable + * Expression}'. * * @return the meta object for the attribute 'Editable Expression'. - * @generated * @see org.eclipse.sirius.components.view.tree.TreeDescription#getEditableExpression() * @see #getTreeDescription() + * @generated */ EAttribute getTreeDescription_EditableExpression(); /** - * Returns the meta object for the attribute '{@link org.eclipse.sirius.components.view.tree.TreeDescription#getSelectableExpression Selectable Expression}'. + * Returns the meta object for the attribute + * '{@link org.eclipse.sirius.components.view.tree.TreeDescription#getSelectableExpression Selectable + * Expression}'. * * @return the meta object for the attribute 'Selectable Expression'. - * @generated * @see org.eclipse.sirius.components.view.tree.TreeDescription#getSelectableExpression() * @see #getTreeDescription() + * @generated */ EAttribute getTreeDescription_SelectableExpression(); /** - * Returns the meta object for the attribute '{@link org.eclipse.sirius.components.view.tree.TreeDescription#getDeletableExpression Deletable Expression}'. + * Returns the meta object for the attribute + * '{@link org.eclipse.sirius.components.view.tree.TreeDescription#getDeletableExpression Deletable + * Expression}'. * * @return the meta object for the attribute 'Deletable Expression'. - * @generated * @see org.eclipse.sirius.components.view.tree.TreeDescription#getDeletableExpression() * @see #getTreeDescription() + * @generated */ EAttribute getTreeDescription_DeletableExpression(); /** - * Returns the meta object for the containment reference list '{@link org.eclipse.sirius.components.view.tree.TreeDescription#getTreeItemLabelDescriptions Tree Item Label Descriptions}'. - * + * Returns the meta object for the containment reference list + * '{@link org.eclipse.sirius.components.view.tree.TreeDescription#getTreeItemLabelDescriptions Tree Item Label + * Descriptions}'. * * @return the meta object for the containment reference list 'Tree Item Label Descriptions'. - * @generated * @see org.eclipse.sirius.components.view.tree.TreeDescription#getTreeItemLabelDescriptions() * @see #getTreeDescription() + * @generated */ EReference getTreeDescription_TreeItemLabelDescriptions(); /** - * Returns the meta object for the containment reference list '{@link org.eclipse.sirius.components.view.tree.TreeDescription#getContextMenuEntries Context Menu Entries}'. + * Returns the meta object for the containment reference list + * '{@link org.eclipse.sirius.components.view.tree.TreeDescription#getContextMenuEntries Context Menu + * Entries}'. * * @return the meta object for the containment reference list 'Context Menu Entries'. - * @generated * @see org.eclipse.sirius.components.view.tree.TreeDescription#getContextMenuEntries() * @see #getTreeDescription() + * @generated */ EReference getTreeDescription_ContextMenuEntries(); @@ -718,67 +810,74 @@ public interface TreePackage extends EPackage { * Item Label Description}'. * * @return the meta object for class 'Item Label Description'. - * @generated * @see org.eclipse.sirius.components.view.tree.TreeItemLabelDescription + * @generated */ EClass getTreeItemLabelDescription(); /** - * Returns the meta object for the attribute '{@link org.eclipse.sirius.components.view.tree.TreeItemLabelDescription#getName Name}'. + * Returns the meta object for the attribute + * '{@link org.eclipse.sirius.components.view.tree.TreeItemLabelDescription#getName Name}'. * * @return the meta object for the attribute 'Name'. - * @generated * @see org.eclipse.sirius.components.view.tree.TreeItemLabelDescription#getName() * @see #getTreeItemLabelDescription() + * @generated */ EAttribute getTreeItemLabelDescription_Name(); /** - * Returns the meta object for the attribute '{@link org.eclipse.sirius.components.view.tree.TreeItemLabelDescription#getPreconditionExpression + * Returns the meta object for the attribute + * '{@link org.eclipse.sirius.components.view.tree.TreeItemLabelDescription#getPreconditionExpression * Precondition Expression}'. * * @return the meta object for the attribute 'Precondition Expression'. - * @generated * @see org.eclipse.sirius.components.view.tree.TreeItemLabelDescription#getPreconditionExpression() * @see #getTreeItemLabelDescription() + * @generated */ EAttribute getTreeItemLabelDescription_PreconditionExpression(); /** - * Returns the meta object for the containment reference list '{@link org.eclipse.sirius.components.view.tree.TreeItemLabelDescription#getChildren Children}'. + * Returns the meta object for the containment reference list + * '{@link org.eclipse.sirius.components.view.tree.TreeItemLabelDescription#getChildren Children}'. * * @return the meta object for the containment reference list 'Children'. - * @generated * @see org.eclipse.sirius.components.view.tree.TreeItemLabelDescription#getChildren() * @see #getTreeItemLabelDescription() + * @generated */ EReference getTreeItemLabelDescription_Children(); /** - * Returns the meta object for class '{@link org.eclipse.sirius.components.view.tree.TreeItemLabelFragmentDescription Item Label Fragment Description}'. + * Returns the meta object for class + * '{@link org.eclipse.sirius.components.view.tree.TreeItemLabelFragmentDescription Item Label Fragment + * Description}'. * * @return the meta object for class 'Item Label Fragment Description'. - * @generated * @see org.eclipse.sirius.components.view.tree.TreeItemLabelFragmentDescription + * @generated */ EClass getTreeItemLabelFragmentDescription(); /** - * Returns the meta object for the attribute '{@link org.eclipse.sirius.components.view.tree.TreeItemLabelFragmentDescription#getLabelExpression Label Expression}'. + * Returns the meta object for the attribute + * '{@link org.eclipse.sirius.components.view.tree.TreeItemLabelFragmentDescription#getLabelExpression Label + * Expression}'. * * @return the meta object for the attribute 'Label Expression'. - * @generated * @see org.eclipse.sirius.components.view.tree.TreeItemLabelFragmentDescription#getLabelExpression() * @see #getTreeItemLabelFragmentDescription() + * @generated */ EAttribute getTreeItemLabelFragmentDescription_LabelExpression(); /** - * Returns the meta object for the reference '{@link org.eclipse.sirius.components.view.tree.TreeItemLabelFragmentDescription#getStyle Style}'. + * Returns the meta object for the reference + * '{@link org.eclipse.sirius.components.view.tree.TreeItemLabelFragmentDescription#getStyle Style}'. * * @return the meta object for the reference 'Style'. * @generated @@ -792,8 +891,8 @@ public interface TreePackage extends EPackage { * Item Label Element Description}'. * * @return the meta object for class 'Item Label Element Description'. - * @generated * @see org.eclipse.sirius.components.view.tree.TreeItemLabelElementDescription + * @generated */ EClass getTreeItemLabelElementDescription(); @@ -802,113 +901,170 @@ public interface TreePackage extends EPackage { * Item Context Menu Entry}'. * * @return the meta object for class 'Item Context Menu Entry'. - * @generated * @see org.eclipse.sirius.components.view.tree.TreeItemContextMenuEntry + * @generated */ EClass getTreeItemContextMenuEntry(); /** - * Returns the meta object for the attribute '{@link org.eclipse.sirius.components.view.tree.TreeItemContextMenuEntry#getName Name}'. + * Returns the meta object for the attribute + * '{@link org.eclipse.sirius.components.view.tree.TreeItemContextMenuEntry#getName Name}'. * * @return the meta object for the attribute 'Name'. - * @generated * @see org.eclipse.sirius.components.view.tree.TreeItemContextMenuEntry#getName() * @see #getTreeItemContextMenuEntry() + * @generated */ EAttribute getTreeItemContextMenuEntry_Name(); /** - * Returns the meta object for the attribute '{@link org.eclipse.sirius.components.view.tree.TreeItemContextMenuEntry#getLabelExpression Label Expression}'. + * Returns the meta object for the attribute + * '{@link org.eclipse.sirius.components.view.tree.TreeItemContextMenuEntry#getPreconditionExpression + * Precondition Expression}'. * - * @return the meta object for the attribute 'Label Expression'. - * @generated - * @see org.eclipse.sirius.components.view.tree.TreeItemContextMenuEntry#getLabelExpression() + * @return the meta object for the attribute 'Precondition Expression'. + * @see org.eclipse.sirius.components.view.tree.TreeItemContextMenuEntry#getPreconditionExpression() * @see #getTreeItemContextMenuEntry() + * @generated */ - EAttribute getTreeItemContextMenuEntry_LabelExpression(); + EAttribute getTreeItemContextMenuEntry_PreconditionExpression(); /** - * Returns the meta object for the attribute '{@link org.eclipse.sirius.components.view.tree.TreeItemContextMenuEntry#getIconURLExpression Icon URL Expression}'. - * + * Returns the meta object for class + * '{@link org.eclipse.sirius.components.view.tree.SingleClickTreeItemContextMenuEntry Single Click Tree Item + * Context Menu Entry}'. * - * @return the meta object for the attribute 'Icon URL Expression'. + * @return the meta object for class 'Single Click Tree Item Context Menu Entry'. + * @see org.eclipse.sirius.components.view.tree.SingleClickTreeItemContextMenuEntry * @generated - * @see org.eclipse.sirius.components.view.tree.TreeItemContextMenuEntry#getIconURLExpression() - * @see #getTreeItemContextMenuEntry() */ - EAttribute getTreeItemContextMenuEntry_IconURLExpression(); + EClass getSingleClickTreeItemContextMenuEntry(); /** - * Returns the meta object for the attribute '{@link org.eclipse.sirius.components.view.tree.TreeItemContextMenuEntry#getPreconditionExpression - * Precondition Expression}'. + * Returns the meta object for the containment reference list + * '{@link org.eclipse.sirius.components.view.tree.SingleClickTreeItemContextMenuEntry#getBody Body}'. * - * @return the meta object for the attribute 'Precondition Expression'. + * @return the meta object for the containment reference list 'Body'. + * @see org.eclipse.sirius.components.view.tree.SingleClickTreeItemContextMenuEntry#getBody() + * @see #getSingleClickTreeItemContextMenuEntry() * @generated - * @see org.eclipse.sirius.components.view.tree.TreeItemContextMenuEntry#getPreconditionExpression() - * @see #getTreeItemContextMenuEntry() */ - EAttribute getTreeItemContextMenuEntry_PreconditionExpression(); + EReference getSingleClickTreeItemContextMenuEntry_Body(); /** - * Returns the meta object for class '{@link org.eclipse.sirius.components.view.tree.SingleClickTreeItemContextMenuEntry Single Click Tree Item Context Menu Entry}'. + * Returns the meta object for the attribute + * '{@link org.eclipse.sirius.components.view.tree.SingleClickTreeItemContextMenuEntry#getLabelExpression Label + * Expression}'. * - * @return the meta object for class 'Single Click Tree Item Context Menu Entry'. + * @return the meta object for the attribute 'Label Expression'. + * @see org.eclipse.sirius.components.view.tree.SingleClickTreeItemContextMenuEntry#getLabelExpression() + * @see #getSingleClickTreeItemContextMenuEntry() * @generated - * @see org.eclipse.sirius.components.view.tree.SingleClickTreeItemContextMenuEntry */ - EClass getSingleClickTreeItemContextMenuEntry(); + EAttribute getSingleClickTreeItemContextMenuEntry_LabelExpression(); /** - * Returns the meta object for the reference list '{@link org.eclipse.sirius.components.view.tree.SingleClickTreeItemContextMenuEntry#getBody Body}'. + * Returns the meta object for the attribute + * '{@link org.eclipse.sirius.components.view.tree.SingleClickTreeItemContextMenuEntry#getIconURLExpression Icon + * URL Expression}'. * - * @return the meta object for the reference list 'Body'. - * @generated - * @see org.eclipse.sirius.components.view.tree.SingleClickTreeItemContextMenuEntry#getBody() + * @return the meta object for the attribute 'Icon URL Expression'. + * @see org.eclipse.sirius.components.view.tree.SingleClickTreeItemContextMenuEntry#getIconURLExpression() * @see #getSingleClickTreeItemContextMenuEntry() + * @generated */ - EReference getSingleClickTreeItemContextMenuEntry_Body(); + EAttribute getSingleClickTreeItemContextMenuEntry_IconURLExpression(); /** * Returns the meta object for class '{@link org.eclipse.sirius.components.view.tree.FetchTreeItemContextMenuEntry * Fetch Tree Item Context Menu Entry}'. * * @return the meta object for class 'Fetch Tree Item Context Menu Entry'. - * @generated * @see org.eclipse.sirius.components.view.tree.FetchTreeItemContextMenuEntry + * @generated */ EClass getFetchTreeItemContextMenuEntry(); /** - * Returns the meta object for the attribute '{@link org.eclipse.sirius.components.view.tree.FetchTreeItemContextMenuEntry#getUrlExression Url Exression}'. + * Returns the meta object for the attribute + * '{@link org.eclipse.sirius.components.view.tree.FetchTreeItemContextMenuEntry#getUrlExression Url + * Exression}'. * * @return the meta object for the attribute 'Url Exression'. - * @generated * @see org.eclipse.sirius.components.view.tree.FetchTreeItemContextMenuEntry#getUrlExression() * @see #getFetchTreeItemContextMenuEntry() + * @generated */ EAttribute getFetchTreeItemContextMenuEntry_UrlExression(); /** - * Returns the meta object for the attribute '{@link org.eclipse.sirius.components.view.tree.FetchTreeItemContextMenuEntry#getKind Kind}'. + * Returns the meta object for the attribute + * '{@link org.eclipse.sirius.components.view.tree.FetchTreeItemContextMenuEntry#getKind Kind}'. * * @return the meta object for the attribute 'Kind'. - * @generated * @see org.eclipse.sirius.components.view.tree.FetchTreeItemContextMenuEntry#getKind() * @see #getFetchTreeItemContextMenuEntry() + * @generated */ EAttribute getFetchTreeItemContextMenuEntry_Kind(); /** - * Returns the meta object for enum '{@link org.eclipse.sirius.components.view.tree.FetchTreeItemContextMenuEntryKind Fetch Tree Item Context Menu Entry Kind}'. - * + * Returns the meta object for the attribute + * '{@link org.eclipse.sirius.components.view.tree.FetchTreeItemContextMenuEntry#getLabelExpression Label + * Expression}'. * - * @return the meta object for enum 'Fetch Tree Item Context Menu Entry Kind'. + * @return the meta object for the attribute 'Label Expression'. + * @see org.eclipse.sirius.components.view.tree.FetchTreeItemContextMenuEntry#getLabelExpression() + * @see #getFetchTreeItemContextMenuEntry() + * @generated + */ + EAttribute getFetchTreeItemContextMenuEntry_LabelExpression(); + + /** + * Returns the meta object for the attribute + * '{@link org.eclipse.sirius.components.view.tree.FetchTreeItemContextMenuEntry#getIconURLExpression Icon URL + * Expression}'. + * + * @return the meta object for the attribute 'Icon URL Expression'. + * @see org.eclipse.sirius.components.view.tree.FetchTreeItemContextMenuEntry#getIconURLExpression() + * @see #getFetchTreeItemContextMenuEntry() + * @generated + */ + EAttribute getFetchTreeItemContextMenuEntry_IconURLExpression(); + + /** + * Returns the meta object for class '{@link org.eclipse.sirius.components.view.tree.CustomTreeItemContextMenuEntry + * Custom Tree Item Context Menu Entry}'. + * + * @return the meta object for class 'Custom Tree Item Context Menu Entry'. + * @see org.eclipse.sirius.components.view.tree.CustomTreeItemContextMenuEntry * @generated + */ + EClass getCustomTreeItemContextMenuEntry(); + + /** + * Returns the meta object for the attribute + * '{@link org.eclipse.sirius.components.view.tree.CustomTreeItemContextMenuEntry#getContributionId Contribution + * Id}'. + * + * @return the meta object for the attribute 'Contribution Id'. + * @see org.eclipse.sirius.components.view.tree.CustomTreeItemContextMenuEntry#getContributionId() + * @see #getCustomTreeItemContextMenuEntry() + * @generated + */ + EAttribute getCustomTreeItemContextMenuEntry_ContributionId(); + + /** + * Returns the meta object for enum + * '{@link org.eclipse.sirius.components.view.tree.FetchTreeItemContextMenuEntryKind Fetch Tree Item Context + * Menu Entry Kind}'. + * + * @return the meta object for enum 'Fetch Tree Item Context Menu Entry Kind'. * @see org.eclipse.sirius.components.view.tree.FetchTreeItemContextMenuEntryKind + * @generated */ EEnum getFetchTreeItemContextMenuEntryKind(); @@ -939,254 +1095,321 @@ interface Literals { * The meta object literal for the '{@link org.eclipse.sirius.components.view.tree.impl.TreeDescriptionImpl * Description}' class. * - * @generated * @see org.eclipse.sirius.components.view.tree.impl.TreeDescriptionImpl * @see org.eclipse.sirius.components.view.tree.impl.TreePackageImpl#getTreeDescription() + * @generated */ EClass TREE_DESCRIPTION = eINSTANCE.getTreeDescription(); /** - * The meta object literal for the 'Kind Expression' attribute feature. + * The meta object literal for the 'Kind Expression' attribute feature. + * * * @generated */ EAttribute TREE_DESCRIPTION__KIND_EXPRESSION = eINSTANCE.getTreeDescription_KindExpression(); /** - * The meta object literal for the 'Tree Item Icon Expression' attribute feature. + * The meta object literal for the 'Tree Item Icon Expression' attribute feature. * * @generated */ EAttribute TREE_DESCRIPTION__TREE_ITEM_ICON_EXPRESSION = eINSTANCE.getTreeDescription_TreeItemIconExpression(); /** - * The meta object literal for the 'Tree Item Id Expression' attribute feature. + * The meta object literal for the 'Tree Item Id Expression' attribute feature. * * @generated */ EAttribute TREE_DESCRIPTION__TREE_ITEM_ID_EXPRESSION = eINSTANCE.getTreeDescription_TreeItemIdExpression(); /** - * The meta object literal for the 'Tree Item Object Expression' attribute feature. + * The meta object literal for the 'Tree Item Object Expression' attribute feature. * * @generated */ EAttribute TREE_DESCRIPTION__TREE_ITEM_OBJECT_EXPRESSION = eINSTANCE.getTreeDescription_TreeItemObjectExpression(); /** - * The meta object literal for the 'Elements Expression' attribute feature. + * The meta object literal for the 'Elements Expression' attribute feature. * * @generated */ EAttribute TREE_DESCRIPTION__ELEMENTS_EXPRESSION = eINSTANCE.getTreeDescription_ElementsExpression(); /** - * The meta object literal for the 'Has Children Expression' attribute feature. + * The meta object literal for the 'Has Children Expression' attribute feature. * * @generated */ EAttribute TREE_DESCRIPTION__HAS_CHILDREN_EXPRESSION = eINSTANCE.getTreeDescription_HasChildrenExpression(); /** - * The meta object literal for the 'Children Expression' attribute feature. + * The meta object literal for the 'Children Expression' attribute feature. * * @generated */ EAttribute TREE_DESCRIPTION__CHILDREN_EXPRESSION = eINSTANCE.getTreeDescription_ChildrenExpression(); /** - * The meta object literal for the 'Parent Expression' attribute feature. + * The meta object literal for the 'Parent Expression' attribute feature. * * @generated */ EAttribute TREE_DESCRIPTION__PARENT_EXPRESSION = eINSTANCE.getTreeDescription_ParentExpression(); /** - * The meta object literal for the 'Editable Expression' attribute feature. + * The meta object literal for the 'Editable Expression' attribute feature. * * @generated */ EAttribute TREE_DESCRIPTION__EDITABLE_EXPRESSION = eINSTANCE.getTreeDescription_EditableExpression(); /** - * The meta object literal for the 'Selectable Expression' attribute feature. + * The meta object literal for the 'Selectable Expression' attribute feature. * * @generated */ EAttribute TREE_DESCRIPTION__SELECTABLE_EXPRESSION = eINSTANCE.getTreeDescription_SelectableExpression(); /** - * The meta object literal for the 'Deletable Expression' attribute feature. + * The meta object literal for the 'Deletable Expression' attribute feature. * * @generated */ EAttribute TREE_DESCRIPTION__DELETABLE_EXPRESSION = eINSTANCE.getTreeDescription_DeletableExpression(); /** - * The meta object literal for the 'Tree Item Label Descriptions' reference list feature. + * The meta object literal for the 'Tree Item Label Descriptions' containment reference list + * feature. * * @generated */ EReference TREE_DESCRIPTION__TREE_ITEM_LABEL_DESCRIPTIONS = eINSTANCE.getTreeDescription_TreeItemLabelDescriptions(); /** - * The meta object literal for the 'Context Menu Entries' reference list feature. + * The meta object literal for the 'Context Menu Entries' containment reference list feature. + * * * @generated */ EReference TREE_DESCRIPTION__CONTEXT_MENU_ENTRIES = eINSTANCE.getTreeDescription_ContextMenuEntries(); /** - * The meta object literal for the '{@link org.eclipse.sirius.components.view.tree.impl.TreeItemLabelDescriptionImpl Item Label Description}' class. + * The meta object literal for the + * '{@link org.eclipse.sirius.components.view.tree.impl.TreeItemLabelDescriptionImpl Item Label + * Description}' class. * - * @generated * @see org.eclipse.sirius.components.view.tree.impl.TreeItemLabelDescriptionImpl * @see org.eclipse.sirius.components.view.tree.impl.TreePackageImpl#getTreeItemLabelDescription() + * @generated */ EClass TREE_ITEM_LABEL_DESCRIPTION = eINSTANCE.getTreeItemLabelDescription(); /** - * The meta object literal for the 'Name' attribute feature. + * The meta object literal for the 'Name' attribute feature. * * @generated */ EAttribute TREE_ITEM_LABEL_DESCRIPTION__NAME = eINSTANCE.getTreeItemLabelDescription_Name(); /** - * The meta object literal for the 'Precondition Expression' attribute feature. + * The meta object literal for the 'Precondition Expression' attribute feature. * * @generated */ EAttribute TREE_ITEM_LABEL_DESCRIPTION__PRECONDITION_EXPRESSION = eINSTANCE.getTreeItemLabelDescription_PreconditionExpression(); /** - * The meta object literal for the 'Children' containment reference list feature. + * The meta object literal for the 'Children' containment reference list feature. * * @generated */ EReference TREE_ITEM_LABEL_DESCRIPTION__CHILDREN = eINSTANCE.getTreeItemLabelDescription_Children(); /** - * The meta object literal for the '{@link org.eclipse.sirius.components.view.tree.impl.TreeItemLabelFragmentDescriptionImpl Item Label Fragment Description}' class. + * The meta object literal for the + * '{@link org.eclipse.sirius.components.view.tree.impl.TreeItemLabelFragmentDescriptionImpl Item Label + * Fragment Description}' class. * - * @generated * @see org.eclipse.sirius.components.view.tree.impl.TreeItemLabelFragmentDescriptionImpl * @see org.eclipse.sirius.components.view.tree.impl.TreePackageImpl#getTreeItemLabelFragmentDescription() + * @generated */ EClass TREE_ITEM_LABEL_FRAGMENT_DESCRIPTION = eINSTANCE.getTreeItemLabelFragmentDescription(); /** - * The meta object literal for the 'Label Expression' attribute feature. + * The meta object literal for the 'Label Expression' attribute feature. + * * * @generated */ EAttribute TREE_ITEM_LABEL_FRAGMENT_DESCRIPTION__LABEL_EXPRESSION = eINSTANCE.getTreeItemLabelFragmentDescription_LabelExpression(); /** - * The meta object literal for the 'Style' reference feature. + * The meta object literal for the 'Style' reference feature. * * @generated */ EReference TREE_ITEM_LABEL_FRAGMENT_DESCRIPTION__STYLE = eINSTANCE.getTreeItemLabelFragmentDescription_Style(); /** - * The meta object literal for the '{@link org.eclipse.sirius.components.view.tree.impl.TreeItemLabelElementDescriptionImpl Item Label Element Description}' class. + * The meta object literal for the + * '{@link org.eclipse.sirius.components.view.tree.impl.TreeItemLabelElementDescriptionImpl Item Label + * Element Description}' class. * - * @generated * @see org.eclipse.sirius.components.view.tree.impl.TreeItemLabelElementDescriptionImpl * @see org.eclipse.sirius.components.view.tree.impl.TreePackageImpl#getTreeItemLabelElementDescription() + * @generated */ EClass TREE_ITEM_LABEL_ELEMENT_DESCRIPTION = eINSTANCE.getTreeItemLabelElementDescription(); /** - * The meta object literal for the '{@link org.eclipse.sirius.components.view.tree.impl.TreeItemContextMenuEntryImpl Item Context Menu Entry}' class. + * The meta object literal for the + * '{@link org.eclipse.sirius.components.view.tree.impl.TreeItemContextMenuEntryImpl Item Context Menu + * Entry}' class. * - * @generated * @see org.eclipse.sirius.components.view.tree.impl.TreeItemContextMenuEntryImpl * @see org.eclipse.sirius.components.view.tree.impl.TreePackageImpl#getTreeItemContextMenuEntry() + * @generated */ EClass TREE_ITEM_CONTEXT_MENU_ENTRY = eINSTANCE.getTreeItemContextMenuEntry(); /** - * The meta object literal for the 'Name' attribute feature. + * The meta object literal for the 'Name' attribute feature. * * @generated */ EAttribute TREE_ITEM_CONTEXT_MENU_ENTRY__NAME = eINSTANCE.getTreeItemContextMenuEntry_Name(); /** - * The meta object literal for the 'Label Expression' attribute feature. + * The meta object literal for the 'Precondition Expression' attribute feature. * * @generated */ - EAttribute TREE_ITEM_CONTEXT_MENU_ENTRY__LABEL_EXPRESSION = eINSTANCE.getTreeItemContextMenuEntry_LabelExpression(); + EAttribute TREE_ITEM_CONTEXT_MENU_ENTRY__PRECONDITION_EXPRESSION = eINSTANCE.getTreeItemContextMenuEntry_PreconditionExpression(); /** - * The meta object literal for the 'Icon URL Expression' attribute feature. + * The meta object literal for the + * '{@link org.eclipse.sirius.components.view.tree.impl.SingleClickTreeItemContextMenuEntryImpl Single Click + * Tree Item Context Menu Entry}' class. * + * @see org.eclipse.sirius.components.view.tree.impl.SingleClickTreeItemContextMenuEntryImpl + * @see org.eclipse.sirius.components.view.tree.impl.TreePackageImpl#getSingleClickTreeItemContextMenuEntry() * @generated */ - EAttribute TREE_ITEM_CONTEXT_MENU_ENTRY__ICON_URL_EXPRESSION = eINSTANCE.getTreeItemContextMenuEntry_IconURLExpression(); + EClass SINGLE_CLICK_TREE_ITEM_CONTEXT_MENU_ENTRY = eINSTANCE.getSingleClickTreeItemContextMenuEntry(); /** - * The meta object literal for the 'Precondition Expression' attribute feature. + * The meta object literal for the 'Body' containment reference list feature. * * @generated */ - EAttribute TREE_ITEM_CONTEXT_MENU_ENTRY__PRECONDITION_EXPRESSION = eINSTANCE.getTreeItemContextMenuEntry_PreconditionExpression(); + EReference SINGLE_CLICK_TREE_ITEM_CONTEXT_MENU_ENTRY__BODY = eINSTANCE.getSingleClickTreeItemContextMenuEntry_Body(); /** - * The meta object literal for the '{@link org.eclipse.sirius.components.view.tree.impl.SingleClickTreeItemContextMenuEntryImpl Single Click Tree Item Context Menu Entry}' class. + * The meta object literal for the 'Label Expression' attribute feature. + * * * @generated - * @see org.eclipse.sirius.components.view.tree.impl.SingleClickTreeItemContextMenuEntryImpl - * @see org.eclipse.sirius.components.view.tree.impl.TreePackageImpl#getSingleClickTreeItemContextMenuEntry() */ - EClass SINGLE_CLICK_TREE_ITEM_CONTEXT_MENU_ENTRY = eINSTANCE.getSingleClickTreeItemContextMenuEntry(); + EAttribute SINGLE_CLICK_TREE_ITEM_CONTEXT_MENU_ENTRY__LABEL_EXPRESSION = eINSTANCE.getSingleClickTreeItemContextMenuEntry_LabelExpression(); /** - * The meta object literal for the 'Body' containment reference list feature. + * The meta object literal for the 'Icon URL Expression' attribute feature. * * @generated */ - EReference SINGLE_CLICK_TREE_ITEM_CONTEXT_MENU_ENTRY__BODY = eINSTANCE.getSingleClickTreeItemContextMenuEntry_Body(); + EAttribute SINGLE_CLICK_TREE_ITEM_CONTEXT_MENU_ENTRY__ICON_URL_EXPRESSION = eINSTANCE.getSingleClickTreeItemContextMenuEntry_IconURLExpression(); /** - * The meta object literal for the '{@link org.eclipse.sirius.components.view.tree.impl.FetchTreeItemContextMenuEntryImpl Fetch Tree Item Context Menu Entry}' class. + * The meta object literal for the + * '{@link org.eclipse.sirius.components.view.tree.impl.FetchTreeItemContextMenuEntryImpl Fetch Tree Item + * Context Menu Entry}' class. * - * @generated * @see org.eclipse.sirius.components.view.tree.impl.FetchTreeItemContextMenuEntryImpl * @see org.eclipse.sirius.components.view.tree.impl.TreePackageImpl#getFetchTreeItemContextMenuEntry() + * @generated */ EClass FETCH_TREE_ITEM_CONTEXT_MENU_ENTRY = eINSTANCE.getFetchTreeItemContextMenuEntry(); /** - * The meta object literal for the 'Url Exression' attribute feature. + * The meta object literal for the 'Url Exression' attribute feature. + * * * @generated */ EAttribute FETCH_TREE_ITEM_CONTEXT_MENU_ENTRY__URL_EXRESSION = eINSTANCE.getFetchTreeItemContextMenuEntry_UrlExression(); /** - * The meta object literal for the 'Kind' attribute feature. + * The meta object literal for the 'Kind' attribute feature. * * @generated */ EAttribute FETCH_TREE_ITEM_CONTEXT_MENU_ENTRY__KIND = eINSTANCE.getFetchTreeItemContextMenuEntry_Kind(); /** - * The meta object literal for the '{@link org.eclipse.sirius.components.view.tree.FetchTreeItemContextMenuEntryKind Fetch Tree Item Context Menu Entry Kind}' enum. + * The meta object literal for the 'Label Expression' attribute feature. + * * * @generated + */ + EAttribute FETCH_TREE_ITEM_CONTEXT_MENU_ENTRY__LABEL_EXPRESSION = eINSTANCE.getFetchTreeItemContextMenuEntry_LabelExpression(); + + /** + * The meta object literal for the 'Icon URL Expression' attribute feature. + * + * @generated + */ + EAttribute FETCH_TREE_ITEM_CONTEXT_MENU_ENTRY__ICON_URL_EXPRESSION = eINSTANCE.getFetchTreeItemContextMenuEntry_IconURLExpression(); + + /** + * The meta object literal for the + * '{@link org.eclipse.sirius.components.view.tree.impl.CustomTreeItemContextMenuEntryImpl Custom Tree Item + * Context Menu Entry}' class. + * + * @see org.eclipse.sirius.components.view.tree.impl.CustomTreeItemContextMenuEntryImpl + * @see org.eclipse.sirius.components.view.tree.impl.TreePackageImpl#getCustomTreeItemContextMenuEntry() + * @generated + */ + EClass CUSTOM_TREE_ITEM_CONTEXT_MENU_ENTRY = eINSTANCE.getCustomTreeItemContextMenuEntry(); + + /** + * The meta object literal for the 'Contribution Id' attribute feature. + * + * + * @generated + */ + EAttribute CUSTOM_TREE_ITEM_CONTEXT_MENU_ENTRY__CONTRIBUTION_ID = eINSTANCE.getCustomTreeItemContextMenuEntry_ContributionId(); + + /** + * The meta object literal for the + * '{@link org.eclipse.sirius.components.view.tree.FetchTreeItemContextMenuEntryKind Fetch Tree Item Context + * Menu Entry Kind}' enum. + * * @see org.eclipse.sirius.components.view.tree.FetchTreeItemContextMenuEntryKind * @see org.eclipse.sirius.components.view.tree.impl.TreePackageImpl#getFetchTreeItemContextMenuEntryKind() + * @generated */ EEnum FETCH_TREE_ITEM_CONTEXT_MENU_ENTRY_KIND = eINSTANCE.getFetchTreeItemContextMenuEntryKind(); diff --git a/packages/view/backend/sirius-components-view-tree/src/main/java/org/eclipse/sirius/components/view/tree/impl/CustomTreeItemContextMenuEntryImpl.java b/packages/view/backend/sirius-components-view-tree/src/main/java/org/eclipse/sirius/components/view/tree/impl/CustomTreeItemContextMenuEntryImpl.java new file mode 100644 index 0000000000..f432fe634d --- /dev/null +++ b/packages/view/backend/sirius-components-view-tree/src/main/java/org/eclipse/sirius/components/view/tree/impl/CustomTreeItemContextMenuEntryImpl.java @@ -0,0 +1,172 @@ +/******************************************************************************* + * Copyright (c) 2025 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.sirius.components.view.tree.impl; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.impl.ENotificationImpl; +import org.eclipse.sirius.components.view.tree.CustomTreeItemContextMenuEntry; +import org.eclipse.sirius.components.view.tree.TreePackage; + +/** + * An implementation of the model object 'Custom Tree Item Context Menu Entry'. + * + *

    + * The following features are implemented: + *

    + *
      + *
    • {@link org.eclipse.sirius.components.view.tree.impl.CustomTreeItemContextMenuEntryImpl#getContributionId + * Contribution Id}
    • + *
    + * + * @generated + */ +public class CustomTreeItemContextMenuEntryImpl extends TreeItemContextMenuEntryImpl implements CustomTreeItemContextMenuEntry { + /** + * The default value of the '{@link #getContributionId() Contribution Id}' attribute. + * + * @see #getContributionId() + * @generated + * @ordered + */ + protected static final String CONTRIBUTION_ID_EDEFAULT = null; + + /** + * The cached value of the '{@link #getContributionId() Contribution Id}' attribute. + * + * @see #getContributionId() + * @generated + * @ordered + */ + protected String contributionId = CONTRIBUTION_ID_EDEFAULT; + + /** + * + * + * @generated + */ + protected CustomTreeItemContextMenuEntryImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return TreePackage.Literals.CUSTOM_TREE_ITEM_CONTEXT_MENU_ENTRY; + } + + /** + * + * + * @generated + */ + @Override + public String getContributionId() { + return this.contributionId; + } + + /** + * + * + * @generated + */ + @Override + public void setContributionId(String newContributionId) { + String oldContributionId = this.contributionId; + this.contributionId = newContributionId; + if (this.eNotificationRequired()) + this.eNotify(new ENotificationImpl(this, Notification.SET, TreePackage.CUSTOM_TREE_ITEM_CONTEXT_MENU_ENTRY__CONTRIBUTION_ID, oldContributionId, this.contributionId)); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case TreePackage.CUSTOM_TREE_ITEM_CONTEXT_MENU_ENTRY__CONTRIBUTION_ID: + return this.getContributionId(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case TreePackage.CUSTOM_TREE_ITEM_CONTEXT_MENU_ENTRY__CONTRIBUTION_ID: + this.setContributionId((String) newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case TreePackage.CUSTOM_TREE_ITEM_CONTEXT_MENU_ENTRY__CONTRIBUTION_ID: + this.setContributionId(CONTRIBUTION_ID_EDEFAULT); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case TreePackage.CUSTOM_TREE_ITEM_CONTEXT_MENU_ENTRY__CONTRIBUTION_ID: + return CONTRIBUTION_ID_EDEFAULT == null ? this.contributionId != null : !CONTRIBUTION_ID_EDEFAULT.equals(this.contributionId); + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public String toString() { + if (this.eIsProxy()) + return super.toString(); + + StringBuilder result = new StringBuilder(super.toString()); + result.append(" (contributionId: "); + result.append(this.contributionId); + result.append(')'); + return result.toString(); + } + +} // CustomTreeItemContextMenuEntryImpl diff --git a/packages/view/backend/sirius-components-view-tree/src/main/java/org/eclipse/sirius/components/view/tree/impl/FetchTreeItemContextMenuEntryImpl.java b/packages/view/backend/sirius-components-view-tree/src/main/java/org/eclipse/sirius/components/view/tree/impl/FetchTreeItemContextMenuEntryImpl.java index 6dc7a3dd0d..966fad2aae 100644 --- a/packages/view/backend/sirius-components-view-tree/src/main/java/org/eclipse/sirius/components/view/tree/impl/FetchTreeItemContextMenuEntryImpl.java +++ b/packages/view/backend/sirius-components-view-tree/src/main/java/org/eclipse/sirius/components/view/tree/impl/FetchTreeItemContextMenuEntryImpl.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2024 Obeo. + * Copyright (c) 2024, 2025 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 @@ -29,6 +29,10 @@ *
  • {@link org.eclipse.sirius.components.view.tree.impl.FetchTreeItemContextMenuEntryImpl#getUrlExression Url * Exression}
  • *
  • {@link org.eclipse.sirius.components.view.tree.impl.FetchTreeItemContextMenuEntryImpl#getKind Kind}
  • + *
  • {@link org.eclipse.sirius.components.view.tree.impl.FetchTreeItemContextMenuEntryImpl#getLabelExpression + * Label Expression}
  • + *
  • {@link org.eclipse.sirius.components.view.tree.impl.FetchTreeItemContextMenuEntryImpl#getIconURLExpression + * Icon URL Expression}
  • * * * @generated @@ -74,6 +78,46 @@ public class FetchTreeItemContextMenuEntryImpl extends TreeItemContextMenuEntryI */ protected FetchTreeItemContextMenuEntryKind kind = KIND_EDEFAULT; + /** + * The default value of the '{@link #getLabelExpression() Label Expression}' attribute. + * + * @see #getLabelExpression() + * @generated + * @ordered + */ + protected static final String LABEL_EXPRESSION_EDEFAULT = null; + + /** + * The cached value of the '{@link #getLabelExpression() Label Expression}' attribute. + * + * @see #getLabelExpression() + * @generated + * @ordered + */ + protected String labelExpression = LABEL_EXPRESSION_EDEFAULT; + + /** + * The default value of the '{@link #getIconURLExpression() Icon URL Expression}' attribute. + * + * @see #getIconURLExpression() + * @generated + * @ordered + */ + protected static final String ICON_URL_EXPRESSION_EDEFAULT = null; + + /** + * The cached value of the '{@link #getIconURLExpression() Icon URL Expression}' attribute. + * + * @see #getIconURLExpression() + * @generated + * @ordered + */ + protected String iconURLExpression = ICON_URL_EXPRESSION_EDEFAULT; + /** * * @@ -139,6 +183,52 @@ public void setKind(FetchTreeItemContextMenuEntryKind newKind) { this.eNotify(new ENotificationImpl(this, Notification.SET, TreePackage.FETCH_TREE_ITEM_CONTEXT_MENU_ENTRY__KIND, oldKind, this.kind)); } + /** + * + * + * @generated + */ + @Override + public String getLabelExpression() { + return this.labelExpression; + } + + /** + * + * + * @generated + */ + @Override + public void setLabelExpression(String newLabelExpression) { + String oldLabelExpression = this.labelExpression; + this.labelExpression = newLabelExpression; + if (this.eNotificationRequired()) + this.eNotify(new ENotificationImpl(this, Notification.SET, TreePackage.FETCH_TREE_ITEM_CONTEXT_MENU_ENTRY__LABEL_EXPRESSION, oldLabelExpression, this.labelExpression)); + } + + /** + * + * + * @generated + */ + @Override + public String getIconURLExpression() { + return this.iconURLExpression; + } + + /** + * + * + * @generated + */ + @Override + public void setIconURLExpression(String newIconURLExpression) { + String oldIconURLExpression = this.iconURLExpression; + this.iconURLExpression = newIconURLExpression; + if (this.eNotificationRequired()) + this.eNotify(new ENotificationImpl(this, Notification.SET, TreePackage.FETCH_TREE_ITEM_CONTEXT_MENU_ENTRY__ICON_URL_EXPRESSION, oldIconURLExpression, this.iconURLExpression)); + } + /** * * @@ -151,6 +241,10 @@ public Object eGet(int featureID, boolean resolve, boolean coreType) { return this.getUrlExression(); case TreePackage.FETCH_TREE_ITEM_CONTEXT_MENU_ENTRY__KIND: return this.getKind(); + case TreePackage.FETCH_TREE_ITEM_CONTEXT_MENU_ENTRY__LABEL_EXPRESSION: + return this.getLabelExpression(); + case TreePackage.FETCH_TREE_ITEM_CONTEXT_MENU_ENTRY__ICON_URL_EXPRESSION: + return this.getIconURLExpression(); } return super.eGet(featureID, resolve, coreType); } @@ -169,6 +263,12 @@ public void eSet(int featureID, Object newValue) { case TreePackage.FETCH_TREE_ITEM_CONTEXT_MENU_ENTRY__KIND: this.setKind((FetchTreeItemContextMenuEntryKind) newValue); return; + case TreePackage.FETCH_TREE_ITEM_CONTEXT_MENU_ENTRY__LABEL_EXPRESSION: + this.setLabelExpression((String) newValue); + return; + case TreePackage.FETCH_TREE_ITEM_CONTEXT_MENU_ENTRY__ICON_URL_EXPRESSION: + this.setIconURLExpression((String) newValue); + return; } super.eSet(featureID, newValue); } @@ -187,6 +287,12 @@ public void eUnset(int featureID) { case TreePackage.FETCH_TREE_ITEM_CONTEXT_MENU_ENTRY__KIND: this.setKind(KIND_EDEFAULT); return; + case TreePackage.FETCH_TREE_ITEM_CONTEXT_MENU_ENTRY__LABEL_EXPRESSION: + this.setLabelExpression(LABEL_EXPRESSION_EDEFAULT); + return; + case TreePackage.FETCH_TREE_ITEM_CONTEXT_MENU_ENTRY__ICON_URL_EXPRESSION: + this.setIconURLExpression(ICON_URL_EXPRESSION_EDEFAULT); + return; } super.eUnset(featureID); } @@ -203,6 +309,10 @@ public boolean eIsSet(int featureID) { return URL_EXRESSION_EDEFAULT == null ? this.urlExression != null : !URL_EXRESSION_EDEFAULT.equals(this.urlExression); case TreePackage.FETCH_TREE_ITEM_CONTEXT_MENU_ENTRY__KIND: return this.kind != KIND_EDEFAULT; + case TreePackage.FETCH_TREE_ITEM_CONTEXT_MENU_ENTRY__LABEL_EXPRESSION: + return LABEL_EXPRESSION_EDEFAULT == null ? this.labelExpression != null : !LABEL_EXPRESSION_EDEFAULT.equals(this.labelExpression); + case TreePackage.FETCH_TREE_ITEM_CONTEXT_MENU_ENTRY__ICON_URL_EXPRESSION: + return ICON_URL_EXPRESSION_EDEFAULT == null ? this.iconURLExpression != null : !ICON_URL_EXPRESSION_EDEFAULT.equals(this.iconURLExpression); } return super.eIsSet(featureID); } @@ -222,6 +332,10 @@ public String toString() { result.append(this.urlExression); result.append(", kind: "); result.append(this.kind); + result.append(", labelExpression: "); + result.append(this.labelExpression); + result.append(", iconURLExpression: "); + result.append(this.iconURLExpression); result.append(')'); return result.toString(); } diff --git a/packages/view/backend/sirius-components-view-tree/src/main/java/org/eclipse/sirius/components/view/tree/impl/SingleClickTreeItemContextMenuEntryImpl.java b/packages/view/backend/sirius-components-view-tree/src/main/java/org/eclipse/sirius/components/view/tree/impl/SingleClickTreeItemContextMenuEntryImpl.java index b259cb3ab8..53d005a7d3 100644 --- a/packages/view/backend/sirius-components-view-tree/src/main/java/org/eclipse/sirius/components/view/tree/impl/SingleClickTreeItemContextMenuEntryImpl.java +++ b/packages/view/backend/sirius-components-view-tree/src/main/java/org/eclipse/sirius/components/view/tree/impl/SingleClickTreeItemContextMenuEntryImpl.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2024 Obeo. + * Copyright (c) 2024, 2025 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 @@ -14,10 +14,12 @@ import java.util.Collection; +import org.eclipse.emf.common.notify.Notification; import org.eclipse.emf.common.notify.NotificationChain; import org.eclipse.emf.common.util.EList; import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.InternalEObject; +import org.eclipse.emf.ecore.impl.ENotificationImpl; import org.eclipse.emf.ecore.util.EObjectContainmentEList; import org.eclipse.emf.ecore.util.InternalEList; import org.eclipse.sirius.components.view.Operation; @@ -25,13 +27,18 @@ import org.eclipse.sirius.components.view.tree.TreePackage; /** - * An implementation of the model object 'Single Click Tree Item Context Menu Entry'. + * An implementation of the model object 'Single Click Tree Item Context Menu + * Entry'. *

    * The following features are implemented: *

    *
      *
    • {@link org.eclipse.sirius.components.view.tree.impl.SingleClickTreeItemContextMenuEntryImpl#getBody * Body}
    • + *
    • {@link org.eclipse.sirius.components.view.tree.impl.SingleClickTreeItemContextMenuEntryImpl#getLabelExpression + * Label Expression}
    • + *
    • {@link org.eclipse.sirius.components.view.tree.impl.SingleClickTreeItemContextMenuEntryImpl#getIconURLExpression + * Icon URL Expression}
    • *
    * * @generated @@ -39,14 +46,55 @@ public class SingleClickTreeItemContextMenuEntryImpl extends TreeItemContextMenuEntryImpl implements SingleClickTreeItemContextMenuEntry { /** - * The cached value of the '{@link #getBody() Body}' containment reference list. + * The cached value of the '{@link #getBody() Body}' containment reference list. + * * + * @see #getBody() * @generated * @ordered - * @see #getBody() */ protected EList body; + /** + * The default value of the '{@link #getLabelExpression() Label Expression}' attribute. + * + * @see #getLabelExpression() + * @generated + * @ordered + */ + protected static final String LABEL_EXPRESSION_EDEFAULT = null; + + /** + * The cached value of the '{@link #getLabelExpression() Label Expression}' attribute. + * + * @see #getLabelExpression() + * @generated + * @ordered + */ + protected String labelExpression = LABEL_EXPRESSION_EDEFAULT; + + /** + * The default value of the '{@link #getIconURLExpression() Icon URL Expression}' attribute. + * + * @see #getIconURLExpression() + * @generated + * @ordered + */ + protected static final String ICON_URL_EXPRESSION_EDEFAULT = null; + + /** + * The cached value of the '{@link #getIconURLExpression() Icon URL Expression}' attribute. + * + * @see #getIconURLExpression() + * @generated + * @ordered + */ + protected String iconURLExpression = ICON_URL_EXPRESSION_EDEFAULT; + /** * * @@ -79,6 +127,52 @@ public EList getBody() { return this.body; } + /** + * + * + * @generated + */ + @Override + public String getLabelExpression() { + return this.labelExpression; + } + + /** + * + * + * @generated + */ + @Override + public void setLabelExpression(String newLabelExpression) { + String oldLabelExpression = this.labelExpression; + this.labelExpression = newLabelExpression; + if (this.eNotificationRequired()) + this.eNotify(new ENotificationImpl(this, Notification.SET, TreePackage.SINGLE_CLICK_TREE_ITEM_CONTEXT_MENU_ENTRY__LABEL_EXPRESSION, oldLabelExpression, this.labelExpression)); + } + + /** + * + * + * @generated + */ + @Override + public String getIconURLExpression() { + return this.iconURLExpression; + } + + /** + * + * + * @generated + */ + @Override + public void setIconURLExpression(String newIconURLExpression) { + String oldIconURLExpression = this.iconURLExpression; + this.iconURLExpression = newIconURLExpression; + if (this.eNotificationRequired()) + this.eNotify(new ENotificationImpl(this, Notification.SET, TreePackage.SINGLE_CLICK_TREE_ITEM_CONTEXT_MENU_ENTRY__ICON_URL_EXPRESSION, oldIconURLExpression, this.iconURLExpression)); + } + /** * * @@ -103,6 +197,10 @@ public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { case TreePackage.SINGLE_CLICK_TREE_ITEM_CONTEXT_MENU_ENTRY__BODY: return this.getBody(); + case TreePackage.SINGLE_CLICK_TREE_ITEM_CONTEXT_MENU_ENTRY__LABEL_EXPRESSION: + return this.getLabelExpression(); + case TreePackage.SINGLE_CLICK_TREE_ITEM_CONTEXT_MENU_ENTRY__ICON_URL_EXPRESSION: + return this.getIconURLExpression(); } return super.eGet(featureID, resolve, coreType); } @@ -120,6 +218,12 @@ public void eSet(int featureID, Object newValue) { this.getBody().clear(); this.getBody().addAll((Collection) newValue); return; + case TreePackage.SINGLE_CLICK_TREE_ITEM_CONTEXT_MENU_ENTRY__LABEL_EXPRESSION: + this.setLabelExpression((String) newValue); + return; + case TreePackage.SINGLE_CLICK_TREE_ITEM_CONTEXT_MENU_ENTRY__ICON_URL_EXPRESSION: + this.setIconURLExpression((String) newValue); + return; } super.eSet(featureID, newValue); } @@ -135,6 +239,12 @@ public void eUnset(int featureID) { case TreePackage.SINGLE_CLICK_TREE_ITEM_CONTEXT_MENU_ENTRY__BODY: this.getBody().clear(); return; + case TreePackage.SINGLE_CLICK_TREE_ITEM_CONTEXT_MENU_ENTRY__LABEL_EXPRESSION: + this.setLabelExpression(LABEL_EXPRESSION_EDEFAULT); + return; + case TreePackage.SINGLE_CLICK_TREE_ITEM_CONTEXT_MENU_ENTRY__ICON_URL_EXPRESSION: + this.setIconURLExpression(ICON_URL_EXPRESSION_EDEFAULT); + return; } super.eUnset(featureID); } @@ -149,8 +259,31 @@ public boolean eIsSet(int featureID) { switch (featureID) { case TreePackage.SINGLE_CLICK_TREE_ITEM_CONTEXT_MENU_ENTRY__BODY: return this.body != null && !this.body.isEmpty(); + case TreePackage.SINGLE_CLICK_TREE_ITEM_CONTEXT_MENU_ENTRY__LABEL_EXPRESSION: + return LABEL_EXPRESSION_EDEFAULT == null ? this.labelExpression != null : !LABEL_EXPRESSION_EDEFAULT.equals(this.labelExpression); + case TreePackage.SINGLE_CLICK_TREE_ITEM_CONTEXT_MENU_ENTRY__ICON_URL_EXPRESSION: + return ICON_URL_EXPRESSION_EDEFAULT == null ? this.iconURLExpression != null : !ICON_URL_EXPRESSION_EDEFAULT.equals(this.iconURLExpression); } return super.eIsSet(featureID); } + /** + * + * + * @generated + */ + @Override + public String toString() { + if (this.eIsProxy()) + return super.toString(); + + StringBuilder result = new StringBuilder(super.toString()); + result.append(" (labelExpression: "); + result.append(this.labelExpression); + result.append(", iconURLExpression: "); + result.append(this.iconURLExpression); + result.append(')'); + return result.toString(); + } + } // SingleClickTreeItemContextMenuEntryImpl diff --git a/packages/view/backend/sirius-components-view-tree/src/main/java/org/eclipse/sirius/components/view/tree/impl/TreeDescriptionImpl.java b/packages/view/backend/sirius-components-view-tree/src/main/java/org/eclipse/sirius/components/view/tree/impl/TreeDescriptionImpl.java index e19cb761bd..f1dbbc4d5f 100644 --- a/packages/view/backend/sirius-components-view-tree/src/main/java/org/eclipse/sirius/components/view/tree/impl/TreeDescriptionImpl.java +++ b/packages/view/backend/sirius-components-view-tree/src/main/java/org/eclipse/sirius/components/view/tree/impl/TreeDescriptionImpl.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2024 Obeo. + * Copyright (c) 2024, 2025 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 @@ -13,7 +13,6 @@ package org.eclipse.sirius.components.view.tree.impl; import java.util.Collection; -import java.util.Objects; import org.eclipse.emf.common.notify.Notification; import org.eclipse.emf.common.notify.NotificationChain; @@ -68,218 +67,242 @@ public class TreeDescriptionImpl extends RepresentationDescriptionImpl implements TreeDescription { /** - * The default value of the '{@link #getKindExpression() Kind Expression}' attribute. + * The default value of the '{@link #getKindExpression() Kind Expression}' attribute. * + * @see #getKindExpression() * @generated * @ordered - * @see #getKindExpression() */ protected static final String KIND_EXPRESSION_EDEFAULT = null; /** - * The cached value of the '{@link #getKindExpression() Kind Expression}' attribute. + * The cached value of the '{@link #getKindExpression() Kind Expression}' attribute. * + * @see #getKindExpression() * @generated * @ordered - * @see #getKindExpression() */ protected String kindExpression = KIND_EXPRESSION_EDEFAULT; /** - * The default value of the '{@link #getTreeItemIconExpression() Tree Item Icon Expression}' attribute. + * The default value of the '{@link #getTreeItemIconExpression() Tree Item Icon Expression}' attribute. + * * + * @see #getTreeItemIconExpression() * @generated * @ordered - * @see #getTreeItemIconExpression() */ protected static final String TREE_ITEM_ICON_EXPRESSION_EDEFAULT = null; /** - * The cached value of the '{@link #getTreeItemIconExpression() Tree Item Icon Expression}' attribute. + * The cached value of the '{@link #getTreeItemIconExpression() Tree Item Icon Expression}' attribute. * + * @see #getTreeItemIconExpression() * @generated * @ordered - * @see #getTreeItemIconExpression() */ protected String treeItemIconExpression = TREE_ITEM_ICON_EXPRESSION_EDEFAULT; /** - * The default value of the '{@link #getTreeItemIdExpression() Tree Item Id Expression}' attribute. + * The default value of the '{@link #getTreeItemIdExpression() Tree Item Id Expression}' attribute. * + * @see #getTreeItemIdExpression() * @generated * @ordered - * @see #getTreeItemIdExpression() */ protected static final String TREE_ITEM_ID_EXPRESSION_EDEFAULT = null; /** - * The cached value of the '{@link #getTreeItemIdExpression() Tree Item Id Expression}' attribute. + * The cached value of the '{@link #getTreeItemIdExpression() Tree Item Id Expression}' attribute. * + * @see #getTreeItemIdExpression() * @generated * @ordered - * @see #getTreeItemIdExpression() */ protected String treeItemIdExpression = TREE_ITEM_ID_EXPRESSION_EDEFAULT; /** - * The default value of the '{@link #getTreeItemObjectExpression() Tree Item Object Expression}' attribute. + * The default value of the '{@link #getTreeItemObjectExpression() Tree Item Object Expression}' attribute. + * * + * @see #getTreeItemObjectExpression() * @generated * @ordered - * @see #getTreeItemObjectExpression() */ protected static final String TREE_ITEM_OBJECT_EXPRESSION_EDEFAULT = null; /** - * The cached value of the '{@link #getTreeItemObjectExpression() Tree Item Object Expression}' attribute. + * The cached value of the '{@link #getTreeItemObjectExpression() Tree Item Object Expression}' attribute. + * * + * @see #getTreeItemObjectExpression() * @generated * @ordered - * @see #getTreeItemObjectExpression() */ protected String treeItemObjectExpression = TREE_ITEM_OBJECT_EXPRESSION_EDEFAULT; /** - * The default value of the '{@link #getElementsExpression() Elements Expression}' attribute. + * The default value of the '{@link #getElementsExpression() Elements Expression}' attribute. * + * @see #getElementsExpression() * @generated * @ordered - * @see #getElementsExpression() */ protected static final String ELEMENTS_EXPRESSION_EDEFAULT = null; /** - * The cached value of the '{@link #getElementsExpression() Elements Expression}' attribute. + * The cached value of the '{@link #getElementsExpression() Elements Expression}' attribute. * + * @see #getElementsExpression() * @generated * @ordered - * @see #getElementsExpression() */ protected String elementsExpression = ELEMENTS_EXPRESSION_EDEFAULT; /** - * The default value of the '{@link #getHasChildrenExpression() Has Children Expression}' attribute. + * The default value of the '{@link #getHasChildrenExpression() Has Children Expression}' attribute. * + * @see #getHasChildrenExpression() * @generated * @ordered - * @see #getHasChildrenExpression() */ protected static final String HAS_CHILDREN_EXPRESSION_EDEFAULT = null; /** - * The cached value of the '{@link #getHasChildrenExpression() Has Children Expression}' attribute. + * The cached value of the '{@link #getHasChildrenExpression() Has Children Expression}' attribute. * + * @see #getHasChildrenExpression() * @generated * @ordered - * @see #getHasChildrenExpression() */ protected String hasChildrenExpression = HAS_CHILDREN_EXPRESSION_EDEFAULT; /** - * The default value of the '{@link #getChildrenExpression() Children Expression}' attribute. + * The default value of the '{@link #getChildrenExpression() Children Expression}' attribute. * + * @see #getChildrenExpression() * @generated * @ordered - * @see #getChildrenExpression() */ protected static final String CHILDREN_EXPRESSION_EDEFAULT = null; /** - * The cached value of the '{@link #getChildrenExpression() Children Expression}' attribute. + * The cached value of the '{@link #getChildrenExpression() Children Expression}' attribute. * + * @see #getChildrenExpression() * @generated * @ordered - * @see #getChildrenExpression() */ protected String childrenExpression = CHILDREN_EXPRESSION_EDEFAULT; /** - * The default value of the '{@link #getParentExpression() Parent Expression}' attribute. + * The default value of the '{@link #getParentExpression() Parent Expression}' attribute. * + * @see #getParentExpression() * @generated * @ordered - * @see #getParentExpression() */ protected static final String PARENT_EXPRESSION_EDEFAULT = null; /** - * The cached value of the '{@link #getParentExpression() Parent Expression}' attribute. + * The cached value of the '{@link #getParentExpression() Parent Expression}' attribute. * + * @see #getParentExpression() * @generated * @ordered - * @see #getParentExpression() */ protected String parentExpression = PARENT_EXPRESSION_EDEFAULT; /** - * The default value of the '{@link #getEditableExpression() Editable Expression}' attribute. + * The default value of the '{@link #getEditableExpression() Editable Expression}' attribute. * + * @see #getEditableExpression() * @generated * @ordered - * @see #getEditableExpression() */ protected static final String EDITABLE_EXPRESSION_EDEFAULT = null; /** - * The cached value of the '{@link #getEditableExpression() Editable Expression}' attribute. + * The cached value of the '{@link #getEditableExpression() Editable Expression}' attribute. * + * @see #getEditableExpression() * @generated * @ordered - * @see #getEditableExpression() */ protected String editableExpression = EDITABLE_EXPRESSION_EDEFAULT; /** - * The default value of the '{@link #getSelectableExpression() Selectable Expression}' attribute. + * The default value of the '{@link #getSelectableExpression() Selectable Expression}' attribute. * + * @see #getSelectableExpression() * @generated * @ordered - * @see #getSelectableExpression() */ protected static final String SELECTABLE_EXPRESSION_EDEFAULT = null; /** - * The cached value of the '{@link #getSelectableExpression() Selectable Expression}' attribute. + * The cached value of the '{@link #getSelectableExpression() Selectable Expression}' attribute. * + * @see #getSelectableExpression() * @generated * @ordered - * @see #getSelectableExpression() */ protected String selectableExpression = SELECTABLE_EXPRESSION_EDEFAULT; /** - * The default value of the '{@link #getDeletableExpression() Deletable Expression}' attribute. + * The default value of the '{@link #getDeletableExpression() Deletable Expression}' attribute. * + * @see #getDeletableExpression() * @generated * @ordered - * @see #getDeletableExpression() */ protected static final String DELETABLE_EXPRESSION_EDEFAULT = null; /** - * The cached value of the '{@link #getDeletableExpression() Deletable Expression}' attribute. + * The cached value of the '{@link #getDeletableExpression() Deletable Expression}' attribute. * + * @see #getDeletableExpression() * @generated * @ordered - * @see #getDeletableExpression() */ protected String deletableExpression = DELETABLE_EXPRESSION_EDEFAULT; /** - * The cached value of the '{@link #getTreeItemLabelDescriptions() Tree Item Label Descriptions}' containment reference list. + * The cached value of the '{@link #getTreeItemLabelDescriptions() Tree Item Label Descriptions}' + * containment reference list. * + * @see #getTreeItemLabelDescriptions() * @generated * @ordered - * @see #getTreeItemLabelDescriptions() */ protected EList treeItemLabelDescriptions; /** - * The cached value of the '{@link #getContextMenuEntries() Context Menu Entries}' reference list. + * The cached value of the '{@link #getContextMenuEntries() Context Menu Entries}' containment reference + * list. * + * @see #getContextMenuEntries() * @generated * @ordered - * @see #getContextMenuEntries() */ protected EList contextMenuEntries; @@ -749,27 +772,27 @@ public void eUnset(int featureID) { public boolean eIsSet(int featureID) { switch (featureID) { case TreePackage.TREE_DESCRIPTION__KIND_EXPRESSION: - return !Objects.equals(KIND_EXPRESSION_EDEFAULT, this.kindExpression); + return KIND_EXPRESSION_EDEFAULT == null ? this.kindExpression != null : !KIND_EXPRESSION_EDEFAULT.equals(this.kindExpression); case TreePackage.TREE_DESCRIPTION__TREE_ITEM_ICON_EXPRESSION: - return !Objects.equals(TREE_ITEM_ICON_EXPRESSION_EDEFAULT, this.treeItemIconExpression); + return TREE_ITEM_ICON_EXPRESSION_EDEFAULT == null ? this.treeItemIconExpression != null : !TREE_ITEM_ICON_EXPRESSION_EDEFAULT.equals(this.treeItemIconExpression); case TreePackage.TREE_DESCRIPTION__TREE_ITEM_ID_EXPRESSION: - return !Objects.equals(TREE_ITEM_ID_EXPRESSION_EDEFAULT, this.treeItemIdExpression); + return TREE_ITEM_ID_EXPRESSION_EDEFAULT == null ? this.treeItemIdExpression != null : !TREE_ITEM_ID_EXPRESSION_EDEFAULT.equals(this.treeItemIdExpression); case TreePackage.TREE_DESCRIPTION__TREE_ITEM_OBJECT_EXPRESSION: - return !Objects.equals(TREE_ITEM_OBJECT_EXPRESSION_EDEFAULT, this.treeItemObjectExpression); + return TREE_ITEM_OBJECT_EXPRESSION_EDEFAULT == null ? this.treeItemObjectExpression != null : !TREE_ITEM_OBJECT_EXPRESSION_EDEFAULT.equals(this.treeItemObjectExpression); case TreePackage.TREE_DESCRIPTION__ELEMENTS_EXPRESSION: - return !Objects.equals(ELEMENTS_EXPRESSION_EDEFAULT, this.elementsExpression); + return ELEMENTS_EXPRESSION_EDEFAULT == null ? this.elementsExpression != null : !ELEMENTS_EXPRESSION_EDEFAULT.equals(this.elementsExpression); case TreePackage.TREE_DESCRIPTION__HAS_CHILDREN_EXPRESSION: - return !Objects.equals(HAS_CHILDREN_EXPRESSION_EDEFAULT, this.hasChildrenExpression); + return HAS_CHILDREN_EXPRESSION_EDEFAULT == null ? this.hasChildrenExpression != null : !HAS_CHILDREN_EXPRESSION_EDEFAULT.equals(this.hasChildrenExpression); case TreePackage.TREE_DESCRIPTION__CHILDREN_EXPRESSION: - return !Objects.equals(CHILDREN_EXPRESSION_EDEFAULT, this.childrenExpression); + return CHILDREN_EXPRESSION_EDEFAULT == null ? this.childrenExpression != null : !CHILDREN_EXPRESSION_EDEFAULT.equals(this.childrenExpression); case TreePackage.TREE_DESCRIPTION__PARENT_EXPRESSION: - return !Objects.equals(PARENT_EXPRESSION_EDEFAULT, this.parentExpression); + return PARENT_EXPRESSION_EDEFAULT == null ? this.parentExpression != null : !PARENT_EXPRESSION_EDEFAULT.equals(this.parentExpression); case TreePackage.TREE_DESCRIPTION__EDITABLE_EXPRESSION: - return !Objects.equals(EDITABLE_EXPRESSION_EDEFAULT, this.editableExpression); + return EDITABLE_EXPRESSION_EDEFAULT == null ? this.editableExpression != null : !EDITABLE_EXPRESSION_EDEFAULT.equals(this.editableExpression); case TreePackage.TREE_DESCRIPTION__SELECTABLE_EXPRESSION: - return !Objects.equals(SELECTABLE_EXPRESSION_EDEFAULT, this.selectableExpression); + return SELECTABLE_EXPRESSION_EDEFAULT == null ? this.selectableExpression != null : !SELECTABLE_EXPRESSION_EDEFAULT.equals(this.selectableExpression); case TreePackage.TREE_DESCRIPTION__DELETABLE_EXPRESSION: - return !Objects.equals(DELETABLE_EXPRESSION_EDEFAULT, this.deletableExpression); + return DELETABLE_EXPRESSION_EDEFAULT == null ? this.deletableExpression != null : !DELETABLE_EXPRESSION_EDEFAULT.equals(this.deletableExpression); case TreePackage.TREE_DESCRIPTION__TREE_ITEM_LABEL_DESCRIPTIONS: return this.treeItemLabelDescriptions != null && !this.treeItemLabelDescriptions.isEmpty(); case TreePackage.TREE_DESCRIPTION__CONTEXT_MENU_ENTRIES: @@ -788,30 +811,31 @@ public String toString() { if (this.eIsProxy()) return super.toString(); - String result = super.toString() + " (kindExpression: " + - this.kindExpression + - ", treeItemIconExpression: " + - this.treeItemIconExpression + - ", treeItemIdExpression: " + - this.treeItemIdExpression + - ", treeItemObjectExpression: " + - this.treeItemObjectExpression + - ", elementsExpression: " + - this.elementsExpression + - ", hasChildrenExpression: " + - this.hasChildrenExpression + - ", childrenExpression: " + - this.childrenExpression + - ", parentExpression: " + - this.parentExpression + - ", editableExpression: " + - this.editableExpression + - ", selectableExpression: " + - this.selectableExpression + - ", deletableExpression: " + - this.deletableExpression + - ')'; - return result; + StringBuilder result = new StringBuilder(super.toString()); + result.append(" (kindExpression: "); + result.append(this.kindExpression); + result.append(", treeItemIconExpression: "); + result.append(this.treeItemIconExpression); + result.append(", treeItemIdExpression: "); + result.append(this.treeItemIdExpression); + result.append(", treeItemObjectExpression: "); + result.append(this.treeItemObjectExpression); + result.append(", elementsExpression: "); + result.append(this.elementsExpression); + result.append(", hasChildrenExpression: "); + result.append(this.hasChildrenExpression); + result.append(", childrenExpression: "); + result.append(this.childrenExpression); + result.append(", parentExpression: "); + result.append(this.parentExpression); + result.append(", editableExpression: "); + result.append(this.editableExpression); + result.append(", selectableExpression: "); + result.append(this.selectableExpression); + result.append(", deletableExpression: "); + result.append(this.deletableExpression); + result.append(')'); + return result.toString(); } } // TreeDescriptionImpl diff --git a/packages/view/backend/sirius-components-view-tree/src/main/java/org/eclipse/sirius/components/view/tree/impl/TreeFactoryImpl.java b/packages/view/backend/sirius-components-view-tree/src/main/java/org/eclipse/sirius/components/view/tree/impl/TreeFactoryImpl.java index 33e1d96aa3..9c2ec8c86f 100644 --- a/packages/view/backend/sirius-components-view-tree/src/main/java/org/eclipse/sirius/components/view/tree/impl/TreeFactoryImpl.java +++ b/packages/view/backend/sirius-components-view-tree/src/main/java/org/eclipse/sirius/components/view/tree/impl/TreeFactoryImpl.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2024 Obeo. + * Copyright (c) 2024, 2025 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 @@ -18,6 +18,7 @@ import org.eclipse.emf.ecore.EPackage; import org.eclipse.emf.ecore.impl.EFactoryImpl; import org.eclipse.emf.ecore.plugin.EcorePlugin; +import org.eclipse.sirius.components.view.tree.CustomTreeItemContextMenuEntry; import org.eclipse.sirius.components.view.tree.FetchTreeItemContextMenuEntry; import org.eclipse.sirius.components.view.tree.FetchTreeItemContextMenuEntryKind; import org.eclipse.sirius.components.view.tree.SingleClickTreeItemContextMenuEntry; @@ -77,6 +78,8 @@ public EObject create(EClass eClass) { return this.createSingleClickTreeItemContextMenuEntry(); case TreePackage.FETCH_TREE_ITEM_CONTEXT_MENU_ENTRY: return this.createFetchTreeItemContextMenuEntry(); + case TreePackage.CUSTOM_TREE_ITEM_CONTEXT_MENU_ENTRY: + return this.createCustomTreeItemContextMenuEntry(); default: throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier"); } @@ -167,6 +170,17 @@ public FetchTreeItemContextMenuEntry createFetchTreeItemContextMenuEntry() { return fetchTreeItemContextMenuEntry; } + /** + * + * + * @generated + */ + @Override + public CustomTreeItemContextMenuEntry createCustomTreeItemContextMenuEntry() { + CustomTreeItemContextMenuEntryImpl customTreeItemContextMenuEntry = new CustomTreeItemContextMenuEntryImpl(); + return customTreeItemContextMenuEntry; + } + /** * * diff --git a/packages/view/backend/sirius-components-view-tree/src/main/java/org/eclipse/sirius/components/view/tree/impl/TreeItemContextMenuEntryImpl.java b/packages/view/backend/sirius-components-view-tree/src/main/java/org/eclipse/sirius/components/view/tree/impl/TreeItemContextMenuEntryImpl.java index d33be1dbd6..572a2ff729 100644 --- a/packages/view/backend/sirius-components-view-tree/src/main/java/org/eclipse/sirius/components/view/tree/impl/TreeItemContextMenuEntryImpl.java +++ b/packages/view/backend/sirius-components-view-tree/src/main/java/org/eclipse/sirius/components/view/tree/impl/TreeItemContextMenuEntryImpl.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2024 Obeo. + * Copyright (c) 2024, 2025 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 @@ -12,8 +12,6 @@ *******************************************************************************/ package org.eclipse.sirius.components.view.tree.impl; -import java.util.Objects; - import org.eclipse.emf.common.notify.Notification; import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.impl.ENotificationImpl; @@ -22,16 +20,13 @@ import org.eclipse.sirius.components.view.tree.TreePackage; /** - * An implementation of the model object 'Item Context Menu Entry'. + * An implementation of the model object 'Item Context Menu Entry'. *

    * The following features are implemented: *

    *
      *
    • {@link org.eclipse.sirius.components.view.tree.impl.TreeItemContextMenuEntryImpl#getName Name}
    • - *
    • {@link org.eclipse.sirius.components.view.tree.impl.TreeItemContextMenuEntryImpl#getLabelExpression Label - * Expression}
    • - *
    • {@link org.eclipse.sirius.components.view.tree.impl.TreeItemContextMenuEntryImpl#getIconURLExpression Icon - * URL Expression}
    • *
    • {@link org.eclipse.sirius.components.view.tree.impl.TreeItemContextMenuEntryImpl#getPreconditionExpression * Precondition Expression}
    • *
    @@ -41,74 +36,42 @@ public abstract class TreeItemContextMenuEntryImpl extends MinimalEObjectImpl.Container implements TreeItemContextMenuEntry { /** - * The default value of the '{@link #getName() Name}' attribute. + * The default value of the '{@link #getName() Name}' attribute. * + * @see #getName() * @generated * @ordered - * @see #getName() */ protected static final String NAME_EDEFAULT = null; /** - * The cached value of the '{@link #getName() Name}' attribute. + * The cached value of the '{@link #getName() Name}' attribute. * - * @generated - * @ordered * @see #getName() - */ - protected String name = NAME_EDEFAULT; - - /** - * The default value of the '{@link #getLabelExpression() Label Expression}' attribute. - * - * @generated - * @ordered - * @see #getLabelExpression() - */ - protected static final String LABEL_EXPRESSION_EDEFAULT = null; - - /** - * The cached value of the '{@link #getLabelExpression() Label Expression}' attribute. - * - * @generated - * @ordered - * @see #getLabelExpression() - */ - protected String labelExpression = LABEL_EXPRESSION_EDEFAULT; - - /** - * The default value of the '{@link #getIconURLExpression() Icon URL Expression}' attribute. - * - * @generated - * @ordered - * @see #getIconURLExpression() - */ - protected static final String ICON_URL_EXPRESSION_EDEFAULT = null; - - /** - * The cached value of the '{@link #getIconURLExpression() Icon URL Expression}' attribute. - * * @generated * @ordered - * @see #getIconURLExpression() */ - protected String iconURLExpression = ICON_URL_EXPRESSION_EDEFAULT; + protected String name = NAME_EDEFAULT; /** - * The default value of the '{@link #getPreconditionExpression() Precondition Expression}' attribute. + * The default value of the '{@link #getPreconditionExpression() Precondition Expression}' attribute. * + * @see #getPreconditionExpression() * @generated * @ordered - * @see #getPreconditionExpression() */ protected static final String PRECONDITION_EXPRESSION_EDEFAULT = null; /** - * The cached value of the '{@link #getPreconditionExpression() Precondition Expression}' attribute. + * The cached value of the '{@link #getPreconditionExpression() Precondition Expression}' attribute. * + * @see #getPreconditionExpression() * @generated * @ordered - * @see #getPreconditionExpression() */ protected String preconditionExpression = PRECONDITION_EXPRESSION_EDEFAULT; @@ -154,52 +117,6 @@ public void setName(String newName) { this.eNotify(new ENotificationImpl(this, Notification.SET, TreePackage.TREE_ITEM_CONTEXT_MENU_ENTRY__NAME, oldName, this.name)); } - /** - * - * - * @generated - */ - @Override - public String getLabelExpression() { - return this.labelExpression; - } - - /** - * - * - * @generated - */ - @Override - public void setLabelExpression(String newLabelExpression) { - String oldLabelExpression = this.labelExpression; - this.labelExpression = newLabelExpression; - if (this.eNotificationRequired()) - this.eNotify(new ENotificationImpl(this, Notification.SET, TreePackage.TREE_ITEM_CONTEXT_MENU_ENTRY__LABEL_EXPRESSION, oldLabelExpression, this.labelExpression)); - } - - /** - * - * - * @generated - */ - @Override - public String getIconURLExpression() { - return this.iconURLExpression; - } - - /** - * - * - * @generated - */ - @Override - public void setIconURLExpression(String newIconURLExpression) { - String oldIconURLExpression = this.iconURLExpression; - this.iconURLExpression = newIconURLExpression; - if (this.eNotificationRequired()) - this.eNotify(new ENotificationImpl(this, Notification.SET, TreePackage.TREE_ITEM_CONTEXT_MENU_ENTRY__ICON_URL_EXPRESSION, oldIconURLExpression, this.iconURLExpression)); - } - /** * * @@ -233,10 +150,6 @@ public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { case TreePackage.TREE_ITEM_CONTEXT_MENU_ENTRY__NAME: return this.getName(); - case TreePackage.TREE_ITEM_CONTEXT_MENU_ENTRY__LABEL_EXPRESSION: - return this.getLabelExpression(); - case TreePackage.TREE_ITEM_CONTEXT_MENU_ENTRY__ICON_URL_EXPRESSION: - return this.getIconURLExpression(); case TreePackage.TREE_ITEM_CONTEXT_MENU_ENTRY__PRECONDITION_EXPRESSION: return this.getPreconditionExpression(); } @@ -254,12 +167,6 @@ public void eSet(int featureID, Object newValue) { case TreePackage.TREE_ITEM_CONTEXT_MENU_ENTRY__NAME: this.setName((String) newValue); return; - case TreePackage.TREE_ITEM_CONTEXT_MENU_ENTRY__LABEL_EXPRESSION: - this.setLabelExpression((String) newValue); - return; - case TreePackage.TREE_ITEM_CONTEXT_MENU_ENTRY__ICON_URL_EXPRESSION: - this.setIconURLExpression((String) newValue); - return; case TreePackage.TREE_ITEM_CONTEXT_MENU_ENTRY__PRECONDITION_EXPRESSION: this.setPreconditionExpression((String) newValue); return; @@ -278,12 +185,6 @@ public void eUnset(int featureID) { case TreePackage.TREE_ITEM_CONTEXT_MENU_ENTRY__NAME: this.setName(NAME_EDEFAULT); return; - case TreePackage.TREE_ITEM_CONTEXT_MENU_ENTRY__LABEL_EXPRESSION: - this.setLabelExpression(LABEL_EXPRESSION_EDEFAULT); - return; - case TreePackage.TREE_ITEM_CONTEXT_MENU_ENTRY__ICON_URL_EXPRESSION: - this.setIconURLExpression(ICON_URL_EXPRESSION_EDEFAULT); - return; case TreePackage.TREE_ITEM_CONTEXT_MENU_ENTRY__PRECONDITION_EXPRESSION: this.setPreconditionExpression(PRECONDITION_EXPRESSION_EDEFAULT); return; @@ -300,13 +201,9 @@ public void eUnset(int featureID) { public boolean eIsSet(int featureID) { switch (featureID) { case TreePackage.TREE_ITEM_CONTEXT_MENU_ENTRY__NAME: - return !Objects.equals(NAME_EDEFAULT, this.name); - case TreePackage.TREE_ITEM_CONTEXT_MENU_ENTRY__LABEL_EXPRESSION: - return !Objects.equals(LABEL_EXPRESSION_EDEFAULT, this.labelExpression); - case TreePackage.TREE_ITEM_CONTEXT_MENU_ENTRY__ICON_URL_EXPRESSION: - return !Objects.equals(ICON_URL_EXPRESSION_EDEFAULT, this.iconURLExpression); + return NAME_EDEFAULT == null ? this.name != null : !NAME_EDEFAULT.equals(this.name); case TreePackage.TREE_ITEM_CONTEXT_MENU_ENTRY__PRECONDITION_EXPRESSION: - return !Objects.equals(PRECONDITION_EXPRESSION_EDEFAULT, this.preconditionExpression); + return PRECONDITION_EXPRESSION_EDEFAULT == null ? this.preconditionExpression != null : !PRECONDITION_EXPRESSION_EDEFAULT.equals(this.preconditionExpression); } return super.eIsSet(featureID); } @@ -321,16 +218,13 @@ public String toString() { if (this.eIsProxy()) return super.toString(); - String result = super.toString() + " (name: " + - this.name + - ", labelExpression: " + - this.labelExpression + - ", iconURLExpression: " + - this.iconURLExpression + - ", preconditionExpression: " + - this.preconditionExpression + - ')'; - return result; + StringBuilder result = new StringBuilder(super.toString()); + result.append(" (name: "); + result.append(this.name); + result.append(", preconditionExpression: "); + result.append(this.preconditionExpression); + result.append(')'); + return result.toString(); } } // TreeItemContextMenuEntryImpl diff --git a/packages/view/backend/sirius-components-view-tree/src/main/java/org/eclipse/sirius/components/view/tree/impl/TreePackageImpl.java b/packages/view/backend/sirius-components-view-tree/src/main/java/org/eclipse/sirius/components/view/tree/impl/TreePackageImpl.java index 0634ed3028..4742edc514 100644 --- a/packages/view/backend/sirius-components-view-tree/src/main/java/org/eclipse/sirius/components/view/tree/impl/TreePackageImpl.java +++ b/packages/view/backend/sirius-components-view-tree/src/main/java/org/eclipse/sirius/components/view/tree/impl/TreePackageImpl.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2024 Obeo. + * Copyright (c) 2024, 2025 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 @@ -19,6 +19,7 @@ import org.eclipse.emf.ecore.EReference; import org.eclipse.emf.ecore.impl.EPackageImpl; import org.eclipse.sirius.components.view.ViewPackage; +import org.eclipse.sirius.components.view.tree.CustomTreeItemContextMenuEntry; import org.eclipse.sirius.components.view.tree.FetchTreeItemContextMenuEntry; import org.eclipse.sirius.components.view.tree.FetchTreeItemContextMenuEntryKind; import org.eclipse.sirius.components.view.tree.SingleClickTreeItemContextMenuEntry; @@ -86,6 +87,13 @@ public class TreePackageImpl extends EPackageImpl implements TreePackage { */ private EClass fetchTreeItemContextMenuEntryEClass = null; + /** + * + * + * @generated + */ + private EClass customTreeItemContextMenuEntryEClass = null; + /** * * @@ -115,15 +123,17 @@ public class TreePackageImpl extends EPackageImpl implements TreePackage { private boolean isInitialized = false; /** - * Creates an instance of the model Package, registered with {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package package URI value. + * Creates an instance of the model Package, registered with {@link org.eclipse.emf.ecore.EPackage.Registry + * EPackage.Registry} by the package package URI value. *

    - * Note: the correct way to create the package is via the static factory method {@link #init init()}, which also performs initialization of the package, or returns the registered package, if one - * already exists. + * Note: the correct way to create the package is via the static factory method {@link #init init()}, which also + * performs initialization of the package, or returns the registered package, if one already exists. * - * @generated * @see org.eclipse.emf.ecore.EPackage.Registry * @see org.eclipse.sirius.components.view.tree.TreePackage#eNS_URI * @see #init() + * @generated */ private TreePackageImpl() { super(eNS_URI, TreeFactory.eINSTANCE); @@ -133,13 +143,14 @@ private TreePackageImpl() { * Creates, registers, and initializes the Package for this model, and for any others upon which it depends. * *

    - * This method is used to initialize {@link TreePackage#eINSTANCE} when that field is accessed. Clients should not invoke it directly. Instead, they should simply access that field to obtain the - * package. + * This method is used to initialize {@link TreePackage#eINSTANCE} when that field is accessed. Clients should not + * invoke it directly. Instead, they should simply access that field to obtain the package. + * * - * @generated * @see #eNS_URI * @see #createPackageContents() * @see #initializePackageContents() + * @generated */ public static TreePackage init() { if (isInited) @@ -414,7 +425,7 @@ public EAttribute getTreeItemContextMenuEntry_Name() { * @generated */ @Override - public EAttribute getTreeItemContextMenuEntry_LabelExpression() { + public EAttribute getTreeItemContextMenuEntry_PreconditionExpression() { return (EAttribute) this.treeItemContextMenuEntryEClass.getEStructuralFeatures().get(1); } @@ -424,8 +435,8 @@ public EAttribute getTreeItemContextMenuEntry_LabelExpression() { * @generated */ @Override - public EAttribute getTreeItemContextMenuEntry_IconURLExpression() { - return (EAttribute) this.treeItemContextMenuEntryEClass.getEStructuralFeatures().get(2); + public EClass getSingleClickTreeItemContextMenuEntry() { + return this.singleClickTreeItemContextMenuEntryEClass; } /** @@ -434,8 +445,8 @@ public EAttribute getTreeItemContextMenuEntry_IconURLExpression() { * @generated */ @Override - public EAttribute getTreeItemContextMenuEntry_PreconditionExpression() { - return (EAttribute) this.treeItemContextMenuEntryEClass.getEStructuralFeatures().get(3); + public EReference getSingleClickTreeItemContextMenuEntry_Body() { + return (EReference) this.singleClickTreeItemContextMenuEntryEClass.getEStructuralFeatures().get(0); } /** @@ -444,8 +455,8 @@ public EAttribute getTreeItemContextMenuEntry_PreconditionExpression() { * @generated */ @Override - public EClass getSingleClickTreeItemContextMenuEntry() { - return this.singleClickTreeItemContextMenuEntryEClass; + public EAttribute getSingleClickTreeItemContextMenuEntry_LabelExpression() { + return (EAttribute) this.singleClickTreeItemContextMenuEntryEClass.getEStructuralFeatures().get(1); } /** @@ -454,8 +465,8 @@ public EClass getSingleClickTreeItemContextMenuEntry() { * @generated */ @Override - public EReference getSingleClickTreeItemContextMenuEntry_Body() { - return (EReference) this.singleClickTreeItemContextMenuEntryEClass.getEStructuralFeatures().get(0); + public EAttribute getSingleClickTreeItemContextMenuEntry_IconURLExpression() { + return (EAttribute) this.singleClickTreeItemContextMenuEntryEClass.getEStructuralFeatures().get(2); } /** @@ -488,6 +499,46 @@ public EAttribute getFetchTreeItemContextMenuEntry_Kind() { return (EAttribute) this.fetchTreeItemContextMenuEntryEClass.getEStructuralFeatures().get(1); } + /** + * + * + * @generated + */ + @Override + public EAttribute getFetchTreeItemContextMenuEntry_LabelExpression() { + return (EAttribute) this.fetchTreeItemContextMenuEntryEClass.getEStructuralFeatures().get(2); + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getFetchTreeItemContextMenuEntry_IconURLExpression() { + return (EAttribute) this.fetchTreeItemContextMenuEntryEClass.getEStructuralFeatures().get(3); + } + + /** + * + * + * @generated + */ + @Override + public EClass getCustomTreeItemContextMenuEntry() { + return this.customTreeItemContextMenuEntryEClass; + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getCustomTreeItemContextMenuEntry_ContributionId() { + return (EAttribute) this.customTreeItemContextMenuEntryEClass.getEStructuralFeatures().get(0); + } + /** * * @@ -509,7 +560,8 @@ public TreeFactory getTreeFactory() { } /** - * Creates the meta-model objects for the package. This method is guarded to have no affect on any invocation but its first. + * Creates the meta-model objects for the package. This method is guarded to have no affect on any invocation but + * its first. * * @generated */ @@ -547,23 +599,29 @@ public void createPackageContents() { this.treeItemContextMenuEntryEClass = this.createEClass(TREE_ITEM_CONTEXT_MENU_ENTRY); this.createEAttribute(this.treeItemContextMenuEntryEClass, TREE_ITEM_CONTEXT_MENU_ENTRY__NAME); - this.createEAttribute(this.treeItemContextMenuEntryEClass, TREE_ITEM_CONTEXT_MENU_ENTRY__LABEL_EXPRESSION); - this.createEAttribute(this.treeItemContextMenuEntryEClass, TREE_ITEM_CONTEXT_MENU_ENTRY__ICON_URL_EXPRESSION); this.createEAttribute(this.treeItemContextMenuEntryEClass, TREE_ITEM_CONTEXT_MENU_ENTRY__PRECONDITION_EXPRESSION); this.singleClickTreeItemContextMenuEntryEClass = this.createEClass(SINGLE_CLICK_TREE_ITEM_CONTEXT_MENU_ENTRY); this.createEReference(this.singleClickTreeItemContextMenuEntryEClass, SINGLE_CLICK_TREE_ITEM_CONTEXT_MENU_ENTRY__BODY); + this.createEAttribute(this.singleClickTreeItemContextMenuEntryEClass, SINGLE_CLICK_TREE_ITEM_CONTEXT_MENU_ENTRY__LABEL_EXPRESSION); + this.createEAttribute(this.singleClickTreeItemContextMenuEntryEClass, SINGLE_CLICK_TREE_ITEM_CONTEXT_MENU_ENTRY__ICON_URL_EXPRESSION); this.fetchTreeItemContextMenuEntryEClass = this.createEClass(FETCH_TREE_ITEM_CONTEXT_MENU_ENTRY); this.createEAttribute(this.fetchTreeItemContextMenuEntryEClass, FETCH_TREE_ITEM_CONTEXT_MENU_ENTRY__URL_EXRESSION); this.createEAttribute(this.fetchTreeItemContextMenuEntryEClass, FETCH_TREE_ITEM_CONTEXT_MENU_ENTRY__KIND); + this.createEAttribute(this.fetchTreeItemContextMenuEntryEClass, FETCH_TREE_ITEM_CONTEXT_MENU_ENTRY__LABEL_EXPRESSION); + this.createEAttribute(this.fetchTreeItemContextMenuEntryEClass, FETCH_TREE_ITEM_CONTEXT_MENU_ENTRY__ICON_URL_EXPRESSION); + + this.customTreeItemContextMenuEntryEClass = this.createEClass(CUSTOM_TREE_ITEM_CONTEXT_MENU_ENTRY); + this.createEAttribute(this.customTreeItemContextMenuEntryEClass, CUSTOM_TREE_ITEM_CONTEXT_MENU_ENTRY__CONTRIBUTION_ID); // Create enums this.fetchTreeItemContextMenuEntryKindEEnum = this.createEEnum(FETCH_TREE_ITEM_CONTEXT_MENU_ENTRY_KIND); } /** - * Complete the initialization of the package and its meta-model. This method is guarded to have no affect on any invocation but its first. + * Complete the initialization of the package and its meta-model. This method is guarded to have no affect on any + * invocation but its first. * * @generated */ @@ -589,6 +647,7 @@ public void initializePackageContents() { this.treeItemLabelFragmentDescriptionEClass.getESuperTypes().add(this.getTreeItemLabelElementDescription()); this.singleClickTreeItemContextMenuEntryEClass.getESuperTypes().add(this.getTreeItemContextMenuEntry()); this.fetchTreeItemContextMenuEntryEClass.getESuperTypes().add(this.getTreeItemContextMenuEntry()); + this.customTreeItemContextMenuEntryEClass.getESuperTypes().add(this.getTreeItemContextMenuEntry()); // Initialize classes, features, and operations; add parameters this.initEClass(this.treeDescriptionEClass, TreeDescription.class, "TreeDescription", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); @@ -640,10 +699,6 @@ public void initializePackageContents() { this.initEClass(this.treeItemContextMenuEntryEClass, TreeItemContextMenuEntry.class, "TreeItemContextMenuEntry", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); this.initEAttribute(this.getTreeItemContextMenuEntry_Name(), theViewPackage.getIdentifier(), "name", null, 1, 1, TreeItemContextMenuEntry.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - this.initEAttribute(this.getTreeItemContextMenuEntry_LabelExpression(), theViewPackage.getInterpretedExpression(), "labelExpression", null, 0, 1, TreeItemContextMenuEntry.class, !IS_TRANSIENT, - !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - this.initEAttribute(this.getTreeItemContextMenuEntry_IconURLExpression(), theViewPackage.getInterpretedExpression(), "iconURLExpression", null, 0, 1, TreeItemContextMenuEntry.class, - !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); this.initEAttribute(this.getTreeItemContextMenuEntry_PreconditionExpression(), theViewPackage.getInterpretedExpression(), "preconditionExpression", null, 0, 1, TreeItemContextMenuEntry.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); @@ -651,12 +706,24 @@ public void initializePackageContents() { IS_GENERATED_INSTANCE_CLASS); this.initEReference(this.getSingleClickTreeItemContextMenuEntry_Body(), theViewPackage.getOperation(), null, "body", null, 0, -1, SingleClickTreeItemContextMenuEntry.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + this.initEAttribute(this.getSingleClickTreeItemContextMenuEntry_LabelExpression(), theViewPackage.getInterpretedExpression(), "labelExpression", null, 0, 1, + SingleClickTreeItemContextMenuEntry.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + this.initEAttribute(this.getSingleClickTreeItemContextMenuEntry_IconURLExpression(), theViewPackage.getInterpretedExpression(), "iconURLExpression", null, 0, 1, + SingleClickTreeItemContextMenuEntry.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); this.initEClass(this.fetchTreeItemContextMenuEntryEClass, FetchTreeItemContextMenuEntry.class, "FetchTreeItemContextMenuEntry", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); this.initEAttribute(this.getFetchTreeItemContextMenuEntry_UrlExression(), theViewPackage.getInterpretedExpression(), "urlExression", null, 0, 1, FetchTreeItemContextMenuEntry.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); this.initEAttribute(this.getFetchTreeItemContextMenuEntry_Kind(), this.getFetchTreeItemContextMenuEntryKind(), "kind", null, 0, 1, FetchTreeItemContextMenuEntry.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + this.initEAttribute(this.getFetchTreeItemContextMenuEntry_LabelExpression(), theViewPackage.getInterpretedExpression(), "labelExpression", null, 0, 1, FetchTreeItemContextMenuEntry.class, + !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + this.initEAttribute(this.getFetchTreeItemContextMenuEntry_IconURLExpression(), theViewPackage.getInterpretedExpression(), "iconURLExpression", null, 0, 1, FetchTreeItemContextMenuEntry.class, + !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + + this.initEClass(this.customTreeItemContextMenuEntryEClass, CustomTreeItemContextMenuEntry.class, "CustomTreeItemContextMenuEntry", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + this.initEAttribute(this.getCustomTreeItemContextMenuEntry_ContributionId(), theViewPackage.getIdentifier(), "contributionId", null, 0, 1, CustomTreeItemContextMenuEntry.class, !IS_TRANSIENT, + !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); // Initialize enums and add enum literals this.initEEnum(this.fetchTreeItemContextMenuEntryKindEEnum, FetchTreeItemContextMenuEntryKind.class, "FetchTreeItemContextMenuEntryKind"); diff --git a/packages/view/backend/sirius-components-view-tree/src/main/java/org/eclipse/sirius/components/view/tree/util/TreeAdapterFactory.java b/packages/view/backend/sirius-components-view-tree/src/main/java/org/eclipse/sirius/components/view/tree/util/TreeAdapterFactory.java index 657a5133e1..02f53fddc5 100644 --- a/packages/view/backend/sirius-components-view-tree/src/main/java/org/eclipse/sirius/components/view/tree/util/TreeAdapterFactory.java +++ b/packages/view/backend/sirius-components-view-tree/src/main/java/org/eclipse/sirius/components/view/tree/util/TreeAdapterFactory.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2024 Obeo. + * Copyright (c) 2024, 2025 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 @@ -17,6 +17,7 @@ import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl; import org.eclipse.emf.ecore.EObject; import org.eclipse.sirius.components.view.RepresentationDescription; +import org.eclipse.sirius.components.view.tree.CustomTreeItemContextMenuEntry; import org.eclipse.sirius.components.view.tree.FetchTreeItemContextMenuEntry; import org.eclipse.sirius.components.view.tree.SingleClickTreeItemContextMenuEntry; import org.eclipse.sirius.components.view.tree.TreeDescription; @@ -112,6 +113,11 @@ public Adapter caseFetchTreeItemContextMenuEntry(FetchTreeItemContextMenuEntry o return TreeAdapterFactory.this.createFetchTreeItemContextMenuEntryAdapter(); } + @Override + public Adapter caseCustomTreeItemContextMenuEntry(CustomTreeItemContextMenuEntry object) { + return TreeAdapterFactory.this.createCustomTreeItemContextMenuEntryAdapter(); + } + @Override public Adapter caseRepresentationDescription(RepresentationDescription object) { return TreeAdapterFactory.this.createRepresentationDescriptionAdapter(); @@ -235,6 +241,20 @@ public Adapter createFetchTreeItemContextMenuEntryAdapter() { return null; } + /** + * Creates a new adapter for an object of class + * '{@link org.eclipse.sirius.components.view.tree.CustomTreeItemContextMenuEntry Custom Tree Item Context Menu + * Entry}'. This default implementation returns null so that we can easily ignore + * cases; it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.sirius.components.view.tree.CustomTreeItemContextMenuEntry + * @generated + */ + public Adapter createCustomTreeItemContextMenuEntryAdapter() { + return null; + } + /** * Creates a new adapter for an object of class '{@link org.eclipse.sirius.components.view.RepresentationDescription * Representation Description}'. This default implementation returns null so that diff --git a/packages/view/backend/sirius-components-view-tree/src/main/java/org/eclipse/sirius/components/view/tree/util/TreeSwitch.java b/packages/view/backend/sirius-components-view-tree/src/main/java/org/eclipse/sirius/components/view/tree/util/TreeSwitch.java index 9d0fd1cc57..2842404045 100644 --- a/packages/view/backend/sirius-components-view-tree/src/main/java/org/eclipse/sirius/components/view/tree/util/TreeSwitch.java +++ b/packages/view/backend/sirius-components-view-tree/src/main/java/org/eclipse/sirius/components/view/tree/util/TreeSwitch.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2024 Obeo. + * Copyright (c) 2024, 2025 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 @@ -16,6 +16,7 @@ import org.eclipse.emf.ecore.EPackage; import org.eclipse.emf.ecore.util.Switch; import org.eclipse.sirius.components.view.RepresentationDescription; +import org.eclipse.sirius.components.view.tree.CustomTreeItemContextMenuEntry; import org.eclipse.sirius.components.view.tree.FetchTreeItemContextMenuEntry; import org.eclipse.sirius.components.view.tree.SingleClickTreeItemContextMenuEntry; import org.eclipse.sirius.components.view.tree.TreeDescription; @@ -133,6 +134,15 @@ protected T doSwitch(int classifierID, EObject theEObject) { result = this.defaultCase(theEObject); return result; } + case TreePackage.CUSTOM_TREE_ITEM_CONTEXT_MENU_ENTRY: { + CustomTreeItemContextMenuEntry customTreeItemContextMenuEntry = (CustomTreeItemContextMenuEntry) theEObject; + T result = this.caseCustomTreeItemContextMenuEntry(customTreeItemContextMenuEntry); + if (result == null) + result = this.caseTreeItemContextMenuEntry(customTreeItemContextMenuEntry); + if (result == null) + result = this.defaultCase(theEObject); + return result; + } default: return this.defaultCase(theEObject); } @@ -243,6 +253,21 @@ public T caseFetchTreeItemContextMenuEntry(FetchTreeItemContextMenuEntry object) return null; } + /** + * Returns the result of interpreting the object as an instance of 'Custom Tree Item Context Menu Entry'. + * This implementation returns null; returning a non-null result will terminate the switch. + * + * + * @param object + * the target of the switch. + * @return the result of interpreting the object as an instance of 'Custom Tree Item Context Menu Entry'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseCustomTreeItemContextMenuEntry(CustomTreeItemContextMenuEntry object) { + return null; + } + /** * Returns the result of interpreting the object as an instance of 'Representation Description'. This implementation returns null; returning a non-null result will terminate the switch.