diff --git a/CHANGELOG.adoc b/CHANGELOG.adoc index 996c8473600..e6b1417cd77 100644 --- a/CHANGELOG.adoc +++ b/CHANGELOG.adoc @@ -38,8 +38,8 @@ More existing APIs will be migrated to this new common pattern. - [releng] Switch to `maven-checkstyle-plugin` 3.3.1 - [releng] Remove the dependency to `reflect-metadata` - [releng] Switch to `subscriptions-transport-ws` 0.11.0 -- https://github.com/eclipse-sirius/sirius-web/issues/3466[#3466] [gantt] Move to @ObeoNetwork/gantt-task-react 0.4.14 to benefit for enhancements - [releng] Switch to EMF Json 2.3.10 +- https://github.com/eclipse-sirius/sirius-web/issues/3523[#3523] [gantt] Move to @ObeoNetwork/gantt-task-react 0.4.16 to benefit for enhancements === Bug fixes @@ -65,6 +65,7 @@ More existing APIs will be migrated to this new common pattern. - https://github.com/eclipse-sirius/sirius-web/issues/3563[#3563] [sirius-web] Improve NavigationBar extensibility to allow the contribution of components on the left and right of the navigation bar. - https://github.com/eclipse-sirius/sirius-web/issues/3344[#3344] [core] Add support for reloading representations from the database - https://github.com/eclipse-sirius/sirius-web/issues/3553[#3553] [core] Add RepresentationFactory extension point +- https://github.com/eclipse-sirius/sirius-web/issues/3523[#3523] [gantt] Support rounding dates when changing dates from gantt === Improvements diff --git a/package-lock.json b/package-lock.json index 4c01da00f33..db19eabbaa2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1527,9 +1527,9 @@ } }, "node_modules/@ObeoNetwork/gantt-task-react": { - "version": "0.4.14", - "resolved": "https://npm.pkg.github.com/download/@ObeoNetwork/gantt-task-react/0.4.14/8729379ac49cb0ad855706c4da877fd64d314f08", - "integrity": "sha512-+WutMO6i8dbb/kVf0unOV4xrPau1I2liMp6NUNNNoT+w2+gd25biyWLp9ccNxsUXCMyH+LXx0hYnEbFnhHeGog==", + "version": "0.4.16", + "resolved": "https://npm.pkg.github.com/download/@ObeoNetwork/gantt-task-react/0.4.16/e576aafc87a06330ac983928c46f5a7c456d9e86", + "integrity": "sha512-9V6DhFJlG9Wk78LcjS/jQIXG9QAFIFhrxPoa4iF55rbqx5pgHqaOusqJ8MBwV7ebBD7XPClh0zRXGg7E/wmktw==", "license": "MIT", "dependencies": { "@floating-ui/dom": "1.1.1", @@ -13317,7 +13317,7 @@ "@eclipse-sirius/sirius-components-tsconfig": "*", "@material-ui/core": "4.12.4", "@material-ui/icons": "4.11.3", - "@ObeoNetwork/gantt-task-react": "0.4.14", + "@ObeoNetwork/gantt-task-react": "0.4.16", "@types/react": "17.0.37", "@vitejs/plugin-react": "4.3.0", "@xstate/react": "1.6.3", @@ -13335,7 +13335,7 @@ "@eclipse-sirius/sirius-components-core": "*", "@material-ui/core": "4.12.4", "@material-ui/icons": "4.11.3", - "@ObeoNetwork/gantt-task-react": "0.4.14", + "@ObeoNetwork/gantt-task-react": "0.4.16", "@xstate/react": "1.6.3", "graphql": "16.8.1", "react": "17.0.2", @@ -15884,7 +15884,7 @@ "@material-ui/core": "4.12.4", "@material-ui/icons": "4.11.3", "@material-ui/lab": "4.0.0-alpha.61", - "@ObeoNetwork/gantt-task-react": "0.4.14", + "@ObeoNetwork/gantt-task-react": "0.4.16", "@ObeoNetwork/react-trello": "2.4.11", "@types/react": "17.0.37", "@types/react-router-dom": "5.3.3", @@ -23160,7 +23160,7 @@ "@eclipse-sirius/sirius-components-tsconfig": "*", "@material-ui/core": "4.12.4", "@material-ui/icons": "4.11.3", - "@ObeoNetwork/gantt-task-react": "0.4.14", + "@ObeoNetwork/gantt-task-react": "0.4.16", "@types/react": "17.0.37", "@vitejs/plugin-react": "4.3.0", "@xstate/react": "1.6.3", @@ -26315,7 +26315,7 @@ "@material-ui/core": "4.12.4", "@material-ui/icons": "4.11.3", "@material-ui/lab": "4.0.0-alpha.61", - "@ObeoNetwork/gantt-task-react": "0.4.14", + "@ObeoNetwork/gantt-task-react": "0.4.16", "@ObeoNetwork/react-trello": "2.4.11", "@testing-library/jest-dom": "5.14.1", "@testing-library/react": "12.1.2", @@ -27911,9 +27911,9 @@ } }, "@ObeoNetwork/gantt-task-react": { - "version": "0.4.14", - "resolved": "https://npm.pkg.github.com/download/@ObeoNetwork/gantt-task-react/0.4.14/8729379ac49cb0ad855706c4da877fd64d314f08", - "integrity": "sha512-+WutMO6i8dbb/kVf0unOV4xrPau1I2liMp6NUNNNoT+w2+gd25biyWLp9ccNxsUXCMyH+LXx0hYnEbFnhHeGog==", + "version": "0.4.16", + "resolved": "https://npm.pkg.github.com/download/@ObeoNetwork/gantt-task-react/0.4.16/e576aafc87a06330ac983928c46f5a7c456d9e86", + "integrity": "sha512-9V6DhFJlG9Wk78LcjS/jQIXG9QAFIFhrxPoa4iF55rbqx5pgHqaOusqJ8MBwV7ebBD7XPClh0zRXGg7E/wmktw==", "requires": { "@floating-ui/dom": "1.1.1", "@floating-ui/react": "0.19.0", diff --git a/packages/gantt/backend/sirius-components-collaborative-gantt/src/main/resources/schema/gantt.graphqls b/packages/gantt/backend/sirius-components-collaborative-gantt/src/main/resources/schema/gantt.graphqls index 014b6015b38..10989abb1d5 100644 --- a/packages/gantt/backend/sirius-components-collaborative-gantt/src/main/resources/schema/gantt.graphqls +++ b/packages/gantt/backend/sirius-components-collaborative-gantt/src/main/resources/schema/gantt.graphqls @@ -24,6 +24,18 @@ type Gantt implements Representation { targetObjectId: ID! tasks: [Task!]! columns: [GanttColumn!]! + dateRounding: GanttDateRounding! +} + +type GanttDateRounding { + value : Int! + timeUnit : GanttDateRoundingTimeUnit! +} + +enum GanttDateRoundingTimeUnit { + MINUTE + HOUR + DAY } type GanttColumn { diff --git a/packages/gantt/backend/sirius-components-gantt/src/main/java/org/eclipse/sirius/components/gantt/Gantt.java b/packages/gantt/backend/sirius-components-gantt/src/main/java/org/eclipse/sirius/components/gantt/Gantt.java index 7d2e946f484..c3bc47bd9f3 100644 --- a/packages/gantt/backend/sirius-components-gantt/src/main/java/org/eclipse/sirius/components/gantt/Gantt.java +++ b/packages/gantt/backend/sirius-components-gantt/src/main/java/org/eclipse/sirius/components/gantt/Gantt.java @@ -22,7 +22,7 @@ * * @author lfasani */ -public record Gantt(String id, String descriptionId, String targetObjectId, String label, List tasks, List columns) implements IRepresentation { +public record Gantt(String id, String descriptionId, String targetObjectId, String label, List tasks, List columns, GanttDateRounding dateRounding) implements IRepresentation { public static final String KIND = IRepresentation.KIND_PREFIX + "?type=Gantt"; @@ -68,7 +68,7 @@ public String getKind() { */ @SuppressWarnings("checkstyle:HiddenField") public static final class Builder { - private String id; + private final String id; private String targetObjectId; @@ -80,6 +80,8 @@ public static final class Builder { private List columns; + private GanttDateRounding dateRounding; + private Builder(String id) { this.id = Objects.requireNonNull(id); } @@ -89,6 +91,7 @@ private Builder(Gantt gantt) { this.targetObjectId = gantt.getTargetObjectId(); this.descriptionId = gantt.getDescriptionId(); this.label = gantt.getLabel(); + this.dateRounding = gantt.dateRounding(); } public Builder targetObjectId(String targetObjectId) { @@ -116,8 +119,13 @@ public Builder columns(List columns) { return this; } + public Builder dateRounding(GanttDateRounding dateRounding) { + this.dateRounding = Objects.requireNonNull(dateRounding); + return this; + } + public Gantt build() { - Gantt gantt = new Gantt(this.id, this.descriptionId, this.targetObjectId, this.label, this.tasks, this.columns); + Gantt gantt = new Gantt(this.id, this.descriptionId, this.targetObjectId, this.label, this.tasks, this.columns, this.dateRounding); return gantt; } } diff --git a/packages/gantt/backend/sirius-components-gantt/src/main/java/org/eclipse/sirius/components/gantt/GanttDateRounding.java b/packages/gantt/backend/sirius-components-gantt/src/main/java/org/eclipse/sirius/components/gantt/GanttDateRounding.java new file mode 100644 index 00000000000..653762a311c --- /dev/null +++ b/packages/gantt/backend/sirius-components-gantt/src/main/java/org/eclipse/sirius/components/gantt/GanttDateRounding.java @@ -0,0 +1,20 @@ +/******************************************************************************* + * 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.gantt; + +/** + * Class representing how the date should be rounded in Gantt. + */ +public record GanttDateRounding(Integer value, GanttDateRoundingTimeUnit timeUnit) { +} diff --git a/packages/gantt/backend/sirius-components-gantt/src/main/java/org/eclipse/sirius/components/gantt/GanttDateRoundingTimeUnit.java b/packages/gantt/backend/sirius-components-gantt/src/main/java/org/eclipse/sirius/components/gantt/GanttDateRoundingTimeUnit.java new file mode 100644 index 00000000000..7782a12cc5e --- /dev/null +++ b/packages/gantt/backend/sirius-components-gantt/src/main/java/org/eclipse/sirius/components/gantt/GanttDateRoundingTimeUnit.java @@ -0,0 +1,23 @@ +/******************************************************************************* + * 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.gantt; + +/** + * Enum representing a time unit. + * + * @author lfasani + */ +public enum GanttDateRoundingTimeUnit { + MINUTE, HOUR, DAY +} diff --git a/packages/gantt/backend/sirius-components-gantt/src/main/java/org/eclipse/sirius/components/gantt/Task.java b/packages/gantt/backend/sirius-components-gantt/src/main/java/org/eclipse/sirius/components/gantt/Task.java index af99b48659d..2e9dcd773f6 100644 --- a/packages/gantt/backend/sirius-components-gantt/src/main/java/org/eclipse/sirius/components/gantt/Task.java +++ b/packages/gantt/backend/sirius-components-gantt/src/main/java/org/eclipse/sirius/components/gantt/Task.java @@ -32,80 +32,4 @@ public record Task(String id, String descriptionId, String targetObjectId, Strin Objects.requireNonNull(taskDependencyIds); Objects.requireNonNull(subTasks); } - - /** - * The builder used to create the task. - * - * @author lfasani - */ - @SuppressWarnings("checkstyle:HiddenField") - public static final class Builder { - private String id; - - private String targetObjectId; - - private String targetObjectKind; - - private String targetObjectLabel; - - private String descriptionId; - - private TaskDetail taskDetail; - - private List taskDependencyIds; - - private List subTasks; - - private Builder(String id) { - this.id = Objects.requireNonNull(id); - } - - private Builder() { - } - - public Builder label(String id) { - this.id = Objects.requireNonNull(id); - return this; - } - - public Builder targetObjectId(String targetObjectId) { - this.targetObjectId = Objects.requireNonNull(targetObjectId); - return this; - } - - public Builder targetObjectKind(String targetObjectKind) { - this.targetObjectKind = Objects.requireNonNull(targetObjectKind); - return this; - } - - public Builder targetObjectLabel(String targetObjectLabel) { - this.targetObjectLabel = Objects.requireNonNull(targetObjectLabel); - return this; - } - - public Builder descriptionId(String descriptionId) { - this.descriptionId = Objects.requireNonNull(descriptionId); - return this; - } - - public Builder taskDetail(TaskDetail taskDetail) { - this.taskDetail = Objects.requireNonNull(taskDetail); - return this; - } - - public Builder taskDependencyIds(List taskDependencyIds) { - this.taskDependencyIds = Objects.requireNonNull(taskDependencyIds); - return this; - } - - public Builder subTasks(List subTasks) { - this.subTasks = Objects.requireNonNull(subTasks); - return this; - } - - public Task build() { - Task task = new Task(this.id, this.targetObjectId, this.targetObjectKind, this.targetObjectLabel, this.descriptionId, this.taskDetail, this.taskDependencyIds, this.subTasks); - return task; - } - } } diff --git a/packages/gantt/backend/sirius-components-gantt/src/main/java/org/eclipse/sirius/components/gantt/description/GanttDescription.java b/packages/gantt/backend/sirius-components-gantt/src/main/java/org/eclipse/sirius/components/gantt/description/GanttDescription.java index 66c05b29a62..fc463afebd5 100644 --- a/packages/gantt/backend/sirius-components-gantt/src/main/java/org/eclipse/sirius/components/gantt/description/GanttDescription.java +++ b/packages/gantt/backend/sirius-components-gantt/src/main/java/org/eclipse/sirius/components/gantt/description/GanttDescription.java @@ -31,7 +31,8 @@ @PublicApi public record GanttDescription(String id, String label, Function idProvider, Function labelProvider, Function targetObjectIdProvider, Predicate canCreatePredicate, List taskDescriptions, Consumer createTaskProvider, - Consumer editTaskProvider, Consumer deleteTaskProvider, Consumer dropTaskProvider, Consumer createTaskDependencyProvider) implements IRepresentationDescription { + Consumer editTaskProvider, Consumer deleteTaskProvider, Consumer dropTaskProvider, Consumer createTaskDependencyProvider, + Function dateRoundingProvider) implements IRepresentationDescription { public static final String LABEL = "label"; @@ -63,6 +64,7 @@ public record GanttDescription(String id, String label, Function taskDescriptions; + private Function dateRoundingProvider; + private Builder(String id) { this.id = Objects.requireNonNull(id); } @@ -181,9 +185,14 @@ public Builder taskDescriptions(List taskDescriptions) { return this; } + public Builder dateRoundingProvider(Function dateRoundingProvider) { + this.dateRoundingProvider = Objects.requireNonNull(dateRoundingProvider); + return this; + } + public GanttDescription build() { GanttDescription ganttDescription = new GanttDescription(this.id, this.label, this.idProvider, this.labelProvider, this.targetObjectIdProvider, this.canCreatePredicate, - this.taskDescriptions, this.createTaskProvider, this.editTaskProvider, this.deleteTaskProvider, this.dropTaskProvider, this.createTaskDependencyProvider); + this.taskDescriptions, this.createTaskProvider, this.editTaskProvider, this.deleteTaskProvider, this.dropTaskProvider, this.createTaskDependencyProvider, this.dateRoundingProvider); return ganttDescription; } } diff --git a/packages/gantt/backend/sirius-components-gantt/src/main/java/org/eclipse/sirius/components/gantt/renderer/GanttElementFactory.java b/packages/gantt/backend/sirius-components-gantt/src/main/java/org/eclipse/sirius/components/gantt/renderer/GanttElementFactory.java index 6a4793a10dc..fdc816eecbb 100644 --- a/packages/gantt/backend/sirius-components-gantt/src/main/java/org/eclipse/sirius/components/gantt/renderer/GanttElementFactory.java +++ b/packages/gantt/backend/sirius-components-gantt/src/main/java/org/eclipse/sirius/components/gantt/renderer/GanttElementFactory.java @@ -48,7 +48,7 @@ private Gantt instantiateGantt(GanttElementProps props, List children) { .map(Task.class::cast) .toList(); - return new Gantt(props.id(), props.descriptionId(), props.targetObjectId(), props.label(), tasks, props.columns()); + return new Gantt(props.id(), props.descriptionId(), props.targetObjectId(), props.label(), tasks, props.columns(), props.dateRounding()); } private Task instantiateTask(TaskElementProps props, List children) { @@ -58,7 +58,7 @@ private Task instantiateTask(TaskElementProps props, List children) { .toList(); TaskDetail detail = props.detail(); - if (detail.computeStartEndDynamically()) { + if (detail.computeStartEndDynamically() && !subTasks.isEmpty()) { Instant startTime = subTasks.stream() .filter(task -> task.detail().startTime() != null) diff --git a/packages/gantt/backend/sirius-components-gantt/src/main/java/org/eclipse/sirius/components/gantt/renderer/component/GanttComponent.java b/packages/gantt/backend/sirius-components-gantt/src/main/java/org/eclipse/sirius/components/gantt/renderer/component/GanttComponent.java index 60064d29517..c2b1dcf2224 100644 --- a/packages/gantt/backend/sirius-components-gantt/src/main/java/org/eclipse/sirius/components/gantt/renderer/component/GanttComponent.java +++ b/packages/gantt/backend/sirius-components-gantt/src/main/java/org/eclipse/sirius/components/gantt/renderer/component/GanttComponent.java @@ -19,9 +19,13 @@ import java.util.Objects; import java.util.Optional; import java.util.UUID; +import java.util.regex.Matcher; +import java.util.regex.Pattern; import org.eclipse.sirius.components.gantt.Gantt; import org.eclipse.sirius.components.gantt.GanttColumn; +import org.eclipse.sirius.components.gantt.GanttDateRounding; +import org.eclipse.sirius.components.gantt.GanttDateRoundingTimeUnit; import org.eclipse.sirius.components.gantt.Task; import org.eclipse.sirius.components.gantt.description.GanttDescription; import org.eclipse.sirius.components.gantt.description.TaskDescription; @@ -54,6 +58,8 @@ public Element render() { String targetObjectId = ganttDescription.targetObjectIdProvider().apply(variableManager); String label = optionalPreviousGantt.map(Gantt::getLabel).orElseGet(() -> ganttDescription.labelProvider().apply(variableManager)); List columns = computeColumn(optionalPreviousGantt); + String dateRoundingString = ganttDescription.dateRoundingProvider().apply(variableManager); + GanttDateRounding dateRounding = getDateRounding(dateRoundingString); List previousTasks = optionalPreviousGantt.map(Gantt::tasks).orElse(List.of()); @@ -66,10 +72,35 @@ public Element render() { return new Element(TaskDescriptionComponent.class, taskComponentProps); }).toList(); - GanttElementProps ganttElementProps = new GanttElementProps(ganttId, ganttDescription.getId(), targetObjectId, label, children, columns); + GanttElementProps ganttElementProps = new GanttElementProps(ganttId, ganttDescription.getId(), targetObjectId, label, children, columns, dateRounding); return new Element(GanttElementProps.TYPE, ganttElementProps); } + private GanttDateRounding getDateRounding(String dateRoundingString) { + GanttDateRounding ganttDateRounding = new GanttDateRounding(1, GanttDateRoundingTimeUnit.DAY); + + String regex = "^(\\d+)([DHm])$"; + Pattern compile = Pattern.compile(regex); + Matcher matcher = compile.matcher(dateRoundingString); + if (matcher.find()) { + try { + Integer value = Integer.parseInt(matcher.group(1)); + String timeUnitLetter = matcher.group(2); + if ("m".equals(timeUnitLetter)) { + ganttDateRounding = new GanttDateRounding(value, GanttDateRoundingTimeUnit.MINUTE); + } else if ("H".equals(timeUnitLetter)) { + ganttDateRounding = new GanttDateRounding(value, GanttDateRoundingTimeUnit.HOUR); + } else if ("D".equals(timeUnitLetter)) { + ganttDateRounding = new GanttDateRounding(value, GanttDateRoundingTimeUnit.DAY); + } + } catch (IllegalStateException | NumberFormatException | IndexOutOfBoundsException e) { + // do nothing + } + } + return ganttDateRounding; + } + + private List computeColumn(Optional optionalPreviousGantt) { return optionalPreviousGantt.map(previousGantt -> { List columns = previousGantt.columns(); diff --git a/packages/gantt/backend/sirius-components-gantt/src/main/java/org/eclipse/sirius/components/gantt/renderer/elements/GanttElementProps.java b/packages/gantt/backend/sirius-components-gantt/src/main/java/org/eclipse/sirius/components/gantt/renderer/elements/GanttElementProps.java index 19c2cf1917c..3159543aa3b 100644 --- a/packages/gantt/backend/sirius-components-gantt/src/main/java/org/eclipse/sirius/components/gantt/renderer/elements/GanttElementProps.java +++ b/packages/gantt/backend/sirius-components-gantt/src/main/java/org/eclipse/sirius/components/gantt/renderer/elements/GanttElementProps.java @@ -16,6 +16,7 @@ import java.util.Objects; import org.eclipse.sirius.components.gantt.GanttColumn; +import org.eclipse.sirius.components.gantt.GanttDateRounding; import org.eclipse.sirius.components.representations.Element; import org.eclipse.sirius.components.representations.IProps; @@ -24,7 +25,7 @@ * * @author lfasani */ -public record GanttElementProps(String id, String descriptionId, String targetObjectId, String label, List children, List columns) implements IProps { +public record GanttElementProps(String id, String descriptionId, String targetObjectId, String label, List children, List columns, GanttDateRounding dateRounding) implements IProps { public static final String TYPE = "Gantt"; @@ -35,6 +36,7 @@ public record GanttElementProps(String id, String descriptionId, String targetOb Objects.requireNonNull(label); Objects.requireNonNull(children); Objects.requireNonNull(columns); + Objects.requireNonNull(dateRounding); } @Override diff --git a/packages/gantt/frontend/sirius-components-gantt/package.json b/packages/gantt/frontend/sirius-components-gantt/package.json index 82db86540e7..be4fb59480b 100644 --- a/packages/gantt/frontend/sirius-components-gantt/package.json +++ b/packages/gantt/frontend/sirius-components-gantt/package.json @@ -31,7 +31,7 @@ }, "peerDependencies": { "@apollo/client": "3.10.4", - "@ObeoNetwork/gantt-task-react": "0.4.14", + "@ObeoNetwork/gantt-task-react": "0.4.16", "@eclipse-sirius/sirius-components-core": "*", "@material-ui/core": "4.12.4", "@material-ui/icons": "4.11.3", @@ -47,7 +47,7 @@ "@eclipse-sirius/sirius-components-tsconfig": "*", "@material-ui/core": "4.12.4", "@material-ui/icons": "4.11.3", - "@ObeoNetwork/gantt-task-react": "0.4.14", + "@ObeoNetwork/gantt-task-react": "0.4.16", "@types/react": "17.0.37", "@vitejs/plugin-react": "4.3.0", "@xstate/react": "1.6.3", diff --git a/packages/gantt/frontend/sirius-components-gantt/src/graphql/subscription/GanttSubscription.types.ts b/packages/gantt/frontend/sirius-components-gantt/src/graphql/subscription/GanttSubscription.types.ts index de7caee36c4..52e712bbac0 100644 --- a/packages/gantt/frontend/sirius-components-gantt/src/graphql/subscription/GanttSubscription.types.ts +++ b/packages/gantt/frontend/sirius-components-gantt/src/graphql/subscription/GanttSubscription.types.ts @@ -57,6 +57,18 @@ export interface GQLGantt { backgroundColor: string; tasks: GQLTask[]; columns: GQLColumn[]; + dateRounding: GQLGanttDateRounding; +} + +export interface GQLGanttDateRounding { + value: number; + timeUnit: GQLRepresentationMetadata; +} + +export enum GQLGanttDateRoundingTimeUnit { + MINUTE, + HOUR, + DAY, } export interface GQLTask { diff --git a/packages/gantt/frontend/sirius-components-gantt/src/graphql/subscription/ganttSubscription.ts b/packages/gantt/frontend/sirius-components-gantt/src/graphql/subscription/ganttSubscription.ts index 6164038fec7..8ec0463d33c 100644 --- a/packages/gantt/frontend/sirius-components-gantt/src/graphql/subscription/ganttSubscription.ts +++ b/packages/gantt/frontend/sirius-components-gantt/src/graphql/subscription/ganttSubscription.ts @@ -32,6 +32,10 @@ export const ganttEventSubscription = gql` label } targetObjectId + dateRounding { + value + timeUnit + } tasks { ...taskFields subTasks { diff --git a/packages/gantt/frontend/sirius-components-gantt/src/helper/helper.tsx b/packages/gantt/frontend/sirius-components-gantt/src/helper/helper.tsx index e50f7b22de3..51aba4b8370 100644 --- a/packages/gantt/frontend/sirius-components-gantt/src/helper/helper.tsx +++ b/packages/gantt/frontend/sirius-components-gantt/src/helper/helper.tsx @@ -10,7 +10,16 @@ * Contributors: * Obeo - initial API and implementation *******************************************************************************/ -import { Column, ColumnProps, Dependency, TaskOrEmpty, TaskType, TitleColumn } from '@ObeoNetwork/gantt-task-react'; +import { + Column, + ColumnProps, + DateExtremity, + Dependency, + TaskOrEmpty, + TaskType, + TitleColumn, +} from '@ObeoNetwork/gantt-task-react'; +import { BarMoveAction } from '@ObeoNetwork/gantt-task-react/dist/types/gantt-task-actions'; import { GQLColumn, GQLGantt, @@ -180,3 +189,88 @@ export const getDisplayedColumns = (gqlColumns: GQLColumn[]): Column[] => { export const getSelectedColumns = (gqlColumns: GQLColumn[]) => { return gqlColumns.filter((col) => col.displayed === true).map((col) => TaskListColumnEnum[col.id]); }; + +const getDayOfTheYear = (date: Date) => { + const start = new Date(date.getFullYear(), 0, 0); + const diff = date.getTime() - start.getTime() + (start.getTimezoneOffset() - date.getTimezoneOffset()) * 60 * 1000; + const oneDay = 1000 * 60 * 60 * 24; + const day = Math.floor(diff / oneDay); + return day; +}; + +export const roundDate = ( + date: Date, + dateExtremity: DateExtremity, + action: BarMoveAction, + dateMoveStep: String +): Date => { + const regex = /^(\d+)([DHm])$/; + const matches = dateMoveStep.match(regex); + + if (matches && matches[1]) { + let value = parseInt(matches[1], 10); + const dimension = matches[2]; + const newdate = new Date(date); + if (dimension == 'D') { + let dayOfTheYear: number = getDayOfTheYear(newdate); + if (newdate.getMinutes() != 0 || newdate.getHours() != 0 || (dayOfTheYear - 1) % value > 0) { + newdate.setMinutes(0); + newdate.setHours(0); + if (dateExtremity == 'start' || action == 'move') { + // In case of move we need to round start and end date with the same direction (floor) so that the duration keeps unchanged + dayOfTheYear = Math.floor((dayOfTheYear - 1) / value) * value + 1; + } else if (dateExtremity == 'end') { + dayOfTheYear = Math.ceil(dayOfTheYear / value) * value + 1; + } + // setDate behaves differently according to the current date so ensure to start from the first day in the year + newdate.setMonth(0); + newdate.setDate(1); + newdate.setDate(dayOfTheYear); + } + } else if (dimension == 'H') { + if (newdate.getMinutes() != 0 || newdate.getHours() % value > 0) { + newdate.setMinutes(0); + let hours = newdate.getHours(); + if (dateExtremity == 'start' || action == 'move') { + // In case of move we need to round start and end date with the same direction (floor) so that the duration keeps unchanged + hours = Math.floor(newdate.getHours() / value) * value; + } else if (dateExtremity == 'end') { + hours = Math.ceil(newdate.getHours() / value) * value; + } + newdate.setHours(hours); + } + } else if (dimension == 'm') { + if (newdate.getMinutes() % value > 0) { + let minutes = newdate.getMinutes(); + if (dateExtremity == 'start' || action == 'move') { + // In case of move we need to round start and end date with the same direction (floor) so that the duration keeps unchanged + minutes = Math.floor(newdate.getMinutes() / value) * value; + } else if (dateExtremity == 'end') { + minutes = Math.ceil(newdate.getMinutes() / value) * value; + } + newdate.setMinutes(minutes); + } + } + newdate.setSeconds(0); + return newdate; + } else { + return new Date(date); + } +}; + +export const checkIsHoliday = (date: Date, _, __, dateExtremity: DateExtremity) => { + const day = date.getDay(); + + let isHoliday = false; + const isMondayStart = date.getDay() == 1 && date.getHours() == 0 && date.getMinutes() == 0; + const isStaturdayStart = date.getDay() == 6 && date.getHours() == 0 && date.getMinutes() == 0; + if (dateExtremity == 'start') { + //Monday 00:00 is excluded from WE + isHoliday = day == 6 || (day == 0 && !isMondayStart); + } else if (dateExtremity == 'end') { + //Saturday 00:00 is included from WE + isHoliday = (day == 6 && !isStaturdayStart) || day == 0 || isMondayStart; + } + + return isHoliday; +}; diff --git a/packages/gantt/frontend/sirius-components-gantt/src/representation/Gantt.tsx b/packages/gantt/frontend/sirius-components-gantt/src/representation/Gantt.tsx index a8efb8040a0..0c1ba484a17 100644 --- a/packages/gantt/frontend/sirius-components-gantt/src/representation/Gantt.tsx +++ b/packages/gantt/frontend/sirius-components-gantt/src/representation/Gantt.tsx @@ -14,6 +14,7 @@ import '@ObeoNetwork/gantt-task-react'; import { ColorStyles, Column, + DateExtremity, Distances, Gantt as GanttDiagram, Icons, @@ -27,13 +28,14 @@ import { ViewMode, } from '@ObeoNetwork/gantt-task-react'; import '@ObeoNetwork/gantt-task-react/dist/style.css'; +import { BarMoveAction } from '@ObeoNetwork/gantt-task-react/dist/types/gantt-task-actions'; import { Selection } from '@eclipse-sirius/sirius-components-core'; import { Theme, makeStyles, useTheme } from '@material-ui/core/styles'; import ChevronRightIcon from '@material-ui/icons/ChevronRight'; import ExpandMoreIcon from '@material-ui/icons/ExpandMore'; import { useEffect, useRef, useState } from 'react'; import { SelectableTask } from '../graphql/subscription/GanttSubscription.types'; -import { getDisplayedColumns, getSelectedColumns } from '../helper/helper'; +import { checkIsHoliday, getDisplayedColumns, getSelectedColumns, roundDate } from '../helper/helper'; import { getContextalPalette } from '../palette/ContextualPalette'; import { Toolbar } from '../toolbar/Toolbar'; import { GanttProps, GanttState, TaskListColumnEnum } from './Gantt.types'; @@ -59,6 +61,7 @@ export const Gantt = ({ representationId, tasks, gqlColumns, + dateRounding, setSelection, onCreateTask, onEditTask, @@ -259,8 +262,11 @@ export const Gantt = ({ onDelete={onDeleteTask} onDoubleClick={(task) => onChangeTaskCollapseState(task.id, !task.hideChildren)} onClick={handleSelection} - roundEndDate={(date: Date) => date} - roundStartDate={(date: Date) => date} + roundDate={(date: Date, _: ViewMode, dateExtremity: DateExtremity, action: BarMoveAction) => + roundDate(date, dateExtremity, action, dateRounding) + } + checkIsHoliday={checkIsHoliday} + dateMoveStep={dateRounding} onWheel={onwheel} ContextualPalette={getContextalPalette({ onCreateTask, diff --git a/packages/gantt/frontend/sirius-components-gantt/src/representation/Gantt.types.ts b/packages/gantt/frontend/sirius-components-gantt/src/representation/Gantt.types.ts index deb55563c8d..30f1853b896 100644 --- a/packages/gantt/frontend/sirius-components-gantt/src/representation/Gantt.types.ts +++ b/packages/gantt/frontend/sirius-components-gantt/src/representation/Gantt.types.ts @@ -34,6 +34,7 @@ export interface GanttProps { representationId: string; tasks: TaskOrEmpty[]; gqlColumns: GQLColumn[]; + dateRounding: string; setSelection: (selection: Selection) => void; onCreateTask: (task: Task) => void; onEditTask: (task: TaskOrEmpty) => void; diff --git a/packages/gantt/frontend/sirius-components-gantt/src/representation/GanttRepresentation.tsx b/packages/gantt/frontend/sirius-components-gantt/src/representation/GanttRepresentation.tsx index 5bf4e1949ac..d4cb65d9ecf 100644 --- a/packages/gantt/frontend/sirius-components-gantt/src/representation/GanttRepresentation.tsx +++ b/packages/gantt/frontend/sirius-components-gantt/src/representation/GanttRepresentation.tsx @@ -148,6 +148,8 @@ export const GanttRepresentation = ({ editingContextId, representationId }: Repr representationId={representationId} tasks={tasks} gqlColumns={gantt.columns} + dateRounding={'1D'} + // WIP dateRounding={gantt.dateRounding} setSelection={setSelection} onCreateTask={createTask} onEditTask={handleEditTask} diff --git a/packages/gantt/frontend/sirius-components-gantt/src/toolbar/Toolbar.tsx b/packages/gantt/frontend/sirius-components-gantt/src/toolbar/Toolbar.tsx index 982512c6d95..898d2ab59df 100644 --- a/packages/gantt/frontend/sirius-components-gantt/src/toolbar/Toolbar.tsx +++ b/packages/gantt/frontend/sirius-components-gantt/src/toolbar/Toolbar.tsx @@ -205,6 +205,7 @@ export const Toolbar = ({ Quarter Day Half Day Day + Two Days Week Month Year diff --git a/packages/sirius-web/frontend/sirius-web/package.json b/packages/sirius-web/frontend/sirius-web/package.json index 3ca4dc58a19..a12db4ee495 100644 --- a/packages/sirius-web/frontend/sirius-web/package.json +++ b/packages/sirius-web/frontend/sirius-web/package.json @@ -30,7 +30,7 @@ "@material-ui/core": "4.12.4", "@material-ui/icons": "4.11.3", "@material-ui/lab": "4.0.0-alpha.61", - "@ObeoNetwork/gantt-task-react": "0.4.14", + "@ObeoNetwork/gantt-task-react": "0.4.16", "@ObeoNetwork/react-trello": "2.4.11", "@types/react": "17.0.37", "@types/react-router-dom": "5.3.3", diff --git a/packages/starters/backend/sirius-components-task-starter/src/main/java/org/eclipse/sirius/components/task/starter/configuration/TaskExampleBuilder.java b/packages/starters/backend/sirius-components-task-starter/src/main/java/org/eclipse/sirius/components/task/starter/configuration/TaskExampleBuilder.java index 5ed1e42a01e..b7d43891609 100644 --- a/packages/starters/backend/sirius-components-task-starter/src/main/java/org/eclipse/sirius/components/task/starter/configuration/TaskExampleBuilder.java +++ b/packages/starters/backend/sirius-components-task-starter/src/main/java/org/eclipse/sirius/components/task/starter/configuration/TaskExampleBuilder.java @@ -108,15 +108,18 @@ private Project createDevProject(Person paul, Person peter) { codeDev.setEndTime(Instant.parse(DATE_2023_12_15T17_30_00Z)); codeDev.getAssignedPersons().add(peter); codeDev.setComputeStartEndDynamically(false); + codeDev.setProgress(40); Task frontDev = TaskFactory.eINSTANCE.createTask(); frontDev.setName("Front"); frontDev.setStartTime(Instant.parse(DATE_2023_12_13T08_30_00Z)); frontDev.setEndTime(Instant.parse("2023-12-14T17:30:00Z")); + frontDev.setProgress(30); frontDev.getAssignedPersons().add(peter); Task backDev = TaskFactory.eINSTANCE.createTask(); backDev.setName("Back"); backDev.setStartTime(Instant.parse("2023-12-14T14:00:00Z")); backDev.setEndTime(Instant.parse(DATE_2023_12_16T17_30_00Z)); + backDev.setProgress(40); backDev.getAssignedPersons().add(paul); codeDev.getSubTasks().addAll(List.of(frontDev, backDev)); @@ -306,7 +309,7 @@ private Project createOKRProject(Person paul, Person peter) { keyResultTestsOK.getSubTasks().addAll(List.of(manualsTest, automaticTests)); objectiveAppicationRunning.getOwnedKeyResults().addAll(List.of(keyResultDevCompleted, keyResultTestsOK)); - okrProject.getOwnedObjectives().addAll(List.of(objectiveAppicationRunning)); + okrProject.getOwnedObjectives().add(objectiveAppicationRunning); return okrProject; } diff --git a/packages/starters/backend/sirius-components-task-starter/src/main/java/org/eclipse/sirius/components/task/starter/configuration/view/TaskJavaService.java b/packages/starters/backend/sirius-components-task-starter/src/main/java/org/eclipse/sirius/components/task/starter/configuration/view/TaskJavaService.java index c9855b198c9..11fb9c4d8f5 100644 --- a/packages/starters/backend/sirius-components-task-starter/src/main/java/org/eclipse/sirius/components/task/starter/configuration/view/TaskJavaService.java +++ b/packages/starters/backend/sirius-components-task-starter/src/main/java/org/eclipse/sirius/components/task/starter/configuration/view/TaskJavaService.java @@ -79,9 +79,11 @@ public void createTask(EObject context) { EObject parent = context.eContainer(); if (parent instanceof Project project) { - project.getOwnedTasks().add(task); + int index = project.getOwnedTasks().indexOf(context); + project.getOwnedTasks().add(index + 1, task); } else if (parent instanceof AbstractTask parentTask) { - parentTask.getSubTasks().add(task); + int index = parentTask.getSubTasks().indexOf(context); + parentTask.getSubTasks().add(index + 1, task); } } else if (context instanceof Project project) { long epochSecondStartTime = Instant.now().getEpochSecond(); @@ -202,6 +204,10 @@ private void moveTaskInSubTasks(Task sourceTask, int indexInTarget, Task targetT targetTask.getSubTasks().move(subTasks.size() - 1, sourceTask); } } else { + boolean targetHadNoChild = subTasks.isEmpty(); + if (targetHadNoChild) { + targetTask.setComputeStartEndDynamically(true); + } if (indexInTarget >= 0 && indexInTarget <= targetTask.getSubTasks().size()) { targetTask.getSubTasks().add(indexInTarget, sourceTask); } else { diff --git a/packages/starters/backend/sirius-components-task-starter/src/test/java/org/eclipse/sirius/components/task/starter/configuration/view/TaskJavaServiceTests.java b/packages/starters/backend/sirius-components-task-starter/src/test/java/org/eclipse/sirius/components/task/starter/configuration/view/TaskJavaServiceTests.java index f3b684aed21..29c3e7ada2c 100644 --- a/packages/starters/backend/sirius-components-task-starter/src/test/java/org/eclipse/sirius/components/task/starter/configuration/view/TaskJavaServiceTests.java +++ b/packages/starters/backend/sirius-components-task-starter/src/test/java/org/eclipse/sirius/components/task/starter/configuration/view/TaskJavaServiceTests.java @@ -102,13 +102,13 @@ void createTask() { service.createTask(task1); assertThat(project.getOwnedTasks()).hasSize(3); - assertThat(project.getOwnedTasks().get(2).getStartTime()).isEqualTo(Instant.ofEpochSecond(1704157260)); - assertThat(project.getOwnedTasks().get(2).getEndTime()).isEqualTo(Instant.ofEpochSecond(2 * 1704157260 - 1704067200)); + assertThat(project.getOwnedTasks().get(1).getStartTime()).isEqualTo(Instant.ofEpochSecond(1704157260)); + assertThat(project.getOwnedTasks().get(1).getEndTime()).isEqualTo(Instant.ofEpochSecond(2L * 1704157260 - 1704067200)); service.createTask(task11); assertThat(task1.getSubTasks()).hasSize(2); assertThat(task1.getSubTasks().get(1).getStartTime()).isEqualTo(Instant.ofEpochSecond(1704157260)); - assertThat(task1.getSubTasks().get(1).getEndTime()).isEqualTo(Instant.ofEpochSecond(2 * 1704157260 - 1704067200)); + assertThat(task1.getSubTasks().get(1).getEndTime()).isEqualTo(Instant.ofEpochSecond(2L * 1704157260 - 1704067200)); } diff --git a/packages/task/backend/sirius-components-task/src/main/java/org/eclipse/sirius/components/task/AbstractTask.java b/packages/task/backend/sirius-components-task/src/main/java/org/eclipse/sirius/components/task/AbstractTask.java index eef6906c924..e51055eb58b 100644 --- a/packages/task/backend/sirius-components-task/src/main/java/org/eclipse/sirius/components/task/AbstractTask.java +++ b/packages/task/backend/sirius-components-task/src/main/java/org/eclipse/sirius/components/task/AbstractTask.java @@ -154,13 +154,13 @@ public interface AbstractTask extends EObject { void setProgress(int value); /** - * Returns the value of the 'Compute Start End Dynamically' attribute. + * Returns the value of the 'Compute Start End Dynamically' attribute. The default value is + * "true". * * @return the value of the 'Compute Start End Dynamically' attribute. * @see #setComputeStartEndDynamically(boolean) * @see org.eclipse.sirius.components.task.TaskPackage#getAbstractTask_ComputeStartEndDynamically() - * @model + * @model default="true" * @generated */ boolean isComputeStartEndDynamically(); diff --git a/packages/task/backend/sirius-components-task/src/main/java/org/eclipse/sirius/components/task/impl/AbstractTaskImpl.java b/packages/task/backend/sirius-components-task/src/main/java/org/eclipse/sirius/components/task/impl/AbstractTaskImpl.java index 4c233cc8793..7d57fcccd04 100644 --- a/packages/task/backend/sirius-components-task/src/main/java/org/eclipse/sirius/components/task/impl/AbstractTaskImpl.java +++ b/packages/task/backend/sirius-components-task/src/main/java/org/eclipse/sirius/components/task/impl/AbstractTaskImpl.java @@ -164,7 +164,7 @@ public abstract class AbstractTaskImpl extends MinimalEObjectImpl.Container impl * @generated * @ordered */ - protected static final boolean COMPUTE_START_END_DYNAMICALLY_EDEFAULT = false; + protected static final boolean COMPUTE_START_END_DYNAMICALLY_EDEFAULT = true; /** * The cached value of the '{@link #isComputeStartEndDynamically() Compute Start End Dynamically}' diff --git a/packages/task/backend/sirius-components-task/src/main/java/org/eclipse/sirius/components/task/impl/TaskPackageImpl.java b/packages/task/backend/sirius-components-task/src/main/java/org/eclipse/sirius/components/task/impl/TaskPackageImpl.java index 4cb9232b4f6..c3672456e8c 100644 --- a/packages/task/backend/sirius-components-task/src/main/java/org/eclipse/sirius/components/task/impl/TaskPackageImpl.java +++ b/packages/task/backend/sirius-components-task/src/main/java/org/eclipse/sirius/components/task/impl/TaskPackageImpl.java @@ -699,7 +699,7 @@ public void initializePackageContents() { !IS_DERIVED, IS_ORDERED); this.initEAttribute(this.getAbstractTask_Progress(), this.ecorePackage.getEInt(), "progress", null, 0, 1, AbstractTask.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - this.initEAttribute(this.getAbstractTask_ComputeStartEndDynamically(), this.ecorePackage.getEBoolean(), "computeStartEndDynamically", null, 0, 1, AbstractTask.class, !IS_TRANSIENT, + this.initEAttribute(this.getAbstractTask_ComputeStartEndDynamically(), this.ecorePackage.getEBoolean(), "computeStartEndDynamically", "true", 0, 1, AbstractTask.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); this.initEReference(this.getAbstractTask_Tags(), this.getTaskTag(), null, "tags", null, 0, -1, AbstractTask.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); diff --git a/packages/task/backend/sirius-components-task/src/main/resources/model/task.ecore b/packages/task/backend/sirius-components-task/src/main/resources/model/task.ecore index c973cc57e37..50649d223a9 100644 --- a/packages/task/backend/sirius-components-task/src/main/resources/model/task.ecore +++ b/packages/task/backend/sirius-components-task/src/main/resources/model/task.ecore @@ -28,7 +28,7 @@ + eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean" defaultValueLiteral="true"/> diff --git a/packages/view/backend/sirius-components-view-builder/src/main/java/org/eclipse/sirius/components/view/builder/generated/ConditionalTaskStyleBuilder.java b/packages/view/backend/sirius-components-view-builder/src/main/java/org/eclipse/sirius/components/view/builder/generated/ConditionalTaskStyleBuilder.java deleted file mode 100644 index ad3ccdb0dd9..00000000000 --- a/packages/view/backend/sirius-components-view-builder/src/main/java/org/eclipse/sirius/components/view/builder/generated/ConditionalTaskStyleBuilder.java +++ /dev/null @@ -1,65 +0,0 @@ -/******************************************************************************* - * 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 ConditionalTaskStyleBuilder. - * - * @author BuilderGenerator - * @generated - */ -public class ConditionalTaskStyleBuilder { - - /** - * Create instance org.eclipse.sirius.components.view.gantt.ConditionalTaskStyle. - * @generated - */ - private org.eclipse.sirius.components.view.gantt.ConditionalTaskStyle conditionalTaskStyle = org.eclipse.sirius.components.view.gantt.GanttFactory.eINSTANCE.createConditionalTaskStyle(); - - /** - * Return instance org.eclipse.sirius.components.view.gantt.ConditionalTaskStyle. - * @generated - */ - protected org.eclipse.sirius.components.view.gantt.ConditionalTaskStyle getConditionalTaskStyle() { - return this.conditionalTaskStyle; - } - - /** - * Return instance org.eclipse.sirius.components.view.gantt.ConditionalTaskStyle. - * @generated - */ - public org.eclipse.sirius.components.view.gantt.ConditionalTaskStyle build() { - return this.getConditionalTaskStyle(); - } - - /** - * Setter for Condition. - * - * @generated - */ - public ConditionalTaskStyleBuilder condition(java.lang.String value) { - this.getConditionalTaskStyle().setCondition(value); - return this; - } - /** - * Setter for Style. - * - * @generated - */ - public ConditionalTaskStyleBuilder style(org.eclipse.sirius.components.view.gantt.TaskStyleDescription value) { - this.getConditionalTaskStyle().setStyle(value); - return this; - } - -} - diff --git a/packages/view/backend/sirius-components-view-builder/src/main/java/org/eclipse/sirius/components/view/builder/generated/GanttBuilders.java b/packages/view/backend/sirius-components-view-builder/src/main/java/org/eclipse/sirius/components/view/builder/generated/GanttBuilders.java index d7ce19a44b9..193db7ebf59 100644 --- a/packages/view/backend/sirius-components-view-builder/src/main/java/org/eclipse/sirius/components/view/builder/generated/GanttBuilders.java +++ b/packages/view/backend/sirius-components-view-builder/src/main/java/org/eclipse/sirius/components/view/builder/generated/GanttBuilders.java @@ -39,16 +39,6 @@ public TaskDescriptionBuilder newTaskDescription() { return new TaskDescriptionBuilder(); } - /** - * Instantiate a ConditionalTaskStyleBuilder . - * - * @author BuilderGenerator - * @generated - */ - public ConditionalTaskStyleBuilder newConditionalTaskStyle() { - return new ConditionalTaskStyleBuilder(); - } - /** * Instantiate a CreateTaskToolBuilder . * diff --git a/packages/view/backend/sirius-components-view-builder/src/main/java/org/eclipse/sirius/components/view/builder/generated/GanttDescriptionBuilder.java b/packages/view/backend/sirius-components-view-builder/src/main/java/org/eclipse/sirius/components/view/builder/generated/GanttDescriptionBuilder.java index 58d2b1f7099..ea649b2e60a 100644 --- a/packages/view/backend/sirius-components-view-builder/src/main/java/org/eclipse/sirius/components/view/builder/generated/GanttDescriptionBuilder.java +++ b/packages/view/backend/sirius-components-view-builder/src/main/java/org/eclipse/sirius/components/view/builder/generated/GanttDescriptionBuilder.java @@ -90,15 +90,6 @@ public GanttDescriptionBuilder taskElementDescriptions(org.eclipse.sirius.compon return this; } - /** - * Setter for BackgroundColor. - * - * @generated - */ - public GanttDescriptionBuilder backgroundColor(org.eclipse.sirius.components.view.UserColor value) { - this.getGanttDescription().setBackgroundColor(value); - return this; - } /** * Setter for CreateTool. * @@ -147,5 +138,15 @@ public GanttDescriptionBuilder createTaskDependencyTool(org.eclipse.sirius.compo return this; } + /** + * Setter for DateRoundingExpression. + * + * @generated + */ + public GanttDescriptionBuilder dateRoundingExpression(java.lang.String value) { + this.getGanttDescription().setDateRoundingExpression(value); + return this; + } + } diff --git a/packages/view/backend/sirius-components-view-builder/src/main/java/org/eclipse/sirius/components/view/builder/generated/TaskDescriptionBuilder.java b/packages/view/backend/sirius-components-view-builder/src/main/java/org/eclipse/sirius/components/view/builder/generated/TaskDescriptionBuilder.java index b26ffd7c4d3..f372b26979f 100644 --- a/packages/view/backend/sirius-components-view-builder/src/main/java/org/eclipse/sirius/components/view/builder/generated/TaskDescriptionBuilder.java +++ b/packages/view/backend/sirius-components-view-builder/src/main/java/org/eclipse/sirius/components/view/builder/generated/TaskDescriptionBuilder.java @@ -136,27 +136,6 @@ public TaskDescriptionBuilder taskDependenciesExpression(java.lang.String value) return this; } - /** - * Setter for Style. - * - * @generated - */ - public TaskDescriptionBuilder style(org.eclipse.sirius.components.view.gantt.TaskStyleDescription value) { - this.getTaskDescription().setStyle(value); - return this; - } - /** - * Setter for ConditionalStyles. - * - * @generated - */ - public TaskDescriptionBuilder conditionalStyles(org.eclipse.sirius.components.view.gantt.ConditionalTaskStyle ... values) { - for (org.eclipse.sirius.components.view.gantt.ConditionalTaskStyle value : values) { - this.getTaskDescription().getConditionalStyles().add(value); - } - return this; - } - /** * Setter for SubTaskElementDescriptions. * diff --git a/packages/view/backend/sirius-components-view-builder/src/main/java/org/eclipse/sirius/components/view/builder/generated/TaskStyleDescriptionBuilder.java b/packages/view/backend/sirius-components-view-builder/src/main/java/org/eclipse/sirius/components/view/builder/generated/TaskStyleDescriptionBuilder.java deleted file mode 100644 index 65f0e62bcfe..00000000000 --- a/packages/view/backend/sirius-components-view-builder/src/main/java/org/eclipse/sirius/components/view/builder/generated/TaskStyleDescriptionBuilder.java +++ /dev/null @@ -1,103 +0,0 @@ -/******************************************************************************* - * 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.gantt.TaskStyleDescription. - * - * @author BuilderGenerator - * @generated - */ -public abstract class TaskStyleDescriptionBuilder { - - /** - * Builder for org.eclipse.sirius.components.view.gantt.TaskStyleDescription. - * @generated - */ - protected abstract org.eclipse.sirius.components.view.gantt.TaskStyleDescription getTaskStyleDescription(); - - /** - * Setter for FontSize. - * - * @generated - */ - public TaskStyleDescriptionBuilder fontSize(java.lang.Integer value) { - this.getTaskStyleDescription().setFontSize(value); - return this; - } - /** - * Setter for Italic. - * - * @generated - */ - public TaskStyleDescriptionBuilder italic(java.lang.Boolean value) { - this.getTaskStyleDescription().setItalic(value); - return this; - } - /** - * Setter for Bold. - * - * @generated - */ - public TaskStyleDescriptionBuilder bold(java.lang.Boolean value) { - this.getTaskStyleDescription().setBold(value); - return this; - } - /** - * Setter for Underline. - * - * @generated - */ - public TaskStyleDescriptionBuilder underline(java.lang.Boolean value) { - this.getTaskStyleDescription().setUnderline(value); - return this; - } - /** - * Setter for StrikeThrough. - * - * @generated - */ - public TaskStyleDescriptionBuilder strikeThrough(java.lang.Boolean value) { - this.getTaskStyleDescription().setStrikeThrough(value); - return this; - } - /** - * Setter for LabelColorExpression. - * - * @generated - */ - public TaskStyleDescriptionBuilder labelColorExpression(java.lang.String value) { - this.getTaskStyleDescription().setLabelColorExpression(value); - return this; - } - /** - * Setter for BackgroundColorExpression. - * - * @generated - */ - public TaskStyleDescriptionBuilder backgroundColorExpression(java.lang.String value) { - this.getTaskStyleDescription().setBackgroundColorExpression(value); - return this; - } - /** - * Setter for ProgressColorExpression. - * - * @generated - */ - public TaskStyleDescriptionBuilder progressColorExpression(java.lang.String value) { - this.getTaskStyleDescription().setProgressColorExpression(value); - return this; - } - -} - diff --git a/packages/view/backend/sirius-components-view-emf/src/main/java/org/eclipse/sirius/components/view/emf/gantt/ViewGanttDescriptionConverter.java b/packages/view/backend/sirius-components-view-emf/src/main/java/org/eclipse/sirius/components/view/emf/gantt/ViewGanttDescriptionConverter.java index 1d060534f49..39a31d244dc 100644 --- a/packages/view/backend/sirius-components-view-emf/src/main/java/org/eclipse/sirius/components/view/emf/gantt/ViewGanttDescriptionConverter.java +++ b/packages/view/backend/sirius-components-view-emf/src/main/java/org/eclipse/sirius/components/view/emf/gantt/ViewGanttDescriptionConverter.java @@ -109,6 +109,7 @@ public IRepresentationDescription convert(RepresentationDescription viewRepresen .orElse(variable -> { })) .taskDescriptions(taskDescriptions) + .dateRoundingProvider(variableManager -> this.evaluateString(interpreter, variableManager, viewGanttDescription.getDateRoundingExpression())) .build(); } @@ -132,7 +133,7 @@ private Consumer getOperationsHandler(List operation private TaskDescription convert(org.eclipse.sirius.components.view.gantt.TaskDescription viewTaskDescription, AQLInterpreter interpreter, Map taskDescription2Ids) { List reusedTaskDescriptionIds = viewTaskDescription.getReusedTaskElementDescriptions().stream() - .map(taskDescription -> taskDescription2Ids.get(taskDescription)) + .map(taskDescription2Ids::get) .toList(); List subTaskDescriptions = Optional.ofNullable(viewTaskDescription.getSubTaskElementDescriptions()) @@ -243,7 +244,7 @@ private boolean canCreate(String domainType, String preconditionExpression, Vari private String computeGanttLabel(org.eclipse.sirius.components.view.gantt.GanttDescription viewGanttDescription, VariableManager variableManager, AQLInterpreter interpreter) { String title = variableManager.get(GanttDescription.LABEL, String.class) .orElseGet(() -> this.evaluateString(interpreter, variableManager, viewGanttDescription.getTitleExpression())); - if (title == null || title.isBlank()) { + if (title.isBlank()) { return DEFAULT_GANTT_LABEL; } else { return title; diff --git a/packages/view/backend/sirius-components-view-gantt-edit/src/main/java/org/eclipse/sirius/components/view/gantt/provider/ConditionalTaskStyleItemProvider.java b/packages/view/backend/sirius-components-view-gantt-edit/src/main/java/org/eclipse/sirius/components/view/gantt/provider/ConditionalTaskStyleItemProvider.java deleted file mode 100644 index e8b9a7f65cc..00000000000 --- a/packages/view/backend/sirius-components-view-gantt-edit/src/main/java/org/eclipse/sirius/components/view/gantt/provider/ConditionalTaskStyleItemProvider.java +++ /dev/null @@ -1,148 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2023 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.gantt.provider; - -import java.util.Collection; -import java.util.List; - -import org.eclipse.emf.common.notify.AdapterFactory; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.ecore.EStructuralFeature; -import org.eclipse.emf.edit.provider.IItemPropertyDescriptor; -import org.eclipse.emf.edit.provider.ViewerNotification; -import org.eclipse.sirius.components.view.gantt.ConditionalTaskStyle; -import org.eclipse.sirius.components.view.gantt.GanttPackage; -import org.eclipse.sirius.components.view.provider.ConditionalItemProvider; - -/** - * This is the item provider adapter for a {@link org.eclipse.sirius.components.view.gantt.ConditionalTaskStyle} object. - * - * - * @generated - */ -public class ConditionalTaskStyleItemProvider extends ConditionalItemProvider { - /** - * This constructs an instance from a factory and a notifier. - * - * @generated - */ - public ConditionalTaskStyleItemProvider(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); - - } - return this.itemPropertyDescriptors; - } - - /** - * This specifies how to implement {@link #getChildren} and is used to deduce an appropriate feature for an - * {@link org.eclipse.emf.edit.command.AddCommand}, {@link org.eclipse.emf.edit.command.RemoveCommand} or - * {@link org.eclipse.emf.edit.command.MoveCommand} in {@link #createCommand}. - * - * @generated - */ - @Override - public Collection getChildrenFeatures(Object object) { - if (this.childrenFeatures == null) { - super.getChildrenFeatures(object); - this.childrenFeatures.add(GanttPackage.Literals.CONDITIONAL_TASK_STYLE__STYLE); - } - return this.childrenFeatures; - } - - /** - * - * - * @generated - */ - @Override - protected EStructuralFeature getChildFeature(Object object, Object child) { - // Check the type of the specified child object and return the proper feature to use for - // adding (see {@link AddCommand}) it as a child. - - return super.getChildFeature(object, child); - } - - /** - * This returns ConditionalTaskStyle.gif. - * - * @generated - */ - @Override - public Object getImage(Object object) { - return this.overlayImage(object, this.getResourceLocator().getImage("full/obj16/ConditionalTaskStyle")); - } - - /** - * - * - * @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 = ((ConditionalTaskStyle) object).getCondition(); - return label == null || label.length() == 0 ? this.getString("_UI_ConditionalTaskStyle_type") : this.getString("_UI_ConditionalTaskStyle_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(ConditionalTaskStyle.class)) { - case GanttPackage.CONDITIONAL_TASK_STYLE__STYLE: - this.fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, false)); - return; - } - super.notifyChanged(notification); - } - - /** - * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children that can be created - * under this object. - * - * @generated - */ - @Override - protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { - super.collectNewChildDescriptors(newChildDescriptors, object); - } - -} diff --git a/packages/view/backend/sirius-components-view-gantt-edit/src/main/java/org/eclipse/sirius/components/view/gantt/provider/GanttDescriptionItemProvider.java b/packages/view/backend/sirius-components-view-gantt-edit/src/main/java/org/eclipse/sirius/components/view/gantt/provider/GanttDescriptionItemProvider.java index a7efcc5e134..c69567d11cf 100644 --- a/packages/view/backend/sirius-components-view-gantt-edit/src/main/java/org/eclipse/sirius/components/view/gantt/provider/GanttDescriptionItemProvider.java +++ b/packages/view/backend/sirius-components-view-gantt-edit/src/main/java/org/eclipse/sirius/components/view/gantt/provider/GanttDescriptionItemProvider.java @@ -18,9 +18,10 @@ import org.eclipse.emf.common.notify.AdapterFactory; import org.eclipse.emf.common.notify.Notification; import org.eclipse.emf.ecore.EStructuralFeature; +import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; import org.eclipse.emf.edit.provider.IItemPropertyDescriptor; +import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; import org.eclipse.emf.edit.provider.ViewerNotification; -import org.eclipse.sirius.components.view.ViewFactory; import org.eclipse.sirius.components.view.gantt.GanttDescription; import org.eclipse.sirius.components.view.gantt.GanttFactory; import org.eclipse.sirius.components.view.gantt.GanttPackage; @@ -52,10 +53,24 @@ public List getPropertyDescriptors(Object object) { if (this.itemPropertyDescriptors == null) { super.getPropertyDescriptors(object); + this.addDateRoundingExpressionPropertyDescriptor(object); } return this.itemPropertyDescriptors; } + /** + * This adds a property descriptor for the Date Rounding Expression feature. + * + * @generated + */ + protected void addDateRoundingExpressionPropertyDescriptor(Object object) { + this.itemPropertyDescriptors.add(this.createItemPropertyDescriptor(((ComposeableAdapterFactory) this.adapterFactory).getRootAdapterFactory(), this.getResourceLocator(), + this.getString("_UI_GanttDescription_dateRoundingExpression_feature"), + this.getString("_UI_PropertyDescriptor_description", "_UI_GanttDescription_dateRoundingExpression_feature", "_UI_GanttDescription_type"), + GanttPackage.Literals.GANTT_DESCRIPTION__DATE_ROUNDING_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 @@ -69,7 +84,6 @@ public Collection getChildrenFeatures(Object objec if (this.childrenFeatures == null) { super.getChildrenFeatures(object); this.childrenFeatures.add(GanttPackage.Literals.GANTT_DESCRIPTION__TASK_ELEMENT_DESCRIPTIONS); - this.childrenFeatures.add(GanttPackage.Literals.GANTT_DESCRIPTION__BACKGROUND_COLOR); this.childrenFeatures.add(GanttPackage.Literals.GANTT_DESCRIPTION__CREATE_TOOL); this.childrenFeatures.add(GanttPackage.Literals.GANTT_DESCRIPTION__EDIT_TOOL); this.childrenFeatures.add(GanttPackage.Literals.GANTT_DESCRIPTION__DELETE_TOOL); @@ -135,8 +149,10 @@ public void notifyChanged(Notification notification) { this.updateChildren(notification); switch (notification.getFeatureID(GanttDescription.class)) { + case GanttPackage.GANTT_DESCRIPTION__DATE_ROUNDING_EXPRESSION: + this.fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true)); + return; case GanttPackage.GANTT_DESCRIPTION__TASK_ELEMENT_DESCRIPTIONS: - case GanttPackage.GANTT_DESCRIPTION__BACKGROUND_COLOR: case GanttPackage.GANTT_DESCRIPTION__CREATE_TOOL: case GanttPackage.GANTT_DESCRIPTION__EDIT_TOOL: case GanttPackage.GANTT_DESCRIPTION__DELETE_TOOL: @@ -160,8 +176,6 @@ protected void collectNewChildDescriptors(Collection newChildDescriptors newChildDescriptors.add(this.createChildParameter(GanttPackage.Literals.GANTT_DESCRIPTION__TASK_ELEMENT_DESCRIPTIONS, GanttFactory.eINSTANCE.createTaskDescription())); - newChildDescriptors.add(this.createChildParameter(GanttPackage.Literals.GANTT_DESCRIPTION__BACKGROUND_COLOR, ViewFactory.eINSTANCE.createFixedColor())); - newChildDescriptors.add(this.createChildParameter(GanttPackage.Literals.GANTT_DESCRIPTION__CREATE_TOOL, GanttFactory.eINSTANCE.createCreateTaskTool())); newChildDescriptors.add(this.createChildParameter(GanttPackage.Literals.GANTT_DESCRIPTION__EDIT_TOOL, GanttFactory.eINSTANCE.createEditTaskTool())); diff --git a/packages/view/backend/sirius-components-view-gantt-edit/src/main/java/org/eclipse/sirius/components/view/gantt/provider/GanttItemProviderAdapterFactory.java b/packages/view/backend/sirius-components-view-gantt-edit/src/main/java/org/eclipse/sirius/components/view/gantt/provider/GanttItemProviderAdapterFactory.java index e182aed5e35..caa06ead431 100644 --- a/packages/view/backend/sirius-components-view-gantt-edit/src/main/java/org/eclipse/sirius/components/view/gantt/provider/GanttItemProviderAdapterFactory.java +++ b/packages/view/backend/sirius-components-view-gantt-edit/src/main/java/org/eclipse/sirius/components/view/gantt/provider/GanttItemProviderAdapterFactory.java @@ -144,30 +144,6 @@ public Adapter createTaskDescriptionAdapter() { return this.taskDescriptionItemProvider; } - /** - * This keeps track of the one adapter used for all - * {@link org.eclipse.sirius.components.view.gantt.ConditionalTaskStyle} instances. - * - * @generated - */ - protected ConditionalTaskStyleItemProvider conditionalTaskStyleItemProvider; - - /** - * This creates an adapter for a {@link org.eclipse.sirius.components.view.gantt.ConditionalTaskStyle}. - * - * @generated - */ - @Override - public Adapter createConditionalTaskStyleAdapter() { - if (this.conditionalTaskStyleItemProvider == null) { - this.conditionalTaskStyleItemProvider = new ConditionalTaskStyleItemProvider(this); - } - - return this.conditionalTaskStyleItemProvider; - } - /** * This keeps track of the one adapter used for all {@link org.eclipse.sirius.components.view.gantt.CreateTaskTool} * instances. @@ -417,8 +393,6 @@ public void dispose() { this.ganttDescriptionItemProvider.dispose(); if (this.taskDescriptionItemProvider != null) this.taskDescriptionItemProvider.dispose(); - if (this.conditionalTaskStyleItemProvider != null) - this.conditionalTaskStyleItemProvider.dispose(); if (this.createTaskToolItemProvider != null) this.createTaskToolItemProvider.dispose(); if (this.editTaskToolItemProvider != null) diff --git a/packages/view/backend/sirius-components-view-gantt-edit/src/main/java/org/eclipse/sirius/components/view/gantt/provider/TaskDescriptionItemProvider.java b/packages/view/backend/sirius-components-view-gantt-edit/src/main/java/org/eclipse/sirius/components/view/gantt/provider/TaskDescriptionItemProvider.java index 6039b3f330a..3a8ae9e7fab 100644 --- a/packages/view/backend/sirius-components-view-gantt-edit/src/main/java/org/eclipse/sirius/components/view/gantt/provider/TaskDescriptionItemProvider.java +++ b/packages/view/backend/sirius-components-view-gantt-edit/src/main/java/org/eclipse/sirius/components/view/gantt/provider/TaskDescriptionItemProvider.java @@ -226,8 +226,6 @@ protected void addReusedTaskElementDescriptionsPropertyDescriptor(Object object) public Collection getChildrenFeatures(Object object) { if (this.childrenFeatures == null) { super.getChildrenFeatures(object); - this.childrenFeatures.add(GanttPackage.Literals.TASK_DESCRIPTION__STYLE); - this.childrenFeatures.add(GanttPackage.Literals.TASK_DESCRIPTION__CONDITIONAL_STYLES); this.childrenFeatures.add(GanttPackage.Literals.TASK_DESCRIPTION__SUB_TASK_ELEMENT_DESCRIPTIONS); } return this.childrenFeatures; @@ -301,8 +299,6 @@ public void notifyChanged(Notification notification) { case GanttPackage.TASK_DESCRIPTION__TASK_DEPENDENCIES_EXPRESSION: this.fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true)); return; - case GanttPackage.TASK_DESCRIPTION__STYLE: - case GanttPackage.TASK_DESCRIPTION__CONDITIONAL_STYLES: case GanttPackage.TASK_DESCRIPTION__SUB_TASK_ELEMENT_DESCRIPTIONS: this.fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, false)); return; @@ -320,8 +316,6 @@ public void notifyChanged(Notification notification) { protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { super.collectNewChildDescriptors(newChildDescriptors, object); - newChildDescriptors.add(this.createChildParameter(GanttPackage.Literals.TASK_DESCRIPTION__CONDITIONAL_STYLES, GanttFactory.eINSTANCE.createConditionalTaskStyle())); - newChildDescriptors.add(this.createChildParameter(GanttPackage.Literals.TASK_DESCRIPTION__SUB_TASK_ELEMENT_DESCRIPTIONS, GanttFactory.eINSTANCE.createTaskDescription())); } diff --git a/packages/view/backend/sirius-components-view-gantt-edit/src/main/java/org/eclipse/sirius/components/view/gantt/provider/TaskStyleDescriptionItemProvider.java b/packages/view/backend/sirius-components-view-gantt-edit/src/main/java/org/eclipse/sirius/components/view/gantt/provider/TaskStyleDescriptionItemProvider.java deleted file mode 100644 index 571ef7b30a3..00000000000 --- a/packages/view/backend/sirius-components-view-gantt-edit/src/main/java/org/eclipse/sirius/components/view/gantt/provider/TaskStyleDescriptionItemProvider.java +++ /dev/null @@ -1,153 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2023 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.gantt.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.edit.provider.ComposeableAdapterFactory; -import org.eclipse.emf.edit.provider.IItemPropertyDescriptor; -import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; -import org.eclipse.emf.edit.provider.ViewerNotification; -import org.eclipse.sirius.components.view.gantt.GanttPackage; -import org.eclipse.sirius.components.view.gantt.TaskStyleDescription; -import org.eclipse.sirius.components.view.provider.LabelStyleItemProvider; - -/** - * This is the item provider adapter for a {@link org.eclipse.sirius.components.view.gantt.TaskStyleDescription} object. - * - * - * @generated - */ -public class TaskStyleDescriptionItemProvider extends LabelStyleItemProvider { - /** - * This constructs an instance from a factory and a notifier. - * - * @generated - */ - public TaskStyleDescriptionItemProvider(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.addLabelColorExpressionPropertyDescriptor(object); - this.addBackgroundColorExpressionPropertyDescriptor(object); - this.addProgressColorExpressionPropertyDescriptor(object); - } - return this.itemPropertyDescriptors; - } - - /** - * This adds a property descriptor for the Label Color Expression feature. - * - * @generated - */ - protected void addLabelColorExpressionPropertyDescriptor(Object object) { - this.itemPropertyDescriptors.add(this.createItemPropertyDescriptor(((ComposeableAdapterFactory) this.adapterFactory).getRootAdapterFactory(), this.getResourceLocator(), - this.getString("_UI_TaskStyleDescription_labelColorExpression_feature"), - this.getString("_UI_PropertyDescriptor_description", "_UI_TaskStyleDescription_labelColorExpression_feature", "_UI_TaskStyleDescription_type"), - GanttPackage.Literals.TASK_STYLE_DESCRIPTION__LABEL_COLOR_EXPRESSION, true, false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); - } - - /** - * This adds a property descriptor for the Background Color Expression feature. - * - * @generated - */ - protected void addBackgroundColorExpressionPropertyDescriptor(Object object) { - this.itemPropertyDescriptors.add(this.createItemPropertyDescriptor(((ComposeableAdapterFactory) this.adapterFactory).getRootAdapterFactory(), this.getResourceLocator(), - this.getString("_UI_TaskStyleDescription_backgroundColorExpression_feature"), - this.getString("_UI_PropertyDescriptor_description", "_UI_TaskStyleDescription_backgroundColorExpression_feature", "_UI_TaskStyleDescription_type"), - GanttPackage.Literals.TASK_STYLE_DESCRIPTION__BACKGROUND_COLOR_EXPRESSION, true, false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); - } - - /** - * This adds a property descriptor for the Progress Color Expression feature. - * - * @generated - */ - protected void addProgressColorExpressionPropertyDescriptor(Object object) { - this.itemPropertyDescriptors.add(this.createItemPropertyDescriptor(((ComposeableAdapterFactory) this.adapterFactory).getRootAdapterFactory(), this.getResourceLocator(), - this.getString("_UI_TaskStyleDescription_progressColorExpression_feature"), - this.getString("_UI_PropertyDescriptor_description", "_UI_TaskStyleDescription_progressColorExpression_feature", "_UI_TaskStyleDescription_type"), - GanttPackage.Literals.TASK_STYLE_DESCRIPTION__PROGRESS_COLOR_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) { - TaskStyleDescription taskStyleDescription = (TaskStyleDescription) object; - return this.getString("_UI_TaskStyleDescription_type") + " " + taskStyleDescription.getFontSize(); - } - - /** - * 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(TaskStyleDescription.class)) { - case GanttPackage.TASK_STYLE_DESCRIPTION__LABEL_COLOR_EXPRESSION: - case GanttPackage.TASK_STYLE_DESCRIPTION__BACKGROUND_COLOR_EXPRESSION: - case GanttPackage.TASK_STYLE_DESCRIPTION__PROGRESS_COLOR_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); - } - -} diff --git a/packages/view/backend/sirius-components-view-gantt-edit/src/main/resources/icons/full/obj16/ConditionalTaskStyle.gif b/packages/view/backend/sirius-components-view-gantt-edit/src/main/resources/icons/full/obj16/ConditionalTaskStyle.gif deleted file mode 100644 index badaab0664a..00000000000 Binary files a/packages/view/backend/sirius-components-view-gantt-edit/src/main/resources/icons/full/obj16/ConditionalTaskStyle.gif and /dev/null differ diff --git a/packages/view/backend/sirius-components-view-gantt-edit/src/main/resources/icons/full/obj16/TaskStyleDescription.gif b/packages/view/backend/sirius-components-view-gantt-edit/src/main/resources/icons/full/obj16/TaskStyleDescription.gif deleted file mode 100644 index c4a8af41844..00000000000 Binary files a/packages/view/backend/sirius-components-view-gantt-edit/src/main/resources/icons/full/obj16/TaskStyleDescription.gif and /dev/null differ diff --git a/packages/view/backend/sirius-components-view-gantt-edit/src/main/resources/plugin.properties b/packages/view/backend/sirius-components-view-gantt-edit/src/main/resources/plugin.properties index c603a3522f5..87354a0bbd3 100644 --- a/packages/view/backend/sirius-components-view-gantt-edit/src/main/resources/plugin.properties +++ b/packages/view/backend/sirius-components-view-gantt-edit/src/main/resources/plugin.properties @@ -23,8 +23,6 @@ _UI_PropertyDescriptor_description = The {0} of the {1} _UI_GanttDescription_type = Gantt Description _UI_TaskDescription_type = Task Description -_UI_TaskStyleDescription_type = Task Style Description -_UI_ConditionalTaskStyle_type = Conditional Task Style _UI_TaskTool_type = Task Tool _UI_CreateTaskTool_type = Create Task Tool _UI_EditTaskTool_type = Edit Task Tool @@ -36,12 +34,12 @@ _UI_Unknown_type = Object _UI_Unknown_datatype= Value _UI_GanttDescription_taskElementDescriptions_feature = Task Element Descriptions -_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_GanttDescription_dropTool_feature = Drop Tool _UI_GanttDescription_createTaskDependencyTool_feature = Create Task Dependency Tool +_UI_GanttDescription_dateRoundingExpression_feature = Date Rounding Expression _UI_TaskDescription_name_feature = Name _UI_TaskDescription_domainType_feature = Domain Type _UI_TaskDescription_semanticCandidatesExpression_feature = Semantic Candidates Expression @@ -52,14 +50,8 @@ _UI_TaskDescription_endTimeExpression_feature = End Time Expression _UI_TaskDescription_progressExpression_feature = Progress Expression _UI_TaskDescription_computeStartEndDynamicallyExpression_feature = Compute Start End Dynamically Expression _UI_TaskDescription_taskDependenciesExpression_feature = Task Dependencies Expression -_UI_TaskDescription_style_feature = Style -_UI_TaskDescription_conditionalStyles_feature = Conditional Styles _UI_TaskDescription_subTaskElementDescriptions_feature = Sub Task Element Descriptions _UI_TaskDescription_reusedTaskElementDescriptions_feature = Reused Task Element Descriptions -_UI_TaskStyleDescription_labelColorExpression_feature = Label Color Expression -_UI_TaskStyleDescription_backgroundColorExpression_feature = Background Color Expression -_UI_TaskStyleDescription_progressColorExpression_feature = Progress Color Expression -_UI_ConditionalTaskStyle_style_feature = Style _UI_TaskTool_name_feature = Name _UI_TaskTool_body_feature = Body _UI_Unknown_feature = Unspecified diff --git a/packages/view/backend/sirius-components-view-gantt/src/main/java/org/eclipse/sirius/components/view/gantt/ConditionalTaskStyle.java b/packages/view/backend/sirius-components-view-gantt/src/main/java/org/eclipse/sirius/components/view/gantt/ConditionalTaskStyle.java deleted file mode 100644 index 9ab28557552..00000000000 --- a/packages/view/backend/sirius-components-view-gantt/src/main/java/org/eclipse/sirius/components/view/gantt/ConditionalTaskStyle.java +++ /dev/null @@ -1,56 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2023 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.gantt; - -import org.eclipse.sirius.components.view.Conditional; - -/** - * A representation of the model object 'Conditional Task Style'. - * - *

