From f5e47ca2247a42cb214328b62200b6cf3ca6c46f Mon Sep 17 00:00:00 2001 From: Florian Barbin Date: Wed, 7 Feb 2024 18:42:45 +0100 Subject: [PATCH] [3079] Add a name attribute on deck view descriptions This makes the LaneDescription and CardDescription easier to identify. Bug: https://github.com/eclipse-sirius/sirius-web/issues/3079 Signed-off-by: Florian Barbin --- CHANGELOG.adoc | 1 + .../view/ViewDeckDescriptionBuilder.java | 2 + .../generated/CardDescriptionBuilder.java | 10 + .../DeckElementDescriptionBuilder.java | 67 ++++ .../generated/LaneDescriptionBuilder.java | 10 + .../ListLayoutStrategyDescriptionBuilder.java | 2 +- .../provider/CardDescriptionItemProvider.java | 66 +--- .../DeckElementDescriptionItemProvider.java | 183 ++++++++++ .../provider/LaneDescriptionItemProvider.java | 70 +--- .../src/main/resources/plugin.properties | 11 +- .../components/view/deck/CardDescription.java | 74 +--- .../view/deck/DeckElementDescription.java | 132 +++++++ .../components/view/deck/DeckPackage.java | 334 ++++++++++------- .../components/view/deck/LaneDescription.java | 73 +--- .../view/deck/impl/CardDescriptionImpl.java | 171 +-------- .../deck/impl/DeckElementDescriptionImpl.java | 344 ++++++++++++++++++ .../view/deck/impl/DeckPackageImpl.java | 144 ++++---- .../view/deck/impl/LaneDescriptionImpl.java | 184 +--------- .../view/deck/util/DeckAdapterFactory.java | 20 + .../components/view/deck/util/DeckSwitch.java | 27 ++ .../src/main/resources/model/deck.ecore | 29 +- .../src/main/resources/model/deck.genmodel | 12 +- 22 files changed, 1098 insertions(+), 868 deletions(-) create mode 100644 packages/view/backend/sirius-components-view-builder/src/main/java/org/eclipse/sirius/components/view/builder/generated/DeckElementDescriptionBuilder.java create mode 100644 packages/view/backend/sirius-components-view-deck-edit/src/main/java/org/eclipse/sirius/components/view/deck/provider/DeckElementDescriptionItemProvider.java create mode 100644 packages/view/backend/sirius-components-view-deck/src/main/java/org/eclipse/sirius/components/view/deck/DeckElementDescription.java create mode 100644 packages/view/backend/sirius-components-view-deck/src/main/java/org/eclipse/sirius/components/view/deck/impl/DeckElementDescriptionImpl.java diff --git a/CHANGELOG.adoc b/CHANGELOG.adoc index b0e2df3ee6d..3035241f5d6 100644 --- a/CHANGELOG.adoc +++ b/CHANGELOG.adoc @@ -76,6 +76,7 @@ image:doc/screenshots/deploymenDiagram.png[Deployment Diagram,70%] - https://github.com/eclipse-sirius/sirius-web/issues/1844[#1844] [emf] Unload resources by default when the EMF based editing context is disposed - https://github.com/eclipse-sirius/sirius-web/issues/3020[#3020] [sirius-web] Improve the creation of the Apollo GraphQL client. - https://github.com/eclipse-sirius/sirius-web/issues/3056[#3056] [trees] Expand the clickable/draggable zone for tree items +- https://github.com/eclipse-sirius/sirius-web/issues/3079[#3079] [deck] Add a name attribute on CardDescription and LaneDescription == v2024.1.0 diff --git a/packages/starters/backend/sirius-components-task-starter/src/main/java/org/eclipse/sirius/components/task/starter/configuration/view/ViewDeckDescriptionBuilder.java b/packages/starters/backend/sirius-components-task-starter/src/main/java/org/eclipse/sirius/components/task/starter/configuration/view/ViewDeckDescriptionBuilder.java index 275efa4eabb..a669e11fdac 100644 --- a/packages/starters/backend/sirius-components-task-starter/src/main/java/org/eclipse/sirius/components/task/starter/configuration/view/ViewDeckDescriptionBuilder.java +++ b/packages/starters/backend/sirius-components-task-starter/src/main/java/org/eclipse/sirius/components/task/starter/configuration/view/ViewDeckDescriptionBuilder.java @@ -69,6 +69,7 @@ private CardDescription createCardDescription() { EditCardTool editCardTool = this.createEditCardTool(); DeleteCardTool deleteCardTool = this.createDeleteCardTool(); return this.deckBuilders.newCardDescription() + .name("Card Description") .semanticCandidatesExpression("aql:self.getTasksWithTag()") .titleExpression("aql:self.name") .labelExpression("aql:self.computeTaskDurationDays()") @@ -83,6 +84,7 @@ private LaneDescription createLaneDescription() { CardDropTool cardDropTool = this.createCardDropTool(); EditLaneTool editLaneTool = this.createEditLaneTool(); return this.deckBuilders.newLaneDescription() + .name("Lane Description") .semanticCandidatesExpression("aql:self.ownedTags->select(tag | tag.prefix == 'daily')") .labelExpression("aql:self.getTasksWithTag()->size() + ' / ' + self.eContainer().oclAsType(task::Project).ownedTasks->select(task | task.tags->exists(tag | tag.prefix == 'daily'))->size()") .titleExpression("aql:self.suffix") diff --git a/packages/view/backend/sirius-components-view-builder/src/main/java/org/eclipse/sirius/components/view/builder/generated/CardDescriptionBuilder.java b/packages/view/backend/sirius-components-view-builder/src/main/java/org/eclipse/sirius/components/view/builder/generated/CardDescriptionBuilder.java index f5aeda4e911..82f36ffa717 100644 --- a/packages/view/backend/sirius-components-view-builder/src/main/java/org/eclipse/sirius/components/view/builder/generated/CardDescriptionBuilder.java +++ b/packages/view/backend/sirius-components-view-builder/src/main/java/org/eclipse/sirius/components/view/builder/generated/CardDescriptionBuilder.java @@ -42,6 +42,16 @@ public org.eclipse.sirius.components.view.deck.CardDescription build() { return this.getCardDescription(); } + /** + * Setter for Name. + * + * @generated + */ + public CardDescriptionBuilder name(java.lang.String value) { + this.getCardDescription().setName(value); + return this; + } + /** * Setter for SemanticCandidatesExpression. * diff --git a/packages/view/backend/sirius-components-view-builder/src/main/java/org/eclipse/sirius/components/view/builder/generated/DeckElementDescriptionBuilder.java b/packages/view/backend/sirius-components-view-builder/src/main/java/org/eclipse/sirius/components/view/builder/generated/DeckElementDescriptionBuilder.java new file mode 100644 index 00000000000..89200e5ba29 --- /dev/null +++ b/packages/view/backend/sirius-components-view-builder/src/main/java/org/eclipse/sirius/components/view/builder/generated/DeckElementDescriptionBuilder.java @@ -0,0 +1,67 @@ +/******************************************************************************* + * 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.builder.generated; + +/** + * Builder for org.eclipse.sirius.components.view.deck.DeckElementDescription. + * + * @author BuilderGenerator + * @generated + */ +public abstract class DeckElementDescriptionBuilder { + + /** + * Builder for org.eclipse.sirius.components.view.deck.DeckElementDescription. + * @generated + */ + protected abstract org.eclipse.sirius.components.view.deck.DeckElementDescription getDeckElementDescription(); + + /** + * Setter for Name. + * + * @generated + */ + public DeckElementDescriptionBuilder name(java.lang.String value) { + this.getDeckElementDescription().setName(value); + return this; + } + /** + * Setter for SemanticCandidatesExpression. + * + * @generated + */ + public DeckElementDescriptionBuilder semanticCandidatesExpression(java.lang.String value) { + this.getDeckElementDescription().setSemanticCandidatesExpression(value); + return this; + } + /** + * Setter for TitleExpression. + * + * @generated + */ + public DeckElementDescriptionBuilder titleExpression(java.lang.String value) { + this.getDeckElementDescription().setTitleExpression(value); + return this; + } + /** + * Setter for LabelExpression. + * + * @generated + */ + public DeckElementDescriptionBuilder labelExpression(java.lang.String value) { + this.getDeckElementDescription().setLabelExpression(value); + return this; + } + +} + diff --git a/packages/view/backend/sirius-components-view-builder/src/main/java/org/eclipse/sirius/components/view/builder/generated/LaneDescriptionBuilder.java b/packages/view/backend/sirius-components-view-builder/src/main/java/org/eclipse/sirius/components/view/builder/generated/LaneDescriptionBuilder.java index 90648383e6a..a1af731f40f 100644 --- a/packages/view/backend/sirius-components-view-builder/src/main/java/org/eclipse/sirius/components/view/builder/generated/LaneDescriptionBuilder.java +++ b/packages/view/backend/sirius-components-view-builder/src/main/java/org/eclipse/sirius/components/view/builder/generated/LaneDescriptionBuilder.java @@ -42,6 +42,16 @@ public org.eclipse.sirius.components.view.deck.LaneDescription build() { return this.getLaneDescription(); } + /** + * Setter for Name. + * + * @generated + */ + public LaneDescriptionBuilder name(java.lang.String value) { + this.getLaneDescription().setName(value); + return this; + } + /** * Setter for SemanticCandidatesExpression. * diff --git a/packages/view/backend/sirius-components-view-builder/src/main/java/org/eclipse/sirius/components/view/builder/generated/ListLayoutStrategyDescriptionBuilder.java b/packages/view/backend/sirius-components-view-builder/src/main/java/org/eclipse/sirius/components/view/builder/generated/ListLayoutStrategyDescriptionBuilder.java index 132e9ddb8fb..389936de63b 100644 --- a/packages/view/backend/sirius-components-view-builder/src/main/java/org/eclipse/sirius/components/view/builder/generated/ListLayoutStrategyDescriptionBuilder.java +++ b/packages/view/backend/sirius-components-view-builder/src/main/java/org/eclipse/sirius/components/view/builder/generated/ListLayoutStrategyDescriptionBuilder.java @@ -25,7 +25,7 @@ public class ListLayoutStrategyDescriptionBuilder { * * @generated */ - private final org.eclipse.sirius.components.view.diagram.ListLayoutStrategyDescription listLayoutStrategyDescription = org.eclipse.sirius.components.view.diagram.DiagramFactory.eINSTANCE.createListLayoutStrategyDescription(); + private org.eclipse.sirius.components.view.diagram.ListLayoutStrategyDescription listLayoutStrategyDescription = org.eclipse.sirius.components.view.diagram.DiagramFactory.eINSTANCE.createListLayoutStrategyDescription(); /** * Return instance org.eclipse.sirius.components.view.diagram.ListLayoutStrategyDescription. diff --git a/packages/view/backend/sirius-components-view-deck-edit/src/main/java/org/eclipse/sirius/components/view/deck/provider/CardDescriptionItemProvider.java b/packages/view/backend/sirius-components-view-deck-edit/src/main/java/org/eclipse/sirius/components/view/deck/provider/CardDescriptionItemProvider.java index c5a7d2db34a..1ea5a1649b7 100644 --- a/packages/view/backend/sirius-components-view-deck-edit/src/main/java/org/eclipse/sirius/components/view/deck/provider/CardDescriptionItemProvider.java +++ b/packages/view/backend/sirius-components-view-deck-edit/src/main/java/org/eclipse/sirius/components/view/deck/provider/CardDescriptionItemProvider.java @@ -17,18 +17,10 @@ import org.eclipse.emf.common.notify.AdapterFactory; import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.util.ResourceLocator; import org.eclipse.emf.ecore.EStructuralFeature; import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; -import org.eclipse.emf.edit.provider.IChildCreationExtender; -import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; -import org.eclipse.emf.edit.provider.IItemLabelProvider; import org.eclipse.emf.edit.provider.IItemPropertyDescriptor; -import org.eclipse.emf.edit.provider.IItemPropertySource; -import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; -import org.eclipse.emf.edit.provider.ITreeItemContentProvider; import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; -import org.eclipse.emf.edit.provider.ItemProviderAdapter; import org.eclipse.emf.edit.provider.ViewerNotification; import org.eclipse.sirius.components.view.deck.CardDescription; import org.eclipse.sirius.components.view.deck.DeckFactory; @@ -40,8 +32,7 @@ * * @generated */ -public class CardDescriptionItemProvider extends ItemProviderAdapter - implements IEditingDomainItemProvider, IStructuredItemContentProvider, ITreeItemContentProvider, IItemLabelProvider, IItemPropertySource { +public class CardDescriptionItemProvider extends DeckElementDescriptionItemProvider { /** * This constructs an instance from a factory and a notifier. * @@ -61,51 +52,11 @@ public List getPropertyDescriptors(Object object) { if (this.itemPropertyDescriptors == null) { super.getPropertyDescriptors(object); - this.addSemanticCandidatesExpressionPropertyDescriptor(object); - this.addTitleExpressionPropertyDescriptor(object); - this.addLabelExpressionPropertyDescriptor(object); this.addDescriptionExpressionPropertyDescriptor(object); } return this.itemPropertyDescriptors; } - /** - * This adds a property descriptor for the Semantic Candidates Expression feature. - * - * @generated - */ - protected void addSemanticCandidatesExpressionPropertyDescriptor(Object object) { - this.itemPropertyDescriptors.add(this.createItemPropertyDescriptor(((ComposeableAdapterFactory) this.adapterFactory).getRootAdapterFactory(), this.getResourceLocator(), - this.getString("_UI_CardDescription_semanticCandidatesExpression_feature"), - this.getString("_UI_PropertyDescriptor_description", "_UI_CardDescription_semanticCandidatesExpression_feature", "_UI_CardDescription_type"), - DeckPackage.Literals.CARD_DESCRIPTION__SEMANTIC_CANDIDATES_EXPRESSION, true, false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); - } - - /** - * This adds a property descriptor for the Title Expression feature. - * - * @generated - */ - protected void addTitleExpressionPropertyDescriptor(Object object) { - this.itemPropertyDescriptors.add(this.createItemPropertyDescriptor(((ComposeableAdapterFactory) this.adapterFactory).getRootAdapterFactory(), this.getResourceLocator(), - this.getString("_UI_CardDescription_titleExpression_feature"), - this.getString("_UI_PropertyDescriptor_description", "_UI_CardDescription_titleExpression_feature", "_UI_CardDescription_type"), - DeckPackage.Literals.CARD_DESCRIPTION__TITLE_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_CardDescription_labelExpression_feature"), - this.getString("_UI_PropertyDescriptor_description", "_UI_CardDescription_labelExpression_feature", "_UI_CardDescription_type"), - DeckPackage.Literals.CARD_DESCRIPTION__LABEL_EXPRESSION, true, false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); - } - /** * This adds a property descriptor for the Description Expression feature. @@ -177,7 +128,7 @@ protected boolean shouldComposeCreationImage() { */ @Override public String getText(Object object) { - String label = ((CardDescription) object).getSemanticCandidatesExpression(); + String label = ((CardDescription) object).getName(); return label == null || label.length() == 0 ? this.getString("_UI_CardDescription_type") : this.getString("_UI_CardDescription_type") + " " + label; } @@ -193,9 +144,6 @@ public void notifyChanged(Notification notification) { this.updateChildren(notification); switch (notification.getFeatureID(CardDescription.class)) { - case DeckPackage.CARD_DESCRIPTION__SEMANTIC_CANDIDATES_EXPRESSION: - case DeckPackage.CARD_DESCRIPTION__TITLE_EXPRESSION: - case DeckPackage.CARD_DESCRIPTION__LABEL_EXPRESSION: case DeckPackage.CARD_DESCRIPTION__DESCRIPTION_EXPRESSION: this.fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true)); return; @@ -222,14 +170,4 @@ protected void collectNewChildDescriptors(Collection newChildDescriptors newChildDescriptors.add(this.createChildParameter(DeckPackage.Literals.CARD_DESCRIPTION__DELETE_TOOL, DeckFactory.eINSTANCE.createDeleteCardTool())); } - /** - * 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-deck-edit/src/main/java/org/eclipse/sirius/components/view/deck/provider/DeckElementDescriptionItemProvider.java b/packages/view/backend/sirius-components-view-deck-edit/src/main/java/org/eclipse/sirius/components/view/deck/provider/DeckElementDescriptionItemProvider.java new file mode 100644 index 00000000000..0c2c76f7165 --- /dev/null +++ b/packages/view/backend/sirius-components-view-deck-edit/src/main/java/org/eclipse/sirius/components/view/deck/provider/DeckElementDescriptionItemProvider.java @@ -0,0 +1,183 @@ +/******************************************************************************* + * 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.deck.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.common.util.ResourceLocator; +import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; +import org.eclipse.emf.edit.provider.IChildCreationExtender; +import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; +import org.eclipse.emf.edit.provider.IItemLabelProvider; +import org.eclipse.emf.edit.provider.IItemPropertyDescriptor; +import org.eclipse.emf.edit.provider.IItemPropertySource; +import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; +import org.eclipse.emf.edit.provider.ITreeItemContentProvider; +import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; +import org.eclipse.emf.edit.provider.ItemProviderAdapter; +import org.eclipse.emf.edit.provider.ViewerNotification; +import org.eclipse.sirius.components.view.deck.DeckElementDescription; +import org.eclipse.sirius.components.view.deck.DeckPackage; + +/** + * This is the item provider adapter for a {@link org.eclipse.sirius.components.view.deck.DeckElementDescription} + * object. + * + * @generated + */ +public class DeckElementDescriptionItemProvider extends ItemProviderAdapter + implements IEditingDomainItemProvider, IStructuredItemContentProvider, ITreeItemContentProvider, IItemLabelProvider, IItemPropertySource { + /** + * This constructs an instance from a factory and a notifier. + * + * @generated + */ + public DeckElementDescriptionItemProvider(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.addSemanticCandidatesExpressionPropertyDescriptor(object); + this.addTitleExpressionPropertyDescriptor(object); + this.addLabelExpressionPropertyDescriptor(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_DeckElementDescription_name_feature"), + this.getString("_UI_PropertyDescriptor_description", "_UI_DeckElementDescription_name_feature", "_UI_DeckElementDescription_type"), DeckPackage.Literals.DECK_ELEMENT_DESCRIPTION__NAME, + true, false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); + } + + /** + * This adds a property descriptor for the Semantic Candidates Expression feature. + * + * @generated + */ + protected void addSemanticCandidatesExpressionPropertyDescriptor(Object object) { + this.itemPropertyDescriptors.add(this.createItemPropertyDescriptor(((ComposeableAdapterFactory) this.adapterFactory).getRootAdapterFactory(), this.getResourceLocator(), + this.getString("_UI_DeckElementDescription_semanticCandidatesExpression_feature"), + this.getString("_UI_PropertyDescriptor_description", "_UI_DeckElementDescription_semanticCandidatesExpression_feature", "_UI_DeckElementDescription_type"), + DeckPackage.Literals.DECK_ELEMENT_DESCRIPTION__SEMANTIC_CANDIDATES_EXPRESSION, true, false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); + } + + /** + * This adds a property descriptor for the Title Expression feature. + * + * @generated + */ + protected void addTitleExpressionPropertyDescriptor(Object object) { + this.itemPropertyDescriptors.add(this.createItemPropertyDescriptor(((ComposeableAdapterFactory) this.adapterFactory).getRootAdapterFactory(), this.getResourceLocator(), + this.getString("_UI_DeckElementDescription_titleExpression_feature"), + this.getString("_UI_PropertyDescriptor_description", "_UI_DeckElementDescription_titleExpression_feature", "_UI_DeckElementDescription_type"), + DeckPackage.Literals.DECK_ELEMENT_DESCRIPTION__TITLE_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_DeckElementDescription_labelExpression_feature"), + this.getString("_UI_PropertyDescriptor_description", "_UI_DeckElementDescription_labelExpression_feature", "_UI_DeckElementDescription_type"), + DeckPackage.Literals.DECK_ELEMENT_DESCRIPTION__LABEL_EXPRESSION, true, false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); + } + + /** + * + * + * @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 = ((DeckElementDescription) object).getName(); + return label == null || label.length() == 0 ? this.getString("_UI_DeckElementDescription_type") : this.getString("_UI_DeckElementDescription_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(DeckElementDescription.class)) { + case DeckPackage.DECK_ELEMENT_DESCRIPTION__NAME: + case DeckPackage.DECK_ELEMENT_DESCRIPTION__SEMANTIC_CANDIDATES_EXPRESSION: + case DeckPackage.DECK_ELEMENT_DESCRIPTION__TITLE_EXPRESSION: + case DeckPackage.DECK_ELEMENT_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); + } + + /** + * 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-deck-edit/src/main/java/org/eclipse/sirius/components/view/deck/provider/LaneDescriptionItemProvider.java b/packages/view/backend/sirius-components-view-deck-edit/src/main/java/org/eclipse/sirius/components/view/deck/provider/LaneDescriptionItemProvider.java index 57ea9803125..1f047ff67bd 100644 --- a/packages/view/backend/sirius-components-view-deck-edit/src/main/java/org/eclipse/sirius/components/view/deck/provider/LaneDescriptionItemProvider.java +++ b/packages/view/backend/sirius-components-view-deck-edit/src/main/java/org/eclipse/sirius/components/view/deck/provider/LaneDescriptionItemProvider.java @@ -17,18 +17,8 @@ import org.eclipse.emf.common.notify.AdapterFactory; import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.util.ResourceLocator; import org.eclipse.emf.ecore.EStructuralFeature; -import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; -import org.eclipse.emf.edit.provider.IChildCreationExtender; -import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; -import org.eclipse.emf.edit.provider.IItemLabelProvider; import org.eclipse.emf.edit.provider.IItemPropertyDescriptor; -import org.eclipse.emf.edit.provider.IItemPropertySource; -import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; -import org.eclipse.emf.edit.provider.ITreeItemContentProvider; -import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; -import org.eclipse.emf.edit.provider.ItemProviderAdapter; import org.eclipse.emf.edit.provider.ViewerNotification; import org.eclipse.sirius.components.view.deck.DeckFactory; import org.eclipse.sirius.components.view.deck.DeckPackage; @@ -40,8 +30,7 @@ * * @generated */ -public class LaneDescriptionItemProvider extends ItemProviderAdapter - implements IEditingDomainItemProvider, IStructuredItemContentProvider, ITreeItemContentProvider, IItemLabelProvider, IItemPropertySource { +public class LaneDescriptionItemProvider extends DeckElementDescriptionItemProvider { /** * This constructs an instance from a factory and a notifier. * @@ -61,50 +50,10 @@ public List getPropertyDescriptors(Object object) { if (this.itemPropertyDescriptors == null) { super.getPropertyDescriptors(object); - this.addSemanticCandidatesExpressionPropertyDescriptor(object); - this.addTitleExpressionPropertyDescriptor(object); - this.addLabelExpressionPropertyDescriptor(object); } return this.itemPropertyDescriptors; } - /** - * This adds a property descriptor for the Semantic Candidates Expression feature. - * - * @generated - */ - protected void addSemanticCandidatesExpressionPropertyDescriptor(Object object) { - this.itemPropertyDescriptors.add(this.createItemPropertyDescriptor(((ComposeableAdapterFactory) this.adapterFactory).getRootAdapterFactory(), this.getResourceLocator(), - this.getString("_UI_LaneDescription_semanticCandidatesExpression_feature"), - this.getString("_UI_PropertyDescriptor_description", "_UI_LaneDescription_semanticCandidatesExpression_feature", "_UI_LaneDescription_type"), - DeckPackage.Literals.LANE_DESCRIPTION__SEMANTIC_CANDIDATES_EXPRESSION, true, false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); - } - - /** - * This adds a property descriptor for the Title Expression feature. - * - * @generated - */ - protected void addTitleExpressionPropertyDescriptor(Object object) { - this.itemPropertyDescriptors.add(this.createItemPropertyDescriptor(((ComposeableAdapterFactory) this.adapterFactory).getRootAdapterFactory(), this.getResourceLocator(), - this.getString("_UI_LaneDescription_titleExpression_feature"), - this.getString("_UI_PropertyDescriptor_description", "_UI_LaneDescription_titleExpression_feature", "_UI_LaneDescription_type"), - DeckPackage.Literals.LANE_DESCRIPTION__TITLE_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_LaneDescription_labelExpression_feature"), - this.getString("_UI_PropertyDescriptor_description", "_UI_LaneDescription_labelExpression_feature", "_UI_LaneDescription_type"), - DeckPackage.Literals.LANE_DESCRIPTION__LABEL_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 @@ -165,7 +114,7 @@ protected boolean shouldComposeCreationImage() { */ @Override public String getText(Object object) { - String label = ((LaneDescription) object).getSemanticCandidatesExpression(); + String label = ((LaneDescription) object).getName(); return label == null || label.length() == 0 ? this.getString("_UI_LaneDescription_type") : this.getString("_UI_LaneDescription_type") + " " + label; } @@ -181,11 +130,6 @@ public void notifyChanged(Notification notification) { this.updateChildren(notification); switch (notification.getFeatureID(LaneDescription.class)) { - case DeckPackage.LANE_DESCRIPTION__SEMANTIC_CANDIDATES_EXPRESSION: - case DeckPackage.LANE_DESCRIPTION__TITLE_EXPRESSION: - case DeckPackage.LANE_DESCRIPTION__LABEL_EXPRESSION: - this.fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true)); - return; case DeckPackage.LANE_DESCRIPTION__OWNED_CARD_DESCRIPTIONS: case DeckPackage.LANE_DESCRIPTION__EDIT_TOOL: case DeckPackage.LANE_DESCRIPTION__CREATE_TOOL: @@ -215,14 +159,4 @@ protected void collectNewChildDescriptors(Collection newChildDescriptors newChildDescriptors.add(this.createChildParameter(DeckPackage.Literals.LANE_DESCRIPTION__CARD_DROP_TOOL, DeckFactory.eINSTANCE.createCardDropTool())); } - /** - * 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-deck-edit/src/main/resources/plugin.properties b/packages/view/backend/sirius-components-view-deck-edit/src/main/resources/plugin.properties index 1661fb5a901..89f45eee936 100644 --- a/packages/view/backend/sirius-components-view-deck-edit/src/main/resources/plugin.properties +++ b/packages/view/backend/sirius-components-view-deck-edit/src/main/resources/plugin.properties @@ -31,6 +31,7 @@ _UI_DeleteCardTool_type = Delete Card Tool _UI_EditLaneTool_type = Edit Lane Tool _UI_CardDropTool_type = Card Drop Tool _UI_LaneDropTool_type = Lane Drop Tool +_UI_DeckElementDescription_type = Element Description _UI_Unknown_type = Object _UI_Unknown_datatype= Value @@ -38,21 +39,19 @@ _UI_Unknown_datatype= Value _UI_DeckDescription_laneDescriptions_feature = Lane Descriptions _UI_DeckDescription_backgroundColor_feature = Background Color _UI_DeckDescription_laneDropTool_feature = Lane Drop Tool -_UI_LaneDescription_semanticCandidatesExpression_feature = Semantic Candidates Expression -_UI_LaneDescription_titleExpression_feature = Title Expression -_UI_LaneDescription_labelExpression_feature = Label Expression _UI_LaneDescription_ownedCardDescriptions_feature = Owned Card Descriptions _UI_LaneDescription_editTool_feature = Edit Tool _UI_LaneDescription_createTool_feature = Create Tool _UI_LaneDescription_cardDropTool_feature = Card Drop Tool -_UI_CardDescription_semanticCandidatesExpression_feature = Semantic Candidates Expression -_UI_CardDescription_titleExpression_feature = Title Expression -_UI_CardDescription_labelExpression_feature = Label Expression _UI_CardDescription_descriptionExpression_feature = Description Expression _UI_CardDescription_editTool_feature = Edit Tool _UI_CardDescription_deleteTool_feature = Delete Tool _UI_DeckTool_name_feature = Name _UI_DeckTool_preconditionExpression_feature = Precondition Expression _UI_DeckTool_body_feature = Body +_UI_DeckElementDescription_name_feature = Name +_UI_DeckElementDescription_semanticCandidatesExpression_feature = Semantic Candidates Expression +_UI_DeckElementDescription_titleExpression_feature = Title Expression +_UI_DeckElementDescription_labelExpression_feature = Label Expression _UI_Unknown_feature = Unspecified diff --git a/packages/view/backend/sirius-components-view-deck/src/main/java/org/eclipse/sirius/components/view/deck/CardDescription.java b/packages/view/backend/sirius-components-view-deck/src/main/java/org/eclipse/sirius/components/view/deck/CardDescription.java index 25a2c032cdf..fdb53830a6d 100644 --- a/packages/view/backend/sirius-components-view-deck/src/main/java/org/eclipse/sirius/components/view/deck/CardDescription.java +++ b/packages/view/backend/sirius-components-view-deck/src/main/java/org/eclipse/sirius/components/view/deck/CardDescription.java @@ -12,8 +12,6 @@ *******************************************************************************/ package org.eclipse.sirius.components.view.deck; -import org.eclipse.emf.ecore.EObject; - /** * A representation of the model object 'Card Description'. @@ -34,77 +32,7 @@ * @model * @generated */ -public interface CardDescription extends EObject { - /** - * Returns the value of the 'Semantic Candidates Expression' attribute. The default value is - * "aql:self". - * - * @return the value of the 'Semantic Candidates Expression' attribute. - * @see #setSemanticCandidatesExpression(String) - * @see org.eclipse.sirius.components.view.deck.DeckPackage#getCardDescription_SemanticCandidatesExpression() - * @model default="aql:self" dataType="org.eclipse.sirius.components.view.InterpretedExpression" required="true" - * @generated - */ - String getSemanticCandidatesExpression(); - - /** - * Sets the value of the - * '{@link org.eclipse.sirius.components.view.deck.CardDescription#getSemanticCandidatesExpression Semantic - * Candidates Expression}' attribute. - * - * @param value - * the new value of the 'Semantic Candidates Expression' attribute. - * @see #getSemanticCandidatesExpression() - * @generated - */ - void setSemanticCandidatesExpression(String value); - - /** - * Returns the value of the 'Title Expression' attribute. The default value is - * "aql:self". - * - * @return the value of the 'Title Expression' attribute. - * @see #setTitleExpression(String) - * @see org.eclipse.sirius.components.view.deck.DeckPackage#getCardDescription_TitleExpression() - * @model default="aql:self" dataType="org.eclipse.sirius.components.view.InterpretedExpression" - * @generated - */ - String getTitleExpression(); - - /** - * Sets the value of the '{@link org.eclipse.sirius.components.view.deck.CardDescription#getTitleExpression - * Title Expression}' attribute. - * - * @param value - * the new value of the 'Title Expression' attribute. - * @see #getTitleExpression() - * @generated - */ - void setTitleExpression(String value); - - /** - * Returns the value of the 'Label Expression' attribute. The default value is - * "aql:self". - * - * @return the value of the 'Label Expression' attribute. - * @see #setLabelExpression(String) - * @see org.eclipse.sirius.components.view.deck.DeckPackage#getCardDescription_LabelExpression() - * @model default="aql:self" dataType="org.eclipse.sirius.components.view.InterpretedExpression" - * @generated - */ - String getLabelExpression(); - - /** - * Sets the value of the '{@link org.eclipse.sirius.components.view.deck.CardDescription#getLabelExpression - * Label Expression}' attribute. - * - * @param value - * the new value of the 'Label Expression' attribute. - * @see #getLabelExpression() - * @generated - */ - void setLabelExpression(String value); - +public interface CardDescription extends DeckElementDescription { /** * Returns the value of the 'Description Expression' attribute. The default value is * "aql:self". diff --git a/packages/view/backend/sirius-components-view-deck/src/main/java/org/eclipse/sirius/components/view/deck/DeckElementDescription.java b/packages/view/backend/sirius-components-view-deck/src/main/java/org/eclipse/sirius/components/view/deck/DeckElementDescription.java new file mode 100644 index 00000000000..f81421f260f --- /dev/null +++ b/packages/view/backend/sirius-components-view-deck/src/main/java/org/eclipse/sirius/components/view/deck/DeckElementDescription.java @@ -0,0 +1,132 @@ +/******************************************************************************* + * 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.deck; + +import org.eclipse.emf.ecore.EObject; + +/** + * A representation of the model object 'Element Description'. + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link org.eclipse.sirius.components.view.deck.DeckElementDescription#getName Name}
  • + *
  • {@link org.eclipse.sirius.components.view.deck.DeckElementDescription#getSemanticCandidatesExpression + * Semantic Candidates Expression}
  • + *
  • {@link org.eclipse.sirius.components.view.deck.DeckElementDescription#getTitleExpression Title + * Expression}
  • + *
  • {@link org.eclipse.sirius.components.view.deck.DeckElementDescription#getLabelExpression Label + * Expression}
  • + *
+ * + * @see org.eclipse.sirius.components.view.deck.DeckPackage#getDeckElementDescription() + * @model abstract="true" + * @generated + */ +public interface DeckElementDescription extends EObject { + /** + * Returns the value of the 'Name' attribute. The default value is + * "newDeckElementDescription". + * + * @return the value of the 'Name' attribute. + * @see #setName(String) + * @see org.eclipse.sirius.components.view.deck.DeckPackage#getDeckElementDescription_Name() + * @model default="newDeckElementDescription" dataType="org.eclipse.sirius.components.view.Identifier" + * @generated + */ + String getName(); + + /** + * Sets the value of the '{@link org.eclipse.sirius.components.view.deck.DeckElementDescription#getName + * Name}' attribute. + * + * @param value + * the new value of the 'Name' attribute. + * @see #getName() + * @generated + */ + void setName(String value); + + /** + * Returns the value of the 'Semantic Candidates Expression' attribute. The default value is + * "aql:self". + * + * @return the value of the 'Semantic Candidates Expression' attribute. + * @see #setSemanticCandidatesExpression(String) + * @see org.eclipse.sirius.components.view.deck.DeckPackage#getDeckElementDescription_SemanticCandidatesExpression() + * @model default="aql:self" dataType="org.eclipse.sirius.components.view.InterpretedExpression" required="true" + * @generated + */ + String getSemanticCandidatesExpression(); + + /** + * Sets the value of the + * '{@link org.eclipse.sirius.components.view.deck.DeckElementDescription#getSemanticCandidatesExpression + * Semantic Candidates Expression}' attribute. + * + * @param value + * the new value of the 'Semantic Candidates Expression' attribute. + * @see #getSemanticCandidatesExpression() + * @generated + */ + void setSemanticCandidatesExpression(String value); + + /** + * Returns the value of the 'Title Expression' attribute. The default value is + * "aql:self". + * + * @return the value of the 'Title Expression' attribute. + * @see #setTitleExpression(String) + * @see org.eclipse.sirius.components.view.deck.DeckPackage#getDeckElementDescription_TitleExpression() + * @model default="aql:self" dataType="org.eclipse.sirius.components.view.InterpretedExpression" + * @generated + */ + String getTitleExpression(); + + /** + * Sets the value of the '{@link org.eclipse.sirius.components.view.deck.DeckElementDescription#getTitleExpression + * Title Expression}' attribute. + * + * @param value + * the new value of the 'Title Expression' attribute. + * @see #getTitleExpression() + * @generated + */ + void setTitleExpression(String value); + + /** + * Returns the value of the 'Label Expression' attribute. The default value is + * "aql:self". + * + * @return the value of the 'Label Expression' attribute. + * @see #setLabelExpression(String) + * @see org.eclipse.sirius.components.view.deck.DeckPackage#getDeckElementDescription_LabelExpression() + * @model default="aql:self" dataType="org.eclipse.sirius.components.view.InterpretedExpression" + * @generated + */ + String getLabelExpression(); + + /** + * Sets the value of the '{@link org.eclipse.sirius.components.view.deck.DeckElementDescription#getLabelExpression + * Label Expression}' attribute. + * + * @param value + * the new value of the 'Label Expression' attribute. + * @see #getLabelExpression() + * @generated + */ + void setLabelExpression(String value); + +} // DeckElementDescription diff --git a/packages/view/backend/sirius-components-view-deck/src/main/java/org/eclipse/sirius/components/view/deck/DeckPackage.java b/packages/view/backend/sirius-components-view-deck/src/main/java/org/eclipse/sirius/components/view/deck/DeckPackage.java index b77afcedbcb..cb71c2f2c85 100644 --- a/packages/view/backend/sirius-components-view-deck/src/main/java/org/eclipse/sirius/components/view/deck/DeckPackage.java +++ b/packages/view/backend/sirius-components-view-deck/src/main/java/org/eclipse/sirius/components/view/deck/DeckPackage.java @@ -150,6 +150,69 @@ public interface DeckPackage extends EPackage { */ int DECK_DESCRIPTION_OPERATION_COUNT = ViewPackage.REPRESENTATION_DESCRIPTION_OPERATION_COUNT + 0; + /** + * The meta object id for the '{@link org.eclipse.sirius.components.view.deck.impl.DeckElementDescriptionImpl + * Element Description}' class. + * + * @see org.eclipse.sirius.components.view.deck.impl.DeckElementDescriptionImpl + * @see org.eclipse.sirius.components.view.deck.impl.DeckPackageImpl#getDeckElementDescription() + * @generated + */ + int DECK_ELEMENT_DESCRIPTION = 10; + + /** + * The feature id for the 'Name' attribute. + * + * @generated + * @ordered + */ + int DECK_ELEMENT_DESCRIPTION__NAME = 0; + + /** + * The feature id for the 'Semantic Candidates Expression' attribute. + * + * @generated + * @ordered + */ + int DECK_ELEMENT_DESCRIPTION__SEMANTIC_CANDIDATES_EXPRESSION = 1; + + /** + * The feature id for the 'Title Expression' attribute. + * + * @generated + * @ordered + */ + int DECK_ELEMENT_DESCRIPTION__TITLE_EXPRESSION = 2; + + /** + * The feature id for the 'Label Expression' attribute. + * + * @generated + * @ordered + */ + int DECK_ELEMENT_DESCRIPTION__LABEL_EXPRESSION = 3; + + /** + * The number of structural features of the 'Element Description' class. + * + * @generated + * @ordered + */ + int DECK_ELEMENT_DESCRIPTION_FEATURE_COUNT = 4; + + /** + * The number of operations of the 'Element Description' class. + * + * @generated + * @ordered + */ + int DECK_ELEMENT_DESCRIPTION_OPERATION_COUNT = 0; + /** * The meta object id for the '{@link org.eclipse.sirius.components.view.deck.impl.LaneDescriptionImpl Lane * Description}' class. @@ -160,6 +223,14 @@ public interface DeckPackage extends EPackage { */ int LANE_DESCRIPTION = 1; + /** + * The feature id for the 'Name' attribute. + * + * @generated + * @ordered + */ + int LANE_DESCRIPTION__NAME = DECK_ELEMENT_DESCRIPTION__NAME; + /** * The feature id for the 'Semantic Candidates Expression' attribute. @@ -167,7 +238,7 @@ public interface DeckPackage extends EPackage { * @generated * @ordered */ - int LANE_DESCRIPTION__SEMANTIC_CANDIDATES_EXPRESSION = 0; + int LANE_DESCRIPTION__SEMANTIC_CANDIDATES_EXPRESSION = DECK_ELEMENT_DESCRIPTION__SEMANTIC_CANDIDATES_EXPRESSION; /** * The feature id for the 'Title Expression' attribute. @@ -238,7 +309,7 @@ public interface DeckPackage extends EPackage { * @generated * @ordered */ - int LANE_DESCRIPTION_OPERATION_COUNT = 0; + int LANE_DESCRIPTION_OPERATION_COUNT = DECK_ELEMENT_DESCRIPTION_OPERATION_COUNT + 0; /** * The meta object id for the '{@link org.eclipse.sirius.components.view.deck.impl.CardDescriptionImpl Card @@ -250,6 +321,14 @@ public interface DeckPackage extends EPackage { */ int CARD_DESCRIPTION = 2; + /** + * The feature id for the 'Name' attribute. + * + * @generated + * @ordered + */ + int CARD_DESCRIPTION__NAME = DECK_ELEMENT_DESCRIPTION__NAME; + /** * The feature id for the 'Semantic Candidates Expression' attribute. @@ -257,7 +336,7 @@ public interface DeckPackage extends EPackage { * @generated * @ordered */ - int CARD_DESCRIPTION__SEMANTIC_CANDIDATES_EXPRESSION = 0; + int CARD_DESCRIPTION__SEMANTIC_CANDIDATES_EXPRESSION = DECK_ELEMENT_DESCRIPTION__SEMANTIC_CANDIDATES_EXPRESSION; /** * The feature id for the 'Title Expression' attribute. @@ -319,7 +398,7 @@ public interface DeckPackage extends EPackage { * @generated * @ordered */ - int CARD_DESCRIPTION_OPERATION_COUNT = 0; + int CARD_DESCRIPTION_OPERATION_COUNT = DECK_ELEMENT_DESCRIPTION_OPERATION_COUNT + 0; /** * The meta object id for the '{@link org.eclipse.sirius.components.view.deck.impl.DeckToolImpl Tool}' @@ -747,42 +826,6 @@ public interface DeckPackage extends EPackage { */ EClass getLaneDescription(); - /** - * Returns the meta object for the attribute - * '{@link org.eclipse.sirius.components.view.deck.LaneDescription#getSemanticCandidatesExpression Semantic - * Candidates Expression}'. - * - * @return the meta object for the attribute 'Semantic Candidates Expression'. - * @see org.eclipse.sirius.components.view.deck.LaneDescription#getSemanticCandidatesExpression() - * @see #getLaneDescription() - * @generated - */ - EAttribute getLaneDescription_SemanticCandidatesExpression(); - - /** - * Returns the meta object for the attribute - * '{@link org.eclipse.sirius.components.view.deck.LaneDescription#getTitleExpression Title Expression}'. - * - * - * @return the meta object for the attribute 'Title Expression'. - * @see org.eclipse.sirius.components.view.deck.LaneDescription#getTitleExpression() - * @see #getLaneDescription() - * @generated - */ - EAttribute getLaneDescription_TitleExpression(); - - /** - * Returns the meta object for the attribute - * '{@link org.eclipse.sirius.components.view.deck.LaneDescription#getLabelExpression Label Expression}'. - * - * - * @return the meta object for the attribute 'Label Expression'. - * @see org.eclipse.sirius.components.view.deck.LaneDescription#getLabelExpression() - * @see #getLaneDescription() - * @generated - */ - EAttribute getLaneDescription_LabelExpression(); - /** * Returns the meta object for the containment reference list * '{@link org.eclipse.sirius.components.view.deck.LaneDescription#getOwnedCardDescriptions Owned Card @@ -841,42 +884,6 @@ public interface DeckPackage extends EPackage { */ EClass getCardDescription(); - /** - * Returns the meta object for the attribute - * '{@link org.eclipse.sirius.components.view.deck.CardDescription#getSemanticCandidatesExpression Semantic - * Candidates Expression}'. - * - * @return the meta object for the attribute 'Semantic Candidates Expression'. - * @see org.eclipse.sirius.components.view.deck.CardDescription#getSemanticCandidatesExpression() - * @see #getCardDescription() - * @generated - */ - EAttribute getCardDescription_SemanticCandidatesExpression(); - - /** - * Returns the meta object for the attribute - * '{@link org.eclipse.sirius.components.view.deck.CardDescription#getTitleExpression Title Expression}'. - * - * - * @return the meta object for the attribute 'Title Expression'. - * @see org.eclipse.sirius.components.view.deck.CardDescription#getTitleExpression() - * @see #getCardDescription() - * @generated - */ - EAttribute getCardDescription_TitleExpression(); - - /** - * Returns the meta object for the attribute - * '{@link org.eclipse.sirius.components.view.deck.CardDescription#getLabelExpression Label Expression}'. - * - * - * @return the meta object for the attribute 'Label Expression'. - * @see org.eclipse.sirius.components.view.deck.CardDescription#getLabelExpression() - * @see #getCardDescription() - * @generated - */ - EAttribute getCardDescription_LabelExpression(); - /** * Returns the meta object for the attribute * '{@link org.eclipse.sirius.components.view.deck.CardDescription#getDescriptionExpression Description @@ -1018,6 +1025,64 @@ public interface DeckPackage extends EPackage { */ EClass getLaneDropTool(); + /** + * Returns the meta object for class '{@link org.eclipse.sirius.components.view.deck.DeckElementDescription + * Element Description}'. + * + * @return the meta object for class 'Element Description'. + * @see org.eclipse.sirius.components.view.deck.DeckElementDescription + * @generated + */ + EClass getDeckElementDescription(); + + /** + * Returns the meta object for the attribute + * '{@link org.eclipse.sirius.components.view.deck.DeckElementDescription#getName Name}'. + * + * @return the meta object for the attribute 'Name'. + * @see org.eclipse.sirius.components.view.deck.DeckElementDescription#getName() + * @see #getDeckElementDescription() + * @generated + */ + EAttribute getDeckElementDescription_Name(); + + /** + * Returns the meta object for the attribute + * '{@link org.eclipse.sirius.components.view.deck.DeckElementDescription#getSemanticCandidatesExpression + * Semantic Candidates Expression}'. + * + * @return the meta object for the attribute 'Semantic Candidates Expression'. + * @see org.eclipse.sirius.components.view.deck.DeckElementDescription#getSemanticCandidatesExpression() + * @see #getDeckElementDescription() + * @generated + */ + EAttribute getDeckElementDescription_SemanticCandidatesExpression(); + + /** + * Returns the meta object for the attribute + * '{@link org.eclipse.sirius.components.view.deck.DeckElementDescription#getTitleExpression Title + * Expression}'. + * + * @return the meta object for the attribute 'Title Expression'. + * @see org.eclipse.sirius.components.view.deck.DeckElementDescription#getTitleExpression() + * @see #getDeckElementDescription() + * @generated + */ + EAttribute getDeckElementDescription_TitleExpression(); + + /** + * Returns the meta object for the attribute + * '{@link org.eclipse.sirius.components.view.deck.DeckElementDescription#getLabelExpression Label + * Expression}'. + * + * @return the meta object for the attribute 'Label Expression'. + * @see org.eclipse.sirius.components.view.deck.DeckElementDescription#getLabelExpression() + * @see #getDeckElementDescription() + * @generated + */ + EAttribute getDeckElementDescription_LabelExpression(); + /** * Returns the factory that creates the instances of the model. * @@ -1084,30 +1149,6 @@ interface Literals { */ EClass LANE_DESCRIPTION = eINSTANCE.getLaneDescription(); - /** - * The meta object literal for the 'Semantic Candidates Expression' attribute feature. - * - * @generated - */ - EAttribute LANE_DESCRIPTION__SEMANTIC_CANDIDATES_EXPRESSION = eINSTANCE.getLaneDescription_SemanticCandidatesExpression(); - - /** - * The meta object literal for the 'Title Expression' attribute feature. - * - * - * @generated - */ - EAttribute LANE_DESCRIPTION__TITLE_EXPRESSION = eINSTANCE.getLaneDescription_TitleExpression(); - - /** - * The meta object literal for the 'Label Expression' attribute feature. - * - * - * @generated - */ - EAttribute LANE_DESCRIPTION__LABEL_EXPRESSION = eINSTANCE.getLaneDescription_LabelExpression(); - /** * The meta object literal for the 'Owned Card Descriptions' containment reference list feature. * @@ -1150,30 +1191,6 @@ interface Literals { */ EClass CARD_DESCRIPTION = eINSTANCE.getCardDescription(); - /** - * The meta object literal for the 'Semantic Candidates Expression' attribute feature. - * - * @generated - */ - EAttribute CARD_DESCRIPTION__SEMANTIC_CANDIDATES_EXPRESSION = eINSTANCE.getCardDescription_SemanticCandidatesExpression(); - - /** - * The meta object literal for the 'Title Expression' attribute feature. - * - * - * @generated - */ - EAttribute CARD_DESCRIPTION__TITLE_EXPRESSION = eINSTANCE.getCardDescription_TitleExpression(); - - /** - * The meta object literal for the 'Label Expression' attribute feature. - * - * - * @generated - */ - EAttribute CARD_DESCRIPTION__LABEL_EXPRESSION = eINSTANCE.getCardDescription_LabelExpression(); - /** * The meta object literal for the 'Description Expression' attribute feature. @@ -1292,6 +1309,49 @@ interface Literals { */ EClass LANE_DROP_TOOL = eINSTANCE.getLaneDropTool(); + /** + * The meta object literal for the + * '{@link org.eclipse.sirius.components.view.deck.impl.DeckElementDescriptionImpl Element + * Description}' class. + * + * @see org.eclipse.sirius.components.view.deck.impl.DeckElementDescriptionImpl + * @see org.eclipse.sirius.components.view.deck.impl.DeckPackageImpl#getDeckElementDescription() + * @generated + */ + EClass DECK_ELEMENT_DESCRIPTION = eINSTANCE.getDeckElementDescription(); + + /** + * The meta object literal for the 'Name' attribute feature. + * + * @generated + */ + EAttribute DECK_ELEMENT_DESCRIPTION__NAME = eINSTANCE.getDeckElementDescription_Name(); + + /** + * The meta object literal for the 'Semantic Candidates Expression' attribute feature. + * + * @generated + */ + EAttribute DECK_ELEMENT_DESCRIPTION__SEMANTIC_CANDIDATES_EXPRESSION = eINSTANCE.getDeckElementDescription_SemanticCandidatesExpression(); + + /** + * The meta object literal for the 'Title Expression' attribute feature. + * + * + * @generated + */ + EAttribute DECK_ELEMENT_DESCRIPTION__TITLE_EXPRESSION = eINSTANCE.getDeckElementDescription_TitleExpression(); + + /** + * The meta object literal for the 'Label Expression' attribute feature. + * + * + * @generated + */ + EAttribute DECK_ELEMENT_DESCRIPTION__LABEL_EXPRESSION = eINSTANCE.getDeckElementDescription_LabelExpression(); + } } // DeckPackage diff --git a/packages/view/backend/sirius-components-view-deck/src/main/java/org/eclipse/sirius/components/view/deck/LaneDescription.java b/packages/view/backend/sirius-components-view-deck/src/main/java/org/eclipse/sirius/components/view/deck/LaneDescription.java index ba33e08b9cc..b44448f92b7 100644 --- a/packages/view/backend/sirius-components-view-deck/src/main/java/org/eclipse/sirius/components/view/deck/LaneDescription.java +++ b/packages/view/backend/sirius-components-view-deck/src/main/java/org/eclipse/sirius/components/view/deck/LaneDescription.java @@ -13,7 +13,6 @@ package org.eclipse.sirius.components.view.deck; import org.eclipse.emf.common.util.EList; -import org.eclipse.emf.ecore.EObject; /** * A representation of the model object 'Lane Description'. - * - * @return the value of the 'Semantic Candidates Expression' attribute. - * @see #setSemanticCandidatesExpression(String) - * @see org.eclipse.sirius.components.view.deck.DeckPackage#getLaneDescription_SemanticCandidatesExpression() - * @model default="aql:self" dataType="org.eclipse.sirius.components.view.InterpretedExpression" required="true" - * @generated - */ - String getSemanticCandidatesExpression(); - - /** - * Sets the value of the - * '{@link org.eclipse.sirius.components.view.deck.LaneDescription#getSemanticCandidatesExpression Semantic - * Candidates Expression}' attribute. - * - * @param value - * the new value of the 'Semantic Candidates Expression' attribute. - * @see #getSemanticCandidatesExpression() - * @generated - */ - void setSemanticCandidatesExpression(String value); - - /** - * Returns the value of the 'Title Expression' attribute. The default value is - * "aql:self". - * - * @return the value of the 'Title Expression' attribute. - * @see #setTitleExpression(String) - * @see org.eclipse.sirius.components.view.deck.DeckPackage#getLaneDescription_TitleExpression() - * @model default="aql:self" dataType="org.eclipse.sirius.components.view.InterpretedExpression" - * @generated - */ - String getTitleExpression(); - - /** - * Sets the value of the '{@link org.eclipse.sirius.components.view.deck.LaneDescription#getTitleExpression - * Title Expression}' attribute. - * - * @param value - * the new value of the 'Title Expression' attribute. - * @see #getTitleExpression() - * @generated - */ - void setTitleExpression(String value); - - /** - * Returns the value of the 'Label Expression' attribute. The default value is - * "aql:self". - * - * @return the value of the 'Label Expression' attribute. - * @see #setLabelExpression(String) - * @see org.eclipse.sirius.components.view.deck.DeckPackage#getLaneDescription_LabelExpression() - * @model default="aql:self" dataType="org.eclipse.sirius.components.view.InterpretedExpression" - * @generated - */ - String getLabelExpression(); - - /** - * Sets the value of the '{@link org.eclipse.sirius.components.view.deck.LaneDescription#getLabelExpression - * Label Expression}' attribute. - * - * @param value - * the new value of the 'Label Expression' attribute. - * @see #getLabelExpression() - * @generated - */ - void setLabelExpression(String value); - +public interface LaneDescription extends DeckElementDescription { /** * Returns the value of the 'Owned Card Descriptions' containment reference list. The list contents * are of type {@link org.eclipse.sirius.components.view.deck.CardDescription}. - * - * @see #getSemanticCandidatesExpression() - * @generated - * @ordered - */ - protected static final String SEMANTIC_CANDIDATES_EXPRESSION_EDEFAULT = "aql:self"; - - /** - * The cached value of the '{@link #getSemanticCandidatesExpression() Semantic Candidates Expression}' - * attribute. - * - * @see #getSemanticCandidatesExpression() - * @generated - * @ordered - */ - protected String semanticCandidatesExpression = SEMANTIC_CANDIDATES_EXPRESSION_EDEFAULT; - - /** - * The default value of the '{@link #getTitleExpression() Title Expression}' attribute. - * - * @see #getTitleExpression() - * @generated - * @ordered - */ - protected static final String TITLE_EXPRESSION_EDEFAULT = "aql:self"; - - /** - * The cached value of the '{@link #getTitleExpression() Title Expression}' attribute. - * - * @see #getTitleExpression() - * @generated - * @ordered - */ - protected String titleExpression = TITLE_EXPRESSION_EDEFAULT; - - /** - * The default value of the '{@link #getLabelExpression() Label Expression}' attribute. - * - * @see #getLabelExpression() - * @generated - * @ordered - */ - protected static final String LABEL_EXPRESSION_EDEFAULT = "aql:self"; - - /** - * The cached value of the '{@link #getLabelExpression() Label Expression}' attribute. - * - * @see #getLabelExpression() - * @generated - * @ordered - */ - protected String labelExpression = LABEL_EXPRESSION_EDEFAULT; - +public class CardDescriptionImpl extends DeckElementDescriptionImpl implements CardDescription { /** * The default value of the '{@link #getDescriptionExpression() Description Expression}' attribute. @@ -161,76 +100,6 @@ protected EClass eStaticClass() { return DeckPackage.Literals.CARD_DESCRIPTION; } - /** - * - * - * @generated - */ - @Override - public String getSemanticCandidatesExpression() { - return this.semanticCandidatesExpression; - } - - /** - * - * - * @generated - */ - @Override - public void setSemanticCandidatesExpression(String newSemanticCandidatesExpression) { - String oldSemanticCandidatesExpression = this.semanticCandidatesExpression; - this.semanticCandidatesExpression = newSemanticCandidatesExpression; - if (this.eNotificationRequired()) - this.eNotify( - new ENotificationImpl(this, Notification.SET, DeckPackage.CARD_DESCRIPTION__SEMANTIC_CANDIDATES_EXPRESSION, oldSemanticCandidatesExpression, this.semanticCandidatesExpression)); - } - - /** - * - * - * @generated - */ - @Override - public String getTitleExpression() { - return this.titleExpression; - } - - /** - * - * - * @generated - */ - @Override - public void setTitleExpression(String newTitleExpression) { - String oldTitleExpression = this.titleExpression; - this.titleExpression = newTitleExpression; - if (this.eNotificationRequired()) - this.eNotify(new ENotificationImpl(this, Notification.SET, DeckPackage.CARD_DESCRIPTION__TITLE_EXPRESSION, oldTitleExpression, this.titleExpression)); - } - - /** - * - * - * @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, DeckPackage.CARD_DESCRIPTION__LABEL_EXPRESSION, oldLabelExpression, this.labelExpression)); - } - /** * * @@ -374,12 +243,6 @@ public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { - case DeckPackage.CARD_DESCRIPTION__SEMANTIC_CANDIDATES_EXPRESSION: - return this.getSemanticCandidatesExpression(); - case DeckPackage.CARD_DESCRIPTION__TITLE_EXPRESSION: - return this.getTitleExpression(); - case DeckPackage.CARD_DESCRIPTION__LABEL_EXPRESSION: - return this.getLabelExpression(); case DeckPackage.CARD_DESCRIPTION__DESCRIPTION_EXPRESSION: return this.getDescriptionExpression(); case DeckPackage.CARD_DESCRIPTION__EDIT_TOOL: @@ -399,15 +262,6 @@ public Object eGet(int featureID, boolean resolve, boolean coreType) { @Override public void eSet(int featureID, Object newValue) { switch (featureID) { - case DeckPackage.CARD_DESCRIPTION__SEMANTIC_CANDIDATES_EXPRESSION: - this.setSemanticCandidatesExpression((String) newValue); - return; - case DeckPackage.CARD_DESCRIPTION__TITLE_EXPRESSION: - this.setTitleExpression((String) newValue); - return; - case DeckPackage.CARD_DESCRIPTION__LABEL_EXPRESSION: - this.setLabelExpression((String) newValue); - return; case DeckPackage.CARD_DESCRIPTION__DESCRIPTION_EXPRESSION: this.setDescriptionExpression((String) newValue); return; @@ -429,15 +283,6 @@ public void eSet(int featureID, Object newValue) { @Override public void eUnset(int featureID) { switch (featureID) { - case DeckPackage.CARD_DESCRIPTION__SEMANTIC_CANDIDATES_EXPRESSION: - this.setSemanticCandidatesExpression(SEMANTIC_CANDIDATES_EXPRESSION_EDEFAULT); - return; - case DeckPackage.CARD_DESCRIPTION__TITLE_EXPRESSION: - this.setTitleExpression(TITLE_EXPRESSION_EDEFAULT); - return; - case DeckPackage.CARD_DESCRIPTION__LABEL_EXPRESSION: - this.setLabelExpression(LABEL_EXPRESSION_EDEFAULT); - return; case DeckPackage.CARD_DESCRIPTION__DESCRIPTION_EXPRESSION: this.setDescriptionExpression(DESCRIPTION_EXPRESSION_EDEFAULT); return; @@ -459,12 +304,6 @@ public void eUnset(int featureID) { @Override public boolean eIsSet(int featureID) { switch (featureID) { - case DeckPackage.CARD_DESCRIPTION__SEMANTIC_CANDIDATES_EXPRESSION: - return SEMANTIC_CANDIDATES_EXPRESSION_EDEFAULT == null ? this.semanticCandidatesExpression != null : !SEMANTIC_CANDIDATES_EXPRESSION_EDEFAULT.equals(this.semanticCandidatesExpression); - case DeckPackage.CARD_DESCRIPTION__TITLE_EXPRESSION: - return TITLE_EXPRESSION_EDEFAULT == null ? this.titleExpression != null : !TITLE_EXPRESSION_EDEFAULT.equals(this.titleExpression); - case DeckPackage.CARD_DESCRIPTION__LABEL_EXPRESSION: - return LABEL_EXPRESSION_EDEFAULT == null ? this.labelExpression != null : !LABEL_EXPRESSION_EDEFAULT.equals(this.labelExpression); case DeckPackage.CARD_DESCRIPTION__DESCRIPTION_EXPRESSION: return DESCRIPTION_EXPRESSION_EDEFAULT == null ? this.descriptionExpression != null : !DESCRIPTION_EXPRESSION_EDEFAULT.equals(this.descriptionExpression); case DeckPackage.CARD_DESCRIPTION__EDIT_TOOL: @@ -486,13 +325,7 @@ public String toString() { return super.toString(); StringBuilder result = new StringBuilder(super.toString()); - result.append(" (semanticCandidatesExpression: "); - result.append(this.semanticCandidatesExpression); - result.append(", titleExpression: "); - result.append(this.titleExpression); - result.append(", labelExpression: "); - result.append(this.labelExpression); - result.append(", descriptionExpression: "); + result.append(" (descriptionExpression: "); result.append(this.descriptionExpression); result.append(')'); return result.toString(); diff --git a/packages/view/backend/sirius-components-view-deck/src/main/java/org/eclipse/sirius/components/view/deck/impl/DeckElementDescriptionImpl.java b/packages/view/backend/sirius-components-view-deck/src/main/java/org/eclipse/sirius/components/view/deck/impl/DeckElementDescriptionImpl.java new file mode 100644 index 00000000000..6067e10172b --- /dev/null +++ b/packages/view/backend/sirius-components-view-deck/src/main/java/org/eclipse/sirius/components/view/deck/impl/DeckElementDescriptionImpl.java @@ -0,0 +1,344 @@ +/******************************************************************************* + * 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.deck.impl; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.impl.ENotificationImpl; +import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; +import org.eclipse.sirius.components.view.deck.DeckElementDescription; +import org.eclipse.sirius.components.view.deck.DeckPackage; + +/** + * An implementation of the model object 'Element Description'. + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link org.eclipse.sirius.components.view.deck.impl.DeckElementDescriptionImpl#getName Name}
  • + *
  • {@link org.eclipse.sirius.components.view.deck.impl.DeckElementDescriptionImpl#getSemanticCandidatesExpression + * Semantic Candidates Expression}
  • + *
  • {@link org.eclipse.sirius.components.view.deck.impl.DeckElementDescriptionImpl#getTitleExpression Title + * Expression}
  • + *
  • {@link org.eclipse.sirius.components.view.deck.impl.DeckElementDescriptionImpl#getLabelExpression Label + * Expression}
  • + *
+ * + * @generated + */ +public abstract class DeckElementDescriptionImpl extends MinimalEObjectImpl.Container implements DeckElementDescription { + /** + * The default value of the '{@link #getName() Name}' attribute. + * + * @see #getName() + * @generated + * @ordered + */ + protected static final String NAME_EDEFAULT = "newDeckElementDescription"; + + /** + * The cached value of the '{@link #getName() Name}' attribute. + * + * @see #getName() + * @generated + * @ordered + */ + protected String name = NAME_EDEFAULT; + + /** + * The default value of the '{@link #getSemanticCandidatesExpression() Semantic Candidates Expression}' + * attribute. + * + * @see #getSemanticCandidatesExpression() + * @generated + * @ordered + */ + protected static final String SEMANTIC_CANDIDATES_EXPRESSION_EDEFAULT = "aql:self"; + + /** + * The cached value of the '{@link #getSemanticCandidatesExpression() Semantic Candidates Expression}' + * attribute. + * + * @see #getSemanticCandidatesExpression() + * @generated + * @ordered + */ + protected String semanticCandidatesExpression = SEMANTIC_CANDIDATES_EXPRESSION_EDEFAULT; + + /** + * The default value of the '{@link #getTitleExpression() Title Expression}' attribute. + * + * @see #getTitleExpression() + * @generated + * @ordered + */ + protected static final String TITLE_EXPRESSION_EDEFAULT = "aql:self"; + + /** + * The cached value of the '{@link #getTitleExpression() Title Expression}' attribute. + * + * @see #getTitleExpression() + * @generated + * @ordered + */ + protected String titleExpression = TITLE_EXPRESSION_EDEFAULT; + + /** + * The default value of the '{@link #getLabelExpression() Label Expression}' attribute. + * + * @see #getLabelExpression() + * @generated + * @ordered + */ + protected static final String LABEL_EXPRESSION_EDEFAULT = "aql:self"; + + /** + * The cached value of the '{@link #getLabelExpression() Label Expression}' attribute. + * + * @see #getLabelExpression() + * @generated + * @ordered + */ + protected String labelExpression = LABEL_EXPRESSION_EDEFAULT; + + /** + * + * + * @generated + */ + protected DeckElementDescriptionImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return DeckPackage.Literals.DECK_ELEMENT_DESCRIPTION; + } + + /** + * + * + * @generated + */ + @Override + public String getName() { + return this.name; + } + + /** + * + * + * @generated + */ + @Override + public void setName(String newName) { + String oldName = this.name; + this.name = newName; + if (this.eNotificationRequired()) + this.eNotify(new ENotificationImpl(this, Notification.SET, DeckPackage.DECK_ELEMENT_DESCRIPTION__NAME, oldName, this.name)); + } + + /** + * + * + * @generated + */ + @Override + public String getSemanticCandidatesExpression() { + return this.semanticCandidatesExpression; + } + + /** + * + * + * @generated + */ + @Override + public void setSemanticCandidatesExpression(String newSemanticCandidatesExpression) { + String oldSemanticCandidatesExpression = this.semanticCandidatesExpression; + this.semanticCandidatesExpression = newSemanticCandidatesExpression; + if (this.eNotificationRequired()) + this.eNotify(new ENotificationImpl(this, Notification.SET, DeckPackage.DECK_ELEMENT_DESCRIPTION__SEMANTIC_CANDIDATES_EXPRESSION, oldSemanticCandidatesExpression, + this.semanticCandidatesExpression)); + } + + /** + * + * + * @generated + */ + @Override + public String getTitleExpression() { + return this.titleExpression; + } + + /** + * + * + * @generated + */ + @Override + public void setTitleExpression(String newTitleExpression) { + String oldTitleExpression = this.titleExpression; + this.titleExpression = newTitleExpression; + if (this.eNotificationRequired()) + this.eNotify(new ENotificationImpl(this, Notification.SET, DeckPackage.DECK_ELEMENT_DESCRIPTION__TITLE_EXPRESSION, oldTitleExpression, this.titleExpression)); + } + + /** + * + * + * @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, DeckPackage.DECK_ELEMENT_DESCRIPTION__LABEL_EXPRESSION, oldLabelExpression, this.labelExpression)); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case DeckPackage.DECK_ELEMENT_DESCRIPTION__NAME: + return this.getName(); + case DeckPackage.DECK_ELEMENT_DESCRIPTION__SEMANTIC_CANDIDATES_EXPRESSION: + return this.getSemanticCandidatesExpression(); + case DeckPackage.DECK_ELEMENT_DESCRIPTION__TITLE_EXPRESSION: + return this.getTitleExpression(); + case DeckPackage.DECK_ELEMENT_DESCRIPTION__LABEL_EXPRESSION: + return this.getLabelExpression(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case DeckPackage.DECK_ELEMENT_DESCRIPTION__NAME: + this.setName((String) newValue); + return; + case DeckPackage.DECK_ELEMENT_DESCRIPTION__SEMANTIC_CANDIDATES_EXPRESSION: + this.setSemanticCandidatesExpression((String) newValue); + return; + case DeckPackage.DECK_ELEMENT_DESCRIPTION__TITLE_EXPRESSION: + this.setTitleExpression((String) newValue); + return; + case DeckPackage.DECK_ELEMENT_DESCRIPTION__LABEL_EXPRESSION: + this.setLabelExpression((String) newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case DeckPackage.DECK_ELEMENT_DESCRIPTION__NAME: + this.setName(NAME_EDEFAULT); + return; + case DeckPackage.DECK_ELEMENT_DESCRIPTION__SEMANTIC_CANDIDATES_EXPRESSION: + this.setSemanticCandidatesExpression(SEMANTIC_CANDIDATES_EXPRESSION_EDEFAULT); + return; + case DeckPackage.DECK_ELEMENT_DESCRIPTION__TITLE_EXPRESSION: + this.setTitleExpression(TITLE_EXPRESSION_EDEFAULT); + return; + case DeckPackage.DECK_ELEMENT_DESCRIPTION__LABEL_EXPRESSION: + this.setLabelExpression(LABEL_EXPRESSION_EDEFAULT); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case DeckPackage.DECK_ELEMENT_DESCRIPTION__NAME: + return NAME_EDEFAULT == null ? this.name != null : !NAME_EDEFAULT.equals(this.name); + case DeckPackage.DECK_ELEMENT_DESCRIPTION__SEMANTIC_CANDIDATES_EXPRESSION: + return SEMANTIC_CANDIDATES_EXPRESSION_EDEFAULT == null ? this.semanticCandidatesExpression != null : !SEMANTIC_CANDIDATES_EXPRESSION_EDEFAULT.equals(this.semanticCandidatesExpression); + case DeckPackage.DECK_ELEMENT_DESCRIPTION__TITLE_EXPRESSION: + return TITLE_EXPRESSION_EDEFAULT == null ? this.titleExpression != null : !TITLE_EXPRESSION_EDEFAULT.equals(this.titleExpression); + case DeckPackage.DECK_ELEMENT_DESCRIPTION__LABEL_EXPRESSION: + return LABEL_EXPRESSION_EDEFAULT == null ? this.labelExpression != null : !LABEL_EXPRESSION_EDEFAULT.equals(this.labelExpression); + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public String toString() { + if (this.eIsProxy()) + return super.toString(); + + StringBuilder result = new StringBuilder(super.toString()); + result.append(" (name: "); + result.append(this.name); + result.append(", semanticCandidatesExpression: "); + result.append(this.semanticCandidatesExpression); + result.append(", titleExpression: "); + result.append(this.titleExpression); + result.append(", labelExpression: "); + result.append(this.labelExpression); + result.append(')'); + return result.toString(); + } + +} // DeckElementDescriptionImpl diff --git a/packages/view/backend/sirius-components-view-deck/src/main/java/org/eclipse/sirius/components/view/deck/impl/DeckPackageImpl.java b/packages/view/backend/sirius-components-view-deck/src/main/java/org/eclipse/sirius/components/view/deck/impl/DeckPackageImpl.java index 58903f6314b..ec766e17ba2 100644 --- a/packages/view/backend/sirius-components-view-deck/src/main/java/org/eclipse/sirius/components/view/deck/impl/DeckPackageImpl.java +++ b/packages/view/backend/sirius-components-view-deck/src/main/java/org/eclipse/sirius/components/view/deck/impl/DeckPackageImpl.java @@ -22,6 +22,7 @@ import org.eclipse.sirius.components.view.deck.CardDropTool; import org.eclipse.sirius.components.view.deck.CreateCardTool; import org.eclipse.sirius.components.view.deck.DeckDescription; +import org.eclipse.sirius.components.view.deck.DeckElementDescription; import org.eclipse.sirius.components.view.deck.DeckFactory; import org.eclipse.sirius.components.view.deck.DeckPackage; import org.eclipse.sirius.components.view.deck.DeckTool; @@ -107,6 +108,13 @@ public class DeckPackageImpl extends EPackageImpl implements DeckPackage { */ private EClass laneDropToolEClass = null; + /** + * + * + * @generated + */ + private EClass deckElementDescriptionEClass = null; + /** * Creates an instance of the model Package, registered with {@link org.eclipse.emf.ecore.EPackage.Registry * EPackage.Registry} by the package package URI value. @@ -227,8 +235,8 @@ public EClass getLaneDescription() { * @generated */ @Override - public EAttribute getLaneDescription_SemanticCandidatesExpression() { - return (EAttribute) this.laneDescriptionEClass.getEStructuralFeatures().get(0); + public EReference getLaneDescription_OwnedCardDescriptions() { + return (EReference) this.laneDescriptionEClass.getEStructuralFeatures().get(0); } /** @@ -237,8 +245,8 @@ public EAttribute getLaneDescription_SemanticCandidatesExpression() { * @generated */ @Override - public EAttribute getLaneDescription_TitleExpression() { - return (EAttribute) this.laneDescriptionEClass.getEStructuralFeatures().get(1); + public EReference getLaneDescription_EditTool() { + return (EReference) this.laneDescriptionEClass.getEStructuralFeatures().get(1); } /** @@ -247,8 +255,8 @@ public EAttribute getLaneDescription_TitleExpression() { * @generated */ @Override - public EAttribute getLaneDescription_LabelExpression() { - return (EAttribute) this.laneDescriptionEClass.getEStructuralFeatures().get(2); + public EReference getLaneDescription_CreateTool() { + return (EReference) this.laneDescriptionEClass.getEStructuralFeatures().get(2); } /** @@ -257,7 +265,7 @@ public EAttribute getLaneDescription_LabelExpression() { * @generated */ @Override - public EReference getLaneDescription_OwnedCardDescriptions() { + public EReference getLaneDescription_CardDropTool() { return (EReference) this.laneDescriptionEClass.getEStructuralFeatures().get(3); } @@ -267,18 +275,8 @@ public EReference getLaneDescription_OwnedCardDescriptions() { * @generated */ @Override - public EReference getLaneDescription_EditTool() { - return (EReference) this.laneDescriptionEClass.getEStructuralFeatures().get(4); - } - - /** - * - * - * @generated - */ - @Override - public EReference getLaneDescription_CreateTool() { - return (EReference) this.laneDescriptionEClass.getEStructuralFeatures().get(5); + public EClass getCardDescription() { + return this.cardDescriptionEClass; } /** @@ -287,8 +285,8 @@ public EReference getLaneDescription_CreateTool() { * @generated */ @Override - public EReference getLaneDescription_CardDropTool() { - return (EReference) this.laneDescriptionEClass.getEStructuralFeatures().get(6); + public EAttribute getCardDescription_DescriptionExpression() { + return (EAttribute) this.cardDescriptionEClass.getEStructuralFeatures().get(0); } /** @@ -297,8 +295,8 @@ public EReference getLaneDescription_CardDropTool() { * @generated */ @Override - public EClass getCardDescription() { - return this.cardDescriptionEClass; + public EReference getCardDescription_EditTool() { + return (EReference) this.cardDescriptionEClass.getEStructuralFeatures().get(1); } /** @@ -307,8 +305,8 @@ public EClass getCardDescription() { * @generated */ @Override - public EAttribute getCardDescription_SemanticCandidatesExpression() { - return (EAttribute) this.cardDescriptionEClass.getEStructuralFeatures().get(0); + public EReference getCardDescription_DeleteTool() { + return (EReference) this.cardDescriptionEClass.getEStructuralFeatures().get(2); } /** @@ -317,8 +315,8 @@ public EAttribute getCardDescription_SemanticCandidatesExpression() { * @generated */ @Override - public EAttribute getCardDescription_TitleExpression() { - return (EAttribute) this.cardDescriptionEClass.getEStructuralFeatures().get(1); + public EClass getDeckTool() { + return this.deckToolEClass; } /** @@ -327,8 +325,8 @@ public EAttribute getCardDescription_TitleExpression() { * @generated */ @Override - public EAttribute getCardDescription_LabelExpression() { - return (EAttribute) this.cardDescriptionEClass.getEStructuralFeatures().get(2); + public EAttribute getDeckTool_Name() { + return (EAttribute) this.deckToolEClass.getEStructuralFeatures().get(0); } /** @@ -337,8 +335,8 @@ public EAttribute getCardDescription_LabelExpression() { * @generated */ @Override - public EAttribute getCardDescription_DescriptionExpression() { - return (EAttribute) this.cardDescriptionEClass.getEStructuralFeatures().get(3); + public EAttribute getDeckTool_PreconditionExpression() { + return (EAttribute) this.deckToolEClass.getEStructuralFeatures().get(1); } /** @@ -347,8 +345,8 @@ public EAttribute getCardDescription_DescriptionExpression() { * @generated */ @Override - public EReference getCardDescription_EditTool() { - return (EReference) this.cardDescriptionEClass.getEStructuralFeatures().get(4); + public EReference getDeckTool_Body() { + return (EReference) this.deckToolEClass.getEStructuralFeatures().get(2); } /** @@ -357,8 +355,8 @@ public EReference getCardDescription_EditTool() { * @generated */ @Override - public EReference getCardDescription_DeleteTool() { - return (EReference) this.cardDescriptionEClass.getEStructuralFeatures().get(5); + public EClass getCreateCardTool() { + return this.createCardToolEClass; } /** @@ -367,8 +365,8 @@ public EReference getCardDescription_DeleteTool() { * @generated */ @Override - public EClass getDeckTool() { - return this.deckToolEClass; + public EClass getEditCardTool() { + return this.editCardToolEClass; } /** @@ -377,8 +375,8 @@ public EClass getDeckTool() { * @generated */ @Override - public EAttribute getDeckTool_Name() { - return (EAttribute) this.deckToolEClass.getEStructuralFeatures().get(0); + public EClass getDeleteCardTool() { + return this.deleteCardToolEClass; } /** @@ -387,8 +385,8 @@ public EAttribute getDeckTool_Name() { * @generated */ @Override - public EAttribute getDeckTool_PreconditionExpression() { - return (EAttribute) this.deckToolEClass.getEStructuralFeatures().get(1); + public EClass getEditLaneTool() { + return this.editLaneToolEClass; } /** @@ -397,8 +395,8 @@ public EAttribute getDeckTool_PreconditionExpression() { * @generated */ @Override - public EReference getDeckTool_Body() { - return (EReference) this.deckToolEClass.getEStructuralFeatures().get(2); + public EClass getCardDropTool() { + return this.cardDropToolEClass; } /** @@ -407,8 +405,8 @@ public EReference getDeckTool_Body() { * @generated */ @Override - public EClass getCreateCardTool() { - return this.createCardToolEClass; + public EClass getLaneDropTool() { + return this.laneDropToolEClass; } /** @@ -417,8 +415,8 @@ public EClass getCreateCardTool() { * @generated */ @Override - public EClass getEditCardTool() { - return this.editCardToolEClass; + public EClass getDeckElementDescription() { + return this.deckElementDescriptionEClass; } /** @@ -427,8 +425,8 @@ public EClass getEditCardTool() { * @generated */ @Override - public EClass getDeleteCardTool() { - return this.deleteCardToolEClass; + public EAttribute getDeckElementDescription_Name() { + return (EAttribute) this.deckElementDescriptionEClass.getEStructuralFeatures().get(0); } /** @@ -437,8 +435,8 @@ public EClass getDeleteCardTool() { * @generated */ @Override - public EClass getEditLaneTool() { - return this.editLaneToolEClass; + public EAttribute getDeckElementDescription_SemanticCandidatesExpression() { + return (EAttribute) this.deckElementDescriptionEClass.getEStructuralFeatures().get(1); } /** @@ -447,8 +445,8 @@ public EClass getEditLaneTool() { * @generated */ @Override - public EClass getCardDropTool() { - return this.cardDropToolEClass; + public EAttribute getDeckElementDescription_TitleExpression() { + return (EAttribute) this.deckElementDescriptionEClass.getEStructuralFeatures().get(2); } /** @@ -457,8 +455,8 @@ public EClass getCardDropTool() { * @generated */ @Override - public EClass getLaneDropTool() { - return this.laneDropToolEClass; + public EAttribute getDeckElementDescription_LabelExpression() { + return (EAttribute) this.deckElementDescriptionEClass.getEStructuralFeatures().get(3); } /** @@ -496,18 +494,12 @@ public void createPackageContents() { this.createEReference(this.deckDescriptionEClass, DECK_DESCRIPTION__LANE_DROP_TOOL); this.laneDescriptionEClass = this.createEClass(LANE_DESCRIPTION); - this.createEAttribute(this.laneDescriptionEClass, LANE_DESCRIPTION__SEMANTIC_CANDIDATES_EXPRESSION); - this.createEAttribute(this.laneDescriptionEClass, LANE_DESCRIPTION__TITLE_EXPRESSION); - this.createEAttribute(this.laneDescriptionEClass, LANE_DESCRIPTION__LABEL_EXPRESSION); this.createEReference(this.laneDescriptionEClass, LANE_DESCRIPTION__OWNED_CARD_DESCRIPTIONS); this.createEReference(this.laneDescriptionEClass, LANE_DESCRIPTION__EDIT_TOOL); this.createEReference(this.laneDescriptionEClass, LANE_DESCRIPTION__CREATE_TOOL); this.createEReference(this.laneDescriptionEClass, LANE_DESCRIPTION__CARD_DROP_TOOL); this.cardDescriptionEClass = this.createEClass(CARD_DESCRIPTION); - this.createEAttribute(this.cardDescriptionEClass, CARD_DESCRIPTION__SEMANTIC_CANDIDATES_EXPRESSION); - this.createEAttribute(this.cardDescriptionEClass, CARD_DESCRIPTION__TITLE_EXPRESSION); - this.createEAttribute(this.cardDescriptionEClass, CARD_DESCRIPTION__LABEL_EXPRESSION); this.createEAttribute(this.cardDescriptionEClass, CARD_DESCRIPTION__DESCRIPTION_EXPRESSION); this.createEReference(this.cardDescriptionEClass, CARD_DESCRIPTION__EDIT_TOOL); this.createEReference(this.cardDescriptionEClass, CARD_DESCRIPTION__DELETE_TOOL); @@ -528,6 +520,12 @@ public void createPackageContents() { this.cardDropToolEClass = this.createEClass(CARD_DROP_TOOL); this.laneDropToolEClass = this.createEClass(LANE_DROP_TOOL); + + this.deckElementDescriptionEClass = this.createEClass(DECK_ELEMENT_DESCRIPTION); + this.createEAttribute(this.deckElementDescriptionEClass, DECK_ELEMENT_DESCRIPTION__NAME); + this.createEAttribute(this.deckElementDescriptionEClass, DECK_ELEMENT_DESCRIPTION__SEMANTIC_CANDIDATES_EXPRESSION); + this.createEAttribute(this.deckElementDescriptionEClass, DECK_ELEMENT_DESCRIPTION__TITLE_EXPRESSION); + this.createEAttribute(this.deckElementDescriptionEClass, DECK_ELEMENT_DESCRIPTION__LABEL_EXPRESSION); } /** @@ -562,6 +560,8 @@ public void initializePackageContents() { // Add supertypes to classes this.deckDescriptionEClass.getESuperTypes().add(theViewPackage.getRepresentationDescription()); + this.laneDescriptionEClass.getESuperTypes().add(this.getDeckElementDescription()); + this.cardDescriptionEClass.getESuperTypes().add(this.getDeckElementDescription()); this.createCardToolEClass.getESuperTypes().add(this.getDeckTool()); this.editCardToolEClass.getESuperTypes().add(this.getDeckTool()); this.deleteCardToolEClass.getESuperTypes().add(this.getDeckTool()); @@ -579,12 +579,6 @@ public void initializePackageContents() { IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); this.initEClass(this.laneDescriptionEClass, LaneDescription.class, "LaneDescription", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - this.initEAttribute(this.getLaneDescription_SemanticCandidatesExpression(), theViewPackage.getInterpretedExpression(), "semanticCandidatesExpression", "aql:self", 1, 1, LaneDescription.class, - !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - this.initEAttribute(this.getLaneDescription_TitleExpression(), theViewPackage.getInterpretedExpression(), "titleExpression", "aql:self", 0, 1, LaneDescription.class, !IS_TRANSIENT, - !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - this.initEAttribute(this.getLaneDescription_LabelExpression(), theViewPackage.getInterpretedExpression(), "labelExpression", "aql:self", 0, 1, LaneDescription.class, !IS_TRANSIENT, - !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); this.initEReference(this.getLaneDescription_OwnedCardDescriptions(), this.getCardDescription(), null, "ownedCardDescriptions", null, 0, -1, LaneDescription.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); this.initEReference(this.getLaneDescription_EditTool(), this.getEditLaneTool(), null, "editTool", null, 0, 1, LaneDescription.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, @@ -595,12 +589,6 @@ public void initializePackageContents() { IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); this.initEClass(this.cardDescriptionEClass, CardDescription.class, "CardDescription", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - this.initEAttribute(this.getCardDescription_SemanticCandidatesExpression(), theViewPackage.getInterpretedExpression(), "semanticCandidatesExpression", "aql:self", 1, 1, CardDescription.class, - !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - this.initEAttribute(this.getCardDescription_TitleExpression(), theViewPackage.getInterpretedExpression(), "titleExpression", "aql:self", 0, 1, CardDescription.class, !IS_TRANSIENT, - !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - this.initEAttribute(this.getCardDescription_LabelExpression(), theViewPackage.getInterpretedExpression(), "labelExpression", "aql:self", 0, 1, CardDescription.class, !IS_TRANSIENT, - !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); this.initEAttribute(this.getCardDescription_DescriptionExpression(), theViewPackage.getInterpretedExpression(), "descriptionExpression", "aql:self", 0, 1, CardDescription.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); this.initEReference(this.getCardDescription_EditTool(), this.getEditCardTool(), null, "editTool", null, 0, 1, CardDescription.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, @@ -628,6 +616,16 @@ public void initializePackageContents() { this.initEClass(this.laneDropToolEClass, LaneDropTool.class, "LaneDropTool", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + this.initEClass(this.deckElementDescriptionEClass, DeckElementDescription.class, "DeckElementDescription", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + this.initEAttribute(this.getDeckElementDescription_Name(), theViewPackage.getIdentifier(), "name", "newDeckElementDescription", 0, 1, DeckElementDescription.class, !IS_TRANSIENT, !IS_VOLATILE, + IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + this.initEAttribute(this.getDeckElementDescription_SemanticCandidatesExpression(), theViewPackage.getInterpretedExpression(), "semanticCandidatesExpression", "aql:self", 1, 1, + DeckElementDescription.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + this.initEAttribute(this.getDeckElementDescription_TitleExpression(), theViewPackage.getInterpretedExpression(), "titleExpression", "aql:self", 0, 1, DeckElementDescription.class, + !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + this.initEAttribute(this.getDeckElementDescription_LabelExpression(), theViewPackage.getInterpretedExpression(), "labelExpression", "aql:self", 0, 1, DeckElementDescription.class, + !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + // Create resource this.createResource(eNS_URI); } diff --git a/packages/view/backend/sirius-components-view-deck/src/main/java/org/eclipse/sirius/components/view/deck/impl/LaneDescriptionImpl.java b/packages/view/backend/sirius-components-view-deck/src/main/java/org/eclipse/sirius/components/view/deck/impl/LaneDescriptionImpl.java index 0eecd34fed1..67ca6091e6d 100644 --- a/packages/view/backend/sirius-components-view-deck/src/main/java/org/eclipse/sirius/components/view/deck/impl/LaneDescriptionImpl.java +++ b/packages/view/backend/sirius-components-view-deck/src/main/java/org/eclipse/sirius/components/view/deck/impl/LaneDescriptionImpl.java @@ -20,7 +20,6 @@ import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.InternalEObject; import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; import org.eclipse.emf.ecore.util.EObjectContainmentEList; import org.eclipse.emf.ecore.util.InternalEList; import org.eclipse.sirius.components.view.deck.CardDescription; @@ -50,67 +49,7 @@ * * @generated */ -public class LaneDescriptionImpl extends MinimalEObjectImpl.Container implements LaneDescription { - /** - * The default value of the '{@link #getSemanticCandidatesExpression() Semantic Candidates Expression}' - * attribute. - * - * @see #getSemanticCandidatesExpression() - * @generated - * @ordered - */ - protected static final String SEMANTIC_CANDIDATES_EXPRESSION_EDEFAULT = "aql:self"; - - /** - * The cached value of the '{@link #getSemanticCandidatesExpression() Semantic Candidates Expression}' - * attribute. - * - * @see #getSemanticCandidatesExpression() - * @generated - * @ordered - */ - protected String semanticCandidatesExpression = SEMANTIC_CANDIDATES_EXPRESSION_EDEFAULT; - - /** - * The default value of the '{@link #getTitleExpression() Title Expression}' attribute. - * - * @see #getTitleExpression() - * @generated - * @ordered - */ - protected static final String TITLE_EXPRESSION_EDEFAULT = "aql:self"; - - /** - * The cached value of the '{@link #getTitleExpression() Title Expression}' attribute. - * - * @see #getTitleExpression() - * @generated - * @ordered - */ - protected String titleExpression = TITLE_EXPRESSION_EDEFAULT; - - /** - * The default value of the '{@link #getLabelExpression() Label Expression}' attribute. - * - * @see #getLabelExpression() - * @generated - * @ordered - */ - protected static final String LABEL_EXPRESSION_EDEFAULT = "aql:self"; - - /** - * The cached value of the '{@link #getLabelExpression() Label Expression}' attribute. - * - * @see #getLabelExpression() - * @generated - * @ordered - */ - protected String labelExpression = LABEL_EXPRESSION_EDEFAULT; - +public class LaneDescriptionImpl extends DeckElementDescriptionImpl implements LaneDescription { /** * The cached value of the '{@link #getOwnedCardDescriptions() Owned Card Descriptions}' containment * reference list. @@ -170,76 +109,6 @@ protected EClass eStaticClass() { return DeckPackage.Literals.LANE_DESCRIPTION; } - /** - * - * - * @generated - */ - @Override - public String getSemanticCandidatesExpression() { - return this.semanticCandidatesExpression; - } - - /** - * - * - * @generated - */ - @Override - public void setSemanticCandidatesExpression(String newSemanticCandidatesExpression) { - String oldSemanticCandidatesExpression = this.semanticCandidatesExpression; - this.semanticCandidatesExpression = newSemanticCandidatesExpression; - if (this.eNotificationRequired()) - this.eNotify( - new ENotificationImpl(this, Notification.SET, DeckPackage.LANE_DESCRIPTION__SEMANTIC_CANDIDATES_EXPRESSION, oldSemanticCandidatesExpression, this.semanticCandidatesExpression)); - } - - /** - * - * - * @generated - */ - @Override - public String getTitleExpression() { - return this.titleExpression; - } - - /** - * - * - * @generated - */ - @Override - public void setTitleExpression(String newTitleExpression) { - String oldTitleExpression = this.titleExpression; - this.titleExpression = newTitleExpression; - if (this.eNotificationRequired()) - this.eNotify(new ENotificationImpl(this, Notification.SET, DeckPackage.LANE_DESCRIPTION__TITLE_EXPRESSION, oldTitleExpression, this.titleExpression)); - } - - /** - * - * - * @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, DeckPackage.LANE_DESCRIPTION__LABEL_EXPRESSION, oldLabelExpression, this.labelExpression)); - } - /** * * @@ -425,12 +294,6 @@ public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { - case DeckPackage.LANE_DESCRIPTION__SEMANTIC_CANDIDATES_EXPRESSION: - return this.getSemanticCandidatesExpression(); - case DeckPackage.LANE_DESCRIPTION__TITLE_EXPRESSION: - return this.getTitleExpression(); - case DeckPackage.LANE_DESCRIPTION__LABEL_EXPRESSION: - return this.getLabelExpression(); case DeckPackage.LANE_DESCRIPTION__OWNED_CARD_DESCRIPTIONS: return this.getOwnedCardDescriptions(); case DeckPackage.LANE_DESCRIPTION__EDIT_TOOL: @@ -452,15 +315,6 @@ public Object eGet(int featureID, boolean resolve, boolean coreType) { @Override public void eSet(int featureID, Object newValue) { switch (featureID) { - case DeckPackage.LANE_DESCRIPTION__SEMANTIC_CANDIDATES_EXPRESSION: - this.setSemanticCandidatesExpression((String) newValue); - return; - case DeckPackage.LANE_DESCRIPTION__TITLE_EXPRESSION: - this.setTitleExpression((String) newValue); - return; - case DeckPackage.LANE_DESCRIPTION__LABEL_EXPRESSION: - this.setLabelExpression((String) newValue); - return; case DeckPackage.LANE_DESCRIPTION__OWNED_CARD_DESCRIPTIONS: this.getOwnedCardDescriptions().clear(); this.getOwnedCardDescriptions().addAll((Collection) newValue); @@ -486,15 +340,6 @@ public void eSet(int featureID, Object newValue) { @Override public void eUnset(int featureID) { switch (featureID) { - case DeckPackage.LANE_DESCRIPTION__SEMANTIC_CANDIDATES_EXPRESSION: - this.setSemanticCandidatesExpression(SEMANTIC_CANDIDATES_EXPRESSION_EDEFAULT); - return; - case DeckPackage.LANE_DESCRIPTION__TITLE_EXPRESSION: - this.setTitleExpression(TITLE_EXPRESSION_EDEFAULT); - return; - case DeckPackage.LANE_DESCRIPTION__LABEL_EXPRESSION: - this.setLabelExpression(LABEL_EXPRESSION_EDEFAULT); - return; case DeckPackage.LANE_DESCRIPTION__OWNED_CARD_DESCRIPTIONS: this.getOwnedCardDescriptions().clear(); return; @@ -519,12 +364,6 @@ public void eUnset(int featureID) { @Override public boolean eIsSet(int featureID) { switch (featureID) { - case DeckPackage.LANE_DESCRIPTION__SEMANTIC_CANDIDATES_EXPRESSION: - return SEMANTIC_CANDIDATES_EXPRESSION_EDEFAULT == null ? this.semanticCandidatesExpression != null : !SEMANTIC_CANDIDATES_EXPRESSION_EDEFAULT.equals(this.semanticCandidatesExpression); - case DeckPackage.LANE_DESCRIPTION__TITLE_EXPRESSION: - return TITLE_EXPRESSION_EDEFAULT == null ? this.titleExpression != null : !TITLE_EXPRESSION_EDEFAULT.equals(this.titleExpression); - case DeckPackage.LANE_DESCRIPTION__LABEL_EXPRESSION: - return LABEL_EXPRESSION_EDEFAULT == null ? this.labelExpression != null : !LABEL_EXPRESSION_EDEFAULT.equals(this.labelExpression); case DeckPackage.LANE_DESCRIPTION__OWNED_CARD_DESCRIPTIONS: return this.ownedCardDescriptions != null && !this.ownedCardDescriptions.isEmpty(); case DeckPackage.LANE_DESCRIPTION__EDIT_TOOL: @@ -537,25 +376,4 @@ public boolean eIsSet(int featureID) { return super.eIsSet(featureID); } - /** - * - * - * @generated - */ - @Override - public String toString() { - if (this.eIsProxy()) - return super.toString(); - - StringBuilder result = new StringBuilder(super.toString()); - result.append(" (semanticCandidatesExpression: "); - result.append(this.semanticCandidatesExpression); - result.append(", titleExpression: "); - result.append(this.titleExpression); - result.append(", labelExpression: "); - result.append(this.labelExpression); - result.append(')'); - return result.toString(); - } - } // LaneDescriptionImpl diff --git a/packages/view/backend/sirius-components-view-deck/src/main/java/org/eclipse/sirius/components/view/deck/util/DeckAdapterFactory.java b/packages/view/backend/sirius-components-view-deck/src/main/java/org/eclipse/sirius/components/view/deck/util/DeckAdapterFactory.java index 3317959eb62..5d43121d881 100644 --- a/packages/view/backend/sirius-components-view-deck/src/main/java/org/eclipse/sirius/components/view/deck/util/DeckAdapterFactory.java +++ b/packages/view/backend/sirius-components-view-deck/src/main/java/org/eclipse/sirius/components/view/deck/util/DeckAdapterFactory.java @@ -21,6 +21,7 @@ import org.eclipse.sirius.components.view.deck.CardDropTool; import org.eclipse.sirius.components.view.deck.CreateCardTool; import org.eclipse.sirius.components.view.deck.DeckDescription; +import org.eclipse.sirius.components.view.deck.DeckElementDescription; import org.eclipse.sirius.components.view.deck.DeckPackage; import org.eclipse.sirius.components.view.deck.DeckTool; import org.eclipse.sirius.components.view.deck.DeleteCardTool; @@ -130,6 +131,11 @@ public Adapter caseLaneDropTool(LaneDropTool object) { return DeckAdapterFactory.this.createLaneDropToolAdapter(); } + @Override + public Adapter caseDeckElementDescription(DeckElementDescription object) { + return DeckAdapterFactory.this.createDeckElementDescriptionAdapter(); + } + @Override public Adapter caseRepresentationDescription(RepresentationDescription object) { return DeckAdapterFactory.this.createRepresentationDescriptionAdapter(); @@ -293,6 +299,20 @@ public Adapter createLaneDropToolAdapter() { return null; } + /** + * Creates a new adapter for an object of class + * '{@link org.eclipse.sirius.components.view.deck.DeckElementDescription 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.deck.DeckElementDescription + * @generated + */ + public Adapter createDeckElementDescriptionAdapter() { + 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-deck/src/main/java/org/eclipse/sirius/components/view/deck/util/DeckSwitch.java b/packages/view/backend/sirius-components-view-deck/src/main/java/org/eclipse/sirius/components/view/deck/util/DeckSwitch.java index 5e5cd09faca..e0fb9c298ac 100644 --- a/packages/view/backend/sirius-components-view-deck/src/main/java/org/eclipse/sirius/components/view/deck/util/DeckSwitch.java +++ b/packages/view/backend/sirius-components-view-deck/src/main/java/org/eclipse/sirius/components/view/deck/util/DeckSwitch.java @@ -20,6 +20,7 @@ import org.eclipse.sirius.components.view.deck.CardDropTool; import org.eclipse.sirius.components.view.deck.CreateCardTool; import org.eclipse.sirius.components.view.deck.DeckDescription; +import org.eclipse.sirius.components.view.deck.DeckElementDescription; import org.eclipse.sirius.components.view.deck.DeckPackage; import org.eclipse.sirius.components.view.deck.DeckTool; import org.eclipse.sirius.components.view.deck.DeleteCardTool; @@ -91,6 +92,8 @@ protected T doSwitch(int classifierID, EObject theEObject) { case DeckPackage.LANE_DESCRIPTION: { LaneDescription laneDescription = (LaneDescription) theEObject; T result = this.caseLaneDescription(laneDescription); + if (result == null) + result = this.caseDeckElementDescription(laneDescription); if (result == null) result = this.defaultCase(theEObject); return result; @@ -98,6 +101,8 @@ protected T doSwitch(int classifierID, EObject theEObject) { case DeckPackage.CARD_DESCRIPTION: { CardDescription cardDescription = (CardDescription) theEObject; T result = this.caseCardDescription(cardDescription); + if (result == null) + result = this.caseDeckElementDescription(cardDescription); if (result == null) result = this.defaultCase(theEObject); return result; @@ -163,6 +168,13 @@ protected T doSwitch(int classifierID, EObject theEObject) { result = this.defaultCase(theEObject); return result; } + case DeckPackage.DECK_ELEMENT_DESCRIPTION: { + DeckElementDescription deckElementDescription = (DeckElementDescription) theEObject; + T result = this.caseDeckElementDescription(deckElementDescription); + if (result == null) + result = this.defaultCase(theEObject); + return result; + } default: return this.defaultCase(theEObject); } @@ -316,6 +328,21 @@ public T caseLaneDropTool(LaneDropTool object) { return null; } + /** + * Returns the result of interpreting the object as an instance of '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 'Element Description'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseDeckElementDescription(DeckElementDescription 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.