Skip to content
Open
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
2 changes: 2 additions & 0 deletions CHANGELOG.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@

- https://github.com/ObeoNetwork/pepper/issues/9[#9] Add DependencyLink to add real delay between dependencies
- https://github.com/ObeoNetwork/pepper/issues/8[#8] Determine the end time based on the start time and a duration
- https://github.com/ObeoNetwork/pepper/issues/54[#54] Add an option to choose task time granularity


=== Improvements

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) {
addAssignedTeamsPropertyDescriptor(object);
addCalculationOptionPropertyDescriptor(object);
addDurationPropertyDescriptor(object);
addDurationViewModePropertyDescriptor(object);
}
return itemPropertyDescriptors;
}
Expand Down Expand Up @@ -206,6 +207,22 @@ protected void addDurationPropertyDescriptor(Object object) {
PepperPackage.Literals.ABSTRACT_TASK__DURATION, true, false, false, ItemPropertyDescriptor.INTEGRAL_VALUE_IMAGE, null, null));
}

/**
* This adds a property descriptor for the Duration View Mode feature. <!--
* begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
protected void addDurationViewModePropertyDescriptor(Object object) {
itemPropertyDescriptors
.add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(),
getResourceLocator(), getString("_UI_AbstractTask_durationViewMode_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_AbstractTask_durationViewMode_feature",
"_UI_AbstractTask_type"),
PepperPackage.Literals.ABSTRACT_TASK__DURATION_VIEW_MODE, 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
Expand Down Expand Up @@ -277,6 +294,7 @@ public void notifyChanged(Notification notification) {
case PepperPackage.ABSTRACT_TASK__COMPUTE_START_END_DYNAMICALLY:
case PepperPackage.ABSTRACT_TASK__CALCULATION_OPTION:
case PepperPackage.ABSTRACT_TASK__DURATION:
case PepperPackage.ABSTRACT_TASK__DURATION_VIEW_MODE:
fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true));
return;
case PepperPackage.ABSTRACT_TASK__SUB_TASKS:
Expand Down
6 changes: 6 additions & 0 deletions backend/pepper-edit/src/main/resources/plugin.properties
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ _UI_AbstractTask_subTasks_feature = Sub Tasks
_UI_AbstractTask_calculationOption_feature = Calculation Option
_UI_AbstractTask_durationDelay_feature = Delay (H)
_UI_AbstractTask_duration_feature = Duration (Hours)
_UI_AbstractTask_duration_Days_feature = Duration (Days)
_UI_AbstractTask_durationViewMode_feature = Duration View Mode
_UI_TagFolder_name_feature = Name
_UI_TagFolder_ownedTags_feature = Owned Tags
_UI_TagFolder_subFolders_feature = Sub Folders
Expand Down Expand Up @@ -154,6 +156,8 @@ _UI_TaskTimeBoundariesConstraint_EndDuration_feature = End - Duration
_UI_TaskTimeBoundariesConstraint_StartDuration_feature = Start - Duration
_UI_StartOrEnd_Start_feature = Start
_UI_StartOrEnd_End_feature = End
_UI_DurationViewMode_Hours_feature = Hours
_UI_DurationViewMode_Days_feature = Days
_UI_Unknown_feature = Unspecified

_UI_ProjectState_OnGoing_literal = ON_GOING
Expand Down Expand Up @@ -185,3 +189,5 @@ _UI_StartOrEnd_End_literal = END
_UI_TaskTimeBoundariesConstraint_StartEnd_literal = START_END
_UI_TaskTimeBoundariesConstraint_EndDuration_literal = END_DURATION
_UI_TaskTimeBoundariesConstraint_StartDuration_literal = START_DURATION
_UI_DurationViewMode_Hours_literal = HOURS
_UI_DurationViewMode_Days_literal = DAYS
6 changes: 6 additions & 0 deletions backend/pepper-edit/src/main/resources/plugin_fr.properties
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ _UI_AbstractTask_subTasks_feature = Sous t\u00E2ches
_UI_AbstractTask_calculationOption_feature = Option de calcul
_UI_AbstractTask_durationDelay_feature = Délais (H)
_UI_AbstractTask_duration_feature = Dur\u00E9e (Heures)
_UI_AbstractTask_duration_Days_feature = Durée (Jours)
_UI_AbstractTask_durationViewMode_feature = Mode de durée
_UI_TagFolder_name_feature = Nom
_UI_TagFolder_ownedTags_feature = Tags
_UI_TagFolder_subFolders_feature = Sous r\u00E9pertoires
Expand Down Expand Up @@ -155,6 +157,8 @@ _UI_TaskTimeBoundariesConstraint_EndDuration_feature = Fin - Dur
_UI_TaskTimeBoundariesConstraint_StartDuration_feature = Début - Durée
_UI_StartOrEnd_Start_feature = Début
_UI_StartOrEnd_End_feature = Fin
_UI_DurationViewMode_Hours_feature = Heures
_UI_DurationViewMode_Days_feature = Jours
_UI_Unknown_feature = Unspecified

_UI_WorkpackageArtefactNature_Delivrable_literal = DELIVRABLE
Expand Down Expand Up @@ -186,3 +190,5 @@ _UI_StartOrEnd_End_literal = END
_UI_TaskTimeBoundariesConstraint_StartEnd_literal = START_END
_UI_TaskTimeBoundariesConstraint_EndDuration_literal = END_DURATION
_UI_TaskTimeBoundariesConstraint_StartDuration_literal = START_DURATION
_UI_DurationViewMode_Hours_literal = HOURS
_UI_DurationViewMode_Days_literal = DAYS
26 changes: 26 additions & 0 deletions backend/pepper-mm/src/main/java/pepper/peppermm/AbstractTask.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
* <li>{@link AbstractTask#getSubTasks <em>Sub Tasks</em>}</li>
* <li>{@link AbstractTask#getCalculationOption <em>Calculation Option</em>}</li>
* <li>{@link AbstractTask#getDuration <em>Duration</em>}</li>
* <li>{@link AbstractTask#getDurationViewMode <em>Duration View Mode</em>}</li>
* </ul>
*
* @see PepperPackage#getAbstractTask()
Expand Down Expand Up @@ -269,4 +270,29 @@ public interface AbstractTask extends EObject {
*/
void setDuration(int value);

