Skip to content

Commit

Permalink
[1268] Use literal instead of name for Enum label & newValue
Browse files Browse the repository at this point in the history
Bug: eclipse-sirius#1268
Signed-off-by: Axel RICHARD <axel.richard@obeo.fr>
  • Loading branch information
AxelRICHARD authored and gcoutable committed Jun 15, 2022
1 parent a789fca commit 38e1f3b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
- https://github.com/eclipse-sirius/sirius-components/issues/1253[#1253] [studio] Fix the computation of unsynchronized semantic elements in studios (which broke the use of the Create View operation)
- https://github.com/eclipse-sirius/sirius-components/issues/1193[#1193] [layout] Fix edge layout on diagrams with node lists.
- https://github.com/eclipse-sirius/sirius-components/issues/1260[#1260] [workbench] Fix download project fails when model contains a Form Description Editor
- https://github.com/eclipse-sirius/sirius-components/issues/1268[#1268] [form] Use literal instead of name for Enum label & newValue

=== Improvements

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2019, 2021 Obeo.
* Copyright (c) 2019, 2022 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
Expand Down Expand Up @@ -135,7 +135,7 @@ private Function<VariableManager, String> getOptionLabelProvider() {
return variableManager -> {
Object litteral = variableManager.getVariables().get(SelectComponent.CANDIDATE_VARIABLE);
if (litteral instanceof Enumerator) {
return ((Enumerator) litteral).getName();
return ((Enumerator) litteral).getLiteral();
}
return ""; //$NON-NLS-1$
};
Expand Down Expand Up @@ -180,7 +180,7 @@ private BiFunction<VariableManager, String, IStatus> getNewValueHandler() {
EEnum eEnum = (EEnum) eType;
EEnumLiteral literal = eEnum.getEEnumLiteral(id);
if (literal != null) {
Object value = EcoreUtil.createFromString(eEnum, literal.getName());
Object value = EcoreUtil.createFromString(eEnum, literal.getLiteral());
eObject.eSet(eAttribute, value);
}
}
Expand Down

0 comments on commit 38e1f3b

Please sign in to comment.