- * The following features are supported: - *

- *
    - *
  • {@link org.eclipse.sirius.components.view.gantt.ConditionalTaskStyle#getStyle Style}
  • - *
- * - * @see org.eclipse.sirius.components.view.gantt.GanttPackage#getConditionalTaskStyle() - * @model - * @generated - */ -public interface ConditionalTaskStyle extends Conditional { - /** - * Returns the value of the 'Style' containment reference. - * - * @return the value of the 'Style' containment reference. - * @see #setStyle(TaskStyleDescription) - * @see org.eclipse.sirius.components.view.gantt.GanttPackage#getConditionalTaskStyle_Style() - * @model containment="true" required="true" - * @generated - */ - TaskStyleDescription getStyle(); - - /** - * Sets the value of the '{@link org.eclipse.sirius.components.view.gantt.ConditionalTaskStyle#getStyle - * Style}' containment reference. - * - * @param value - * the new value of the 'Style' containment reference. - * @see #getStyle() - * @generated - */ - void setStyle(TaskStyleDescription value); - -} // ConditionalTaskStyle diff --git a/packages/view/backend/sirius-components-view-gantt/src/main/java/org/eclipse/sirius/components/view/gantt/GanttDescription.java b/packages/view/backend/sirius-components-view-gantt/src/main/java/org/eclipse/sirius/components/view/gantt/GanttDescription.java index a11c34266b1..f60b3d9a1e8 100644 --- a/packages/view/backend/sirius-components-view-gantt/src/main/java/org/eclipse/sirius/components/view/gantt/GanttDescription.java +++ b/packages/view/backend/sirius-components-view-gantt/src/main/java/org/eclipse/sirius/components/view/gantt/GanttDescription.java @@ -14,7 +14,6 @@ import org.eclipse.emf.common.util.EList; import org.eclipse.sirius.components.view.RepresentationDescription; -import org.eclipse.sirius.components.view.UserColor; /** * A representation of the model object 'Description'. @@ -25,14 +24,14 @@ *
    *
  • {@link org.eclipse.sirius.components.view.gantt.GanttDescription#getTaskElementDescriptions Task Element * Descriptions}
  • - *
  • {@link org.eclipse.sirius.components.view.gantt.GanttDescription#getBackgroundColor Background - * Color}
  • *
  • {@link org.eclipse.sirius.components.view.gantt.GanttDescription#getCreateTool Create Tool}
  • *
  • {@link org.eclipse.sirius.components.view.gantt.GanttDescription#getEditTool Edit Tool}
  • *
  • {@link org.eclipse.sirius.components.view.gantt.GanttDescription#getDeleteTool Delete Tool}
  • *
  • {@link org.eclipse.sirius.components.view.gantt.GanttDescription#getDropTool Drop Tool}
  • *
  • {@link org.eclipse.sirius.components.view.gantt.GanttDescription#getCreateTaskDependencyTool Create Task * Dependency Tool}
  • + *
  • {@link org.eclipse.sirius.components.view.gantt.GanttDescription#getDateRoundingExpression Date Rounding + * Expression}
  • *
* * @see org.eclipse.sirius.components.view.gantt.GanttPackage#getGanttDescription() @@ -52,29 +51,6 @@ public interface GanttDescription extends RepresentationDescription { */ EList getTaskElementDescriptions(); - /** - * Returns the value of the 'Background Color' containment reference. - * - * @return the value of the 'Background Color' containment reference. - * @see #setBackgroundColor(UserColor) - * @see org.eclipse.sirius.components.view.gantt.GanttPackage#getGanttDescription_BackgroundColor() - * @model containment="true" - * @generated - */ - UserColor getBackgroundColor(); - - /** - * Sets the value of the '{@link org.eclipse.sirius.components.view.gantt.GanttDescription#getBackgroundColor - * Background Color}' containment reference. - * - * @param value - * the new value of the 'Background Color' containment reference. - * @see #getBackgroundColor() - * @generated - */ - void setBackgroundColor(UserColor value); - /** * Returns the value of the 'Create Tool' containment reference. @@ -191,4 +167,27 @@ public interface GanttDescription extends RepresentationDescription { */ void setCreateTaskDependencyTool(CreateTaskDependencyTool value); + /** + * Returns the value of the 'Date Rounding Expression' attribute. The default value is + * "12H". + * + * @return the value of the 'Date Rounding Expression' attribute. + * @see #setDateRoundingExpression(String) + * @see org.eclipse.sirius.components.view.gantt.GanttPackage#getGanttDescription_DateRoundingExpression() + * @model default="12H" dataType="org.eclipse.sirius.components.view.InterpretedExpression" + * @generated + */ + String getDateRoundingExpression(); + + /** + * Sets the value of the '{@link org.eclipse.sirius.components.view.gantt.GanttDescription#getDateRoundingExpression + * Date Rounding Expression}' attribute. + * + * @param value + * the new value of the 'Date Rounding Expression' attribute. + * @see #getDateRoundingExpression() + * @generated + */ + void setDateRoundingExpression(String value); + } // GanttDescription diff --git a/packages/view/backend/sirius-components-view-gantt/src/main/java/org/eclipse/sirius/components/view/gantt/GanttFactory.java b/packages/view/backend/sirius-components-view-gantt/src/main/java/org/eclipse/sirius/components/view/gantt/GanttFactory.java index 126dbb2bc4c..cd2ea2bbbc2 100644 --- a/packages/view/backend/sirius-components-view-gantt/src/main/java/org/eclipse/sirius/components/view/gantt/GanttFactory.java +++ b/packages/view/backend/sirius-components-view-gantt/src/main/java/org/eclipse/sirius/components/view/gantt/GanttFactory.java @@ -45,14 +45,6 @@ public interface GanttFactory extends EFactory { */ TaskDescription createTaskDescription(); - /** - * Returns a new object of class 'Conditional Task Style'. - * - * @return a new object of class 'Conditional Task Style'. - * @generated - */ - ConditionalTaskStyle createConditionalTaskStyle(); - /** * Returns a new object of class 'Create Task Tool'. * diff --git a/packages/view/backend/sirius-components-view-gantt/src/main/java/org/eclipse/sirius/components/view/gantt/GanttPackage.java b/packages/view/backend/sirius-components-view-gantt/src/main/java/org/eclipse/sirius/components/view/gantt/GanttPackage.java index 605ceca6238..864bbb923f8 100644 --- a/packages/view/backend/sirius-components-view-gantt/src/main/java/org/eclipse/sirius/components/view/gantt/GanttPackage.java +++ b/packages/view/backend/sirius-components-view-gantt/src/main/java/org/eclipse/sirius/components/view/gantt/GanttPackage.java @@ -115,15 +115,6 @@ public interface GanttPackage extends EPackage { */ int GANTT_DESCRIPTION__TASK_ELEMENT_DESCRIPTIONS = ViewPackage.REPRESENTATION_DESCRIPTION_FEATURE_COUNT + 0; - /** - * The feature id for the 'Background Color' containment reference. - * - * @generated - * @ordered - */ - int GANTT_DESCRIPTION__BACKGROUND_COLOR = ViewPackage.REPRESENTATION_DESCRIPTION_FEATURE_COUNT + 1; - /** * The feature id for the 'Create Tool' containment reference. @@ -131,7 +122,7 @@ public interface GanttPackage extends EPackage { * @generated * @ordered */ - int GANTT_DESCRIPTION__CREATE_TOOL = ViewPackage.REPRESENTATION_DESCRIPTION_FEATURE_COUNT + 2; + int GANTT_DESCRIPTION__CREATE_TOOL = ViewPackage.REPRESENTATION_DESCRIPTION_FEATURE_COUNT + 1; /** * The feature id for the 'Edit Tool' containment reference. + * + * @generated + * @ordered + */ + int GANTT_DESCRIPTION__DATE_ROUNDING_EXPRESSION = ViewPackage.REPRESENTATION_DESCRIPTION_FEATURE_COUNT + 6; /** * The number of structural features of the 'Description' class. - * - * @generated - * @ordered - */ - int TASK_DESCRIPTION__STYLE = 10; - - /** - * The feature id for the 'Conditional Styles' containment reference list. - * - * - * @generated - * @ordered - */ - int TASK_DESCRIPTION__CONDITIONAL_STYLES = 11; - /** * The feature id for the 'Sub Task Element Descriptions' containment reference list. @@ -308,7 +290,7 @@ public interface GanttPackage extends EPackage { * @generated * @ordered */ - int TASK_DESCRIPTION__SUB_TASK_ELEMENT_DESCRIPTIONS = 12; + int TASK_DESCRIPTION__SUB_TASK_ELEMENT_DESCRIPTIONS = 10; /** * The feature id for the 'Reused Task Element Descriptions' reference list. @@ -317,7 +299,7 @@ public interface GanttPackage extends EPackage { * @generated * @ordered */ - int TASK_DESCRIPTION__REUSED_TASK_ELEMENT_DESCRIPTIONS = 13; + int TASK_DESCRIPTION__REUSED_TASK_ELEMENT_DESCRIPTIONS = 11; /** * The number of structural features of the 'Task Description' class. @@ -336,146 +318,6 @@ public interface GanttPackage extends EPackage { */ int TASK_DESCRIPTION_OPERATION_COUNT = 0; - /** - * The meta object id for the '{@link org.eclipse.sirius.components.view.gantt.impl.TaskStyleDescriptionImpl - * Task Style Description}' class. - * - * @see org.eclipse.sirius.components.view.gantt.impl.TaskStyleDescriptionImpl - * @see org.eclipse.sirius.components.view.gantt.impl.GanttPackageImpl#getTaskStyleDescription() - * @generated - */ - int TASK_STYLE_DESCRIPTION = 2; - - /** - * The feature id for the 'Font Size' attribute. - * - * @generated - * @ordered - */ - int TASK_STYLE_DESCRIPTION__FONT_SIZE = ViewPackage.LABEL_STYLE__FONT_SIZE; - - /** - * The feature id for the 'Italic' attribute. - * - * @generated - * @ordered - */ - int TASK_STYLE_DESCRIPTION__ITALIC = ViewPackage.LABEL_STYLE__ITALIC; - - /** - * The feature id for the 'Bold' attribute. - * - * @generated - * @ordered - */ - int TASK_STYLE_DESCRIPTION__BOLD = ViewPackage.LABEL_STYLE__BOLD; - - /** - * The feature id for the 'Underline' attribute. - * - * @generated - * @ordered - */ - int TASK_STYLE_DESCRIPTION__UNDERLINE = ViewPackage.LABEL_STYLE__UNDERLINE; - - /** - * The feature id for the 'Strike Through' attribute. - * - * @generated - * @ordered - */ - int TASK_STYLE_DESCRIPTION__STRIKE_THROUGH = ViewPackage.LABEL_STYLE__STRIKE_THROUGH; - - /** - * The feature id for the 'Label Color Expression' attribute. - * - * @generated - * @ordered - */ - int TASK_STYLE_DESCRIPTION__LABEL_COLOR_EXPRESSION = ViewPackage.LABEL_STYLE_FEATURE_COUNT + 0; - - /** - * The feature id for the 'Background Color Expression' attribute. - * - * @generated - * @ordered - */ - int TASK_STYLE_DESCRIPTION__BACKGROUND_COLOR_EXPRESSION = ViewPackage.LABEL_STYLE_FEATURE_COUNT + 1; - - /** - * The feature id for the 'Progress Color Expression' attribute. - * - * @generated - * @ordered - */ - int TASK_STYLE_DESCRIPTION__PROGRESS_COLOR_EXPRESSION = ViewPackage.LABEL_STYLE_FEATURE_COUNT + 2; - - /** - * The number of structural features of the 'Task Style Description' class. - * - * @generated - * @ordered - */ - int TASK_STYLE_DESCRIPTION_FEATURE_COUNT = ViewPackage.LABEL_STYLE_FEATURE_COUNT + 3; - - /** - * The number of operations of the 'Task Style Description' class. - * - * @generated - * @ordered - */ - int TASK_STYLE_DESCRIPTION_OPERATION_COUNT = ViewPackage.LABEL_STYLE_OPERATION_COUNT + 0; - - /** - * The meta object id for the '{@link org.eclipse.sirius.components.view.gantt.impl.ConditionalTaskStyleImpl - * Conditional Task Style}' class. - * - * @see org.eclipse.sirius.components.view.gantt.impl.ConditionalTaskStyleImpl - * @see org.eclipse.sirius.components.view.gantt.impl.GanttPackageImpl#getConditionalTaskStyle() - * @generated - */ - int CONDITIONAL_TASK_STYLE = 3; - - /** - * The feature id for the 'Condition' attribute. - * - * @generated - * @ordered - */ - int CONDITIONAL_TASK_STYLE__CONDITION = ViewPackage.CONDITIONAL__CONDITION; - - /** - * The feature id for the 'Style' containment reference. - * - * @generated - * @ordered - */ - int CONDITIONAL_TASK_STYLE__STYLE = ViewPackage.CONDITIONAL_FEATURE_COUNT + 0; - - /** - * The number of structural features of the 'Conditional Task Style' class. - * - * @generated - * @ordered - */ - int CONDITIONAL_TASK_STYLE_FEATURE_COUNT = ViewPackage.CONDITIONAL_FEATURE_COUNT + 1; - - /** - * The number of operations of the 'Conditional Task Style' class. - * - * @generated - * @ordered - */ - int CONDITIONAL_TASK_STYLE_OPERATION_COUNT = ViewPackage.CONDITIONAL_OPERATION_COUNT + 0; - /** * The meta object id for the '{@link org.eclipse.sirius.components.view.gantt.impl.TaskToolImpl Task * Tool}' class. @@ -484,7 +326,7 @@ public interface GanttPackage extends EPackage { * @see org.eclipse.sirius.components.view.gantt.impl.GanttPackageImpl#getTaskTool() * @generated */ - int TASK_TOOL = 4; + int TASK_TOOL = 2; /** * The feature id for the 'Name' attribute. @@ -528,7 +370,7 @@ public interface GanttPackage extends EPackage { * @see org.eclipse.sirius.components.view.gantt.impl.GanttPackageImpl#getCreateTaskTool() * @generated */ - int CREATE_TASK_TOOL = 5; + int CREATE_TASK_TOOL = 3; /** * The feature id for the 'Name' attribute. @@ -572,7 +414,7 @@ public interface GanttPackage extends EPackage { * @see org.eclipse.sirius.components.view.gantt.impl.GanttPackageImpl#getEditTaskTool() * @generated */ - int EDIT_TASK_TOOL = 6; + int EDIT_TASK_TOOL = 4; /** * The feature id for the 'Name' attribute. @@ -616,7 +458,7 @@ public interface GanttPackage extends EPackage { * @see org.eclipse.sirius.components.view.gantt.impl.GanttPackageImpl#getDeleteTaskTool() * @generated */ - int DELETE_TASK_TOOL = 7; + int DELETE_TASK_TOOL = 5; /** * The feature id for the 'Name' attribute. @@ -660,7 +502,7 @@ public interface GanttPackage extends EPackage { * @see org.eclipse.sirius.components.view.gantt.impl.GanttPackageImpl#getDropTaskTool() * @generated */ - int DROP_TASK_TOOL = 8; + int DROP_TASK_TOOL = 6; /** * The feature id for the 'Name' attribute. @@ -704,7 +546,7 @@ public interface GanttPackage extends EPackage { * @see org.eclipse.sirius.components.view.gantt.impl.GanttPackageImpl#getCreateTaskDependencyTool() * @generated */ - int CREATE_TASK_DEPENDENCY_TOOL = 9; + int CREATE_TASK_DEPENDENCY_TOOL = 7; /** * The feature id for the 'Name' attribute. @@ -763,18 +605,6 @@ public interface GanttPackage extends EPackage { */ EReference getGanttDescription_TaskElementDescriptions(); - /** - * Returns the meta object for the containment reference - * '{@link org.eclipse.sirius.components.view.gantt.GanttDescription#getBackgroundColor Background Color}'. - * - * - * @return the meta object for the containment reference 'Background Color'. - * @see org.eclipse.sirius.components.view.gantt.GanttDescription#getBackgroundColor() - * @see #getGanttDescription() - * @generated - */ - EReference getGanttDescription_BackgroundColor(); - /** * Returns the meta object for the containment reference * '{@link org.eclipse.sirius.components.view.gantt.GanttDescription#getCreateTool Create Tool}'. + * + * @return the meta object for the attribute 'Date Rounding Expression'. + * @see org.eclipse.sirius.components.view.gantt.GanttDescription#getDateRoundingExpression() + * @see #getGanttDescription() + * @generated + */ + EAttribute getGanttDescription_DateRoundingExpression(); + /** * Returns the meta object for class '{@link org.eclipse.sirius.components.view.gantt.TaskDescription Task * Description}'. @@ -965,30 +807,6 @@ public interface GanttPackage extends EPackage { */ EAttribute getTaskDescription_TaskDependenciesExpression(); - /** - * Returns the meta object for the containment reference - * '{@link org.eclipse.sirius.components.view.gantt.TaskDescription#getStyle Style}'. - * - * @return the meta object for the containment reference 'Style'. - * @see org.eclipse.sirius.components.view.gantt.TaskDescription#getStyle() - * @see #getTaskDescription() - * @generated - */ - EReference getTaskDescription_Style(); - - /** - * Returns the meta object for the containment reference list - * '{@link org.eclipse.sirius.components.view.gantt.TaskDescription#getConditionalStyles Conditional - * Styles}'. - * - * @return the meta object for the containment reference list 'Conditional Styles'. - * @see org.eclipse.sirius.components.view.gantt.TaskDescription#getConditionalStyles() - * @see #getTaskDescription() - * @generated - */ - EReference getTaskDescription_ConditionalStyles(); - /** * Returns the meta object for the containment reference list * '{@link org.eclipse.sirius.components.view.gantt.TaskDescription#getSubTaskElementDescriptions Sub Task @@ -1013,74 +831,6 @@ public interface GanttPackage extends EPackage { */ EReference getTaskDescription_ReusedTaskElementDescriptions(); - /** - * Returns the meta object for class '{@link org.eclipse.sirius.components.view.gantt.TaskStyleDescription Task - * Style Description}'. - * - * @return the meta object for class 'Task Style Description'. - * @see org.eclipse.sirius.components.view.gantt.TaskStyleDescription - * @generated - */ - EClass getTaskStyleDescription(); - - /** - * Returns the meta object for the attribute - * '{@link org.eclipse.sirius.components.view.gantt.TaskStyleDescription#getLabelColorExpression Label Color - * Expression}'. - * - * @return the meta object for the attribute 'Label Color Expression'. - * @see org.eclipse.sirius.components.view.gantt.TaskStyleDescription#getLabelColorExpression() - * @see #getTaskStyleDescription() - * @generated - */ - EAttribute getTaskStyleDescription_LabelColorExpression(); - - /** - * Returns the meta object for the attribute - * '{@link org.eclipse.sirius.components.view.gantt.TaskStyleDescription#getBackgroundColorExpression Background - * Color Expression}'. - * - * @return the meta object for the attribute 'Background Color Expression'. - * @see org.eclipse.sirius.components.view.gantt.TaskStyleDescription#getBackgroundColorExpression() - * @see #getTaskStyleDescription() - * @generated - */ - EAttribute getTaskStyleDescription_BackgroundColorExpression(); - - /** - * Returns the meta object for the attribute - * '{@link org.eclipse.sirius.components.view.gantt.TaskStyleDescription#getProgressColorExpression Progress - * Color Expression}'. - * - * @return the meta object for the attribute 'Progress Color Expression'. - * @see org.eclipse.sirius.components.view.gantt.TaskStyleDescription#getProgressColorExpression() - * @see #getTaskStyleDescription() - * @generated - */ - EAttribute getTaskStyleDescription_ProgressColorExpression(); - - /** - * Returns the meta object for class '{@link org.eclipse.sirius.components.view.gantt.ConditionalTaskStyle - * Conditional Task Style}'. - * - * @return the meta object for class 'Conditional Task Style'. - * @see org.eclipse.sirius.components.view.gantt.ConditionalTaskStyle - * @generated - */ - EClass getConditionalTaskStyle(); - - /** - * Returns the meta object for the containment reference - * '{@link org.eclipse.sirius.components.view.gantt.ConditionalTaskStyle#getStyle Style}'. - * - * @return the meta object for the containment reference 'Style'. - * @see org.eclipse.sirius.components.view.gantt.ConditionalTaskStyle#getStyle() - * @see #getConditionalTaskStyle() - * @generated - */ - EReference getConditionalTaskStyle_Style(); - /** * Returns the meta object for class '{@link org.eclipse.sirius.components.view.gantt.TaskTool Task Tool}'. * @@ -1204,14 +954,6 @@ interface Literals { */ EReference GANTT_DESCRIPTION__TASK_ELEMENT_DESCRIPTIONS = eINSTANCE.getGanttDescription_TaskElementDescriptions(); - /** - * The meta object literal for the 'Background Color' containment reference feature. - * - * @generated - */ - EReference GANTT_DESCRIPTION__BACKGROUND_COLOR = eINSTANCE.getGanttDescription_BackgroundColor(); - /** * The meta object literal for the 'Create Tool' containment reference feature. @@ -1252,6 +994,14 @@ interface Literals { */ EReference GANTT_DESCRIPTION__CREATE_TASK_DEPENDENCY_TOOL = eINSTANCE.getGanttDescription_CreateTaskDependencyTool(); + /** + * The meta object literal for the 'Date Rounding Expression' attribute feature. + * + * @generated + */ + EAttribute GANTT_DESCRIPTION__DATE_ROUNDING_EXPRESSION = eINSTANCE.getGanttDescription_DateRoundingExpression(); + /** * The meta object literal for the '{@link org.eclipse.sirius.components.view.gantt.impl.TaskDescriptionImpl * Task Description}' class. @@ -1342,22 +1092,6 @@ interface Literals { */ EAttribute TASK_DESCRIPTION__TASK_DEPENDENCIES_EXPRESSION = eINSTANCE.getTaskDescription_TaskDependenciesExpression(); - /** - * The meta object literal for the 'Style' containment reference feature. - * - * @generated - */ - EReference TASK_DESCRIPTION__STYLE = eINSTANCE.getTaskDescription_Style(); - - /** - * The meta object literal for the 'Conditional Styles' containment reference list feature. - * - * @generated - */ - EReference TASK_DESCRIPTION__CONDITIONAL_STYLES = eINSTANCE.getTaskDescription_ConditionalStyles(); - /** * The meta object literal for the 'Sub Task Element Descriptions' containment reference list * feature. @@ -1374,60 +1108,6 @@ interface Literals { */ EReference TASK_DESCRIPTION__REUSED_TASK_ELEMENT_DESCRIPTIONS = eINSTANCE.getTaskDescription_ReusedTaskElementDescriptions(); - /** - * The meta object literal for the - * '{@link org.eclipse.sirius.components.view.gantt.impl.TaskStyleDescriptionImpl Task Style - * Description}' class. - * - * @see org.eclipse.sirius.components.view.gantt.impl.TaskStyleDescriptionImpl - * @see org.eclipse.sirius.components.view.gantt.impl.GanttPackageImpl#getTaskStyleDescription() - * @generated - */ - EClass TASK_STYLE_DESCRIPTION = eINSTANCE.getTaskStyleDescription(); - - /** - * The meta object literal for the 'Label Color Expression' attribute feature. - * - * @generated - */ - EAttribute TASK_STYLE_DESCRIPTION__LABEL_COLOR_EXPRESSION = eINSTANCE.getTaskStyleDescription_LabelColorExpression(); - - /** - * The meta object literal for the 'Background Color Expression' attribute feature. - * - * @generated - */ - EAttribute TASK_STYLE_DESCRIPTION__BACKGROUND_COLOR_EXPRESSION = eINSTANCE.getTaskStyleDescription_BackgroundColorExpression(); - - /** - * The meta object literal for the 'Progress Color Expression' attribute feature. - * - * @generated - */ - EAttribute TASK_STYLE_DESCRIPTION__PROGRESS_COLOR_EXPRESSION = eINSTANCE.getTaskStyleDescription_ProgressColorExpression(); - - /** - * The meta object literal for the - * '{@link org.eclipse.sirius.components.view.gantt.impl.ConditionalTaskStyleImpl Conditional Task - * Style}' class. - * - * @see org.eclipse.sirius.components.view.gantt.impl.ConditionalTaskStyleImpl - * @see org.eclipse.sirius.components.view.gantt.impl.GanttPackageImpl#getConditionalTaskStyle() - * @generated - */ - EClass CONDITIONAL_TASK_STYLE = eINSTANCE.getConditionalTaskStyle(); - - /** - * The meta object literal for the 'Style' containment reference feature. - * - * @generated - */ - EReference CONDITIONAL_TASK_STYLE__STYLE = eINSTANCE.getConditionalTaskStyle_Style(); - /** * The meta object literal for the '{@link org.eclipse.sirius.components.view.gantt.impl.TaskToolImpl Task * Tool}' class. diff --git a/packages/view/backend/sirius-components-view-gantt/src/main/java/org/eclipse/sirius/components/view/gantt/TaskDescription.java b/packages/view/backend/sirius-components-view-gantt/src/main/java/org/eclipse/sirius/components/view/gantt/TaskDescription.java index d647e94c030..e1beba855ae 100644 --- a/packages/view/backend/sirius-components-view-gantt/src/main/java/org/eclipse/sirius/components/view/gantt/TaskDescription.java +++ b/packages/view/backend/sirius-components-view-gantt/src/main/java/org/eclipse/sirius/components/view/gantt/TaskDescription.java @@ -272,41 +272,6 @@ public interface TaskDescription extends EObject { */ void setTaskDependenciesExpression(String value); - /** - * Returns the value of the 'Style' containment reference. - * - * @return the value of the 'Style' containment reference. - * @see #setStyle(TaskStyleDescription) - * @see org.eclipse.sirius.components.view.gantt.GanttPackage#getTaskDescription_Style() - * @model containment="true" required="true" - * @generated - */ - TaskStyleDescription getStyle(); - - /** - * Sets the value of the '{@link org.eclipse.sirius.components.view.gantt.TaskDescription#getStyle Style}' - * containment reference. - * - * @param value - * the new value of the 'Style' containment reference. - * @see #getStyle() - * @generated - */ - void setStyle(TaskStyleDescription value); - - /** - * Returns the value of the 'Conditional Styles' containment reference list. The list contents are - * of type {@link org.eclipse.sirius.components.view.gantt.ConditionalTaskStyle}. - * - * @return the value of the 'Conditional Styles' containment reference list. - * @see org.eclipse.sirius.components.view.gantt.GanttPackage#getTaskDescription_ConditionalStyles() - * @model containment="true" - * @generated - */ - EList getConditionalStyles(); - /** * Returns the value of the 'Sub Task Element Descriptions' containment reference. diff --git a/packages/view/backend/sirius-components-view-gantt/src/main/java/org/eclipse/sirius/components/view/gantt/TaskStyleDescription.java b/packages/view/backend/sirius-components-view-gantt/src/main/java/org/eclipse/sirius/components/view/gantt/TaskStyleDescription.java deleted file mode 100644 index cda00dcc2a9..00000000000 --- a/packages/view/backend/sirius-components-view-gantt/src/main/java/org/eclipse/sirius/components/view/gantt/TaskStyleDescription.java +++ /dev/null @@ -1,110 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2023 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.gantt; - -import org.eclipse.sirius.components.view.LabelStyle; - -/** - * A representation of the model object 'Task Style Description'. - * - *

- * The following features are supported: - *

- *
    - *
  • {@link org.eclipse.sirius.components.view.gantt.TaskStyleDescription#getLabelColorExpression Label Color - * Expression}
  • - *
  • {@link org.eclipse.sirius.components.view.gantt.TaskStyleDescription#getBackgroundColorExpression Background - * Color Expression}
  • - *
  • {@link org.eclipse.sirius.components.view.gantt.TaskStyleDescription#getProgressColorExpression Progress - * Color Expression}
  • - *
- * - * @see org.eclipse.sirius.components.view.gantt.GanttPackage#getTaskStyleDescription() - * @model abstract="true" - * @generated - */ -public interface TaskStyleDescription extends LabelStyle { - /** - * Returns the value of the 'Label Color Expression' attribute. The default value is - * "aql:self". - * - * @return the value of the 'Label Color Expression' attribute. - * @see #setLabelColorExpression(String) - * @see org.eclipse.sirius.components.view.gantt.GanttPackage#getTaskStyleDescription_LabelColorExpression() - * @model default="aql:self" dataType="org.eclipse.sirius.components.view.InterpretedExpression" - * @generated - */ - String getLabelColorExpression(); - - /** - * Sets the value of the - * '{@link org.eclipse.sirius.components.view.gantt.TaskStyleDescription#getLabelColorExpression Label Color - * Expression}' attribute. - * - * @param value - * the new value of the 'Label Color Expression' attribute. - * @see #getLabelColorExpression() - * @generated - */ - void setLabelColorExpression(String value); - - /** - * Returns the value of the 'Background Color Expression' attribute. The default value is - * "aql:self". - * - * @return the value of the 'Background Color Expression' attribute. - * @see #setBackgroundColorExpression(String) - * @see org.eclipse.sirius.components.view.gantt.GanttPackage#getTaskStyleDescription_BackgroundColorExpression() - * @model default="aql:self" dataType="org.eclipse.sirius.components.view.InterpretedExpression" - * @generated - */ - String getBackgroundColorExpression(); - - /** - * Sets the value of the - * '{@link org.eclipse.sirius.components.view.gantt.TaskStyleDescription#getBackgroundColorExpression Background - * Color Expression}' attribute. - * - * @param value - * the new value of the 'Background Color Expression' attribute. - * @see #getBackgroundColorExpression() - * @generated - */ - void setBackgroundColorExpression(String value); - - /** - * Returns the value of the 'Progress Color Expression' attribute. The default value is - * "aql:self". - * - * @return the value of the 'Progress Color Expression' attribute. - * @see #setProgressColorExpression(String) - * @see org.eclipse.sirius.components.view.gantt.GanttPackage#getTaskStyleDescription_ProgressColorExpression() - * @model default="aql:self" dataType="org.eclipse.sirius.components.view.InterpretedExpression" - * @generated - */ - String getProgressColorExpression(); - - /** - * Sets the value of the - * '{@link org.eclipse.sirius.components.view.gantt.TaskStyleDescription#getProgressColorExpression Progress - * Color Expression}' attribute. - * - * @param value - * the new value of the 'Progress Color Expression' attribute. - * @see #getProgressColorExpression() - * @generated - */ - void setProgressColorExpression(String value); - -} // TaskStyleDescription diff --git a/packages/view/backend/sirius-components-view-gantt/src/main/java/org/eclipse/sirius/components/view/gantt/impl/ConditionalTaskStyleImpl.java b/packages/view/backend/sirius-components-view-gantt/src/main/java/org/eclipse/sirius/components/view/gantt/impl/ConditionalTaskStyleImpl.java deleted file mode 100644 index 951c9ef9e8c..00000000000 --- a/packages/view/backend/sirius-components-view-gantt/src/main/java/org/eclipse/sirius/components/view/gantt/impl/ConditionalTaskStyleImpl.java +++ /dev/null @@ -1,187 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2023 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.gantt.impl; - -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.notify.NotificationChain; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.InternalEObject; -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.sirius.components.view.gantt.ConditionalTaskStyle; -import org.eclipse.sirius.components.view.gantt.GanttPackage; -import org.eclipse.sirius.components.view.gantt.TaskStyleDescription; -import org.eclipse.sirius.components.view.impl.ConditionalImpl; - -/** - * An implementation of the model object 'Conditional Task Style'. - *

- * The following features are implemented: - *

- *
    - *
  • {@link org.eclipse.sirius.components.view.gantt.impl.ConditionalTaskStyleImpl#getStyle Style}
  • - *
- * - * @generated - */ -public class ConditionalTaskStyleImpl extends ConditionalImpl implements ConditionalTaskStyle { - /** - * The cached value of the '{@link #getStyle() Style}' containment reference. - * - * @see #getStyle() - * @generated - * @ordered - */ - protected TaskStyleDescription style; - - /** - * - * - * @generated - */ - protected ConditionalTaskStyleImpl() { - super(); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return GanttPackage.Literals.CONDITIONAL_TASK_STYLE; - } - - /** - * - * - * @generated - */ - @Override - public TaskStyleDescription getStyle() { - return this.style; - } - - /** - * - * - * @generated - */ - public NotificationChain basicSetStyle(TaskStyleDescription newStyle, NotificationChain msgs) { - TaskStyleDescription oldStyle = this.style; - this.style = newStyle; - if (this.eNotificationRequired()) { - ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, GanttPackage.CONDITIONAL_TASK_STYLE__STYLE, oldStyle, newStyle); - if (msgs == null) - msgs = notification; - else - msgs.add(notification); - } - return msgs; - } - - /** - * - * - * @generated - */ - @Override - public void setStyle(TaskStyleDescription newStyle) { - if (newStyle != this.style) { - NotificationChain msgs = null; - if (this.style != null) - msgs = ((InternalEObject) this.style).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - GanttPackage.CONDITIONAL_TASK_STYLE__STYLE, null, msgs); - if (newStyle != null) - msgs = ((InternalEObject) newStyle).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - GanttPackage.CONDITIONAL_TASK_STYLE__STYLE, null, msgs); - msgs = this.basicSetStyle(newStyle, msgs); - if (msgs != null) - msgs.dispatch(); - } else if (this.eNotificationRequired()) - this.eNotify(new ENotificationImpl(this, Notification.SET, GanttPackage.CONDITIONAL_TASK_STYLE__STYLE, newStyle, newStyle)); - } - - /** - * - * - * @generated - */ - @Override - public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { - switch (featureID) { - case GanttPackage.CONDITIONAL_TASK_STYLE__STYLE: - return this.basicSetStyle(null, msgs); - } - return super.eInverseRemove(otherEnd, featureID, msgs); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case GanttPackage.CONDITIONAL_TASK_STYLE__STYLE: - return this.getStyle(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case GanttPackage.CONDITIONAL_TASK_STYLE__STYLE: - this.setStyle((TaskStyleDescription) newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case GanttPackage.CONDITIONAL_TASK_STYLE__STYLE: - this.setStyle((TaskStyleDescription) null); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case GanttPackage.CONDITIONAL_TASK_STYLE__STYLE: - return this.style != null; - } - return super.eIsSet(featureID); - } - -} // ConditionalTaskStyleImpl diff --git a/packages/view/backend/sirius-components-view-gantt/src/main/java/org/eclipse/sirius/components/view/gantt/impl/GanttDescriptionImpl.java b/packages/view/backend/sirius-components-view-gantt/src/main/java/org/eclipse/sirius/components/view/gantt/impl/GanttDescriptionImpl.java index 72dee70ef88..8a638ba313f 100644 --- a/packages/view/backend/sirius-components-view-gantt/src/main/java/org/eclipse/sirius/components/view/gantt/impl/GanttDescriptionImpl.java +++ b/packages/view/backend/sirius-components-view-gantt/src/main/java/org/eclipse/sirius/components/view/gantt/impl/GanttDescriptionImpl.java @@ -22,7 +22,6 @@ import org.eclipse.emf.ecore.impl.ENotificationImpl; import org.eclipse.emf.ecore.util.EObjectContainmentEList; import org.eclipse.emf.ecore.util.InternalEList; -import org.eclipse.sirius.components.view.UserColor; import org.eclipse.sirius.components.view.gantt.CreateTaskDependencyTool; import org.eclipse.sirius.components.view.gantt.CreateTaskTool; import org.eclipse.sirius.components.view.gantt.DeleteTaskTool; @@ -41,8 +40,6 @@ *
    *
  • {@link org.eclipse.sirius.components.view.gantt.impl.GanttDescriptionImpl#getTaskElementDescriptions Task * Element Descriptions}
  • - *
  • {@link org.eclipse.sirius.components.view.gantt.impl.GanttDescriptionImpl#getBackgroundColor Background - * Color}
  • *
  • {@link org.eclipse.sirius.components.view.gantt.impl.GanttDescriptionImpl#getCreateTool Create * Tool}
  • *
  • {@link org.eclipse.sirius.components.view.gantt.impl.GanttDescriptionImpl#getEditTool Edit Tool}
  • @@ -51,6 +48,8 @@ *
  • {@link org.eclipse.sirius.components.view.gantt.impl.GanttDescriptionImpl#getDropTool Drop Tool}
  • *
  • {@link org.eclipse.sirius.components.view.gantt.impl.GanttDescriptionImpl#getCreateTaskDependencyTool Create * Task Dependency Tool}
  • + *
  • {@link org.eclipse.sirius.components.view.gantt.impl.GanttDescriptionImpl#getDateRoundingExpression Date + * Rounding Expression}
  • *
* * @generated @@ -66,16 +65,6 @@ public class GanttDescriptionImpl extends RepresentationDescriptionImpl implemen */ protected EList taskElementDescriptions; - /** - * The cached value of the '{@link #getBackgroundColor() Background Color}' containment reference. - * - * @see #getBackgroundColor() - * @generated - * @ordered - */ - protected UserColor backgroundColor; - /** * The cached value of the '{@link #getCreateTool() Create Tool}' containment reference. @@ -127,35 +116,32 @@ public class GanttDescriptionImpl extends RepresentationDescriptionImpl implemen protected CreateTaskDependencyTool createTaskDependencyTool; /** - * + * The default value of the '{@link #getDateRoundingExpression() Date Rounding Expression}' attribute. * + * @see #getDateRoundingExpression() * @generated + * @ordered */ - protected GanttDescriptionImpl() { - super(); - } + protected static final String DATE_ROUNDING_EXPRESSION_EDEFAULT = "12H"; /** - * + * The cached value of the '{@link #getDateRoundingExpression() Date Rounding Expression}' attribute. * + * @see #getDateRoundingExpression() * @generated + * @ordered */ - @Override - protected EClass eStaticClass() { - return GanttPackage.Literals.GANTT_DESCRIPTION; - } + protected String dateRoundingExpression = DATE_ROUNDING_EXPRESSION_EDEFAULT; /** * * * @generated */ - @Override - public EList getTaskElementDescriptions() { - if (this.taskElementDescriptions == null) { - this.taskElementDescriptions = new EObjectContainmentEList<>(TaskDescription.class, this, GanttPackage.GANTT_DESCRIPTION__TASK_ELEMENT_DESCRIPTIONS); - } - return this.taskElementDescriptions; + protected GanttDescriptionImpl() { + super(); } /** @@ -164,26 +150,8 @@ public EList getTaskElementDescriptions() { * @generated */ @Override - public UserColor getBackgroundColor() { - return this.backgroundColor; - } - - /** - * - * - * @generated - */ - public NotificationChain basicSetBackgroundColor(UserColor newBackgroundColor, NotificationChain msgs) { - UserColor oldBackgroundColor = this.backgroundColor; - this.backgroundColor = newBackgroundColor; - if (this.eNotificationRequired()) { - ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, GanttPackage.GANTT_DESCRIPTION__BACKGROUND_COLOR, oldBackgroundColor, newBackgroundColor); - if (msgs == null) - msgs = notification; - else - msgs.add(notification); - } - return msgs; + protected EClass eStaticClass() { + return GanttPackage.Literals.GANTT_DESCRIPTION; } /** @@ -192,18 +160,11 @@ public NotificationChain basicSetBackgroundColor(UserColor newBackgroundColor, N * @generated */ @Override - public void setBackgroundColor(UserColor newBackgroundColor) { - if (newBackgroundColor != this.backgroundColor) { - NotificationChain msgs = null; - if (this.backgroundColor != null) - msgs = ((InternalEObject) this.backgroundColor).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - GanttPackage.GANTT_DESCRIPTION__BACKGROUND_COLOR, null, msgs); - if (newBackgroundColor != null) - msgs = ((InternalEObject) newBackgroundColor).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - GanttPackage.GANTT_DESCRIPTION__BACKGROUND_COLOR, null, msgs); - msgs = this.basicSetBackgroundColor(newBackgroundColor, msgs); - if (msgs != null) - msgs.dispatch(); - } else if (this.eNotificationRequired()) - this.eNotify(new ENotificationImpl(this, Notification.SET, GanttPackage.GANTT_DESCRIPTION__BACKGROUND_COLOR, newBackgroundColor, newBackgroundColor)); + public EList getTaskElementDescriptions() { + if (this.taskElementDescriptions == null) { + this.taskElementDescriptions = new EObjectContainmentEList<>(TaskDescription.class, this, GanttPackage.GANTT_DESCRIPTION__TASK_ELEMENT_DESCRIPTIONS); + } + return this.taskElementDescriptions; } /** @@ -447,6 +408,29 @@ public void setCreateTaskDependencyTool(CreateTaskDependencyTool newCreateTaskDe this.eNotify(new ENotificationImpl(this, Notification.SET, GanttPackage.GANTT_DESCRIPTION__CREATE_TASK_DEPENDENCY_TOOL, newCreateTaskDependencyTool, newCreateTaskDependencyTool)); } + /** + * + * + * @generated + */ + @Override + public String getDateRoundingExpression() { + return this.dateRoundingExpression; + } + + /** + * + * + * @generated + */ + @Override + public void setDateRoundingExpression(String newDateRoundingExpression) { + String oldDateRoundingExpression = this.dateRoundingExpression; + this.dateRoundingExpression = newDateRoundingExpression; + if (this.eNotificationRequired()) + this.eNotify(new ENotificationImpl(this, Notification.SET, GanttPackage.GANTT_DESCRIPTION__DATE_ROUNDING_EXPRESSION, oldDateRoundingExpression, this.dateRoundingExpression)); + } + /** * * @@ -457,8 +441,6 @@ public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, switch (featureID) { case GanttPackage.GANTT_DESCRIPTION__TASK_ELEMENT_DESCRIPTIONS: return ((InternalEList) this.getTaskElementDescriptions()).basicRemove(otherEnd, msgs); - case GanttPackage.GANTT_DESCRIPTION__BACKGROUND_COLOR: - return this.basicSetBackgroundColor(null, msgs); case GanttPackage.GANTT_DESCRIPTION__CREATE_TOOL: return this.basicSetCreateTool(null, msgs); case GanttPackage.GANTT_DESCRIPTION__EDIT_TOOL: @@ -483,8 +465,6 @@ public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { case GanttPackage.GANTT_DESCRIPTION__TASK_ELEMENT_DESCRIPTIONS: return this.getTaskElementDescriptions(); - case GanttPackage.GANTT_DESCRIPTION__BACKGROUND_COLOR: - return this.getBackgroundColor(); case GanttPackage.GANTT_DESCRIPTION__CREATE_TOOL: return this.getCreateTool(); case GanttPackage.GANTT_DESCRIPTION__EDIT_TOOL: @@ -495,6 +475,8 @@ public Object eGet(int featureID, boolean resolve, boolean coreType) { return this.getDropTool(); case GanttPackage.GANTT_DESCRIPTION__CREATE_TASK_DEPENDENCY_TOOL: return this.getCreateTaskDependencyTool(); + case GanttPackage.GANTT_DESCRIPTION__DATE_ROUNDING_EXPRESSION: + return this.getDateRoundingExpression(); } return super.eGet(featureID, resolve, coreType); } @@ -512,9 +494,6 @@ public void eSet(int featureID, Object newValue) { this.getTaskElementDescriptions().clear(); this.getTaskElementDescriptions().addAll((Collection) newValue); return; - case GanttPackage.GANTT_DESCRIPTION__BACKGROUND_COLOR: - this.setBackgroundColor((UserColor) newValue); - return; case GanttPackage.GANTT_DESCRIPTION__CREATE_TOOL: this.setCreateTool((CreateTaskTool) newValue); return; @@ -530,6 +509,9 @@ public void eSet(int featureID, Object newValue) { case GanttPackage.GANTT_DESCRIPTION__CREATE_TASK_DEPENDENCY_TOOL: this.setCreateTaskDependencyTool((CreateTaskDependencyTool) newValue); return; + case GanttPackage.GANTT_DESCRIPTION__DATE_ROUNDING_EXPRESSION: + this.setDateRoundingExpression((String) newValue); + return; } super.eSet(featureID, newValue); } @@ -545,9 +527,6 @@ public void eUnset(int featureID) { case GanttPackage.GANTT_DESCRIPTION__TASK_ELEMENT_DESCRIPTIONS: this.getTaskElementDescriptions().clear(); return; - case GanttPackage.GANTT_DESCRIPTION__BACKGROUND_COLOR: - this.setBackgroundColor((UserColor) null); - return; case GanttPackage.GANTT_DESCRIPTION__CREATE_TOOL: this.setCreateTool((CreateTaskTool) null); return; @@ -563,6 +542,9 @@ public void eUnset(int featureID) { case GanttPackage.GANTT_DESCRIPTION__CREATE_TASK_DEPENDENCY_TOOL: this.setCreateTaskDependencyTool((CreateTaskDependencyTool) null); return; + case GanttPackage.GANTT_DESCRIPTION__DATE_ROUNDING_EXPRESSION: + this.setDateRoundingExpression(DATE_ROUNDING_EXPRESSION_EDEFAULT); + return; } super.eUnset(featureID); } @@ -577,8 +559,6 @@ public boolean eIsSet(int featureID) { switch (featureID) { case GanttPackage.GANTT_DESCRIPTION__TASK_ELEMENT_DESCRIPTIONS: return this.taskElementDescriptions != null && !this.taskElementDescriptions.isEmpty(); - case GanttPackage.GANTT_DESCRIPTION__BACKGROUND_COLOR: - return this.backgroundColor != null; case GanttPackage.GANTT_DESCRIPTION__CREATE_TOOL: return this.createTool != null; case GanttPackage.GANTT_DESCRIPTION__EDIT_TOOL: @@ -589,8 +569,27 @@ public boolean eIsSet(int featureID) { return this.dropTool != null; case GanttPackage.GANTT_DESCRIPTION__CREATE_TASK_DEPENDENCY_TOOL: return this.createTaskDependencyTool != null; + case GanttPackage.GANTT_DESCRIPTION__DATE_ROUNDING_EXPRESSION: + return DATE_ROUNDING_EXPRESSION_EDEFAULT == null ? this.dateRoundingExpression != null : !DATE_ROUNDING_EXPRESSION_EDEFAULT.equals(this.dateRoundingExpression); } return super.eIsSet(featureID); } + /** + * + * + * @generated + */ + @Override + public String toString() { + if (this.eIsProxy()) + return super.toString(); + + StringBuilder result = new StringBuilder(super.toString()); + result.append(" (dateRoundingExpression: "); + result.append(this.dateRoundingExpression); + result.append(')'); + return result.toString(); + } + } // GanttDescriptionImpl diff --git a/packages/view/backend/sirius-components-view-gantt/src/main/java/org/eclipse/sirius/components/view/gantt/impl/GanttFactoryImpl.java b/packages/view/backend/sirius-components-view-gantt/src/main/java/org/eclipse/sirius/components/view/gantt/impl/GanttFactoryImpl.java index d84ebaedda7..19cb3740664 100644 --- a/packages/view/backend/sirius-components-view-gantt/src/main/java/org/eclipse/sirius/components/view/gantt/impl/GanttFactoryImpl.java +++ b/packages/view/backend/sirius-components-view-gantt/src/main/java/org/eclipse/sirius/components/view/gantt/impl/GanttFactoryImpl.java @@ -17,7 +17,6 @@ import org.eclipse.emf.ecore.EPackage; import org.eclipse.emf.ecore.impl.EFactoryImpl; import org.eclipse.emf.ecore.plugin.EcorePlugin; -import org.eclipse.sirius.components.view.gantt.ConditionalTaskStyle; import org.eclipse.sirius.components.view.gantt.CreateTaskDependencyTool; import org.eclipse.sirius.components.view.gantt.CreateTaskTool; import org.eclipse.sirius.components.view.gantt.DeleteTaskTool; @@ -72,8 +71,6 @@ public EObject create(EClass eClass) { return this.createGanttDescription(); case GanttPackage.TASK_DESCRIPTION: return this.createTaskDescription(); - case GanttPackage.CONDITIONAL_TASK_STYLE: - return this.createConditionalTaskStyle(); case GanttPackage.CREATE_TASK_TOOL: return this.createCreateTaskTool(); case GanttPackage.EDIT_TASK_TOOL: @@ -111,17 +108,6 @@ public TaskDescription createTaskDescription() { return taskDescription; } - /** - * - * - * @generated - */ - @Override - public ConditionalTaskStyle createConditionalTaskStyle() { - ConditionalTaskStyleImpl conditionalTaskStyle = new ConditionalTaskStyleImpl(); - return conditionalTaskStyle; - } - /** * * diff --git a/packages/view/backend/sirius-components-view-gantt/src/main/java/org/eclipse/sirius/components/view/gantt/impl/GanttPackageImpl.java b/packages/view/backend/sirius-components-view-gantt/src/main/java/org/eclipse/sirius/components/view/gantt/impl/GanttPackageImpl.java index c6d1d25913b..41fe0d3fba7 100644 --- a/packages/view/backend/sirius-components-view-gantt/src/main/java/org/eclipse/sirius/components/view/gantt/impl/GanttPackageImpl.java +++ b/packages/view/backend/sirius-components-view-gantt/src/main/java/org/eclipse/sirius/components/view/gantt/impl/GanttPackageImpl.java @@ -18,7 +18,6 @@ import org.eclipse.emf.ecore.EReference; import org.eclipse.emf.ecore.impl.EPackageImpl; import org.eclipse.sirius.components.view.ViewPackage; -import org.eclipse.sirius.components.view.gantt.ConditionalTaskStyle; import org.eclipse.sirius.components.view.gantt.CreateTaskDependencyTool; import org.eclipse.sirius.components.view.gantt.CreateTaskTool; import org.eclipse.sirius.components.view.gantt.DeleteTaskTool; @@ -28,7 +27,6 @@ import org.eclipse.sirius.components.view.gantt.GanttFactory; import org.eclipse.sirius.components.view.gantt.GanttPackage; import org.eclipse.sirius.components.view.gantt.TaskDescription; -import org.eclipse.sirius.components.view.gantt.TaskStyleDescription; import org.eclipse.sirius.components.view.gantt.TaskTool; /** @@ -51,20 +49,6 @@ public class GanttPackageImpl extends EPackageImpl implements GanttPackage { */ private EClass taskDescriptionEClass = null; - /** - * - * - * @generated - */ - private EClass taskStyleDescriptionEClass = null; - - /** - * - * - * @generated - */ - private EClass conditionalTaskStyleEClass = null; - /** * * @@ -197,7 +181,7 @@ public EReference getGanttDescription_TaskElementDescriptions() { * @generated */ @Override - public EReference getGanttDescription_BackgroundColor() { + public EReference getGanttDescription_CreateTool() { return (EReference) this.ganttDescriptionEClass.getEStructuralFeatures().get(1); } @@ -207,7 +191,7 @@ public EReference getGanttDescription_BackgroundColor() { * @generated */ @Override - public EReference getGanttDescription_CreateTool() { + public EReference getGanttDescription_EditTool() { return (EReference) this.ganttDescriptionEClass.getEStructuralFeatures().get(2); } @@ -217,7 +201,7 @@ public EReference getGanttDescription_CreateTool() { * @generated */ @Override - public EReference getGanttDescription_EditTool() { + public EReference getGanttDescription_DeleteTool() { return (EReference) this.ganttDescriptionEClass.getEStructuralFeatures().get(3); } @@ -227,7 +211,7 @@ public EReference getGanttDescription_EditTool() { * @generated */ @Override - public EReference getGanttDescription_DeleteTool() { + public EReference getGanttDescription_DropTool() { return (EReference) this.ganttDescriptionEClass.getEStructuralFeatures().get(4); } @@ -237,7 +221,7 @@ public EReference getGanttDescription_DeleteTool() { * @generated */ @Override - public EReference getGanttDescription_DropTool() { + public EReference getGanttDescription_CreateTaskDependencyTool() { return (EReference) this.ganttDescriptionEClass.getEStructuralFeatures().get(5); } @@ -247,8 +231,8 @@ public EReference getGanttDescription_DropTool() { * @generated */ @Override - public EReference getGanttDescription_CreateTaskDependencyTool() { - return (EReference) this.ganttDescriptionEClass.getEStructuralFeatures().get(6); + public EAttribute getGanttDescription_DateRoundingExpression() { + return (EAttribute) this.ganttDescriptionEClass.getEStructuralFeatures().get(6); } /** @@ -361,26 +345,6 @@ public EAttribute getTaskDescription_TaskDependenciesExpression() { return (EAttribute) this.taskDescriptionEClass.getEStructuralFeatures().get(9); } - /** - * - * - * @generated - */ - @Override - public EReference getTaskDescription_Style() { - return (EReference) this.taskDescriptionEClass.getEStructuralFeatures().get(10); - } - - /** - * - * - * @generated - */ - @Override - public EReference getTaskDescription_ConditionalStyles() { - return (EReference) this.taskDescriptionEClass.getEStructuralFeatures().get(11); - } - /** * * @@ -388,7 +352,7 @@ public EReference getTaskDescription_ConditionalStyles() { */ @Override public EReference getTaskDescription_SubTaskElementDescriptions() { - return (EReference) this.taskDescriptionEClass.getEStructuralFeatures().get(12); + return (EReference) this.taskDescriptionEClass.getEStructuralFeatures().get(10); } /** @@ -398,67 +362,7 @@ public EReference getTaskDescription_SubTaskElementDescriptions() { */ @Override public EReference getTaskDescription_ReusedTaskElementDescriptions() { - return (EReference) this.taskDescriptionEClass.getEStructuralFeatures().get(13); - } - - /** - * - * - * @generated - */ - @Override - public EClass getTaskStyleDescription() { - return this.taskStyleDescriptionEClass; - } - - /** - * - * - * @generated - */ - @Override - public EAttribute getTaskStyleDescription_LabelColorExpression() { - return (EAttribute) this.taskStyleDescriptionEClass.getEStructuralFeatures().get(0); - } - - /** - * - * - * @generated - */ - @Override - public EAttribute getTaskStyleDescription_BackgroundColorExpression() { - return (EAttribute) this.taskStyleDescriptionEClass.getEStructuralFeatures().get(1); - } - - /** - * - * - * @generated - */ - @Override - public EAttribute getTaskStyleDescription_ProgressColorExpression() { - return (EAttribute) this.taskStyleDescriptionEClass.getEStructuralFeatures().get(2); - } - - /** - * - * - * @generated - */ - @Override - public EClass getConditionalTaskStyle() { - return this.conditionalTaskStyleEClass; - } - - /** - * - * - * @generated - */ - @Override - public EReference getConditionalTaskStyle_Style() { - return (EReference) this.conditionalTaskStyleEClass.getEStructuralFeatures().get(0); + return (EReference) this.taskDescriptionEClass.getEStructuralFeatures().get(11); } /** @@ -572,12 +476,12 @@ public void createPackageContents() { // Create classes and their features this.ganttDescriptionEClass = this.createEClass(GANTT_DESCRIPTION); this.createEReference(this.ganttDescriptionEClass, GANTT_DESCRIPTION__TASK_ELEMENT_DESCRIPTIONS); - this.createEReference(this.ganttDescriptionEClass, GANTT_DESCRIPTION__BACKGROUND_COLOR); this.createEReference(this.ganttDescriptionEClass, GANTT_DESCRIPTION__CREATE_TOOL); this.createEReference(this.ganttDescriptionEClass, GANTT_DESCRIPTION__EDIT_TOOL); this.createEReference(this.ganttDescriptionEClass, GANTT_DESCRIPTION__DELETE_TOOL); this.createEReference(this.ganttDescriptionEClass, GANTT_DESCRIPTION__DROP_TOOL); this.createEReference(this.ganttDescriptionEClass, GANTT_DESCRIPTION__CREATE_TASK_DEPENDENCY_TOOL); + this.createEAttribute(this.ganttDescriptionEClass, GANTT_DESCRIPTION__DATE_ROUNDING_EXPRESSION); this.taskDescriptionEClass = this.createEClass(TASK_DESCRIPTION); this.createEAttribute(this.taskDescriptionEClass, TASK_DESCRIPTION__NAME); @@ -590,19 +494,9 @@ public void createPackageContents() { this.createEAttribute(this.taskDescriptionEClass, TASK_DESCRIPTION__PROGRESS_EXPRESSION); this.createEAttribute(this.taskDescriptionEClass, TASK_DESCRIPTION__COMPUTE_START_END_DYNAMICALLY_EXPRESSION); this.createEAttribute(this.taskDescriptionEClass, TASK_DESCRIPTION__TASK_DEPENDENCIES_EXPRESSION); - this.createEReference(this.taskDescriptionEClass, TASK_DESCRIPTION__STYLE); - this.createEReference(this.taskDescriptionEClass, TASK_DESCRIPTION__CONDITIONAL_STYLES); this.createEReference(this.taskDescriptionEClass, TASK_DESCRIPTION__SUB_TASK_ELEMENT_DESCRIPTIONS); this.createEReference(this.taskDescriptionEClass, TASK_DESCRIPTION__REUSED_TASK_ELEMENT_DESCRIPTIONS); - this.taskStyleDescriptionEClass = this.createEClass(TASK_STYLE_DESCRIPTION); - this.createEAttribute(this.taskStyleDescriptionEClass, TASK_STYLE_DESCRIPTION__LABEL_COLOR_EXPRESSION); - this.createEAttribute(this.taskStyleDescriptionEClass, TASK_STYLE_DESCRIPTION__BACKGROUND_COLOR_EXPRESSION); - this.createEAttribute(this.taskStyleDescriptionEClass, TASK_STYLE_DESCRIPTION__PROGRESS_COLOR_EXPRESSION); - - this.conditionalTaskStyleEClass = this.createEClass(CONDITIONAL_TASK_STYLE); - this.createEReference(this.conditionalTaskStyleEClass, CONDITIONAL_TASK_STYLE__STYLE); - this.taskToolEClass = this.createEClass(TASK_TOOL); this.createEAttribute(this.taskToolEClass, TASK_TOOL__NAME); this.createEReference(this.taskToolEClass, TASK_TOOL__BODY); @@ -650,8 +544,6 @@ public void initializePackageContents() { // Add supertypes to classes this.ganttDescriptionEClass.getESuperTypes().add(theViewPackage.getRepresentationDescription()); - this.taskStyleDescriptionEClass.getESuperTypes().add(theViewPackage.getLabelStyle()); - this.conditionalTaskStyleEClass.getESuperTypes().add(theViewPackage.getConditional()); this.createTaskToolEClass.getESuperTypes().add(this.getTaskTool()); this.editTaskToolEClass.getESuperTypes().add(this.getTaskTool()); this.deleteTaskToolEClass.getESuperTypes().add(this.getTaskTool()); @@ -662,8 +554,6 @@ public void initializePackageContents() { this.initEClass(this.ganttDescriptionEClass, GanttDescription.class, "GanttDescription", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); this.initEReference(this.getGanttDescription_TaskElementDescriptions(), this.getTaskDescription(), null, "taskElementDescriptions", null, 0, -1, GanttDescription.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - this.initEReference(this.getGanttDescription_BackgroundColor(), theViewPackage.getUserColor(), null, "backgroundColor", null, 0, 1, GanttDescription.class, !IS_TRANSIENT, !IS_VOLATILE, - IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); this.initEReference(this.getGanttDescription_CreateTool(), this.getCreateTaskTool(), null, "createTool", null, 0, 1, GanttDescription.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); this.initEReference(this.getGanttDescription_EditTool(), this.getEditTaskTool(), null, "editTool", null, 0, 1, GanttDescription.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, @@ -674,6 +564,8 @@ public void initializePackageContents() { !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); this.initEReference(this.getGanttDescription_CreateTaskDependencyTool(), this.getCreateTaskDependencyTool(), null, "createTaskDependencyTool", null, 0, 1, GanttDescription.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + this.initEAttribute(this.getGanttDescription_DateRoundingExpression(), theViewPackage.getInterpretedExpression(), "dateRoundingExpression", "12H", 0, 1, GanttDescription.class, !IS_TRANSIENT, + !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); this.initEClass(this.taskDescriptionEClass, TaskDescription.class, "TaskDescription", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); this.initEAttribute(this.getTaskDescription_Name(), theViewPackage.getIdentifier(), "name", "", 1, 1, TaskDescription.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, @@ -696,27 +588,11 @@ public void initializePackageContents() { "aql:self.computeStartEndDynamically", 0, 1, TaskDescription.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); this.initEAttribute(this.getTaskDescription_TaskDependenciesExpression(), theViewPackage.getInterpretedExpression(), "taskDependenciesExpression", "aql:self.dependencies", 0, 1, TaskDescription.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - this.initEReference(this.getTaskDescription_Style(), this.getTaskStyleDescription(), null, "style", null, 1, 1, TaskDescription.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, - !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - this.initEReference(this.getTaskDescription_ConditionalStyles(), this.getConditionalTaskStyle(), null, "conditionalStyles", null, 0, -1, TaskDescription.class, !IS_TRANSIENT, !IS_VOLATILE, - IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); this.initEReference(this.getTaskDescription_SubTaskElementDescriptions(), this.getTaskDescription(), null, "subTaskElementDescriptions", null, 0, -1, TaskDescription.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); this.initEReference(this.getTaskDescription_ReusedTaskElementDescriptions(), this.getTaskDescription(), null, "reusedTaskElementDescriptions", null, 0, -1, TaskDescription.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - this.initEClass(this.taskStyleDescriptionEClass, TaskStyleDescription.class, "TaskStyleDescription", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - this.initEAttribute(this.getTaskStyleDescription_LabelColorExpression(), theViewPackage.getInterpretedExpression(), "labelColorExpression", "aql:self", 0, 1, TaskStyleDescription.class, - !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - this.initEAttribute(this.getTaskStyleDescription_BackgroundColorExpression(), theViewPackage.getInterpretedExpression(), "backgroundColorExpression", "aql:self", 0, 1, - TaskStyleDescription.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - this.initEAttribute(this.getTaskStyleDescription_ProgressColorExpression(), theViewPackage.getInterpretedExpression(), "progressColorExpression", "aql:self", 0, 1, TaskStyleDescription.class, - !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - - this.initEClass(this.conditionalTaskStyleEClass, ConditionalTaskStyle.class, "ConditionalTaskStyle", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - this.initEReference(this.getConditionalTaskStyle_Style(), this.getTaskStyleDescription(), null, "style", null, 1, 1, ConditionalTaskStyle.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, - IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - this.initEClass(this.taskToolEClass, TaskTool.class, "TaskTool", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); this.initEAttribute(this.getTaskTool_Name(), theViewPackage.getIdentifier(), "name", "", 1, 1, TaskTool.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); diff --git a/packages/view/backend/sirius-components-view-gantt/src/main/java/org/eclipse/sirius/components/view/gantt/impl/TaskDescriptionImpl.java b/packages/view/backend/sirius-components-view-gantt/src/main/java/org/eclipse/sirius/components/view/gantt/impl/TaskDescriptionImpl.java index c808f900d10..8ab1331ca85 100644 --- a/packages/view/backend/sirius-components-view-gantt/src/main/java/org/eclipse/sirius/components/view/gantt/impl/TaskDescriptionImpl.java +++ b/packages/view/backend/sirius-components-view-gantt/src/main/java/org/eclipse/sirius/components/view/gantt/impl/TaskDescriptionImpl.java @@ -24,10 +24,8 @@ import org.eclipse.emf.ecore.util.EObjectContainmentEList; import org.eclipse.emf.ecore.util.EObjectResolvingEList; import org.eclipse.emf.ecore.util.InternalEList; -import org.eclipse.sirius.components.view.gantt.ConditionalTaskStyle; import org.eclipse.sirius.components.view.gantt.GanttPackage; import org.eclipse.sirius.components.view.gantt.TaskDescription; -import org.eclipse.sirius.components.view.gantt.TaskStyleDescription; /** * An implementation of the model object 'Task Description'. - * - * @see #getStyle() - * @generated - * @ordered - */ - protected TaskStyleDescription style; - - /** - * The cached value of the '{@link #getConditionalStyles() Conditional Styles}' containment reference list. - * - * - * @see #getConditionalStyles() - * @generated - * @ordered - */ - protected EList conditionalStyles; - /** * The cached value of the '{@link #getSubTaskElementDescriptions() Sub Task Element Descriptions}' * containment reference list. @@ -541,67 +519,6 @@ public void setTaskDependenciesExpression(String newTaskDependenciesExpression) this.eNotify(new ENotificationImpl(this, Notification.SET, GanttPackage.TASK_DESCRIPTION__TASK_DEPENDENCIES_EXPRESSION, oldTaskDependenciesExpression, this.taskDependenciesExpression)); } - /** - * - * - * @generated - */ - @Override - public TaskStyleDescription getStyle() { - return this.style; - } - - /** - * - * - * @generated - */ - public NotificationChain basicSetStyle(TaskStyleDescription newStyle, NotificationChain msgs) { - TaskStyleDescription oldStyle = this.style; - this.style = newStyle; - if (this.eNotificationRequired()) { - ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, GanttPackage.TASK_DESCRIPTION__STYLE, oldStyle, newStyle); - if (msgs == null) - msgs = notification; - else - msgs.add(notification); - } - return msgs; - } - - /** - * - * - * @generated - */ - @Override - public void setStyle(TaskStyleDescription newStyle) { - if (newStyle != this.style) { - NotificationChain msgs = null; - if (this.style != null) - msgs = ((InternalEObject) this.style).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - GanttPackage.TASK_DESCRIPTION__STYLE, null, msgs); - if (newStyle != null) - msgs = ((InternalEObject) newStyle).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - GanttPackage.TASK_DESCRIPTION__STYLE, null, msgs); - msgs = this.basicSetStyle(newStyle, msgs); - if (msgs != null) - msgs.dispatch(); - } else if (this.eNotificationRequired()) - this.eNotify(new ENotificationImpl(this, Notification.SET, GanttPackage.TASK_DESCRIPTION__STYLE, newStyle, newStyle)); - } - - /** - * - * - * @generated - */ - @Override - public EList getConditionalStyles() { - if (this.conditionalStyles == null) { - this.conditionalStyles = new EObjectContainmentEList<>(ConditionalTaskStyle.class, this, GanttPackage.TASK_DESCRIPTION__CONDITIONAL_STYLES); - } - return this.conditionalStyles; - } - /** * * @@ -636,10 +553,6 @@ public EList getReusedTaskElementDescriptions() { @Override public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { switch (featureID) { - case GanttPackage.TASK_DESCRIPTION__STYLE: - return this.basicSetStyle(null, msgs); - case GanttPackage.TASK_DESCRIPTION__CONDITIONAL_STYLES: - return ((InternalEList) this.getConditionalStyles()).basicRemove(otherEnd, msgs); case GanttPackage.TASK_DESCRIPTION__SUB_TASK_ELEMENT_DESCRIPTIONS: return ((InternalEList) this.getSubTaskElementDescriptions()).basicRemove(otherEnd, msgs); } @@ -674,10 +587,6 @@ public Object eGet(int featureID, boolean resolve, boolean coreType) { return this.getComputeStartEndDynamicallyExpression(); case GanttPackage.TASK_DESCRIPTION__TASK_DEPENDENCIES_EXPRESSION: return this.getTaskDependenciesExpression(); - case GanttPackage.TASK_DESCRIPTION__STYLE: - return this.getStyle(); - case GanttPackage.TASK_DESCRIPTION__CONDITIONAL_STYLES: - return this.getConditionalStyles(); case GanttPackage.TASK_DESCRIPTION__SUB_TASK_ELEMENT_DESCRIPTIONS: return this.getSubTaskElementDescriptions(); case GanttPackage.TASK_DESCRIPTION__REUSED_TASK_ELEMENT_DESCRIPTIONS: @@ -725,13 +634,6 @@ public void eSet(int featureID, Object newValue) { case GanttPackage.TASK_DESCRIPTION__TASK_DEPENDENCIES_EXPRESSION: this.setTaskDependenciesExpression((String) newValue); return; - case GanttPackage.TASK_DESCRIPTION__STYLE: - this.setStyle((TaskStyleDescription) newValue); - return; - case GanttPackage.TASK_DESCRIPTION__CONDITIONAL_STYLES: - this.getConditionalStyles().clear(); - this.getConditionalStyles().addAll((Collection) newValue); - return; case GanttPackage.TASK_DESCRIPTION__SUB_TASK_ELEMENT_DESCRIPTIONS: this.getSubTaskElementDescriptions().clear(); this.getSubTaskElementDescriptions().addAll((Collection) newValue); @@ -782,12 +684,6 @@ public void eUnset(int featureID) { case GanttPackage.TASK_DESCRIPTION__TASK_DEPENDENCIES_EXPRESSION: this.setTaskDependenciesExpression(TASK_DEPENDENCIES_EXPRESSION_EDEFAULT); return; - case GanttPackage.TASK_DESCRIPTION__STYLE: - this.setStyle((TaskStyleDescription) null); - return; - case GanttPackage.TASK_DESCRIPTION__CONDITIONAL_STYLES: - this.getConditionalStyles().clear(); - return; case GanttPackage.TASK_DESCRIPTION__SUB_TASK_ELEMENT_DESCRIPTIONS: this.getSubTaskElementDescriptions().clear(); return; @@ -827,10 +723,6 @@ public boolean eIsSet(int featureID) { : !COMPUTE_START_END_DYNAMICALLY_EXPRESSION_EDEFAULT.equals(this.computeStartEndDynamicallyExpression); case GanttPackage.TASK_DESCRIPTION__TASK_DEPENDENCIES_EXPRESSION: return TASK_DEPENDENCIES_EXPRESSION_EDEFAULT == null ? this.taskDependenciesExpression != null : !TASK_DEPENDENCIES_EXPRESSION_EDEFAULT.equals(this.taskDependenciesExpression); - case GanttPackage.TASK_DESCRIPTION__STYLE: - return this.style != null; - case GanttPackage.TASK_DESCRIPTION__CONDITIONAL_STYLES: - return this.conditionalStyles != null && !this.conditionalStyles.isEmpty(); case GanttPackage.TASK_DESCRIPTION__SUB_TASK_ELEMENT_DESCRIPTIONS: return this.subTaskElementDescriptions != null && !this.subTaskElementDescriptions.isEmpty(); case GanttPackage.TASK_DESCRIPTION__REUSED_TASK_ELEMENT_DESCRIPTIONS: diff --git a/packages/view/backend/sirius-components-view-gantt/src/main/java/org/eclipse/sirius/components/view/gantt/impl/TaskStyleDescriptionImpl.java b/packages/view/backend/sirius-components-view-gantt/src/main/java/org/eclipse/sirius/components/view/gantt/impl/TaskStyleDescriptionImpl.java deleted file mode 100644 index aea4d9e692d..00000000000 --- a/packages/view/backend/sirius-components-view-gantt/src/main/java/org/eclipse/sirius/components/view/gantt/impl/TaskStyleDescriptionImpl.java +++ /dev/null @@ -1,287 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2023 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.gantt.impl; - -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.sirius.components.view.gantt.GanttPackage; -import org.eclipse.sirius.components.view.gantt.TaskStyleDescription; -import org.eclipse.sirius.components.view.impl.LabelStyleImpl; - -/** - * An implementation of the model object 'Task Style Description'. - *

- * The following features are implemented: - *

- *
    - *
  • {@link org.eclipse.sirius.components.view.gantt.impl.TaskStyleDescriptionImpl#getLabelColorExpression Label - * Color Expression}
  • - *
  • {@link org.eclipse.sirius.components.view.gantt.impl.TaskStyleDescriptionImpl#getBackgroundColorExpression - * Background Color Expression}
  • - *
  • {@link org.eclipse.sirius.components.view.gantt.impl.TaskStyleDescriptionImpl#getProgressColorExpression - * Progress Color Expression}
  • - *
- * - * @generated - */ -public abstract class TaskStyleDescriptionImpl extends LabelStyleImpl implements TaskStyleDescription { - /** - * The default value of the '{@link #getLabelColorExpression() Label Color Expression}' attribute. - * - * @see #getLabelColorExpression() - * @generated - * @ordered - */ - protected static final String LABEL_COLOR_EXPRESSION_EDEFAULT = "aql:self"; - - /** - * The cached value of the '{@link #getLabelColorExpression() Label Color Expression}' attribute. - * - * @see #getLabelColorExpression() - * @generated - * @ordered - */ - protected String labelColorExpression = LABEL_COLOR_EXPRESSION_EDEFAULT; - - /** - * The default value of the '{@link #getBackgroundColorExpression() Background Color Expression}' - * attribute. - * - * @see #getBackgroundColorExpression() - * @generated - * @ordered - */ - protected static final String BACKGROUND_COLOR_EXPRESSION_EDEFAULT = "aql:self"; - - /** - * The cached value of the '{@link #getBackgroundColorExpression() Background Color Expression}' attribute. - * - * - * @see #getBackgroundColorExpression() - * @generated - * @ordered - */ - protected String backgroundColorExpression = BACKGROUND_COLOR_EXPRESSION_EDEFAULT; - - /** - * The default value of the '{@link #getProgressColorExpression() Progress Color Expression}' attribute. - * - * - * @see #getProgressColorExpression() - * @generated - * @ordered - */ - protected static final String PROGRESS_COLOR_EXPRESSION_EDEFAULT = "aql:self"; - - /** - * The cached value of the '{@link #getProgressColorExpression() Progress Color Expression}' attribute. - * - * - * @see #getProgressColorExpression() - * @generated - * @ordered - */ - protected String progressColorExpression = PROGRESS_COLOR_EXPRESSION_EDEFAULT; - - /** - * - * - * @generated - */ - protected TaskStyleDescriptionImpl() { - super(); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return GanttPackage.Literals.TASK_STYLE_DESCRIPTION; - } - - /** - * - * - * @generated - */ - @Override - public String getLabelColorExpression() { - return this.labelColorExpression; - } - - /** - * - * - * @generated - */ - @Override - public void setLabelColorExpression(String newLabelColorExpression) { - String oldLabelColorExpression = this.labelColorExpression; - this.labelColorExpression = newLabelColorExpression; - if (this.eNotificationRequired()) - this.eNotify(new ENotificationImpl(this, Notification.SET, GanttPackage.TASK_STYLE_DESCRIPTION__LABEL_COLOR_EXPRESSION, oldLabelColorExpression, this.labelColorExpression)); - } - - /** - * - * - * @generated - */ - @Override - public String getBackgroundColorExpression() { - return this.backgroundColorExpression; - } - - /** - * - * - * @generated - */ - @Override - public void setBackgroundColorExpression(String newBackgroundColorExpression) { - String oldBackgroundColorExpression = this.backgroundColorExpression; - this.backgroundColorExpression = newBackgroundColorExpression; - if (this.eNotificationRequired()) - this.eNotify(new ENotificationImpl(this, Notification.SET, GanttPackage.TASK_STYLE_DESCRIPTION__BACKGROUND_COLOR_EXPRESSION, oldBackgroundColorExpression, this.backgroundColorExpression)); - } - - /** - * - * - * @generated - */ - @Override - public String getProgressColorExpression() { - return this.progressColorExpression; - } - - /** - * - * - * @generated - */ - @Override - public void setProgressColorExpression(String newProgressColorExpression) { - String oldProgressColorExpression = this.progressColorExpression; - this.progressColorExpression = newProgressColorExpression; - if (this.eNotificationRequired()) - this.eNotify(new ENotificationImpl(this, Notification.SET, GanttPackage.TASK_STYLE_DESCRIPTION__PROGRESS_COLOR_EXPRESSION, oldProgressColorExpression, this.progressColorExpression)); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case GanttPackage.TASK_STYLE_DESCRIPTION__LABEL_COLOR_EXPRESSION: - return this.getLabelColorExpression(); - case GanttPackage.TASK_STYLE_DESCRIPTION__BACKGROUND_COLOR_EXPRESSION: - return this.getBackgroundColorExpression(); - case GanttPackage.TASK_STYLE_DESCRIPTION__PROGRESS_COLOR_EXPRESSION: - return this.getProgressColorExpression(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case GanttPackage.TASK_STYLE_DESCRIPTION__LABEL_COLOR_EXPRESSION: - this.setLabelColorExpression((String) newValue); - return; - case GanttPackage.TASK_STYLE_DESCRIPTION__BACKGROUND_COLOR_EXPRESSION: - this.setBackgroundColorExpression((String) newValue); - return; - case GanttPackage.TASK_STYLE_DESCRIPTION__PROGRESS_COLOR_EXPRESSION: - this.setProgressColorExpression((String) newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case GanttPackage.TASK_STYLE_DESCRIPTION__LABEL_COLOR_EXPRESSION: - this.setLabelColorExpression(LABEL_COLOR_EXPRESSION_EDEFAULT); - return; - case GanttPackage.TASK_STYLE_DESCRIPTION__BACKGROUND_COLOR_EXPRESSION: - this.setBackgroundColorExpression(BACKGROUND_COLOR_EXPRESSION_EDEFAULT); - return; - case GanttPackage.TASK_STYLE_DESCRIPTION__PROGRESS_COLOR_EXPRESSION: - this.setProgressColorExpression(PROGRESS_COLOR_EXPRESSION_EDEFAULT); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case GanttPackage.TASK_STYLE_DESCRIPTION__LABEL_COLOR_EXPRESSION: - return LABEL_COLOR_EXPRESSION_EDEFAULT == null ? this.labelColorExpression != null : !LABEL_COLOR_EXPRESSION_EDEFAULT.equals(this.labelColorExpression); - case GanttPackage.TASK_STYLE_DESCRIPTION__BACKGROUND_COLOR_EXPRESSION: - return BACKGROUND_COLOR_EXPRESSION_EDEFAULT == null ? this.backgroundColorExpression != null : !BACKGROUND_COLOR_EXPRESSION_EDEFAULT.equals(this.backgroundColorExpression); - case GanttPackage.TASK_STYLE_DESCRIPTION__PROGRESS_COLOR_EXPRESSION: - return PROGRESS_COLOR_EXPRESSION_EDEFAULT == null ? this.progressColorExpression != null : !PROGRESS_COLOR_EXPRESSION_EDEFAULT.equals(this.progressColorExpression); - } - return super.eIsSet(featureID); - } - - /** - * - * - * @generated - */ - @Override - public String toString() { - if (this.eIsProxy()) - return super.toString(); - - StringBuilder result = new StringBuilder(super.toString()); - result.append(" (labelColorExpression: "); - result.append(this.labelColorExpression); - result.append(", backgroundColorExpression: "); - result.append(this.backgroundColorExpression); - result.append(", progressColorExpression: "); - result.append(this.progressColorExpression); - result.append(')'); - return result.toString(); - } - -} // TaskStyleDescriptionImpl diff --git a/packages/view/backend/sirius-components-view-gantt/src/main/java/org/eclipse/sirius/components/view/gantt/util/GanttAdapterFactory.java b/packages/view/backend/sirius-components-view-gantt/src/main/java/org/eclipse/sirius/components/view/gantt/util/GanttAdapterFactory.java index ce67a370039..1687bddfea5 100644 --- a/packages/view/backend/sirius-components-view-gantt/src/main/java/org/eclipse/sirius/components/view/gantt/util/GanttAdapterFactory.java +++ b/packages/view/backend/sirius-components-view-gantt/src/main/java/org/eclipse/sirius/components/view/gantt/util/GanttAdapterFactory.java @@ -16,10 +16,7 @@ import org.eclipse.emf.common.notify.Notifier; import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl; import org.eclipse.emf.ecore.EObject; -import org.eclipse.sirius.components.view.Conditional; -import org.eclipse.sirius.components.view.LabelStyle; import org.eclipse.sirius.components.view.RepresentationDescription; -import org.eclipse.sirius.components.view.gantt.ConditionalTaskStyle; import org.eclipse.sirius.components.view.gantt.CreateTaskDependencyTool; import org.eclipse.sirius.components.view.gantt.CreateTaskTool; import org.eclipse.sirius.components.view.gantt.DeleteTaskTool; @@ -28,7 +25,6 @@ import org.eclipse.sirius.components.view.gantt.GanttDescription; import org.eclipse.sirius.components.view.gantt.GanttPackage; import org.eclipse.sirius.components.view.gantt.TaskDescription; -import org.eclipse.sirius.components.view.gantt.TaskStyleDescription; import org.eclipse.sirius.components.view.gantt.TaskTool; /** @@ -92,16 +88,6 @@ public Adapter caseTaskDescription(TaskDescription object) { return GanttAdapterFactory.this.createTaskDescriptionAdapter(); } - @Override - public Adapter caseTaskStyleDescription(TaskStyleDescription object) { - return GanttAdapterFactory.this.createTaskStyleDescriptionAdapter(); - } - - @Override - public Adapter caseConditionalTaskStyle(ConditionalTaskStyle object) { - return GanttAdapterFactory.this.createConditionalTaskStyleAdapter(); - } - @Override public Adapter caseTaskTool(TaskTool object) { return GanttAdapterFactory.this.createTaskToolAdapter(); @@ -137,16 +123,6 @@ public Adapter caseRepresentationDescription(RepresentationDescription object) { return GanttAdapterFactory.this.createRepresentationDescriptionAdapter(); } - @Override - public Adapter caseLabelStyle(LabelStyle object) { - return GanttAdapterFactory.this.createLabelStyleAdapter(); - } - - @Override - public Adapter caseConditional(Conditional object) { - return GanttAdapterFactory.this.createConditionalAdapter(); - } - @Override public Adapter defaultCase(EObject object) { return GanttAdapterFactory.this.createEObjectAdapter(); @@ -194,34 +170,6 @@ public Adapter createTaskDescriptionAdapter() { return null; } - /** - * Creates a new adapter for an object of class - * '{@link org.eclipse.sirius.components.view.gantt.TaskStyleDescription Task Style 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.gantt.TaskStyleDescription - * @generated - */ - public Adapter createTaskStyleDescriptionAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class - * '{@link org.eclipse.sirius.components.view.gantt.ConditionalTaskStyle Conditional Task Style}'. 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.gantt.ConditionalTaskStyle - * @generated - */ - public Adapter createConditionalTaskStyleAdapter() { - return null; - } - /** * Creates a new adapter for an object of class '{@link org.eclipse.sirius.components.view.gantt.TaskTool Task * Tool}'. This default implementation returns null so that we can easily ignore cases; @@ -319,33 +267,6 @@ public Adapter createRepresentationDescriptionAdapter() { return null; } - /** - * Creates a new adapter for an object of class '{@link org.eclipse.sirius.components.view.LabelStyle Label - * Style}'. 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.LabelStyle - * @generated - */ - public Adapter createLabelStyleAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.sirius.components.view.Conditional - * Conditional}'. 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.Conditional - * @generated - */ - public Adapter createConditionalAdapter() { - return null; - } - /** * Creates a new adapter for the default case. This default implementation returns null. * diff --git a/packages/view/backend/sirius-components-view-gantt/src/main/java/org/eclipse/sirius/components/view/gantt/util/GanttSwitch.java b/packages/view/backend/sirius-components-view-gantt/src/main/java/org/eclipse/sirius/components/view/gantt/util/GanttSwitch.java index 392fd804a4b..37ee7a6b2fa 100644 --- a/packages/view/backend/sirius-components-view-gantt/src/main/java/org/eclipse/sirius/components/view/gantt/util/GanttSwitch.java +++ b/packages/view/backend/sirius-components-view-gantt/src/main/java/org/eclipse/sirius/components/view/gantt/util/GanttSwitch.java @@ -15,10 +15,7 @@ import org.eclipse.emf.ecore.EObject; import org.eclipse.emf.ecore.EPackage; import org.eclipse.emf.ecore.util.Switch; -import org.eclipse.sirius.components.view.Conditional; -import org.eclipse.sirius.components.view.LabelStyle; import org.eclipse.sirius.components.view.RepresentationDescription; -import org.eclipse.sirius.components.view.gantt.ConditionalTaskStyle; import org.eclipse.sirius.components.view.gantt.CreateTaskDependencyTool; import org.eclipse.sirius.components.view.gantt.CreateTaskTool; import org.eclipse.sirius.components.view.gantt.DeleteTaskTool; @@ -27,7 +24,6 @@ import org.eclipse.sirius.components.view.gantt.GanttDescription; import org.eclipse.sirius.components.view.gantt.GanttPackage; import org.eclipse.sirius.components.view.gantt.TaskDescription; -import org.eclipse.sirius.components.view.gantt.TaskStyleDescription; import org.eclipse.sirius.components.view.gantt.TaskTool; /** @@ -97,24 +93,6 @@ protected T doSwitch(int classifierID, EObject theEObject) { result = this.defaultCase(theEObject); return result; } - case GanttPackage.TASK_STYLE_DESCRIPTION: { - TaskStyleDescription taskStyleDescription = (TaskStyleDescription) theEObject; - T result = this.caseTaskStyleDescription(taskStyleDescription); - if (result == null) - result = this.caseLabelStyle(taskStyleDescription); - if (result == null) - result = this.defaultCase(theEObject); - return result; - } - case GanttPackage.CONDITIONAL_TASK_STYLE: { - ConditionalTaskStyle conditionalTaskStyle = (ConditionalTaskStyle) theEObject; - T result = this.caseConditionalTaskStyle(conditionalTaskStyle); - if (result == null) - result = this.caseConditional(conditionalTaskStyle); - if (result == null) - result = this.defaultCase(theEObject); - return result; - } case GanttPackage.TASK_TOOL: { TaskTool taskTool = (TaskTool) theEObject; T result = this.caseTaskTool(taskTool); @@ -201,36 +179,6 @@ public T caseTaskDescription(TaskDescription object) { return null; } - /** - * Returns the result of interpreting the object as an instance of 'Task Style 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 'Task Style Description'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseTaskStyleDescription(TaskStyleDescription object) { - return null; - } - - /** - * Returns the result of interpreting the object as an instance of 'Conditional Task Style'. 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 'Conditional Task Style'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseConditionalTaskStyle(ConditionalTaskStyle object) { - return null; - } - /** * Returns the result of interpreting the object as an instance of 'Task Tool'. * This implementation returns null; returning a non-null result will terminate the switch. @@ -335,34 +283,6 @@ public T caseRepresentationDescription(RepresentationDescription object) { return null; } - /** - * Returns the result of interpreting the object as an instance of 'Label Style'. - * 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 'Label Style'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseLabelStyle(LabelStyle object) { - return null; - } - - /** - * Returns the result of interpreting the object as an instance of 'Conditional'. - * 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 'Conditional'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseConditional(Conditional object) { - return null; - } - /** * Returns the result of interpreting the object as an instance of 'EObject'. This * implementation returns null; returning a non-null result will terminate the switch, but this is the last case diff --git a/packages/view/backend/sirius-components-view-gantt/src/main/resources/model/gantt.ecore b/packages/view/backend/sirius-components-view-gantt/src/main/resources/model/gantt.ecore index c4bb447e6da..09324294727 100644 --- a/packages/view/backend/sirius-components-view-gantt/src/main/resources/model/gantt.ecore +++ b/packages/view/backend/sirius-components-view-gantt/src/main/resources/model/gantt.ecore @@ -4,8 +4,6 @@ - + - - - - - - - - - - diff --git a/packages/view/backend/sirius-components-view-gantt/src/main/resources/model/gantt.genmodel b/packages/view/backend/sirius-components-view-gantt/src/main/resources/model/gantt.genmodel index cc98f1823d6..bc760dca350 100644 --- a/packages/view/backend/sirius-components-view-gantt/src/main/resources/model/gantt.genmodel +++ b/packages/view/backend/sirius-components-view-gantt/src/main/resources/model/gantt.genmodel @@ -16,12 +16,12 @@ extensibleProviderFactory="true" childCreationExtenders="true" ecorePackage="gantt.ecore#/"> - + @@ -34,19 +34,9 @@ - - - - - - - - - -