Skip to content

Commit

Permalink
Add TaskDescription.name
Browse files Browse the repository at this point in the history
Signed-off-by: Laurent Fasani <laurent.fasani@obeo.fr>
  • Loading branch information
lfasani committed Feb 26, 2024
1 parent c9e5a13 commit 3594760
Show file tree
Hide file tree
Showing 10 changed files with 180 additions and 29 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,15 @@ private GanttDescription createGanttDescription() {

private DeleteTaskTool createDeleteTaskTool() {
return new GanttBuilders().newDeleteTaskTool()
.name("Delete Task")
.body(new DeleteElementBuilder()
.build())
.build();
}

private EditTaskTool createEditTaskTool() {
return new GanttBuilders().newEditTaskTool()
.name("Edit Task")
.body(new ChangeContextBuilder()
.expression("aql:self.editTask(newName, newDescription, newStartTime, newEndTime, newProgress)")
.build())
Expand All @@ -80,6 +82,7 @@ private EditTaskTool createEditTaskTool() {

private CreateTaskTool createCreateTaskTool() {
return new GanttBuilders().newCreateTaskTool()
.name("Create Task After")
.body(new ChangeContextBuilder()
.expression("aql:self.createTask()")
.build())
Expand All @@ -90,6 +93,7 @@ private TaskDescription createTaskDescriptionInProject() {
TaskDescription taskDescriptionInTask = this.createTaskDescriptionInTask();

return new GanttBuilders().newTaskDescription()
.name("Tasks In Project")
.semanticCandidatesExpression("aql:self.ownedTasks")
.nameExpression("aql:self.name")
.descriptionExpression("aql:self.description")
Expand All @@ -104,6 +108,7 @@ private TaskDescription createTaskDescriptionInProject() {

private TaskDescription createTaskDescriptionInTask() {
TaskDescription taskDescription = new GanttBuilders().newTaskDescription()
.name("Sub Tasks")
.semanticCandidatesExpression("aql:self.subTasks")
.nameExpression("aql:self.name")
.descriptionExpression("aql:self.description")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,16 @@ public org.eclipse.sirius.components.view.gantt.TaskDescription build() {
return this.getTaskDescription();
}

/**
* Setter for Name.
*
* @generated
*/
public TaskDescriptionBuilder name(java.lang.String value) {
this.getTaskDescription().setName(value);
return this;
}

/**
* Setter for SemanticCandidatesExpression.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
* @generated
*/
public class TaskDescriptionItemProvider extends ItemProviderAdapter
implements IEditingDomainItemProvider, IStructuredItemContentProvider, ITreeItemContentProvider, IItemLabelProvider, IItemPropertySource {
implements IEditingDomainItemProvider, IStructuredItemContentProvider, ITreeItemContentProvider, IItemLabelProvider, IItemPropertySource {
/**
* This constructs an instance from a factory and a notifier. <!-- begin-user-doc --> <!-- end-user-doc -->
*
Expand All @@ -61,6 +61,7 @@ public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) {
if (this.itemPropertyDescriptors == null) {
super.getPropertyDescriptors(object);

this.addNamePropertyDescriptor(object);
this.addSemanticCandidatesExpressionPropertyDescriptor(object);
this.addNameExpressionPropertyDescriptor(object);
this.addDescriptionExpressionPropertyDescriptor(object);
Expand All @@ -74,6 +75,17 @@ public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) {
return this.itemPropertyDescriptors;
}

/**
* This adds a property descriptor for the Name feature. <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
protected void addNamePropertyDescriptor(Object object) {
this.itemPropertyDescriptors.add(this.createItemPropertyDescriptor(((ComposeableAdapterFactory) this.adapterFactory).getRootAdapterFactory(), this.getResourceLocator(),
this.getString("_UI_TaskDescription_name_feature"), this.getString("_UI_PropertyDescriptor_description", "_UI_TaskDescription_name_feature", "_UI_TaskDescription_type"),
GanttPackage.Literals.TASK_DESCRIPTION__NAME, true, false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
}

/**
* This adds a property descriptor for the Semantic Candidates Expression feature. <!-- begin-user-doc --> <!--
* end-user-doc -->
Expand Down Expand Up @@ -249,7 +261,7 @@ protected boolean shouldComposeCreationImage() {
*/
@Override
public String getText(Object object) {
String label = ((TaskDescription) object).getNameExpression();
String label = ((TaskDescription) object).getName();
return label == null || label.length() == 0 ? this.getString("_UI_TaskDescription_type") : this.getString("_UI_TaskDescription_type") + " " + label;
}

Expand All @@ -265,6 +277,7 @@ public void notifyChanged(Notification notification) {
this.updateChildren(notification);

switch (notification.getFeatureID(TaskDescription.class)) {
case GanttPackage.TASK_DESCRIPTION__NAME:
case GanttPackage.TASK_DESCRIPTION__SEMANTIC_CANDIDATES_EXPRESSION:
case GanttPackage.TASK_DESCRIPTION__NAME_EXPRESSION:
case GanttPackage.TASK_DESCRIPTION__DESCRIPTION_EXPRESSION:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ _UI_GanttDescription_backgroundColor_feature = Background Color
_UI_GanttDescription_createTool_feature = Create Tool
_UI_GanttDescription_editTool_feature = Edit Tool
_UI_GanttDescription_deleteTool_feature = Delete Tool
_UI_TaskDescription_name_feature = Name
_UI_TaskDescription_semanticCandidatesExpression_feature = Semantic Candidates Expression
_UI_TaskDescription_nameExpression_feature = Name Expression
_UI_TaskDescription_descriptionExpression_feature = Description Expression
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,22 +178,30 @@ public interface GanttPackage extends EPackage {
*/
int TASK_DESCRIPTION = 1;

/**
* The feature id for the '<em><b>Name</b></em>' attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
* @ordered
*/
int TASK_DESCRIPTION__NAME = 0;

/**
* The feature id for the '<em><b>Semantic Candidates Expression</b></em>' attribute. <!-- begin-user-doc --> <!--
* end-user-doc -->
*
* @generated
* @ordered
*/
int TASK_DESCRIPTION__SEMANTIC_CANDIDATES_EXPRESSION = 0;
int TASK_DESCRIPTION__SEMANTIC_CANDIDATES_EXPRESSION = 1;

/**
* The feature id for the '<em><b>Name Expression</b></em>' attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
* @ordered
*/
int TASK_DESCRIPTION__NAME_EXPRESSION = 1;
int TASK_DESCRIPTION__NAME_EXPRESSION = 2;

/**
* The feature id for the '<em><b>Description Expression</b></em>' attribute. <!-- begin-user-doc --> <!--
Expand All @@ -202,7 +210,7 @@ public interface GanttPackage extends EPackage {
* @generated
* @ordered
*/
int TASK_DESCRIPTION__DESCRIPTION_EXPRESSION = 2;
int TASK_DESCRIPTION__DESCRIPTION_EXPRESSION = 3;

/**
* The feature id for the '<em><b>Start Time Expression</b></em>' attribute. <!-- begin-user-doc --> <!--
Expand All @@ -211,7 +219,7 @@ public interface GanttPackage extends EPackage {
* @generated
* @ordered
*/
int TASK_DESCRIPTION__START_TIME_EXPRESSION = 3;
int TASK_DESCRIPTION__START_TIME_EXPRESSION = 4;

/**
* The feature id for the '<em><b>End Time Expression</b></em>' attribute. <!-- begin-user-doc --> <!-- end-user-doc
Expand All @@ -220,7 +228,7 @@ public interface GanttPackage extends EPackage {
* @generated
* @ordered
*/
int TASK_DESCRIPTION__END_TIME_EXPRESSION = 4;
int TASK_DESCRIPTION__END_TIME_EXPRESSION = 5;

/**
* The feature id for the '<em><b>Progress Expression</b></em>' attribute. <!-- begin-user-doc --> <!-- end-user-doc
Expand All @@ -229,7 +237,7 @@ public interface GanttPackage extends EPackage {
* @generated
* @ordered
*/
int TASK_DESCRIPTION__PROGRESS_EXPRESSION = 5;
int TASK_DESCRIPTION__PROGRESS_EXPRESSION = 6;

/**
* The feature id for the '<em><b>Compute Start End Dynamically Expression</b></em>' attribute. <!-- begin-user-doc
Expand All @@ -238,7 +246,7 @@ public interface GanttPackage extends EPackage {
* @generated
* @ordered
*/
int TASK_DESCRIPTION__COMPUTE_START_END_DYNAMICALLY_EXPRESSION = 6;
int TASK_DESCRIPTION__COMPUTE_START_END_DYNAMICALLY_EXPRESSION = 7;

/**
* The feature id for the '<em><b>Dependencies Expression</b></em>' attribute. <!-- begin-user-doc --> <!--
Expand All @@ -247,7 +255,7 @@ public interface GanttPackage extends EPackage {
* @generated
* @ordered
*/
int TASK_DESCRIPTION__DEPENDENCIES_EXPRESSION = 7;
int TASK_DESCRIPTION__DEPENDENCIES_EXPRESSION = 8;

/**
* The feature id for the '<em><b>Style</b></em>' containment reference. <!-- begin-user-doc --> <!-- end-user-doc
Expand All @@ -256,7 +264,7 @@ public interface GanttPackage extends EPackage {
* @generated
* @ordered
*/
int TASK_DESCRIPTION__STYLE = 8;
int TASK_DESCRIPTION__STYLE = 9;

/**
* The feature id for the '<em><b>Conditional Styles</b></em>' containment reference list. <!-- begin-user-doc -->
Expand All @@ -265,7 +273,7 @@ public interface GanttPackage extends EPackage {
* @generated
* @ordered
*/
int TASK_DESCRIPTION__CONDITIONAL_STYLES = 9;
int TASK_DESCRIPTION__CONDITIONAL_STYLES = 10;

/**
* The feature id for the '<em><b>Sub Task Element Descriptions</b></em>' containment reference list. <!--
Expand All @@ -274,7 +282,7 @@ public interface GanttPackage extends EPackage {
* @generated
* @ordered
*/
int TASK_DESCRIPTION__SUB_TASK_ELEMENT_DESCRIPTIONS = 10;
int TASK_DESCRIPTION__SUB_TASK_ELEMENT_DESCRIPTIONS = 11;

/**
* The feature id for the '<em><b>Reused Task Element Descriptions</b></em>' reference list. <!-- begin-user-doc -->
Expand All @@ -283,7 +291,7 @@ public interface GanttPackage extends EPackage {
* @generated
* @ordered
*/
int TASK_DESCRIPTION__REUSED_TASK_ELEMENT_DESCRIPTIONS = 11;
int TASK_DESCRIPTION__REUSED_TASK_ELEMENT_DESCRIPTIONS = 12;

/**
* The number of structural features of the '<em>Task Description</em>' class. <!-- begin-user-doc --> <!--
Expand All @@ -292,7 +300,7 @@ public interface GanttPackage extends EPackage {
* @generated
* @ordered
*/
int TASK_DESCRIPTION_FEATURE_COUNT = 12;
int TASK_DESCRIPTION_FEATURE_COUNT = 13;

/**
* The number of operations of the '<em>Task Description</em>' class. <!-- begin-user-doc --> <!-- end-user-doc -->
Expand Down Expand Up @@ -734,6 +742,18 @@ public interface GanttPackage extends EPackage {
*/
EClass getTaskDescription();

/**
* Returns the meta object for the attribute
* '{@link org.eclipse.sirius.components.view.gantt.TaskDescription#getName <em>Name</em>}'. <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @return the meta object for the attribute '<em>Name</em>'.
* @see org.eclipse.sirius.components.view.gantt.TaskDescription#getName()
* @see #getTaskDescription()
* @generated
*/
EAttribute getTaskDescription_Name();

/**
* Returns the meta object for the attribute
* '{@link org.eclipse.sirius.components.view.gantt.TaskDescription#getSemanticCandidatesExpression <em>Semantic
Expand Down Expand Up @@ -1103,6 +1123,14 @@ interface Literals {
*/
EClass TASK_DESCRIPTION = eINSTANCE.getTaskDescription();

/**
* The meta object literal for the '<em><b>Name</b></em>' attribute feature. <!-- begin-user-doc --> <!--
* end-user-doc -->
*
* @generated
*/
EAttribute TASK_DESCRIPTION__NAME = eINSTANCE.getTaskDescription_Name();

/**
* The meta object literal for the '<em><b>Semantic Candidates Expression</b></em>' attribute feature. <!--
* begin-user-doc --> <!-- end-user-doc -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,29 @@
* @generated
*/
public interface TaskDescription extends EObject {
/**
* Returns the value of the '<em><b>Name</b></em>' attribute. The default value is <code>""</code>. <!--
* begin-user-doc --> <!-- end-user-doc -->
*
* @return the value of the '<em>Name</em>' attribute.
* @see #setName(String)
* @see org.eclipse.sirius.components.view.gantt.GanttPackage#getTaskDescription_Name()
* @model default="" dataType="org.eclipse.sirius.components.view.Identifier" required="true"
* @generated
*/
String getName();

/**
* Sets the value of the '{@link org.eclipse.sirius.components.view.gantt.TaskDescription#getName <em>Name</em>}'
* attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @param value
* the new value of the '<em>Name</em>' attribute.
* @see #getName()
* @generated
*/
void setName(String value);

/**
* Returns the value of the '<em><b>Semantic Candidates Expression</b></em>' attribute. The default value is
* <code>"aql:self"</code>. <!-- begin-user-doc --> <!-- end-user-doc -->
Expand Down

0 comments on commit 3594760

Please sign in to comment.