Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[3079] Add a name attribute on deck view descriptions #3080

Merged
merged 1 commit into from
Feb 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ image:doc/screenshots/showDeletionConfirmation.png[Deletion Confirmation Dialog,
- https://github.com/eclipse-sirius/sirius-web/issues/3066[#3066] [core] The core object-related services now can also find/resolve representations.
- [portal] Use MUI tooltips for Portal toolbar elements
- https://github.com/eclipse-sirius/sirius-web/issues/2480[#2480] [diagram] Merge the rectangle node and the image node into FreeFormNode.
- https://github.com/eclipse-sirius/sirius-web/issues/3079[#3079] [deck] Add a name attribute on CardDescription and LaneDescription

== v2024.1.0

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()")
Expand All @@ -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")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
}

}

Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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. <!-- begin-user-doc --> <!-- end-user-doc -->
*
Expand All @@ -61,51 +52,11 @@ public List<IItemPropertyDescriptor> 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. <!-- begin-user-doc --> <!--
* end-user-doc -->
*
* @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. <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @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. <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @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. <!-- begin-user-doc --> <!-- end-user-doc
* -->
Expand Down Expand Up @@ -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;
}

Expand All @@ -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;
Expand All @@ -222,14 +170,4 @@ protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors
newChildDescriptors.add(this.createChildParameter(DeckPackage.Literals.CARD_DESCRIPTION__DELETE_TOOL, DeckFactory.eINSTANCE.createDeleteCardTool()));
}

/**
* Return the resource locator for this item provider's resources. <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
@Override
public ResourceLocator getResourceLocator() {
return ((IChildCreationExtender) this.adapterFactory).getResourceLocator();
}

}
Loading
Loading