From eb42458df88ca8da11070cb515b562d86abf93e0 Mon Sep 17 00:00:00 2001 From: Jerome Gout Date: Mon, 14 Oct 2024 15:47:09 +0200 Subject: [PATCH] [4101] Add loop tree item label element description Bug: https://github.com/eclipse-sirius/sirius-web/issues/4101 Signed-off-by: Jerome Gout --- CHANGELOG.adoc | 1 + .../DomainViewTreeDescriptionProvider.java | 37 ++- .../trees/DomainExplorerControllerTests.java | 2 +- ...eeItemLabelDescriptionControllerTests.java | 16 +- ...reeItemLabelElementDescriptionBuilder.java | 77 +++++ .../builder/generated/tree/TreeBuilders.java | 10 + .../view/emf/tree/TreeItemStyleConverter.java | 22 ++ ...emLabelElementDescriptionItemProvider.java | 188 ++++++++++++ ...emLabelElementDescriptionItemProvider.java | 42 ++- .../TreeItemLabelDescriptionItemProvider.java | 2 + .../TreeItemProviderAdapterFactory.java | 27 ++ .../ForTreeItemLabelElementDescription.svg | 1 + .../src/main/resources/plugin.properties | 4 + .../ForTreeItemLabelElementDescription.java | 97 ++++++ .../components/view/tree/TreeFactory.java | 9 + .../components/view/tree/TreePackage.java | 149 ++++++++- ...orTreeItemLabelElementDescriptionImpl.java | 288 ++++++++++++++++++ .../view/tree/impl/TreeFactoryImpl.java | 14 + .../view/tree/impl/TreePackageImpl.java | 63 ++++ .../view/tree/util/TreeAdapterFactory.java | 21 ++ .../components/view/tree/util/TreeSwitch.java | 26 ++ .../src/main/resources/model/tree.ecore | 7 + .../src/main/resources/model/tree.genmodel | 7 +- 23 files changed, 1085 insertions(+), 25 deletions(-) create mode 100644 packages/view/backend/sirius-components-view-builder/src/main/java/org/eclipse/sirius/components/view/builder/generated/tree/ForTreeItemLabelElementDescriptionBuilder.java create mode 100644 packages/view/backend/sirius-components-view-tree-edit/src/main/java/org/eclipse/sirius/components/view/tree/provider/ForTreeItemLabelElementDescriptionItemProvider.java create mode 100644 packages/view/backend/sirius-components-view-tree-edit/src/main/resources/icons/full/obj16/ForTreeItemLabelElementDescription.svg create mode 100644 packages/view/backend/sirius-components-view-tree/src/main/java/org/eclipse/sirius/components/view/tree/ForTreeItemLabelElementDescription.java create mode 100644 packages/view/backend/sirius-components-view-tree/src/main/java/org/eclipse/sirius/components/view/tree/impl/ForTreeItemLabelElementDescriptionImpl.java diff --git a/CHANGELOG.adoc b/CHANGELOG.adoc index ad6534382b..fef539523b 100644 --- a/CHANGELOG.adoc +++ b/CHANGELOG.adoc @@ -104,6 +104,7 @@ never, always and if_children (to display the separator only if children exist). Project template images will now have a predictable size of 150px by 110px. This will allow specifier to create images that fir perfectly in the project template card. - https://github.com/eclipse-sirius/sirius-web/issues/4095[#4095] Add conditional tree item label element description +- https://github.com/eclipse-sirius/sirius-web/issues/4101[#4101] Add loop tree item label element description == v2024.9.0 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 911413817f..66601ab2a1 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 @@ -161,6 +161,15 @@ private TreeItemLabelDescription entityStyle(TextStylePalette textStylePalette) .children( this.getEntityKeyFragment(textStylePalette), this.getEntityValueFragment(textStylePalette), + new TreeBuilders().newTreeItemLabelFragmentDescription() + .labelExpression(" {") + .style(this.getTextStyleByName(textStylePalette, NORMAL_TEXT_STYLE_NAME)) + .build(), + this.getAttributesFragments(textStylePalette), + new TreeBuilders().newTreeItemLabelFragmentDescription() + .labelExpression("}") + .style(this.getTextStyleByName(textStylePalette, NORMAL_TEXT_STYLE_NAME)) + .build(), this.getAbstractEntityValueFragment(textStylePalette)) .build(); } @@ -176,6 +185,13 @@ private TreeItemLabelDescription defaultStyle() { .build(); } + private TreeItemLabelElementDescription getEntityKeyFragment(TextStylePalette textStylePalette) { + return new TreeBuilders().newTreeItemLabelFragmentDescription() + .labelExpression("aql:'[Entity] '") + .style(this.getTextStyleByName(textStylePalette, BROWN_BOLD_TEXT_STYLE_NAME)) + .build(); + } + private TreeItemLabelElementDescription getEntityValueFragment(TextStylePalette textStylePalette) { return new TreeBuilders().newTreeItemLabelFragmentDescription() .labelExpression(AQL_SELF_GET_TREE_ITEM_LABEL) @@ -193,10 +209,23 @@ private TreeItemLabelElementDescription getAbstractEntityValueFragment(TextStyle .build(); } - private TreeItemLabelElementDescription getEntityKeyFragment(TextStylePalette textStylePalette) { - return new TreeBuilders().newTreeItemLabelFragmentDescription() - .labelExpression("aql:'[Entity] '") - .style(this.getTextStyleByName(textStylePalette, BROWN_BOLD_TEXT_STYLE_NAME)) + private TreeItemLabelElementDescription getAttributesFragments(TextStylePalette textStylePalette) { + return new TreeBuilders().newForTreeItemLabelElementDescription() + .iterator("attribute") + .iterableExpression("aql:self.attributes") + .children( + new TreeBuilders().newTreeItemLabelFragmentDescription() + .labelExpression("aql:attribute.name") + .style(this.getTextStyleByName(textStylePalette, NORMAL_TEXT_STYLE_NAME)) + .build(), + new TreeBuilders().newIfTreeItemLabelElementDescription() + .predicateExpression("aql:self.attributes->indexOf(attribute) < (self.attributes->size())") + .children(new TreeBuilders().newTreeItemLabelFragmentDescription() + .labelExpression(", ") + .style(this.getTextStyleByName(textStylePalette, NORMAL_TEXT_STYLE_NAME)) + .build()) + .build() + ) .build(); } diff --git a/packages/sirius-web/backend/sirius-web/src/test/java/org/eclipse/sirius/web/application/controllers/trees/DomainExplorerControllerTests.java b/packages/sirius-web/backend/sirius-web/src/test/java/org/eclipse/sirius/web/application/controllers/trees/DomainExplorerControllerTests.java index 41fe279603..99b5b0f351 100644 --- a/packages/sirius-web/backend/sirius-web/src/test/java/org/eclipse/sirius/web/application/controllers/trees/DomainExplorerControllerTests.java +++ b/packages/sirius-web/backend/sirius-web/src/test/java/org/eclipse/sirius/web/application/controllers/trees/DomainExplorerControllerTests.java @@ -148,7 +148,7 @@ public void givenAnExplorerRepresentationWhenWeSubscribeToItsEventThenTheReprese assertThat(tree.getChildren().get(0).getChildren()).hasSize(1); assertThat(tree.getChildren().get(0).getChildren().get(0).getLabel().toString()).isEqualTo("buck"); assertThat(tree.getChildren().get(0).getChildren().get(0).getChildren()).hasSize(3); - assertThat(tree.getChildren().get(0).getChildren().get(0).getChildren().get(2).getLabel().toString()).isEqualTo("[Entity] Human"); + assertThat(tree.getChildren().get(0).getChildren().get(0).getChildren().get(2).getLabel().toString()).contains("[Entity] Human"); assertThat(tree.getChildren().get(0).getChildren().get(0).getChildren().get(2).getChildren()).hasSize(4); assertThat(tree.getChildren().get(0).getChildren().get(0).getChildren().get(2).getChildren().get(0).getLabel().toString()).isEqualTo("superTypes"); settingId.set(tree.getChildren().get(0).getChildren().get(0).getChildren().get(2).getChildren().get(0).getId()); diff --git a/packages/sirius-web/backend/sirius-web/src/test/java/org/eclipse/sirius/web/application/controllers/trees/TreeItemLabelDescriptionControllerTests.java b/packages/sirius-web/backend/sirius-web/src/test/java/org/eclipse/sirius/web/application/controllers/trees/TreeItemLabelDescriptionControllerTests.java index e270d67838..1fcaefcdaa 100644 --- a/packages/sirius-web/backend/sirius-web/src/test/java/org/eclipse/sirius/web/application/controllers/trees/TreeItemLabelDescriptionControllerTests.java +++ b/packages/sirius-web/backend/sirius-web/src/test/java/org/eclipse/sirius/web/application/controllers/trees/TreeItemLabelDescriptionControllerTests.java @@ -26,7 +26,6 @@ import java.util.function.Consumer; import org.eclipse.sirius.components.collaborative.trees.dto.TreeRefreshedEventPayload; -import org.eclipse.sirius.components.core.api.labels.StyledString; import org.eclipse.sirius.components.trees.Tree; import org.eclipse.sirius.components.trees.TreeItem; import org.eclipse.sirius.web.AbstractIntegrationTests; @@ -116,6 +115,7 @@ public void givenAStudioWhenTheTreeItemLabelsAreRequestedThenTheCorrectStylesAre // 2- check that styles are properly applied // - check that the ROOT entity has not the abstract style applied. // - check that the NamedElement entity has the abstract style (if style) + // - check that the Human entity has 3 attributes (for style) var inputStyle = new ExplorerEventInput(UUID.randomUUID(), StudioIdentifiers.SAMPLE_STUDIO_PROJECT.toString(), explorerRepresentationId); var fluxStyle = this.explorerEventSubscriptionRunner.run(inputStyle); @@ -126,11 +126,15 @@ public void givenAStudioWhenTheTreeItemLabelsAreRequestedThenTheCorrectStylesAre .getChildren() .get(0) .getChildren(); - StyledString rootLabel = domainChildren.get(0).getLabel(); - StyledString namedElementLabel = domainChildren.get(1).getLabel(); - assertThat(rootLabel.styledStringFragments()).hasSize(2); - assertThat(namedElementLabel.styledStringFragments()).hasSize(3); - assertThat(namedElementLabel.toString()).isEqualTo("[Entity] NamedElement [abstract]"); + var rootLabels = domainChildren.get(0).getLabel().styledStringFragments(); + var namedElementLabels = domainChildren.get(1).getLabel().styledStringFragments(); + var humanLabels = domainChildren.get(2).getLabel().styledStringFragments(); + assertThat(rootLabels.get(rootLabels.size() - 1).text()).doesNotContain("[abstract]"); + assertThat(namedElementLabels.get(namedElementLabels.size() - 1).text()).contains("[abstract]"); + assertThat(humanLabels).hasSize(9); + assertThat(humanLabels.get(3).text()).isEqualTo("description"); + assertThat(humanLabels.get(5).text()).isEqualTo("promoted"); + assertThat(humanLabels.get(7).text()).isEqualTo("birthDate"); }); StepVerifier.create(fluxStyle) diff --git a/packages/view/backend/sirius-components-view-builder/src/main/java/org/eclipse/sirius/components/view/builder/generated/tree/ForTreeItemLabelElementDescriptionBuilder.java b/packages/view/backend/sirius-components-view-builder/src/main/java/org/eclipse/sirius/components/view/builder/generated/tree/ForTreeItemLabelElementDescriptionBuilder.java new file mode 100644 index 0000000000..3d267db0e7 --- /dev/null +++ b/packages/view/backend/sirius-components-view-builder/src/main/java/org/eclipse/sirius/components/view/builder/generated/tree/ForTreeItemLabelElementDescriptionBuilder.java @@ -0,0 +1,77 @@ +/******************************************************************************* + * Copyright (c) 2023, 2024 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 ForTreeItemLabelElementDescriptionBuilder. + * + * @author BuilderGenerator + * @generated + */ +public class ForTreeItemLabelElementDescriptionBuilder { + + /** + * Create instance org.eclipse.sirius.components.view.tree.ForTreeItemLabelElementDescription. + * @generated + */ + private org.eclipse.sirius.components.view.tree.ForTreeItemLabelElementDescription forTreeItemLabelElementDescription = org.eclipse.sirius.components.view.tree.TreeFactory.eINSTANCE.createForTreeItemLabelElementDescription(); + + /** + * Return instance org.eclipse.sirius.components.view.tree.ForTreeItemLabelElementDescription. + * @generated + */ + protected org.eclipse.sirius.components.view.tree.ForTreeItemLabelElementDescription getForTreeItemLabelElementDescription() { + return this.forTreeItemLabelElementDescription; + } + + /** + * Return instance org.eclipse.sirius.components.view.tree.ForTreeItemLabelElementDescription. + * @generated + */ + public org.eclipse.sirius.components.view.tree.ForTreeItemLabelElementDescription build() { + return this.getForTreeItemLabelElementDescription(); + } + + /** + * Setter for Iterator. + * + * @generated + */ + public ForTreeItemLabelElementDescriptionBuilder iterator(java.lang.String value) { + this.getForTreeItemLabelElementDescription().setIterator(value); + return this; + } + /** + * Setter for IterableExpression. + * + * @generated + */ + public ForTreeItemLabelElementDescriptionBuilder iterableExpression(java.lang.String value) { + this.getForTreeItemLabelElementDescription().setIterableExpression(value); + return this; + } + /** + * Setter for Children. + * + * @generated + */ + public ForTreeItemLabelElementDescriptionBuilder children(org.eclipse.sirius.components.view.tree.TreeItemLabelElementDescription ... values) { + for (org.eclipse.sirius.components.view.tree.TreeItemLabelElementDescription value : values) { + this.getForTreeItemLabelElementDescription().getChildren().add(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 ec33386cb0..f7e2a483cb 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 @@ -49,6 +49,16 @@ public IfTreeItemLabelElementDescriptionBuilder newIfTreeItemLabelElementDescrip return new IfTreeItemLabelElementDescriptionBuilder(); } + /** + * Instantiate a ForTreeItemLabelElementDescriptionBuilder . + * + * @author BuilderGenerator + * @generated + */ + public ForTreeItemLabelElementDescriptionBuilder newForTreeItemLabelElementDescription() { + return new ForTreeItemLabelElementDescriptionBuilder(); + } + /** * Instantiate a TreeItemLabelFragmentDescriptionBuilder . * diff --git a/packages/view/backend/sirius-components-view-emf/src/main/java/org/eclipse/sirius/components/view/emf/tree/TreeItemStyleConverter.java b/packages/view/backend/sirius-components-view-emf/src/main/java/org/eclipse/sirius/components/view/emf/tree/TreeItemStyleConverter.java index 933366a1d4..1a2037a81e 100644 --- a/packages/view/backend/sirius-components-view-emf/src/main/java/org/eclipse/sirius/components/view/emf/tree/TreeItemStyleConverter.java +++ b/packages/view/backend/sirius-components-view-emf/src/main/java/org/eclipse/sirius/components/view/emf/tree/TreeItemStyleConverter.java @@ -12,6 +12,7 @@ *******************************************************************************/ package org.eclipse.sirius.components.view.emf.tree; +import java.util.ArrayList; import java.util.List; import java.util.Map; import java.util.Objects; @@ -22,6 +23,7 @@ import org.eclipse.sirius.components.core.api.labels.StyledStringFragmentStyle; import org.eclipse.sirius.components.core.api.labels.UnderLineStyle; import org.eclipse.sirius.components.interpreter.AQLInterpreter; +import org.eclipse.sirius.components.view.tree.ForTreeItemLabelElementDescription; import org.eclipse.sirius.components.view.tree.IfTreeItemLabelElementDescription; import org.eclipse.sirius.components.view.tree.TreeItemLabelDescription; import org.eclipse.sirius.components.view.tree.TreeItemLabelElementDescription; @@ -61,6 +63,8 @@ private List convertElement(TreeItemLabelElementDescriptio .flatMap(tiled -> this.convertElement(tiled).stream()) .toList(); } + } else if (element instanceof ForTreeItemLabelElementDescription forElement) { + result = this.convertForElementDescription(forElement); } return result; } @@ -91,6 +95,18 @@ private StyledStringFragment convertFragment(TreeItemLabelFragmentDescription fr return new StyledStringFragment(text, styleBuilder.build()); } + private List convertForElementDescription(ForTreeItemLabelElementDescription forElement) { + var result = new ArrayList(); + var iterable = evaluateObjectList(forElement.getIterableExpression()); + iterable.forEach(iteration -> { + variables.put(forElement.getIterator(), iteration); + result.addAll(forElement.getChildren().stream() + .flatMap(tiled -> this.convertElement(tiled).stream()) + .toList()); + }); + return result; + } + private Optional evaluateString(String expression) { return this.interpreter.evaluateExpression(this.variables, expression).asString(); } @@ -98,4 +114,10 @@ private Optional evaluateString(String expression) { private Optional evaluateBoolean(String expression) { return this.interpreter.evaluateExpression(this.variables, expression).asBoolean(); } + + private List evaluateObjectList(String expression) { + return interpreter.evaluateExpression(variables, expression) + .asObjects() + .orElse(List.of()); + } } diff --git a/packages/view/backend/sirius-components-view-tree-edit/src/main/java/org/eclipse/sirius/components/view/tree/provider/ForTreeItemLabelElementDescriptionItemProvider.java b/packages/view/backend/sirius-components-view-tree-edit/src/main/java/org/eclipse/sirius/components/view/tree/provider/ForTreeItemLabelElementDescriptionItemProvider.java new file mode 100644 index 0000000000..d9659a955a --- /dev/null +++ b/packages/view/backend/sirius-components-view-tree-edit/src/main/java/org/eclipse/sirius/components/view/tree/provider/ForTreeItemLabelElementDescriptionItemProvider.java @@ -0,0 +1,188 @@ +/******************************************************************************* + * Copyright (c) 2024 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.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.tree.ForTreeItemLabelElementDescription; +import org.eclipse.sirius.components.view.tree.TreeFactory; +import org.eclipse.sirius.components.view.tree.TreePackage; + +/** + * This is the item provider adapter for a + * {@link org.eclipse.sirius.components.view.tree.ForTreeItemLabelElementDescription} object. + * + * + * @generated + */ +public class ForTreeItemLabelElementDescriptionItemProvider extends TreeItemLabelElementDescriptionItemProvider { + /** + * This constructs an instance from a factory and a notifier. + * + * @generated + */ + public ForTreeItemLabelElementDescriptionItemProvider(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); + + addIteratorPropertyDescriptor(object); + addIterableExpressionPropertyDescriptor(object); + } + return itemPropertyDescriptors; + } + + /** + * This adds a property descriptor for the Iterator feature. + * + * @generated + */ + protected void addIteratorPropertyDescriptor(Object object) { + itemPropertyDescriptors.add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getResourceLocator(), + getString("_UI_ForTreeItemLabelElementDescription_iterator_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_ForTreeItemLabelElementDescription_iterator_feature", "_UI_ForTreeItemLabelElementDescription_type"), + TreePackage.Literals.FOR_TREE_ITEM_LABEL_ELEMENT_DESCRIPTION__ITERATOR, true, false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); + } + + /** + * This adds a property descriptor for the Iterable Expression feature. + * + * @generated + */ + protected void addIterableExpressionPropertyDescriptor(Object object) { + itemPropertyDescriptors.add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getResourceLocator(), + getString("_UI_ForTreeItemLabelElementDescription_iterableExpression_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_ForTreeItemLabelElementDescription_iterableExpression_feature", "_UI_ForTreeItemLabelElementDescription_type"), + TreePackage.Literals.FOR_TREE_ITEM_LABEL_ELEMENT_DESCRIPTION__ITERABLE_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.FOR_TREE_ITEM_LABEL_ELEMENT_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 ForTreeItemLabelElementDescription.gif. + * + * @generated NOT + */ + @Override + public Object getImage(Object object) { + return overlayImage(object, getResourceLocator().getImage("full/obj16/ForTreeItemLabelElementDescription.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 = ((ForTreeItemLabelElementDescription) object).getIterator(); + return label == null || label.length() == 0 ? getString("_UI_ForTreeItemLabelElementDescription_type") : getString("_UI_ForTreeItemLabelElementDescription_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(ForTreeItemLabelElementDescription.class)) { + case TreePackage.FOR_TREE_ITEM_LABEL_ELEMENT_DESCRIPTION__ITERATOR: + case TreePackage.FOR_TREE_ITEM_LABEL_ELEMENT_DESCRIPTION__ITERABLE_EXPRESSION: + fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true)); + return; + case TreePackage.FOR_TREE_ITEM_LABEL_ELEMENT_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.FOR_TREE_ITEM_LABEL_ELEMENT_DESCRIPTION__CHILDREN, TreeFactory.eINSTANCE.createIfTreeItemLabelElementDescription())); + + newChildDescriptors.add(createChildParameter(TreePackage.Literals.FOR_TREE_ITEM_LABEL_ELEMENT_DESCRIPTION__CHILDREN, TreeFactory.eINSTANCE.createForTreeItemLabelElementDescription())); + + newChildDescriptors.add(createChildParameter(TreePackage.Literals.FOR_TREE_ITEM_LABEL_ELEMENT_DESCRIPTION__CHILDREN, TreeFactory.eINSTANCE.createTreeItemLabelFragmentDescription())); + } + +} diff --git a/packages/view/backend/sirius-components-view-tree-edit/src/main/java/org/eclipse/sirius/components/view/tree/provider/IfTreeItemLabelElementDescriptionItemProvider.java b/packages/view/backend/sirius-components-view-tree-edit/src/main/java/org/eclipse/sirius/components/view/tree/provider/IfTreeItemLabelElementDescriptionItemProvider.java index 19943f7397..f24bd6c7c2 100644 --- a/packages/view/backend/sirius-components-view-tree-edit/src/main/java/org/eclipse/sirius/components/view/tree/provider/IfTreeItemLabelElementDescriptionItemProvider.java +++ b/packages/view/backend/sirius-components-view-tree-edit/src/main/java/org/eclipse/sirius/components/view/tree/provider/IfTreeItemLabelElementDescriptionItemProvider.java @@ -17,11 +17,13 @@ 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.tree.IfTreeItemLabelElementDescription; +import org.eclipse.sirius.components.view.tree.TreeFactory; import org.eclipse.sirius.components.view.tree.TreePackage; /** @@ -52,7 +54,6 @@ public List getPropertyDescriptors(Object object) { super.getPropertyDescriptors(object); addPredicateExpressionPropertyDescriptor(object); - addChildrenPropertyDescriptor(object); } return itemPropertyDescriptors; } @@ -71,15 +72,33 @@ protected void addPredicateExpressionPropertyDescriptor(Object object) { } /** - * This adds a property descriptor for the Children feature. + * 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 */ - protected void addChildrenPropertyDescriptor(Object object) { - itemPropertyDescriptors.add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getResourceLocator(), - getString("_UI_IfTreeItemLabelElementDescription_children_feature"), - getString("_UI_PropertyDescriptor_description", "_UI_IfTreeItemLabelElementDescription_children_feature", "_UI_IfTreeItemLabelElementDescription_type"), - TreePackage.Literals.IF_TREE_ITEM_LABEL_ELEMENT_DESCRIPTION__CHILDREN, true, false, true, null, null, null)); + @Override + public Collection getChildrenFeatures(Object object) { + if (childrenFeatures == null) { + super.getChildrenFeatures(object); + childrenFeatures.add(TreePackage.Literals.IF_TREE_ITEM_LABEL_ELEMENT_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); } /** @@ -128,6 +147,9 @@ public void notifyChanged(Notification notification) { case TreePackage.IF_TREE_ITEM_LABEL_ELEMENT_DESCRIPTION__PREDICATE_EXPRESSION: fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true)); return; + case TreePackage.IF_TREE_ITEM_LABEL_ELEMENT_DESCRIPTION__CHILDREN: + fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, false)); + return; } super.notifyChanged(notification); } @@ -141,6 +163,12 @@ public void notifyChanged(Notification notification) { @Override protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { super.collectNewChildDescriptors(newChildDescriptors, object); + + newChildDescriptors.add(createChildParameter(TreePackage.Literals.IF_TREE_ITEM_LABEL_ELEMENT_DESCRIPTION__CHILDREN, TreeFactory.eINSTANCE.createIfTreeItemLabelElementDescription())); + + newChildDescriptors.add(createChildParameter(TreePackage.Literals.IF_TREE_ITEM_LABEL_ELEMENT_DESCRIPTION__CHILDREN, TreeFactory.eINSTANCE.createForTreeItemLabelElementDescription())); + + newChildDescriptors.add(createChildParameter(TreePackage.Literals.IF_TREE_ITEM_LABEL_ELEMENT_DESCRIPTION__CHILDREN, TreeFactory.eINSTANCE.createTreeItemLabelFragmentDescription())); } } 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 92c053ee37..ba228e5f7b 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 @@ -189,6 +189,8 @@ protected void collectNewChildDescriptors(Collection newChildDescriptors newChildDescriptors.add(createChildParameter(TreePackage.Literals.TREE_ITEM_LABEL_DESCRIPTION__CHILDREN, TreeFactory.eINSTANCE.createIfTreeItemLabelElementDescription())); + newChildDescriptors.add(createChildParameter(TreePackage.Literals.TREE_ITEM_LABEL_DESCRIPTION__CHILDREN, TreeFactory.eINSTANCE.createForTreeItemLabelElementDescription())); + newChildDescriptors.add(createChildParameter(TreePackage.Literals.TREE_ITEM_LABEL_DESCRIPTION__CHILDREN, TreeFactory.eINSTANCE.createTreeItemLabelFragmentDescription())); } 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 da0d6c90a4..144e79aed2 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 @@ -196,6 +196,30 @@ public Adapter createIfTreeItemLabelElementDescriptionAdapter() { return ifTreeItemLabelElementDescriptionItemProvider; } + /** + * This keeps track of the one adapter used for all + * {@link org.eclipse.sirius.components.view.tree.ForTreeItemLabelElementDescription} instances. + * + * @generated + */ + protected ForTreeItemLabelElementDescriptionItemProvider forTreeItemLabelElementDescriptionItemProvider; + + /** + * This creates an adapter for a {@link org.eclipse.sirius.components.view.tree.ForTreeItemLabelElementDescription}. + * + * + * @generated + */ + @Override + public Adapter createForTreeItemLabelElementDescriptionAdapter() { + if (forTreeItemLabelElementDescriptionItemProvider == null) { + forTreeItemLabelElementDescriptionItemProvider = new ForTreeItemLabelElementDescriptionItemProvider(this); + } + + return forTreeItemLabelElementDescriptionItemProvider; + } + /** * This creates an adapter for a {@link org.eclipse.sirius.components.view.tree.TreeItemLabelFragmentDescription}. * @@ -380,6 +404,9 @@ public void dispose() { if (ifTreeItemLabelElementDescriptionItemProvider != null) { ifTreeItemLabelElementDescriptionItemProvider.dispose(); } + if (forTreeItemLabelElementDescriptionItemProvider != null) { + forTreeItemLabelElementDescriptionItemProvider.dispose(); + } if (treeItemLabelFragmentDescriptionItemProvider != null) { treeItemLabelFragmentDescriptionItemProvider.dispose(); } diff --git a/packages/view/backend/sirius-components-view-tree-edit/src/main/resources/icons/full/obj16/ForTreeItemLabelElementDescription.svg b/packages/view/backend/sirius-components-view-tree-edit/src/main/resources/icons/full/obj16/ForTreeItemLabelElementDescription.svg new file mode 100644 index 0000000000..116b5ad19b --- /dev/null +++ b/packages/view/backend/sirius-components-view-tree-edit/src/main/resources/icons/full/obj16/ForTreeItemLabelElementDescription.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 ad6502f3b7..30e9d7e0ae 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 @@ -26,6 +26,7 @@ _UI_PropertyDescriptor_description = The {0} of the {1} _UI_TreeDescription_type =Tree Description _UI_TreeItemLabelDescription_type = Item Label Description _UI_IfTreeItemLabelElementDescription_type = If Tree Item Label Element Description +_UI_ForTreeItemLabelElementDescription_type = For Tree Item Label Element Description _UI_TreeItemLabelFragmentDescription_type = Item Label Fragment Description _UI_TreeItemLabelElementDescription_type = Item Label Element Description _UI_TreeItemContextMenuEntry_type = Item Context Menu Entry @@ -53,6 +54,9 @@ _UI_TreeItemLabelDescription_preconditionExpression_feature = Precondition Expre _UI_TreeItemLabelDescription_children_feature = Children _UI_IfTreeItemLabelElementDescription_predicateExpression_feature = Predicate Expression _UI_IfTreeItemLabelElementDescription_children_feature = Children +_UI_ForTreeItemLabelElementDescription_iterator_feature = Iterator +_UI_ForTreeItemLabelElementDescription_iterableExpression_feature = Iterable Expression +_UI_ForTreeItemLabelElementDescription_children_feature = Children _UI_TreeItemLabelFragmentDescription_labelExpression_feature = Label Expression _UI_TreeItemLabelFragmentDescription_style_feature = Style _UI_TreeItemContextMenuEntry_name_feature = Name diff --git a/packages/view/backend/sirius-components-view-tree/src/main/java/org/eclipse/sirius/components/view/tree/ForTreeItemLabelElementDescription.java b/packages/view/backend/sirius-components-view-tree/src/main/java/org/eclipse/sirius/components/view/tree/ForTreeItemLabelElementDescription.java new file mode 100644 index 0000000000..489ca3a155 --- /dev/null +++ b/packages/view/backend/sirius-components-view-tree/src/main/java/org/eclipse/sirius/components/view/tree/ForTreeItemLabelElementDescription.java @@ -0,0 +1,97 @@ +/******************************************************************************* + * Copyright (c) 2024 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; + +import org.eclipse.emf.common.util.EList; + +/** + * A representation of the model object 'For Tree Item Label Element + * Description'. + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link org.eclipse.sirius.components.view.tree.ForTreeItemLabelElementDescription#getIterator + * Iterator}
  • + *
  • {@link org.eclipse.sirius.components.view.tree.ForTreeItemLabelElementDescription#getIterableExpression + * Iterable Expression}
  • + *
  • {@link org.eclipse.sirius.components.view.tree.ForTreeItemLabelElementDescription#getChildren + * Children}
  • + *
+ * + * @see org.eclipse.sirius.components.view.tree.TreePackage#getForTreeItemLabelElementDescription() + * @model + * @generated + */ +public interface ForTreeItemLabelElementDescription extends TreeItemLabelElementDescription { + /** + * Returns the value of the 'Iterator' attribute. + * + * @return the value of the 'Iterator' attribute. + * @see #setIterator(String) + * @see org.eclipse.sirius.components.view.tree.TreePackage#getForTreeItemLabelElementDescription_Iterator() + * @model + * @generated + */ + String getIterator(); + + /** + * Sets the value of the + * '{@link org.eclipse.sirius.components.view.tree.ForTreeItemLabelElementDescription#getIterator + * Iterator}' attribute. + * + * @param value + * the new value of the 'Iterator' attribute. + * @see #getIterator() + * @generated + */ + void setIterator(String value); + + /** + * Returns the value of the 'Iterable Expression' attribute. + * + * @return the value of the 'Iterable Expression' attribute. + * @see #setIterableExpression(String) + * @see org.eclipse.sirius.components.view.tree.TreePackage#getForTreeItemLabelElementDescription_IterableExpression() + * @model dataType="org.eclipse.sirius.components.view.InterpretedExpression" + * @generated + */ + String getIterableExpression(); + + /** + * Sets the value of the + * '{@link org.eclipse.sirius.components.view.tree.ForTreeItemLabelElementDescription#getIterableExpression + * Iterable Expression}' attribute. + * + * @param value + * the new value of the 'Iterable Expression' attribute. + * @see #getIterableExpression() + * @generated + */ + void setIterableExpression(String value); + + /** + * Returns the value of the 'Children' containment reference list. The list contents are of type + * {@link org.eclipse.sirius.components.view.tree.TreeItemLabelElementDescription}. + * + * @return the value of the 'Children' containment reference list. + * @see org.eclipse.sirius.components.view.tree.TreePackage#getForTreeItemLabelElementDescription_Children() + * @model containment="true" required="true" + * @generated + */ + EList getChildren(); + +} // ForTreeItemLabelElementDescription 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 349ea24a6d..7e80248e02 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 @@ -55,6 +55,15 @@ public interface TreeFactory extends EFactory { */ IfTreeItemLabelElementDescription createIfTreeItemLabelElementDescription(); + /** + * Returns a new object of class 'For Tree Item Label Element Description'. + * + * @return a new object of class 'For Tree Item Label Element Description'. + * @generated + */ + ForTreeItemLabelElementDescription createForTreeItemLabelElementDescription(); + /** * Returns a new object of class 'Item Label Fragment Description'. 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 55ca1d786c..35f57d04f9 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 @@ -297,7 +297,7 @@ public interface TreePackage extends EPackage { * @see org.eclipse.sirius.components.view.tree.impl.TreePackageImpl#getTreeItemLabelElementDescription() * @generated */ - int TREE_ITEM_LABEL_ELEMENT_DESCRIPTION = 4; + int TREE_ITEM_LABEL_ELEMENT_DESCRIPTION = 5; /** * The number of structural features of the 'Item Label Element Description' class. @@ -364,6 +364,61 @@ public interface TreePackage extends EPackage { */ int IF_TREE_ITEM_LABEL_ELEMENT_DESCRIPTION_OPERATION_COUNT = TREE_ITEM_LABEL_ELEMENT_DESCRIPTION_OPERATION_COUNT + 0; + /** + * The meta object id for the + * '{@link org.eclipse.sirius.components.view.tree.impl.ForTreeItemLabelElementDescriptionImpl For Tree Item + * Label Element Description}' class. + * + * @see org.eclipse.sirius.components.view.tree.impl.ForTreeItemLabelElementDescriptionImpl + * @see org.eclipse.sirius.components.view.tree.impl.TreePackageImpl#getForTreeItemLabelElementDescription() + * @generated + */ + int FOR_TREE_ITEM_LABEL_ELEMENT_DESCRIPTION = 3; + + /** + * The feature id for the 'Iterator' attribute. + * + * @generated + * @ordered + */ + int FOR_TREE_ITEM_LABEL_ELEMENT_DESCRIPTION__ITERATOR = TREE_ITEM_LABEL_ELEMENT_DESCRIPTION_FEATURE_COUNT + 0; + + /** + * The feature id for the 'Iterable Expression' attribute. + * + * @generated + * @ordered + */ + int FOR_TREE_ITEM_LABEL_ELEMENT_DESCRIPTION__ITERABLE_EXPRESSION = TREE_ITEM_LABEL_ELEMENT_DESCRIPTION_FEATURE_COUNT + 1; + + /** + * The feature id for the 'Children' containment reference list. + * + * @generated + * @ordered + */ + int FOR_TREE_ITEM_LABEL_ELEMENT_DESCRIPTION__CHILDREN = TREE_ITEM_LABEL_ELEMENT_DESCRIPTION_FEATURE_COUNT + 2; + + /** + * The number of structural features of the 'For Tree Item Label Element Description' class. + * + * @generated + * @ordered + */ + int FOR_TREE_ITEM_LABEL_ELEMENT_DESCRIPTION_FEATURE_COUNT = TREE_ITEM_LABEL_ELEMENT_DESCRIPTION_FEATURE_COUNT + 3; + + /** + * The number of operations of the 'For Tree Item Label Element Description' class. + * + * + * @generated + * @ordered + */ + int FOR_TREE_ITEM_LABEL_ELEMENT_DESCRIPTION_OPERATION_COUNT = 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 @@ -373,7 +428,7 @@ public interface TreePackage extends EPackage { * @see org.eclipse.sirius.components.view.tree.impl.TreePackageImpl#getTreeItemLabelFragmentDescription() * @generated */ - int TREE_ITEM_LABEL_FRAGMENT_DESCRIPTION = 3; + int TREE_ITEM_LABEL_FRAGMENT_DESCRIPTION = 4; /** * The feature id for the 'Label Expression' attribute. @@ -482,7 +537,7 @@ public interface TreePackage extends EPackage { * @see org.eclipse.sirius.components.view.tree.impl.TreePackageImpl#getSingleClickTreeItemContextMenuEntry() * @generated */ - int SINGLE_CLICK_TREE_ITEM_CONTEXT_MENU_ENTRY = 6; + int SINGLE_CLICK_TREE_ITEM_CONTEXT_MENU_ENTRY = 7; /** * The feature id for the 'Name' attribute. @@ -554,7 +609,7 @@ public interface TreePackage extends EPackage { * @see org.eclipse.sirius.components.view.tree.impl.TreePackageImpl#getFetchTreeItemContextMenuEntry() * @generated */ - int FETCH_TREE_ITEM_CONTEXT_MENU_ENTRY = 7; + int FETCH_TREE_ITEM_CONTEXT_MENU_ENTRY = 8; /** * The feature id for the 'Name' attribute. @@ -640,7 +695,7 @@ public interface TreePackage extends EPackage { * @see org.eclipse.sirius.components.view.tree.impl.TreePackageImpl#getFetchTreeItemContextMenuEntryKind() * @generated */ - int FETCH_TREE_ITEM_CONTEXT_MENU_ENTRY_KIND = 8; + int FETCH_TREE_ITEM_CONTEXT_MENU_ENTRY_KIND = 9; /** * Returns the meta object for class '{@link org.eclipse.sirius.components.view.tree.TreeDescription @@ -889,6 +944,53 @@ public interface TreePackage extends EPackage { */ EReference getIfTreeItemLabelElementDescription_Children(); + /** + * Returns the meta object for class + * '{@link org.eclipse.sirius.components.view.tree.ForTreeItemLabelElementDescription For Tree Item Label + * Element Description}'. + * + * @return the meta object for class 'For Tree Item Label Element Description'. + * @see org.eclipse.sirius.components.view.tree.ForTreeItemLabelElementDescription + * @generated + */ + EClass getForTreeItemLabelElementDescription(); + + /** + * Returns the meta object for the attribute + * '{@link org.eclipse.sirius.components.view.tree.ForTreeItemLabelElementDescription#getIterator + * Iterator}'. + * + * @return the meta object for the attribute 'Iterator'. + * @see org.eclipse.sirius.components.view.tree.ForTreeItemLabelElementDescription#getIterator() + * @see #getForTreeItemLabelElementDescription() + * @generated + */ + EAttribute getForTreeItemLabelElementDescription_Iterator(); + + /** + * Returns the meta object for the attribute + * '{@link org.eclipse.sirius.components.view.tree.ForTreeItemLabelElementDescription#getIterableExpression + * Iterable Expression}'. + * + * @return the meta object for the attribute 'Iterable Expression'. + * @see org.eclipse.sirius.components.view.tree.ForTreeItemLabelElementDescription#getIterableExpression() + * @see #getForTreeItemLabelElementDescription() + * @generated + */ + EAttribute getForTreeItemLabelElementDescription_IterableExpression(); + + /** + * Returns the meta object for the containment reference list + * '{@link org.eclipse.sirius.components.view.tree.ForTreeItemLabelElementDescription#getChildren + * Children}'. + * + * @return the meta object for the containment reference list 'Children'. + * @see org.eclipse.sirius.components.view.tree.ForTreeItemLabelElementDescription#getChildren() + * @see #getForTreeItemLabelElementDescription() + * @generated + */ + EReference getForTreeItemLabelElementDescription_Children(); + /** * Returns the meta object for class * '{@link org.eclipse.sirius.components.view.tree.TreeItemLabelFragmentDescription Item Label Fragment @@ -1259,6 +1361,41 @@ interface Literals { */ EReference IF_TREE_ITEM_LABEL_ELEMENT_DESCRIPTION__CHILDREN = eINSTANCE.getIfTreeItemLabelElementDescription_Children(); + /** + * The meta object literal for the + * '{@link org.eclipse.sirius.components.view.tree.impl.ForTreeItemLabelElementDescriptionImpl For Tree Item + * Label Element Description}' class. + * + * @see org.eclipse.sirius.components.view.tree.impl.ForTreeItemLabelElementDescriptionImpl + * @see org.eclipse.sirius.components.view.tree.impl.TreePackageImpl#getForTreeItemLabelElementDescription() + * @generated + */ + EClass FOR_TREE_ITEM_LABEL_ELEMENT_DESCRIPTION = eINSTANCE.getForTreeItemLabelElementDescription(); + + /** + * The meta object literal for the 'Iterator' attribute feature. + * + * @generated + */ + EAttribute FOR_TREE_ITEM_LABEL_ELEMENT_DESCRIPTION__ITERATOR = eINSTANCE.getForTreeItemLabelElementDescription_Iterator(); + + /** + * The meta object literal for the 'Iterable Expression' attribute feature. + * + * @generated + */ + EAttribute FOR_TREE_ITEM_LABEL_ELEMENT_DESCRIPTION__ITERABLE_EXPRESSION = eINSTANCE.getForTreeItemLabelElementDescription_IterableExpression(); + + /** + * The meta object literal for the 'Children' containment reference list feature. + * + * @generated + */ + EReference FOR_TREE_ITEM_LABEL_ELEMENT_DESCRIPTION__CHILDREN = eINSTANCE.getForTreeItemLabelElementDescription_Children(); + /** * The meta object literal for the * '{@link org.eclipse.sirius.components.view.tree.impl.TreeItemLabelFragmentDescriptionImpl Item Label diff --git a/packages/view/backend/sirius-components-view-tree/src/main/java/org/eclipse/sirius/components/view/tree/impl/ForTreeItemLabelElementDescriptionImpl.java b/packages/view/backend/sirius-components-view-tree/src/main/java/org/eclipse/sirius/components/view/tree/impl/ForTreeItemLabelElementDescriptionImpl.java new file mode 100644 index 0000000000..836bfe1173 --- /dev/null +++ b/packages/view/backend/sirius-components-view-tree/src/main/java/org/eclipse/sirius/components/view/tree/impl/ForTreeItemLabelElementDescriptionImpl.java @@ -0,0 +1,288 @@ +/******************************************************************************* + * Copyright (c) 2024 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 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.tree.ForTreeItemLabelElementDescription; +import org.eclipse.sirius.components.view.tree.TreeItemLabelElementDescription; +import org.eclipse.sirius.components.view.tree.TreePackage; + +/** + * An implementation of the model object 'For Tree Item Label Element + * Description'. + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link org.eclipse.sirius.components.view.tree.impl.ForTreeItemLabelElementDescriptionImpl#getIterator + * Iterator}
  • + *
  • {@link org.eclipse.sirius.components.view.tree.impl.ForTreeItemLabelElementDescriptionImpl#getIterableExpression + * Iterable Expression}
  • + *
  • {@link org.eclipse.sirius.components.view.tree.impl.ForTreeItemLabelElementDescriptionImpl#getChildren + * Children}
  • + *
+ * + * @generated + */ +public class ForTreeItemLabelElementDescriptionImpl extends TreeItemLabelElementDescriptionImpl implements ForTreeItemLabelElementDescription { + /** + * The default value of the '{@link #getIterator() Iterator}' attribute. + * + * @see #getIterator() + * @generated + * @ordered + */ + protected static final String ITERATOR_EDEFAULT = null; + + /** + * The cached value of the '{@link #getIterator() Iterator}' attribute. + * + * @see #getIterator() + * @generated + * @ordered + */ + protected String iterator = ITERATOR_EDEFAULT; + + /** + * The default value of the '{@link #getIterableExpression() Iterable Expression}' attribute. + * + * @see #getIterableExpression() + * @generated + * @ordered + */ + protected static final String ITERABLE_EXPRESSION_EDEFAULT = null; + + /** + * The cached value of the '{@link #getIterableExpression() Iterable Expression}' attribute. + * + * @see #getIterableExpression() + * @generated + * @ordered + */ + protected String iterableExpression = ITERABLE_EXPRESSION_EDEFAULT; + + /** + * The cached value of the '{@link #getChildren() Children}' containment reference list. + * + * @see #getChildren() + * @generated + * @ordered + */ + protected EList children; + + /** + * + * + * @generated + */ + protected ForTreeItemLabelElementDescriptionImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return TreePackage.Literals.FOR_TREE_ITEM_LABEL_ELEMENT_DESCRIPTION; + } + + /** + * + * + * @generated + */ + @Override + public String getIterator() { + return this.iterator; + } + + /** + * + * + * @generated + */ + @Override + public void setIterator(String newIterator) { + String oldIterator = this.iterator; + this.iterator = newIterator; + if (this.eNotificationRequired()) + this.eNotify(new ENotificationImpl(this, Notification.SET, TreePackage.FOR_TREE_ITEM_LABEL_ELEMENT_DESCRIPTION__ITERATOR, oldIterator, this.iterator)); + } + + /** + * + * + * @generated + */ + @Override + public String getIterableExpression() { + return this.iterableExpression; + } + + /** + * + * + * @generated + */ + @Override + public void setIterableExpression(String newIterableExpression) { + String oldIterableExpression = this.iterableExpression; + this.iterableExpression = newIterableExpression; + if (this.eNotificationRequired()) + this.eNotify(new ENotificationImpl(this, Notification.SET, TreePackage.FOR_TREE_ITEM_LABEL_ELEMENT_DESCRIPTION__ITERABLE_EXPRESSION, oldIterableExpression, this.iterableExpression)); + } + + /** + * + * + * @generated + */ + @Override + public EList getChildren() { + if (this.children == null) { + this.children = new EObjectContainmentEList<>(TreeItemLabelElementDescription.class, this, TreePackage.FOR_TREE_ITEM_LABEL_ELEMENT_DESCRIPTION__CHILDREN); + } + return this.children; + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case TreePackage.FOR_TREE_ITEM_LABEL_ELEMENT_DESCRIPTION__CHILDREN: + return ((InternalEList) this.getChildren()).basicRemove(otherEnd, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case TreePackage.FOR_TREE_ITEM_LABEL_ELEMENT_DESCRIPTION__ITERATOR: + return this.getIterator(); + case TreePackage.FOR_TREE_ITEM_LABEL_ELEMENT_DESCRIPTION__ITERABLE_EXPRESSION: + return this.getIterableExpression(); + case TreePackage.FOR_TREE_ITEM_LABEL_ELEMENT_DESCRIPTION__CHILDREN: + return this.getChildren(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case TreePackage.FOR_TREE_ITEM_LABEL_ELEMENT_DESCRIPTION__ITERATOR: + this.setIterator((String) newValue); + return; + case TreePackage.FOR_TREE_ITEM_LABEL_ELEMENT_DESCRIPTION__ITERABLE_EXPRESSION: + this.setIterableExpression((String) newValue); + return; + case TreePackage.FOR_TREE_ITEM_LABEL_ELEMENT_DESCRIPTION__CHILDREN: + this.getChildren().clear(); + this.getChildren().addAll((Collection) newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case TreePackage.FOR_TREE_ITEM_LABEL_ELEMENT_DESCRIPTION__ITERATOR: + this.setIterator(ITERATOR_EDEFAULT); + return; + case TreePackage.FOR_TREE_ITEM_LABEL_ELEMENT_DESCRIPTION__ITERABLE_EXPRESSION: + this.setIterableExpression(ITERABLE_EXPRESSION_EDEFAULT); + return; + case TreePackage.FOR_TREE_ITEM_LABEL_ELEMENT_DESCRIPTION__CHILDREN: + this.getChildren().clear(); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case TreePackage.FOR_TREE_ITEM_LABEL_ELEMENT_DESCRIPTION__ITERATOR: + return ITERATOR_EDEFAULT == null ? this.iterator != null : !ITERATOR_EDEFAULT.equals(this.iterator); + case TreePackage.FOR_TREE_ITEM_LABEL_ELEMENT_DESCRIPTION__ITERABLE_EXPRESSION: + return ITERABLE_EXPRESSION_EDEFAULT == null ? this.iterableExpression != null : !ITERABLE_EXPRESSION_EDEFAULT.equals(this.iterableExpression); + case TreePackage.FOR_TREE_ITEM_LABEL_ELEMENT_DESCRIPTION__CHILDREN: + return this.children != null && !this.children.isEmpty(); + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public String toString() { + if (this.eIsProxy()) + return super.toString(); + + StringBuilder result = new StringBuilder(super.toString()); + result.append(" (iterator: "); + result.append(this.iterator); + result.append(", iterableExpression: "); + result.append(this.iterableExpression); + result.append(')'); + return result.toString(); + } + +} // ForTreeItemLabelElementDescriptionImpl 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 e17782c42d..bb34a15bdd 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 @@ -20,6 +20,7 @@ import org.eclipse.emf.ecore.plugin.EcorePlugin; import org.eclipse.sirius.components.view.tree.FetchTreeItemContextMenuEntry; import org.eclipse.sirius.components.view.tree.FetchTreeItemContextMenuEntryKind; +import org.eclipse.sirius.components.view.tree.ForTreeItemLabelElementDescription; import org.eclipse.sirius.components.view.tree.IfTreeItemLabelElementDescription; import org.eclipse.sirius.components.view.tree.SingleClickTreeItemContextMenuEntry; import org.eclipse.sirius.components.view.tree.TreeDescription; @@ -75,6 +76,8 @@ public EObject create(EClass eClass) { return this.createTreeItemLabelDescription(); case TreePackage.IF_TREE_ITEM_LABEL_ELEMENT_DESCRIPTION: return this.createIfTreeItemLabelElementDescription(); + case TreePackage.FOR_TREE_ITEM_LABEL_ELEMENT_DESCRIPTION: + return this.createForTreeItemLabelElementDescription(); case TreePackage.TREE_ITEM_LABEL_FRAGMENT_DESCRIPTION: return this.createTreeItemLabelFragmentDescription(); case TreePackage.SINGLE_CLICK_TREE_ITEM_CONTEXT_MENU_ENTRY: @@ -149,6 +152,17 @@ public IfTreeItemLabelElementDescription createIfTreeItemLabelElementDescription return ifTreeItemLabelElementDescription; } + /** + * + * + * @generated + */ + @Override + public ForTreeItemLabelElementDescription createForTreeItemLabelElementDescription() { + ForTreeItemLabelElementDescriptionImpl forTreeItemLabelElementDescription = new ForTreeItemLabelElementDescriptionImpl(); + return forTreeItemLabelElementDescription; + } + /** * * 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 d61fcd8791..f1bba891ca 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 @@ -21,6 +21,7 @@ import org.eclipse.sirius.components.view.ViewPackage; import org.eclipse.sirius.components.view.tree.FetchTreeItemContextMenuEntry; import org.eclipse.sirius.components.view.tree.FetchTreeItemContextMenuEntryKind; +import org.eclipse.sirius.components.view.tree.ForTreeItemLabelElementDescription; import org.eclipse.sirius.components.view.tree.IfTreeItemLabelElementDescription; import org.eclipse.sirius.components.view.tree.SingleClickTreeItemContextMenuEntry; import org.eclipse.sirius.components.view.tree.TreeDescription; @@ -59,6 +60,13 @@ public class TreePackageImpl extends EPackageImpl implements TreePackage { */ private EClass ifTreeItemLabelElementDescriptionEClass = null; + /** + * + * + * @generated + */ + private EClass forTreeItemLabelElementDescriptionEClass = null; + /** * * @@ -389,6 +397,46 @@ public EReference getIfTreeItemLabelElementDescription_Children() { return (EReference) this.ifTreeItemLabelElementDescriptionEClass.getEStructuralFeatures().get(1); } + /** + * + * + * @generated + */ + @Override + public EClass getForTreeItemLabelElementDescription() { + return this.forTreeItemLabelElementDescriptionEClass; + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getForTreeItemLabelElementDescription_Iterator() { + return (EAttribute) this.forTreeItemLabelElementDescriptionEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getForTreeItemLabelElementDescription_IterableExpression() { + return (EAttribute) this.forTreeItemLabelElementDescriptionEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EReference getForTreeItemLabelElementDescription_Children() { + return (EReference) this.forTreeItemLabelElementDescriptionEClass.getEStructuralFeatures().get(2); + } + /** * * @@ -585,6 +633,11 @@ public void createPackageContents() { this.createEAttribute(this.ifTreeItemLabelElementDescriptionEClass, IF_TREE_ITEM_LABEL_ELEMENT_DESCRIPTION__PREDICATE_EXPRESSION); this.createEReference(this.ifTreeItemLabelElementDescriptionEClass, IF_TREE_ITEM_LABEL_ELEMENT_DESCRIPTION__CHILDREN); + this.forTreeItemLabelElementDescriptionEClass = this.createEClass(FOR_TREE_ITEM_LABEL_ELEMENT_DESCRIPTION); + this.createEAttribute(this.forTreeItemLabelElementDescriptionEClass, FOR_TREE_ITEM_LABEL_ELEMENT_DESCRIPTION__ITERATOR); + this.createEAttribute(this.forTreeItemLabelElementDescriptionEClass, FOR_TREE_ITEM_LABEL_ELEMENT_DESCRIPTION__ITERABLE_EXPRESSION); + this.createEReference(this.forTreeItemLabelElementDescriptionEClass, FOR_TREE_ITEM_LABEL_ELEMENT_DESCRIPTION__CHILDREN); + this.treeItemLabelFragmentDescriptionEClass = this.createEClass(TREE_ITEM_LABEL_FRAGMENT_DESCRIPTION); this.createEAttribute(this.treeItemLabelFragmentDescriptionEClass, TREE_ITEM_LABEL_FRAGMENT_DESCRIPTION__LABEL_EXPRESSION); this.createEReference(this.treeItemLabelFragmentDescriptionEClass, TREE_ITEM_LABEL_FRAGMENT_DESCRIPTION__STYLE); @@ -634,6 +687,7 @@ public void initializePackageContents() { // Add supertypes to classes this.treeDescriptionEClass.getESuperTypes().add(theViewPackage.getRepresentationDescription()); this.ifTreeItemLabelElementDescriptionEClass.getESuperTypes().add(this.getTreeItemLabelElementDescription()); + this.forTreeItemLabelElementDescriptionEClass.getESuperTypes().add(this.getTreeItemLabelElementDescription()); this.treeItemLabelFragmentDescriptionEClass.getESuperTypes().add(this.getTreeItemLabelElementDescription()); this.singleClickTreeItemContextMenuEntryEClass.getESuperTypes().add(this.getTreeItemContextMenuEntry()); this.fetchTreeItemContextMenuEntryEClass.getESuperTypes().add(this.getTreeItemContextMenuEntry()); @@ -683,6 +737,15 @@ public void initializePackageContents() { this.initEReference(this.getIfTreeItemLabelElementDescription_Children(), this.getTreeItemLabelElementDescription(), null, "children", null, 1, -1, IfTreeItemLabelElementDescription.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + this.initEClass(this.forTreeItemLabelElementDescriptionEClass, ForTreeItemLabelElementDescription.class, "ForTreeItemLabelElementDescription", !IS_ABSTRACT, !IS_INTERFACE, + IS_GENERATED_INSTANCE_CLASS); + this.initEAttribute(this.getForTreeItemLabelElementDescription_Iterator(), this.ecorePackage.getEString(), "iterator", null, 0, 1, ForTreeItemLabelElementDescription.class, !IS_TRANSIENT, + !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + this.initEAttribute(this.getForTreeItemLabelElementDescription_IterableExpression(), theViewPackage.getInterpretedExpression(), "iterableExpression", null, 0, 1, + ForTreeItemLabelElementDescription.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + this.initEReference(this.getForTreeItemLabelElementDescription_Children(), this.getTreeItemLabelElementDescription(), null, "children", null, 1, -1, ForTreeItemLabelElementDescription.class, + !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + this.initEClass(this.treeItemLabelFragmentDescriptionEClass, TreeItemLabelFragmentDescription.class, "TreeItemLabelFragmentDescription", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); this.initEAttribute(this.getTreeItemLabelFragmentDescription_LabelExpression(), theViewPackage.getInterpretedExpression(), "labelExpression", null, 0, 1, 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 0ba0ab05c1..961657ecef 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 @@ -18,6 +18,7 @@ import org.eclipse.emf.ecore.EObject; import org.eclipse.sirius.components.view.RepresentationDescription; import org.eclipse.sirius.components.view.tree.FetchTreeItemContextMenuEntry; +import org.eclipse.sirius.components.view.tree.ForTreeItemLabelElementDescription; import org.eclipse.sirius.components.view.tree.IfTreeItemLabelElementDescription; import org.eclipse.sirius.components.view.tree.SingleClickTreeItemContextMenuEntry; import org.eclipse.sirius.components.view.tree.TreeDescription; @@ -64,6 +65,11 @@ public Adapter caseIfTreeItemLabelElementDescription(IfTreeItemLabelElementDescr return TreeAdapterFactory.this.createIfTreeItemLabelElementDescriptionAdapter(); } + @Override + public Adapter caseForTreeItemLabelElementDescription(ForTreeItemLabelElementDescription object) { + return TreeAdapterFactory.this.createForTreeItemLabelElementDescriptionAdapter(); + } + @Override public Adapter caseTreeItemLabelFragmentDescription(TreeItemLabelFragmentDescription object) { return TreeAdapterFactory.this.createTreeItemLabelFragmentDescriptionAdapter(); @@ -185,6 +191,21 @@ public Adapter createIfTreeItemLabelElementDescriptionAdapter() { return null; } + /** + * Creates a new adapter for an object of class + * '{@link org.eclipse.sirius.components.view.tree.ForTreeItemLabelElementDescription For Tree Item Label + * Element Description}'. 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.ForTreeItemLabelElementDescription + * @generated + */ + public Adapter createForTreeItemLabelElementDescriptionAdapter() { + return null; + } + /** * Creates a new adapter for an object of class * '{@link org.eclipse.sirius.components.view.tree.TreeItemLabelFragmentDescription Item Label Fragment 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 e2190990f6..a8267f0287 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 @@ -17,6 +17,7 @@ import org.eclipse.emf.ecore.util.Switch; import org.eclipse.sirius.components.view.RepresentationDescription; import org.eclipse.sirius.components.view.tree.FetchTreeItemContextMenuEntry; +import org.eclipse.sirius.components.view.tree.ForTreeItemLabelElementDescription; import org.eclipse.sirius.components.view.tree.IfTreeItemLabelElementDescription; import org.eclipse.sirius.components.view.tree.SingleClickTreeItemContextMenuEntry; import org.eclipse.sirius.components.view.tree.TreeDescription; @@ -103,6 +104,15 @@ protected T doSwitch(int classifierID, EObject theEObject) { result = this.defaultCase(theEObject); return result; } + case TreePackage.FOR_TREE_ITEM_LABEL_ELEMENT_DESCRIPTION: { + ForTreeItemLabelElementDescription forTreeItemLabelElementDescription = (ForTreeItemLabelElementDescription) theEObject; + T result = this.caseForTreeItemLabelElementDescription(forTreeItemLabelElementDescription); + if (result == null) + result = this.caseTreeItemLabelElementDescription(forTreeItemLabelElementDescription); + if (result == null) + result = this.defaultCase(theEObject); + return result; + } case TreePackage.TREE_ITEM_LABEL_FRAGMENT_DESCRIPTION: { TreeItemLabelFragmentDescription treeItemLabelFragmentDescription = (TreeItemLabelFragmentDescription) theEObject; T result = this.caseTreeItemLabelFragmentDescription(treeItemLabelFragmentDescription); @@ -194,6 +204,22 @@ public T caseIfTreeItemLabelElementDescription(IfTreeItemLabelElementDescription return null; } + /** + * Returns the result of interpreting the object as an instance of 'For Tree Item Label Element + * Description'. 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 'For Tree Item Label Element + * Description'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseForTreeItemLabelElementDescription(ForTreeItemLabelElementDescription object) { + return null; + } + /** * Returns the result of interpreting the object as an instance of 'Item Label Fragment Description'. This implementation returns null; returning a non-null result will terminate the switch.