/**
* Returns the value of the '<em><b>Duration View Mode</b></em>' attribute. The literals are from the enumeration
* {@link DurationViewMode}. <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @return the value of the '<em>Duration View Mode</em>' attribute.
* @see DurationViewMode
* @see #setDurationViewMode(DurationViewMode)
* @see PepperPackage#getAbstractTask_DurationViewMode()
* @model
* @generated
*/
DurationViewMode getDurationViewMode();

/**
* Sets the value of the '{@link AbstractTask#getDurationViewMode <em>Duration View Mode</em>}'
* attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @param value
* the new value of the '<em>Duration View Mode</em>' attribute.
* @see DurationViewMode
* @see #getDurationViewMode()
* @generated
*/
void setDurationViewMode(DurationViewMode value);

} // AbstractTask
215 changes: 215 additions & 0 deletions backend/pepper-mm/src/main/java/pepper/peppermm/DurationViewMode.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,215 @@
/**
* Copyright (c) 2024, 2026 CEA LIST and Others.
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*
* Contributors:
* Obeo - initial API and implementation
*/
package pepper.peppermm;

import java.util.Arrays;
import java.util.Collections;
import java.util.List;

import org.eclipse.emf.common.util.Enumerator;

/**
* <!-- begin-user-doc --> A representation of the literals of the enumeration '<em><b>Duration View Mode</b></em>', and
* utility methods for working with them. <!-- end-user-doc -->
*
* @see pepper.peppermm.PepperPackage#getDurationViewMode()
* @model
* @generated
*/
public enum DurationViewMode implements Enumerator {
/**
* The '<em><b>Hours</b></em>' literal object. <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @see #HOURS_VALUE
* @generated
* @ordered
*/
HOURS(0, "Hours", "HOURS"),

/**
* The '<em><b>Days</b></em>' literal object. <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @see #DAYS_VALUE
* @generated
* @ordered
*/
DAYS(1, "Days", "DAYS");

/**
* The '<em><b>Hours</b></em>' literal value. <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @see #HOURS
* @model name="Hours" literal="HOURS"
* @generated
* @ordered
*/
public static final int HOURS_VALUE = 0;

/**
* The '<em><b>Days</b></em>' literal value. <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @see #DAYS
* @model name="Days" literal="DAYS"
* @generated
* @ordered
*/
public static final int DAYS_VALUE = 1;

/**
* An array of all the '<em><b>Duration View Mode</b></em>' enumerators. <!-- begin-user-doc --> <!-- end-user-doc
* -->
*
* @generated
*/
private static final DurationViewMode[] VALUES_ARRAY = new DurationViewMode[] { HOURS, DAYS, };

/**
* A public read-only list of all the '<em><b>Duration View Mode</b></em>' enumerators. <!-- begin-user-doc --> <!--
* end-user-doc -->
*
* @generated
*/
public static final List<DurationViewMode> VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY));

/**
* Returns the '<em><b>Duration View Mode</b></em>' literal with the specified literal value. <!-- begin-user-doc
* --> <!-- end-user-doc -->
*
* @param literal
* the literal.
* @return the matching enumerator or <code>null</code>.
* @generated
*/
public static DurationViewMode get(String literal) {
for (int i = 0; i < VALUES_ARRAY.length; ++i) {
DurationViewMode result = VALUES_ARRAY[i];
if (result.toString().equals(literal)) {
return result;
}
}
return null;
}

/**
* Returns the '<em><b>Duration View Mode</b></em>' literal with the specified name. <!-- begin-user-doc --> <!--
* end-user-doc -->
*
* @param name
* the name.
* @return the matching enumerator or <code>null</code>.
* @generated
*/
public static DurationViewMode getByName(String name) {
for (int i = 0; i < VALUES_ARRAY.length; ++i) {
DurationViewMode result = VALUES_ARRAY[i];
if (result.getName().equals(name)) {
return result;
}
}
return null;
}

/**
* Returns the '<em><b>Duration View Mode</b></em>' literal with the specified integer value. <!-- begin-user-doc
* --> <!-- end-user-doc -->
*
* @param value
* the integer value.
* @return the matching enumerator or <code>null</code>.
* @generated
*/
public static DurationViewMode get(int value) {
switch (value) {
case HOURS_VALUE:
return HOURS;
case DAYS_VALUE:
return DAYS;
default:
return null;
}
}

/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
private final int value;

/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
private final String name;

/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
private final String literal;

/**
* Only this class can construct instances. <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
private DurationViewMode(int value, String name, String literal) {
this.value = value;
this.name = name;
this.literal = literal;
}

/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
@Override
public int getValue() {
return value;
}

/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
@Override
public String getName() {
return name;
}

/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
@Override
public String getLiteral() {
return literal;
}

/**
* Returns the literal value of the enumerator, which is its string representation. <!-- begin-user-doc --> <!--
* end-user-doc -->
*
* @generated
*/
@Override
public String toString() {
return literal;
}

} // DurationViewMode
Loading
Loading