From 60d679681cd7fbbcb14523e758026d68e7c270d5 Mon Sep 17 00:00:00 2001 From: Michael Charfadi Date: Tue, 30 May 2023 10:52:46 +0200 Subject: [PATCH] [2004] Add an optional icon to select widget options MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bug: https://github.com/eclipse-sirius/sirius-components/issues/2004 Signed-off-by: Michaƫl Charfadi --- CHANGELOG.adoc | 3 + .../ShowIconOptionSelectWidget.jpg | Bin 0 -> 25398 bytes ...ainmentReferenceIfDescriptionProvider.java | 3 +- ...ainmentReferenceIfDescriptionProvider.java | 1 + .../forms/WidgetDescriptionConverter.java | 3 +- .../emf/services/ObjectService.java | 6 +- .../components/MultiSelectStyleProvider.java | 2 + .../components/SelectStyleProvider.java | 2 + ...wFormDescriptionEditorConverterSwitch.java | 2 + .../src/main/resources/schema/form.graphqls | 1 + .../sirius-components-forms-graphql/pom.xml | 5 ++ .../form/SelectOptionIconURLDataFetcher.java | 42 +++++++++ .../components/forms/MultiSelectStyle.java | 20 ++++- .../sirius/components/forms/SelectOption.java | 20 ++++- .../sirius/components/forms/SelectStyle.java | 20 ++++- .../components/MultiSelectComponent.java | 16 ++-- .../forms/components/SelectComponent.java | 16 ++-- .../description/MultiSelectDescription.java | 14 +++ .../forms/description/SelectDescription.java | 14 +++ .../src/form/FormEventFragments.ts | 2 + .../src/form/FormEventFragments.types.ts | 1 + .../MultiSelectPropertySection.tsx | 21 ++++- .../SelectPropertySection.tsx | 22 ++++- .../MultiSelectPropertySection.test.tsx.snap | 20 ++--- .../SelectPropertySection.test.tsx.snap | 20 ++--- ...nalMultiSelectDescriptionStyleBuilder.java | 9 ++ ...ditionalSelectDescriptionStyleBuilder.java | 9 ++ .../MultiSelectDescriptionStyleBuilder.java | 9 ++ .../SelectDescriptionStyleBuilder.java | 9 ++ ...ltiSelectDescriptionStyleItemProvider.java | 14 +++ ...nalSelectDescriptionStyleItemProvider.java | 14 +++ ...ltiSelectDescriptionStyleItemProvider.java | 14 +++ .../SelectDescriptionStyleItemProvider.java | 14 +++ .../src/main/resources/plugin.properties | 2 + .../NodeStylePropertiesConfigurer.java | 9 +- .../emf/form/MultiSelectStyleProvider.java | 2 + .../view/emf/form/SelectStyleProvider.java | 2 + .../ViewFormDescriptionConverterSwitch.java | 8 ++ .../view/MultiSelectDescriptionStyle.java | 23 +++++ .../view/SelectDescriptionStyle.java | 23 +++++ .../sirius/components/view/ViewPackage.java | 80 +++++++++++++++++- ...tionalMultiSelectDescriptionStyleImpl.java | 61 +++++++++++++ ...ConditionalSelectDescriptionStyleImpl.java | 61 +++++++++++++ .../impl/MultiSelectDescriptionStyleImpl.java | 57 +++++++++++++ .../view/impl/SelectDescriptionStyleImpl.java | 56 ++++++++++++ .../components/view/impl/ViewPackageImpl.java | 26 ++++++ .../src/main/resources/model/view.ecore | 2 + .../src/main/resources/model/view.genmodel | 2 + 48 files changed, 725 insertions(+), 57 deletions(-) create mode 100644 doc/screenshots/ShowIconOptionSelectWidget.jpg create mode 100644 packages/forms/backend/sirius-components-forms-graphql/src/main/java/org/eclipse/sirius/components/forms/graphql/datafetchers/form/SelectOptionIconURLDataFetcher.java diff --git a/CHANGELOG.adoc b/CHANGELOG.adoc index d9909050a2..8c17ccd045 100644 --- a/CHANGELOG.adoc +++ b/CHANGELOG.adoc @@ -36,6 +36,9 @@ An absent/empty candidates expression now simply means the widget is empty. === New Features - https://github.com/eclipse-sirius/sirius-components/issues/2039[#2039] [project] A new "Blank Studio" project template is available to create a project with the "studio" nature but no initial content +- https://github.com/eclipse-sirius/sirius-components/issues/2004[#2004] [form] Add the possibility to show select options' icons. ++ +image:doc/screenshots/ShowIconOptionSelectWidget.jpg[Icons on select widget option,70%,30%] === Improvements diff --git a/doc/screenshots/ShowIconOptionSelectWidget.jpg b/doc/screenshots/ShowIconOptionSelectWidget.jpg new file mode 100644 index 0000000000000000000000000000000000000000..07038fec4156f44896612af9d921106c80653472 GIT binary patch literal 25398 zcmeFZcUV(Rw>KO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uy!=y zI{cn4Ii4C(B!ZLL`G?)jDzYponBdMhb(+#Vc^LD1+cTqiuDYCh$(>S~lHJpfXXK2~ z%_o1x)9OEx(ysy0{G0H{!x~J%X69GMYgRD>G`7`5={s}K1b6 variableManager.get(SelectComponent.CANDIDATE_VARIABLE, Object.class).map(this.objectService::getImagePath).orElse("")) .newValueHandler(this.getNewValueHandler()) .diagnosticsProvider(this.propertiesValidationProvider.getDiagnosticsProvider()) .kindProvider(this.propertiesValidationProvider.getKindProvider()) diff --git a/packages/compatibility/backend/sirius-components-compatibility-emf/src/main/java/org/eclipse/sirius/components/compatibility/emf/properties/MultiValuedNonContainmentReferenceIfDescriptionProvider.java b/packages/compatibility/backend/sirius-components-compatibility-emf/src/main/java/org/eclipse/sirius/components/compatibility/emf/properties/MultiValuedNonContainmentReferenceIfDescriptionProvider.java index ea5e708667..532fc999bc 100644 --- a/packages/compatibility/backend/sirius-components-compatibility-emf/src/main/java/org/eclipse/sirius/components/compatibility/emf/properties/MultiValuedNonContainmentReferenceIfDescriptionProvider.java +++ b/packages/compatibility/backend/sirius-components-compatibility-emf/src/main/java/org/eclipse/sirius/components/compatibility/emf/properties/MultiValuedNonContainmentReferenceIfDescriptionProvider.java @@ -92,6 +92,7 @@ private MultiSelectDescription getMultiSelectDescription() { .optionsProvider(this.getOptionsProvider()) .optionIdProvider(this.getOptionIdProvider()) .optionLabelProvider(this.getOptionLabelProvider()) + .optionIconURLProvider(variableManager -> variableManager.get(SelectComponent.CANDIDATE_VARIABLE, Object.class).map(this.objectService::getImagePath).orElse("")) .newValuesHandler(this.getNewValuesHandler()) .diagnosticsProvider(this.propertiesValidationProvider.getDiagnosticsProvider()) .kindProvider(this.propertiesValidationProvider.getKindProvider()) diff --git a/packages/compatibility/backend/sirius-components-compatibility/src/main/java/org/eclipse/sirius/components/compatibility/forms/WidgetDescriptionConverter.java b/packages/compatibility/backend/sirius-components-compatibility/src/main/java/org/eclipse/sirius/components/compatibility/forms/WidgetDescriptionConverter.java index 01696bbe53..2e45c7f713 100644 --- a/packages/compatibility/backend/sirius-components-compatibility/src/main/java/org/eclipse/sirius/components/compatibility/forms/WidgetDescriptionConverter.java +++ b/packages/compatibility/backend/sirius-components-compatibility/src/main/java/org/eclipse/sirius/components/compatibility/forms/WidgetDescriptionConverter.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2019, 2022 Obeo. + * Copyright (c) 2019, 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 @@ -260,6 +260,7 @@ private SelectDescription convertSelect(org.eclipse.sirius.properties.SelectDesc .optionsProvider(optionsProvider) .optionIdProvider(optionIdProvider) .optionLabelProvider(optionLabelProvider) + .optionIconURLProvider(vm -> "") .newValueHandler(newValueHandler) .diagnosticsProvider(variableManager -> List.of()) .kindProvider(object -> "") diff --git a/packages/emf/backend/sirius-components-emf/src/main/java/org/eclipse/sirius/components/emf/services/ObjectService.java b/packages/emf/backend/sirius-components-emf/src/main/java/org/eclipse/sirius/components/emf/services/ObjectService.java index bd9457dec9..4e53faacc1 100644 --- a/packages/emf/backend/sirius-components-emf/src/main/java/org/eclipse/sirius/components/emf/services/ObjectService.java +++ b/packages/emf/backend/sirius-components-emf/src/main/java/org/eclipse/sirius/components/emf/services/ObjectService.java @@ -26,7 +26,6 @@ import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.EObject; import org.eclipse.emf.ecore.InternalEObject; -import org.eclipse.emf.ecore.impl.DynamicEObjectImpl; import org.eclipse.emf.ecore.resource.Resource; import org.eclipse.emf.ecore.resource.ResourceSet; import org.eclipse.emf.edit.domain.EditingDomain; @@ -34,6 +33,7 @@ import org.eclipse.emf.edit.provider.ComposedImage; import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; import org.eclipse.emf.edit.provider.IItemLabelProvider; +import org.eclipse.emf.edit.provider.ReflectiveItemProvider; import org.eclipse.sirius.components.core.api.IEditingContext; import org.eclipse.sirius.components.core.api.IObjectService; import org.eclipse.sirius.components.emf.services.api.IEMFKindService; @@ -151,10 +151,10 @@ public String getFullLabel(Object object) { @Override public String getImagePath(Object object) { - if (object instanceof EObject eObject && !(object instanceof DynamicEObjectImpl)) { + if (object instanceof EObject eObject) { Adapter adapter = this.composedAdapterFactory.adapt(eObject, IItemLabelProvider.class); - if (adapter instanceof IItemLabelProvider labelProvider) { + if (adapter instanceof IItemLabelProvider labelProvider && !(adapter instanceof ReflectiveItemProvider)) { try { Object image = labelProvider.getImage(eObject); String imageFullPath = this.findImagePath(image); diff --git a/packages/formdescriptioneditors/backend/sirius-components-formdescriptioneditors/src/main/java/org/eclipse/sirius/components/formdescriptioneditors/components/MultiSelectStyleProvider.java b/packages/formdescriptioneditors/backend/sirius-components-formdescriptioneditors/src/main/java/org/eclipse/sirius/components/formdescriptioneditors/components/MultiSelectStyleProvider.java index 8e3b100621..2193bc5d6d 100644 --- a/packages/formdescriptioneditors/backend/sirius-components-formdescriptioneditors/src/main/java/org/eclipse/sirius/components/formdescriptioneditors/components/MultiSelectStyleProvider.java +++ b/packages/formdescriptioneditors/backend/sirius-components-formdescriptioneditors/src/main/java/org/eclipse/sirius/components/formdescriptioneditors/components/MultiSelectStyleProvider.java @@ -55,6 +55,7 @@ public MultiSelectStyle build() { boolean bold = this.viewStyle.isBold(); boolean underline = this.viewStyle.isUnderline(); boolean strikeThrough = this.viewStyle.isStrikeThrough(); + boolean isShowIcon = this.viewStyle.isShowIcon(); // @formatter:off return multiSelectStyleBuilder @@ -63,6 +64,7 @@ public MultiSelectStyle build() { .bold(bold) .underline(underline) .strikeThrough(strikeThrough) + .showIcon(isShowIcon) .build(); // @formatter:on } diff --git a/packages/formdescriptioneditors/backend/sirius-components-formdescriptioneditors/src/main/java/org/eclipse/sirius/components/formdescriptioneditors/components/SelectStyleProvider.java b/packages/formdescriptioneditors/backend/sirius-components-formdescriptioneditors/src/main/java/org/eclipse/sirius/components/formdescriptioneditors/components/SelectStyleProvider.java index a59cc81424..71013f4ba3 100644 --- a/packages/formdescriptioneditors/backend/sirius-components-formdescriptioneditors/src/main/java/org/eclipse/sirius/components/formdescriptioneditors/components/SelectStyleProvider.java +++ b/packages/formdescriptioneditors/backend/sirius-components-formdescriptioneditors/src/main/java/org/eclipse/sirius/components/formdescriptioneditors/components/SelectStyleProvider.java @@ -55,6 +55,7 @@ public SelectStyle build() { boolean bold = this.viewStyle.isBold(); boolean underline = this.viewStyle.isUnderline(); boolean strikeThrough = this.viewStyle.isStrikeThrough(); + boolean isShowIcon = this.viewStyle.isShowIcon(); // @formatter:off return selectStyleBuilder @@ -63,6 +64,7 @@ public SelectStyle build() { .bold(bold) .underline(underline) .strikeThrough(strikeThrough) + .showIcon(isShowIcon) .build(); // @formatter:on } diff --git a/packages/formdescriptioneditors/backend/sirius-components-formdescriptioneditors/src/main/java/org/eclipse/sirius/components/formdescriptioneditors/components/ViewFormDescriptionEditorConverterSwitch.java b/packages/formdescriptioneditors/backend/sirius-components-formdescriptioneditors/src/main/java/org/eclipse/sirius/components/formdescriptioneditors/components/ViewFormDescriptionEditorConverterSwitch.java index 94a81d009c..c00c84b113 100644 --- a/packages/formdescriptioneditors/backend/sirius-components-formdescriptioneditors/src/main/java/org/eclipse/sirius/components/formdescriptioneditors/components/ViewFormDescriptionEditorConverterSwitch.java +++ b/packages/formdescriptioneditors/backend/sirius-components-formdescriptioneditors/src/main/java/org/eclipse/sirius/components/formdescriptioneditors/components/ViewFormDescriptionEditorConverterSwitch.java @@ -167,6 +167,7 @@ public AbstractWidgetDescription caseSelectDescription(org.eclipse.sirius.compon .valueProvider(vm -> "") .optionIdProvider(vm -> "") .optionLabelProvider(vm -> "") + .optionIconURLProvider(vm -> "") .optionsProvider(vm -> List.of()) .newValueHandler((vm, value) -> new Success()) .diagnosticsProvider(vm -> List.of()) @@ -228,6 +229,7 @@ public AbstractWidgetDescription caseMultiSelectDescription(org.eclipse.sirius.c .valuesProvider(vm -> List.of()) .optionIdProvider(vm -> "") .optionLabelProvider(vm -> "") + .optionIconURLProvider(vm -> "") .optionsProvider(vm -> List.of()) .newValuesHandler((vm, values) -> new Success()) .diagnosticsProvider(vm -> List.of()) diff --git a/packages/forms/backend/sirius-components-collaborative-forms/src/main/resources/schema/form.graphqls b/packages/forms/backend/sirius-components-collaborative-forms/src/main/resources/schema/form.graphqls index 81ed474a55..b7818d6711 100644 --- a/packages/forms/backend/sirius-components-collaborative-forms/src/main/resources/schema/form.graphqls +++ b/packages/forms/backend/sirius-components-collaborative-forms/src/main/resources/schema/form.graphqls @@ -180,6 +180,7 @@ type Select implements Widget { type SelectOption { id: ID! label: String! + iconURL: String } type SelectStyle { diff --git a/packages/forms/backend/sirius-components-forms-graphql/pom.xml b/packages/forms/backend/sirius-components-forms-graphql/pom.xml index 51bdeec9c6..5f62ccae6c 100644 --- a/packages/forms/backend/sirius-components-forms-graphql/pom.xml +++ b/packages/forms/backend/sirius-components-forms-graphql/pom.xml @@ -58,6 +58,11 @@ sirius-components-annotations-spring 2023.6.1 + + org.eclipse.sirius + sirius-components-forms + 2023.6.1 + org.eclipse.sirius sirius-components-collaborative-forms diff --git a/packages/forms/backend/sirius-components-forms-graphql/src/main/java/org/eclipse/sirius/components/forms/graphql/datafetchers/form/SelectOptionIconURLDataFetcher.java b/packages/forms/backend/sirius-components-forms-graphql/src/main/java/org/eclipse/sirius/components/forms/graphql/datafetchers/form/SelectOptionIconURLDataFetcher.java new file mode 100644 index 0000000000..abb05b51f0 --- /dev/null +++ b/packages/forms/backend/sirius-components-forms-graphql/src/main/java/org/eclipse/sirius/components/forms/graphql/datafetchers/form/SelectOptionIconURLDataFetcher.java @@ -0,0 +1,42 @@ +/******************************************************************************* + * 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.forms.graphql.datafetchers.form; + +import org.eclipse.sirius.components.annotations.spring.graphql.QueryDataFetcher; +import org.eclipse.sirius.components.forms.SelectOption; +import org.eclipse.sirius.components.graphql.api.IDataFetcherWithFieldCoordinates; +import org.eclipse.sirius.components.graphql.api.URLConstants; + +import graphql.schema.DataFetchingEnvironment; + +/** + * Data fetcher for SelectOption.iconURL, to rewrite the relative path of the image into an absolute path on the server. + *

+ * If the SelectOption.iconURL is of the form path/to/image.svg, the rewritten value which will + * be seen by the frontend will be /api/images/path/to/image.svg. + * + * @author mcharfadi + */ +@QueryDataFetcher(type = "SelectOption", field = "iconURL") +public class SelectOptionIconURLDataFetcher implements IDataFetcherWithFieldCoordinates { + + @Override + public String get(DataFetchingEnvironment environment) throws Exception { + SelectOption option = environment.getSource(); + String result = option.getIconURL(); + if (result != null && !result.isBlank()) { + result = URLConstants.IMAGE_BASE_PATH + result; + } + return result; + } +} diff --git a/packages/forms/backend/sirius-components-forms/src/main/java/org/eclipse/sirius/components/forms/MultiSelectStyle.java b/packages/forms/backend/sirius-components-forms/src/main/java/org/eclipse/sirius/components/forms/MultiSelectStyle.java index e338a7ad88..afbec6cd1c 100644 --- a/packages/forms/backend/sirius-components-forms/src/main/java/org/eclipse/sirius/components/forms/MultiSelectStyle.java +++ b/packages/forms/backend/sirius-components-forms/src/main/java/org/eclipse/sirius/components/forms/MultiSelectStyle.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2022 Obeo. + * Copyright (c) 2022, 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 @@ -29,6 +29,8 @@ public final class MultiSelectStyle extends AbstractFontStyle { private String foregroundColor; + private boolean showIcon; + private MultiSelectStyle() { // Prevent instantiation } @@ -41,14 +43,18 @@ public String getForegroundColor() { return this.foregroundColor; } + public boolean isShowIcon() { + return this.showIcon; + } + public static Builder newMultiSelectStyle() { return new Builder(); } @Override public String toString() { - String pattern = "{0} '{'backgroundColor: {1}, foregroundColor: {2}, fontSize: {3}, italic: {4}, bold: {5}, underline: {6}, strikeThrough: {7},'}'"; - return MessageFormat.format(pattern, this.getClass().getSimpleName(), this.backgroundColor, this.foregroundColor, this.fontSize, this.italic, this.bold, this.underline, this.strikeThrough); + String pattern = "{0} '{'backgroundColor: {1}, foregroundColor: {2}, fontSize: {3}, italic: {4}, bold: {5}, underline: {6}, strikeThrough: {7}, isShowIcon: {8'}'}'"; + return MessageFormat.format(pattern, this.getClass().getSimpleName(), this.backgroundColor, this.foregroundColor, this.fontSize, this.italic, this.bold, this.underline, this.strikeThrough, this.showIcon); } /** @@ -72,6 +78,8 @@ public static final class Builder { private boolean strikeThrough; + private boolean showIcon; + private Builder() { } @@ -100,6 +108,11 @@ public Builder bold(boolean bold) { return this; } + public Builder showIcon(boolean showIcon) { + this.showIcon = showIcon; + return this; + } + public Builder underline(boolean underline) { this.underline = underline; return this; @@ -119,6 +132,7 @@ public MultiSelectStyle build() { multiSelectStyle.bold = this.bold; multiSelectStyle.underline = this.underline; multiSelectStyle.strikeThrough = this.strikeThrough; + multiSelectStyle.showIcon = this.showIcon; return multiSelectStyle; } diff --git a/packages/forms/backend/sirius-components-forms/src/main/java/org/eclipse/sirius/components/forms/SelectOption.java b/packages/forms/backend/sirius-components-forms/src/main/java/org/eclipse/sirius/components/forms/SelectOption.java index 2125549c4c..744ca8cebe 100644 --- a/packages/forms/backend/sirius-components-forms/src/main/java/org/eclipse/sirius/components/forms/SelectOption.java +++ b/packages/forms/backend/sirius-components-forms/src/main/java/org/eclipse/sirius/components/forms/SelectOption.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2019, 2022 Obeo. + * Copyright (c) 2019, 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 @@ -28,6 +28,8 @@ public final class SelectOption { private String label; + private String iconURL; + private SelectOption() { // Prevent instantiation } @@ -40,14 +42,18 @@ public String getLabel() { return this.label; } + public String getIconURL() { + return this.iconURL; + } + public static Builder newSelectOption(String id) { return new Builder(id); } @Override public String toString() { - String pattern = "{0} '{'id: {1}, label: {2}'}'"; - return MessageFormat.format(pattern, this.getClass().getSimpleName(), this.id, this.label); + String pattern = "{0} '{'id: {1}, label: {2}', iconUrl: {3}'"; + return MessageFormat.format(pattern, this.getClass().getSimpleName(), this.id, this.label, this.iconURL); } /** @@ -61,6 +67,8 @@ public static final class Builder { private String label; + private String iconURL; + private Builder(String id) { this.id = Objects.requireNonNull(id); } @@ -70,10 +78,16 @@ public Builder label(String label) { return this; } + public Builder iconURL(String iconURL) { + this.iconURL = iconURL; + return this; + } + public SelectOption build() { SelectOption selectOption = new SelectOption(); selectOption.id = Objects.requireNonNull(this.id); selectOption.label = Objects.requireNonNull(this.label); + selectOption.iconURL = this.iconURL; return selectOption; } } diff --git a/packages/forms/backend/sirius-components-forms/src/main/java/org/eclipse/sirius/components/forms/SelectStyle.java b/packages/forms/backend/sirius-components-forms/src/main/java/org/eclipse/sirius/components/forms/SelectStyle.java index 7f48760884..ea90c41583 100644 --- a/packages/forms/backend/sirius-components-forms/src/main/java/org/eclipse/sirius/components/forms/SelectStyle.java +++ b/packages/forms/backend/sirius-components-forms/src/main/java/org/eclipse/sirius/components/forms/SelectStyle.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2022 Obeo. + * Copyright (c) 2022, 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 @@ -28,6 +28,8 @@ public final class SelectStyle extends AbstractFontStyle { private String foregroundColor; + private boolean showIcon; + private SelectStyle() { // Prevent instantiation } @@ -40,14 +42,18 @@ public String getForegroundColor() { return this.foregroundColor; } + public boolean isShowIcon() { + return this.showIcon; + } + public static Builder newSelectStyle() { return new Builder(); } @Override public String toString() { - String pattern = "{0} '{'backgroundColor: {1}, foregroundColor: {2}, fontSize: {3}, italic: {4}, bold: {5}, underline: {6}, strikeThrough: {7},'}'"; - return MessageFormat.format(pattern, this.getClass().getSimpleName(), this.backgroundColor, this.foregroundColor, this.fontSize, this.italic, this.bold, this.underline, this.strikeThrough); + String pattern = "{0} '{'backgroundColor: {1}, foregroundColor: {2}, fontSize: {3}, italic: {4}, bold: {5}, underline: {6}, strikeThrough: {7}, isShowIcon: {8'}'"; + return MessageFormat.format(pattern, this.getClass().getSimpleName(), this.backgroundColor, this.foregroundColor, this.fontSize, this.italic, this.bold, this.underline, this.strikeThrough, this.showIcon); } /** @@ -71,6 +77,8 @@ public static final class Builder { private boolean strikeThrough; + private boolean showIcon; + private Builder() { } @@ -99,6 +107,11 @@ public Builder bold(boolean bold) { return this; } + public Builder showIcon(boolean showIcon) { + this.showIcon = showIcon; + return this; + } + public Builder underline(boolean underline) { this.underline = underline; return this; @@ -118,6 +131,7 @@ public SelectStyle build() { selectStyle.bold = this.bold; selectStyle.underline = this.underline; selectStyle.strikeThrough = this.strikeThrough; + selectStyle.showIcon = this.showIcon; return selectStyle; } diff --git a/packages/forms/backend/sirius-components-forms/src/main/java/org/eclipse/sirius/components/forms/components/MultiSelectComponent.java b/packages/forms/backend/sirius-components-forms/src/main/java/org/eclipse/sirius/components/forms/components/MultiSelectComponent.java index cdea78500c..b5e8b4dcb4 100644 --- a/packages/forms/backend/sirius-components-forms/src/main/java/org/eclipse/sirius/components/forms/components/MultiSelectComponent.java +++ b/packages/forms/backend/sirius-components-forms/src/main/java/org/eclipse/sirius/components/forms/components/MultiSelectComponent.java @@ -54,6 +54,7 @@ public Element render() { String iconURL = multiSelectDescription.getIconURLProvider().apply(variableManager); List optionCandidates = multiSelectDescription.getOptionsProvider().apply(variableManager); List values = multiSelectDescription.getValuesProvider().apply(variableManager); + var multiSelectStyle = multiSelectDescription.getStyleProvider().apply(variableManager); List children = List.of(new Element(DiagnosticComponent.class, new DiagnosticComponentProps(multiSelectDescription, variableManager))); @@ -65,18 +66,21 @@ public Element render() { String optionId = multiSelectDescription.getOptionIdProvider().apply(optionVariableManager); String optionLabel = multiSelectDescription.getOptionLabelProvider().apply(optionVariableManager); - // @formatter:off - SelectOption option = SelectOption.newSelectOption(optionId) - .label(optionLabel) - .build(); - // @formatter:on + var selectOptionBuilder = SelectOption.newSelectOption(optionId) + .label(optionLabel); + if (multiSelectStyle != null && multiSelectStyle.isShowIcon()) { + String optionIconUrl = multiSelectDescription.getOptionIconURLProvider().apply(optionVariableManager); + if (optionIconUrl != null && !optionIconUrl.isBlank()) { + selectOptionBuilder.iconURL(optionIconUrl); + } + } + SelectOption option = selectOptionBuilder.build(); options.add(option); } Function, IStatus> newValuesHandler = newValues -> { return multiSelectDescription.getNewValuesHandler().apply(variableManager, newValues); }; - var multiSelectStyle = multiSelectDescription.getStyleProvider().apply(variableManager); // @formatter:off Builder multiSelectElementPropsBuilder = MultiSelectElementProps.newMultiSelectElementProps(id) diff --git a/packages/forms/backend/sirius-components-forms/src/main/java/org/eclipse/sirius/components/forms/components/SelectComponent.java b/packages/forms/backend/sirius-components-forms/src/main/java/org/eclipse/sirius/components/forms/components/SelectComponent.java index f9265902fe..ab8a34df75 100644 --- a/packages/forms/backend/sirius-components-forms/src/main/java/org/eclipse/sirius/components/forms/components/SelectComponent.java +++ b/packages/forms/backend/sirius-components-forms/src/main/java/org/eclipse/sirius/components/forms/components/SelectComponent.java @@ -53,6 +53,7 @@ public Element render() { String iconURL = selectDescription.getIconURLProvider().apply(variableManager); List optionCandidates = selectDescription.getOptionsProvider().apply(variableManager); String value = selectDescription.getValueProvider().apply(variableManager); + var selectStyle = selectDescription.getStyleProvider().apply(variableManager); List children = List.of(new Element(DiagnosticComponent.class, new DiagnosticComponentProps(selectDescription, variableManager))); @@ -64,18 +65,21 @@ public Element render() { String optionId = selectDescription.getOptionIdProvider().apply(optionVariableManager); String optionLabel = selectDescription.getOptionLabelProvider().apply(optionVariableManager); - // @formatter:off - SelectOption option = SelectOption.newSelectOption(optionId) - .label(optionLabel) - .build(); - // @formatter:on + var selectOptionBuilder = SelectOption.newSelectOption(optionId) + .label(optionLabel); + if (selectStyle != null && selectStyle.isShowIcon()) { + String optionIconUrl = selectDescription.getOptionIconURLProvider().apply(optionVariableManager); + if (optionIconUrl != null && !optionIconUrl.isBlank()) { + selectOptionBuilder.iconURL(optionIconUrl); + } + } + SelectOption option = selectOptionBuilder.build(); options.add(option); } Function specializedHandler = newValue -> { return selectDescription.getNewValueHandler().apply(variableManager, newValue); }; - var selectStyle = selectDescription.getStyleProvider().apply(variableManager); // @formatter:off Builder selectElementPropsBuilder = SelectElementProps.newSelectElementProps(id) diff --git a/packages/forms/backend/sirius-components-forms/src/main/java/org/eclipse/sirius/components/forms/description/MultiSelectDescription.java b/packages/forms/backend/sirius-components-forms/src/main/java/org/eclipse/sirius/components/forms/description/MultiSelectDescription.java index d7e943fd6a..ebf9a7f914 100644 --- a/packages/forms/backend/sirius-components-forms/src/main/java/org/eclipse/sirius/components/forms/description/MultiSelectDescription.java +++ b/packages/forms/backend/sirius-components-forms/src/main/java/org/eclipse/sirius/components/forms/description/MultiSelectDescription.java @@ -44,6 +44,8 @@ public final class MultiSelectDescription extends AbstractWidgetDescription { private Function optionLabelProvider; + private Function optionIconURLProvider; + private Function> valuesProvider; private BiFunction, IStatus> newValuesHandler; @@ -78,6 +80,10 @@ public Function getOptionLabelProvider() { return this.optionLabelProvider; } + public Function getOptionIconURLProvider() { + return this.optionIconURLProvider; + } + public Function> getValuesProvider() { return this.valuesProvider; } @@ -122,6 +128,8 @@ public static final class Builder { private Function optionLabelProvider; + private Function optionIconURLProvider = variableManager -> null; + private Function> valuesProvider; private BiFunction, IStatus> newValuesHandler; @@ -170,6 +178,11 @@ public Builder optionLabelProvider(Function optionLabel return this; } + public Builder optionIconURLProvider(Function optionIconURLProvider) { + this.optionIconURLProvider = Objects.requireNonNull(optionIconURLProvider); + return this; + } + public Builder valuesProvider(Function> valuesProvider) { this.valuesProvider = Objects.requireNonNull(valuesProvider); return this; @@ -214,6 +227,7 @@ public MultiSelectDescription build() { multiSelectDescription.optionsProvider = Objects.requireNonNull(this.optionsProvider); multiSelectDescription.optionIdProvider = Objects.requireNonNull(this.optionIdProvider); multiSelectDescription.optionLabelProvider = Objects.requireNonNull(this.optionLabelProvider); + multiSelectDescription.optionIconURLProvider = Objects.requireNonNull(this.optionIconURLProvider); multiSelectDescription.valuesProvider = Objects.requireNonNull(this.valuesProvider); multiSelectDescription.newValuesHandler = Objects.requireNonNull(this.newValuesHandler); multiSelectDescription.diagnosticsProvider = Objects.requireNonNull(this.diagnosticsProvider); diff --git a/packages/forms/backend/sirius-components-forms/src/main/java/org/eclipse/sirius/components/forms/description/SelectDescription.java b/packages/forms/backend/sirius-components-forms/src/main/java/org/eclipse/sirius/components/forms/description/SelectDescription.java index 34f1c59347..c23710ba2a 100644 --- a/packages/forms/backend/sirius-components-forms/src/main/java/org/eclipse/sirius/components/forms/description/SelectDescription.java +++ b/packages/forms/backend/sirius-components-forms/src/main/java/org/eclipse/sirius/components/forms/description/SelectDescription.java @@ -43,6 +43,8 @@ public final class SelectDescription extends AbstractWidgetDescription { private Function optionLabelProvider; + private Function optionIconURLProvider; + private Function valueProvider; private BiFunction newValueHandler; @@ -77,6 +79,10 @@ public Function getOptionLabelProvider() { return this.optionLabelProvider; } + public Function getOptionIconURLProvider() { + return this.optionIconURLProvider; + } + public Function getValueProvider() { return this.valueProvider; } @@ -120,6 +126,8 @@ public static final class Builder { private Function optionLabelProvider; + private Function optionIconURLProvider = variableManager -> null; + private Function valueProvider; private BiFunction newValueHandler; @@ -168,6 +176,11 @@ public Builder optionLabelProvider(Function optionLabel return this; } + public Builder optionIconURLProvider(Function optionIconURLProvider) { + this.optionIconURLProvider = Objects.requireNonNull(optionIconURLProvider); + return this; + } + public Builder valueProvider(Function valueProvider) { this.valueProvider = Objects.requireNonNull(valueProvider); return this; @@ -212,6 +225,7 @@ public SelectDescription build() { selectDescription.optionsProvider = Objects.requireNonNull(this.optionsProvider); selectDescription.optionIdProvider = Objects.requireNonNull(this.optionIdProvider); selectDescription.optionLabelProvider = Objects.requireNonNull(this.optionLabelProvider); + selectDescription.optionIconURLProvider = Objects.requireNonNull(this.optionIconURLProvider); selectDescription.valueProvider = Objects.requireNonNull(this.valueProvider); selectDescription.newValueHandler = Objects.requireNonNull(this.newValueHandler); selectDescription.diagnosticsProvider = Objects.requireNonNull(this.diagnosticsProvider); diff --git a/packages/forms/frontend/sirius-components-forms/src/form/FormEventFragments.ts b/packages/forms/frontend/sirius-components-forms/src/form/FormEventFragments.ts index 21c0daeec4..c51385af58 100644 --- a/packages/forms/frontend/sirius-components-forms/src/form/FormEventFragments.ts +++ b/packages/forms/frontend/sirius-components-forms/src/form/FormEventFragments.ts @@ -98,6 +98,7 @@ export const widgetFields = (contributions: Array) => ` options { id label + iconURL } style { backgroundColor @@ -117,6 +118,7 @@ export const widgetFields = (contributions: Array) => ` options { id label + iconURL } style { backgroundColor diff --git a/packages/forms/frontend/sirius-components-forms/src/form/FormEventFragments.types.ts b/packages/forms/frontend/sirius-components-forms/src/form/FormEventFragments.types.ts index 779b484d82..f3cfbb41f2 100644 --- a/packages/forms/frontend/sirius-components-forms/src/form/FormEventFragments.types.ts +++ b/packages/forms/frontend/sirius-components-forms/src/form/FormEventFragments.types.ts @@ -207,6 +207,7 @@ export interface GQLMultiSelectStyle { export interface GQLSelectOption { id: string; label: string; + iconURL: string; } export interface GQLRadio extends GQLWidget { diff --git a/packages/forms/frontend/sirius-components-forms/src/propertysections/MultiSelectPropertySection.tsx b/packages/forms/frontend/sirius-components-forms/src/propertysections/MultiSelectPropertySection.tsx index 71f5eb4737..d86fa03ced 100644 --- a/packages/forms/frontend/sirius-components-forms/src/propertysections/MultiSelectPropertySection.tsx +++ b/packages/forms/frontend/sirius-components-forms/src/propertysections/MultiSelectPropertySection.tsx @@ -11,15 +11,16 @@ * Obeo - initial API and implementation *******************************************************************************/ import { gql, useMutation } from '@apollo/client'; -import { useMultiToast } from '@eclipse-sirius/sirius-components-core'; +import { ServerContext, useMultiToast } from '@eclipse-sirius/sirius-components-core'; import Checkbox from '@material-ui/core/Checkbox'; import FormControl from '@material-ui/core/FormControl'; import FormHelperText from '@material-ui/core/FormHelperText'; +import ListItemIcon from '@material-ui/core/ListItemIcon'; import ListItemText from '@material-ui/core/ListItemText'; import MenuItem from '@material-ui/core/MenuItem'; import Select from '@material-ui/core/Select'; import { Theme, makeStyles } from '@material-ui/core/styles'; -import { useEffect, useState } from 'react'; +import { useContext, useEffect, useState } from 'react'; import { GQLEditMultiSelectMutationData, GQLEditMultiSelectPayload, @@ -33,7 +34,7 @@ import { import { PropertySectionLabel } from './PropertySectionLabel'; import { getTextDecorationLineValue } from './getTextDecorationLineValue'; -const useStyle = makeStyles(() => ({ +const useStyle = makeStyles((theme) => ({ style: { backgroundColor: ({ backgroundColor }) => (backgroundColor ? backgroundColor : 'inherit'), color: ({ foregroundColor }) => (foregroundColor ? foregroundColor : 'inherit'), @@ -42,6 +43,13 @@ const useStyle = makeStyles(() => ({ fontWeight: ({ bold }) => (bold ? 'bold' : 'inherit'), textDecorationLine: ({ underline, strikeThrough }) => getTextDecorationLineValue(underline, strikeThrough), }, + icon: { + width: '16px', + height: '16px', + }, + iconRoot: { + minWidth: theme.spacing(3), + }, })); export const editMultiSelectMutation = gql` @@ -102,6 +110,8 @@ export const MultiSelectPropertySection = ({ }; const classes = useStyle(props); + const { httpOrigin } = useContext(ServerContext); + const [isFocused, setFocus] = useState(false); const [editMultiSelect, { loading, error, data }] = @@ -214,6 +224,11 @@ export const MultiSelectPropertySection = ({ {widget.options.map((option) => ( -1} /> + {option.iconURL && ( + + {option.label} + + )} (() => ({ +const useStyle = makeStyles((theme) => ({ style: { backgroundColor: ({ backgroundColor }) => (backgroundColor ? backgroundColor : 'inherit'), color: ({ foregroundColor }) => (foregroundColor ? foregroundColor : 'inherit'), @@ -39,6 +40,13 @@ const useStyle = makeStyles(() => ({ fontWeight: ({ bold }) => (bold ? 'bold' : 'inherit'), textDecorationLine: ({ underline, strikeThrough }) => getTextDecorationLineValue(underline, strikeThrough), }, + icon: { + width: '16px', + height: '16px', + }, + iconRoot: { + minWidth: theme.spacing(3), + }, })); export const editSelectMutation = gql` @@ -98,6 +106,8 @@ export const SelectPropertySection = ({ }; const classes = useStyle(props); + const { httpOrigin } = useContext(ServerContext); + const [isFocused, setFocus] = useState(false); const [editSelect, { loading, error, data }] = useMutation(editSelectMutation); @@ -219,6 +229,12 @@ export const SelectPropertySection = ({ } : {} }> + {option.iconURL && ( + + {option.label} + + )} + {option.label} ))} diff --git a/packages/forms/frontend/sirius-components-forms/src/propertysections/__tests__/__snapshots__/MultiSelectPropertySection.test.tsx.snap b/packages/forms/frontend/sirius-components-forms/src/propertysections/__tests__/__snapshots__/MultiSelectPropertySection.test.tsx.snap index 27d18ccf8c..fa88bd023b 100644 --- a/packages/forms/frontend/sirius-components-forms/src/propertysections/__tests__/__snapshots__/MultiSelectPropertySection.test.tsx.snap +++ b/packages/forms/frontend/sirius-components-forms/src/propertysections/__tests__/__snapshots__/MultiSelectPropertySection.test.tsx.snap @@ -7,7 +7,7 @@ exports[`should render the multiSelect help hint 1`] = ` class="MuiFormControl-root" >

@@ -133,7 +133,7 @@ exports[`should render the multiSelect with style 1`] = ` class="MuiFormControl-root" >
@@ -190,7 +190,7 @@ exports[`should render the multiSelect without style 1`] = ` class="MuiFormControl-root" >
@@ -64,7 +64,7 @@ exports[`should render the select with help hint 1`] = ` class="MuiFormControl-root" >
@@ -190,7 +190,7 @@ exports[`should render the select without style 1`] = ` class="MuiFormControl-root" >
getPropertyDescriptors(Object object) { this.addStrikeThroughPropertyDescriptor(object); this.addBackgroundColorPropertyDescriptor(object); this.addForegroundColorPropertyDescriptor(object); + this.addShowIconPropertyDescriptor(object); } return this.itemPropertyDescriptors; } @@ -141,6 +142,18 @@ protected void addForegroundColorPropertyDescriptor(Object object) { ViewPackage.Literals.MULTI_SELECT_DESCRIPTION_STYLE__FOREGROUND_COLOR, true, false, false, null, null, null)); } + /** + * This adds a property descriptor for the Show Icon feature. + * + * @generated + */ + protected void addShowIconPropertyDescriptor(Object object) { + this.itemPropertyDescriptors.add(this.createItemPropertyDescriptor(((ComposeableAdapterFactory) this.adapterFactory).getRootAdapterFactory(), this.getResourceLocator(), + this.getString("_UI_MultiSelectDescriptionStyle_showIcon_feature"), + this.getString("_UI_PropertyDescriptor_description", "_UI_MultiSelectDescriptionStyle_showIcon_feature", "_UI_MultiSelectDescriptionStyle_type"), + ViewPackage.Literals.MULTI_SELECT_DESCRIPTION_STYLE__SHOW_ICON, true, false, false, ItemPropertyDescriptor.BOOLEAN_VALUE_IMAGE, null, null)); + } + /** * This returns ConditionalMultiSelectDescriptionStyle.gif. * @@ -192,6 +205,7 @@ public void notifyChanged(Notification notification) { case ViewPackage.CONDITIONAL_MULTI_SELECT_DESCRIPTION_STYLE__STRIKE_THROUGH: case ViewPackage.CONDITIONAL_MULTI_SELECT_DESCRIPTION_STYLE__BACKGROUND_COLOR: case ViewPackage.CONDITIONAL_MULTI_SELECT_DESCRIPTION_STYLE__FOREGROUND_COLOR: + case ViewPackage.CONDITIONAL_MULTI_SELECT_DESCRIPTION_STYLE__SHOW_ICON: this.fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true)); return; } diff --git a/packages/view/backend/sirius-components-view-edit/src/main/java/org/eclipse/sirius/components/view/provider/ConditionalSelectDescriptionStyleItemProvider.java b/packages/view/backend/sirius-components-view-edit/src/main/java/org/eclipse/sirius/components/view/provider/ConditionalSelectDescriptionStyleItemProvider.java index 6f32478678..6a555b5dab 100644 --- a/packages/view/backend/sirius-components-view-edit/src/main/java/org/eclipse/sirius/components/view/provider/ConditionalSelectDescriptionStyleItemProvider.java +++ b/packages/view/backend/sirius-components-view-edit/src/main/java/org/eclipse/sirius/components/view/provider/ConditionalSelectDescriptionStyleItemProvider.java @@ -57,6 +57,7 @@ public List getPropertyDescriptors(Object object) { this.addStrikeThroughPropertyDescriptor(object); this.addBackgroundColorPropertyDescriptor(object); this.addForegroundColorPropertyDescriptor(object); + this.addShowIconPropertyDescriptor(object); } return this.itemPropertyDescriptors; } @@ -140,6 +141,18 @@ protected void addForegroundColorPropertyDescriptor(Object object) { ViewPackage.Literals.SELECT_DESCRIPTION_STYLE__FOREGROUND_COLOR, true, false, false, null, null, null)); } + /** + * This adds a property descriptor for the Show Icon feature. + * + * @generated + */ + protected void addShowIconPropertyDescriptor(Object object) { + this.itemPropertyDescriptors.add(this.createItemPropertyDescriptor(((ComposeableAdapterFactory) this.adapterFactory).getRootAdapterFactory(), this.getResourceLocator(), + this.getString("_UI_SelectDescriptionStyle_showIcon_feature"), + this.getString("_UI_PropertyDescriptor_description", "_UI_SelectDescriptionStyle_showIcon_feature", "_UI_SelectDescriptionStyle_type"), + ViewPackage.Literals.SELECT_DESCRIPTION_STYLE__SHOW_ICON, true, false, false, ItemPropertyDescriptor.BOOLEAN_VALUE_IMAGE, null, null)); + } + /** * This returns ConditionalSelectDescriptionStyle.gif. * @@ -190,6 +203,7 @@ public void notifyChanged(Notification notification) { case ViewPackage.CONDITIONAL_SELECT_DESCRIPTION_STYLE__STRIKE_THROUGH: case ViewPackage.CONDITIONAL_SELECT_DESCRIPTION_STYLE__BACKGROUND_COLOR: case ViewPackage.CONDITIONAL_SELECT_DESCRIPTION_STYLE__FOREGROUND_COLOR: + case ViewPackage.CONDITIONAL_SELECT_DESCRIPTION_STYLE__SHOW_ICON: this.fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true)); return; } diff --git a/packages/view/backend/sirius-components-view-edit/src/main/java/org/eclipse/sirius/components/view/provider/MultiSelectDescriptionStyleItemProvider.java b/packages/view/backend/sirius-components-view-edit/src/main/java/org/eclipse/sirius/components/view/provider/MultiSelectDescriptionStyleItemProvider.java index 49dc122ff4..0541ffb85a 100644 --- a/packages/view/backend/sirius-components-view-edit/src/main/java/org/eclipse/sirius/components/view/provider/MultiSelectDescriptionStyleItemProvider.java +++ b/packages/view/backend/sirius-components-view-edit/src/main/java/org/eclipse/sirius/components/view/provider/MultiSelectDescriptionStyleItemProvider.java @@ -57,6 +57,7 @@ public List getPropertyDescriptors(Object object) { this.addStrikeThroughPropertyDescriptor(object); this.addBackgroundColorPropertyDescriptor(object); this.addForegroundColorPropertyDescriptor(object); + this.addShowIconPropertyDescriptor(object); } return this.itemPropertyDescriptors; } @@ -140,6 +141,18 @@ protected void addForegroundColorPropertyDescriptor(Object object) { ViewPackage.Literals.MULTI_SELECT_DESCRIPTION_STYLE__FOREGROUND_COLOR, true, false, false, null, null, null)); } + /** + * This adds a property descriptor for the Show Icon feature. + * + * @generated + */ + protected void addShowIconPropertyDescriptor(Object object) { + this.itemPropertyDescriptors.add(this.createItemPropertyDescriptor(((ComposeableAdapterFactory) this.adapterFactory).getRootAdapterFactory(), this.getResourceLocator(), + this.getString("_UI_MultiSelectDescriptionStyle_showIcon_feature"), + this.getString("_UI_PropertyDescriptor_description", "_UI_MultiSelectDescriptionStyle_showIcon_feature", "_UI_MultiSelectDescriptionStyle_type"), + ViewPackage.Literals.MULTI_SELECT_DESCRIPTION_STYLE__SHOW_ICON, true, false, false, ItemPropertyDescriptor.BOOLEAN_VALUE_IMAGE, null, null)); + } + /** * This returns MultiSelectDescriptionStyle.gif. * @@ -190,6 +203,7 @@ public void notifyChanged(Notification notification) { case ViewPackage.MULTI_SELECT_DESCRIPTION_STYLE__STRIKE_THROUGH: case ViewPackage.MULTI_SELECT_DESCRIPTION_STYLE__BACKGROUND_COLOR: case ViewPackage.MULTI_SELECT_DESCRIPTION_STYLE__FOREGROUND_COLOR: + case ViewPackage.MULTI_SELECT_DESCRIPTION_STYLE__SHOW_ICON: this.fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true)); return; } diff --git a/packages/view/backend/sirius-components-view-edit/src/main/java/org/eclipse/sirius/components/view/provider/SelectDescriptionStyleItemProvider.java b/packages/view/backend/sirius-components-view-edit/src/main/java/org/eclipse/sirius/components/view/provider/SelectDescriptionStyleItemProvider.java index 44fd510545..071773e564 100644 --- a/packages/view/backend/sirius-components-view-edit/src/main/java/org/eclipse/sirius/components/view/provider/SelectDescriptionStyleItemProvider.java +++ b/packages/view/backend/sirius-components-view-edit/src/main/java/org/eclipse/sirius/components/view/provider/SelectDescriptionStyleItemProvider.java @@ -57,6 +57,7 @@ public List getPropertyDescriptors(Object object) { this.addStrikeThroughPropertyDescriptor(object); this.addBackgroundColorPropertyDescriptor(object); this.addForegroundColorPropertyDescriptor(object); + this.addShowIconPropertyDescriptor(object); } return this.itemPropertyDescriptors; } @@ -140,6 +141,18 @@ protected void addForegroundColorPropertyDescriptor(Object object) { ViewPackage.Literals.SELECT_DESCRIPTION_STYLE__FOREGROUND_COLOR, true, false, false, null, null, null)); } + /** + * This adds a property descriptor for the Show Icon feature. + * + * @generated + */ + protected void addShowIconPropertyDescriptor(Object object) { + this.itemPropertyDescriptors.add(this.createItemPropertyDescriptor(((ComposeableAdapterFactory) this.adapterFactory).getRootAdapterFactory(), this.getResourceLocator(), + this.getString("_UI_SelectDescriptionStyle_showIcon_feature"), + this.getString("_UI_PropertyDescriptor_description", "_UI_SelectDescriptionStyle_showIcon_feature", "_UI_SelectDescriptionStyle_type"), + ViewPackage.Literals.SELECT_DESCRIPTION_STYLE__SHOW_ICON, true, false, false, ItemPropertyDescriptor.BOOLEAN_VALUE_IMAGE, null, null)); + } + /** * This returns SelectDescriptionStyle.gif. * @@ -190,6 +203,7 @@ public void notifyChanged(Notification notification) { case ViewPackage.SELECT_DESCRIPTION_STYLE__STRIKE_THROUGH: case ViewPackage.SELECT_DESCRIPTION_STYLE__BACKGROUND_COLOR: case ViewPackage.SELECT_DESCRIPTION_STYLE__FOREGROUND_COLOR: + case ViewPackage.SELECT_DESCRIPTION_STYLE__SHOW_ICON: this.fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true)); return; } diff --git a/packages/view/backend/sirius-components-view-edit/src/main/resources/plugin.properties b/packages/view/backend/sirius-components-view-edit/src/main/resources/plugin.properties index 568567f29b..b44382dadd 100644 --- a/packages/view/backend/sirius-components-view-edit/src/main/resources/plugin.properties +++ b/packages/view/backend/sirius-components-view-edit/src/main/resources/plugin.properties @@ -280,8 +280,10 @@ _UI_TextfieldDescriptionStyle_foregroundColor_feature = Foreground Color _UI_CheckboxDescriptionStyle_color_feature = Color _UI_SelectDescriptionStyle_backgroundColor_feature = Background Color _UI_SelectDescriptionStyle_foregroundColor_feature = Foreground Color +_UI_SelectDescriptionStyle_showIcon_feature = Show Icon _UI_MultiSelectDescriptionStyle_backgroundColor_feature = Background Color _UI_MultiSelectDescriptionStyle_foregroundColor_feature = Foreground Color +_UI_MultiSelectDescriptionStyle_showIcon_feature = Show Icon _UI_TextareaDescriptionStyle_backgroundColor_feature = Background Color _UI_TextareaDescriptionStyle_foregroundColor_feature = Foreground Color _UI_RadioDescriptionStyle_color_feature = Color diff --git a/packages/view/backend/sirius-components-view-emf/src/main/java/org/eclipse/sirius/components/view/emf/diagram/NodeStylePropertiesConfigurer.java b/packages/view/backend/sirius-components-view-emf/src/main/java/org/eclipse/sirius/components/view/emf/diagram/NodeStylePropertiesConfigurer.java index 8d6aba55e7..3e22257f2c 100644 --- a/packages/view/backend/sirius-components-view-emf/src/main/java/org/eclipse/sirius/components/view/emf/diagram/NodeStylePropertiesConfigurer.java +++ b/packages/view/backend/sirius-components-view-emf/src/main/java/org/eclipse/sirius/components/view/emf/diagram/NodeStylePropertiesConfigurer.java @@ -35,6 +35,7 @@ import org.eclipse.sirius.components.collaborative.forms.services.api.IPropertiesDescriptionRegistryConfigurer; import org.eclipse.sirius.components.collaborative.validation.api.IValidationService; import org.eclipse.sirius.components.core.api.IEditingContext; +import org.eclipse.sirius.components.core.api.IObjectService; import org.eclipse.sirius.components.emf.services.EditingContext; import org.eclipse.sirius.components.forms.components.SelectComponent; import org.eclipse.sirius.components.forms.description.AbstractControlDescription; @@ -85,12 +86,15 @@ public class NodeStylePropertiesConfigurer implements IPropertiesDescriptionRegi private final AQLTextfieldCustomizer aqlTextfieldCustomizer; + private final IObjectService objectService; + public NodeStylePropertiesConfigurer(ICustomImageMetadataSearchService customImageSearchService, IValidationService validationService, - List parametricSVGImageRegistries, AQLTextfieldCustomizer aqlTextfieldCustomizer) { + List parametricSVGImageRegistries, AQLTextfieldCustomizer aqlTextfieldCustomizer, IObjectService objectService) { this.validationService = Objects.requireNonNull(validationService); this.customImageSearchService = Objects.requireNonNull(customImageSearchService); this.parametricSVGImageRegistries = parametricSVGImageRegistries; this.aqlTextfieldCustomizer = Objects.requireNonNull(aqlTextfieldCustomizer); + this.objectService = Objects.requireNonNull(objectService); } @Override @@ -337,6 +341,7 @@ private SelectDescription createBorderLineStyleSelectionField(String id, Object .optionsProvider(variableManager -> LineStyle.VALUES.stream().toList()) .optionIdProvider(variableManager -> variableManager.get(SelectComponent.CANDIDATE_VARIABLE, LineStyle.class).map(LineStyle::getLiteral).orElse(EMPTY)) .optionLabelProvider(variableManager -> variableManager.get(SelectComponent.CANDIDATE_VARIABLE, LineStyle.class).map(LineStyle::getName).orElse(EMPTY)) + .optionIconURLProvider(variableManager -> variableManager.get(SelectComponent.CANDIDATE_VARIABLE, Object.class).map(this.objectService::getImagePath).orElse("")) .newValueHandler((variableManager, newValue) -> { var optionalBorderStyle = variableManager.get(VariableManager.SELF, BorderStyle.class); if (optionalBorderStyle.isPresent()) { @@ -372,6 +377,7 @@ private SelectDescription createUserColorSelectionField(String id, String la .optionLabelProvider(variableManager -> variableManager.get(SelectComponent.CANDIDATE_VARIABLE, UserColor.class) .map(UserColor::getName) .orElse(EMPTY)) + .optionIconURLProvider(variableManager -> variableManager.get(SelectComponent.CANDIDATE_VARIABLE, Object.class).map(this.objectService::getImagePath).orElse("")) .newValueHandler((variableManager, newValue) -> variableManager.get(VariableManager.SELF, styleType) .map((style) -> { @@ -435,6 +441,7 @@ private SelectDescription createShapeSelectionField(Object feature) { .optionLabelProvider(variableManager -> variableManager.get(SelectComponent.CANDIDATE_VARIABLE, CustomImageMetadata.class) .map(CustomImageMetadata::getLabel) .orElse(EMPTY)) + .optionIconURLProvider(variableManager -> variableManager.get(SelectComponent.CANDIDATE_VARIABLE, Object.class).map(this.objectService::getImagePath).orElse("")) .newValueHandler(this.getNewShapeValueHandler()) .diagnosticsProvider(this.getDiagnosticsProvider(feature)) .kindProvider(this::kindProvider) diff --git a/packages/view/backend/sirius-components-view-emf/src/main/java/org/eclipse/sirius/components/view/emf/form/MultiSelectStyleProvider.java b/packages/view/backend/sirius-components-view-emf/src/main/java/org/eclipse/sirius/components/view/emf/form/MultiSelectStyleProvider.java index 7ade691052..116d30bfbe 100644 --- a/packages/view/backend/sirius-components-view-emf/src/main/java/org/eclipse/sirius/components/view/emf/form/MultiSelectStyleProvider.java +++ b/packages/view/backend/sirius-components-view-emf/src/main/java/org/eclipse/sirius/components/view/emf/form/MultiSelectStyleProvider.java @@ -57,6 +57,7 @@ public MultiSelectStyle apply(VariableManager variableManager) { boolean bold = this.viewStyle.isBold(); boolean underline = this.viewStyle.isUnderline(); boolean strikeThrough = this.viewStyle.isStrikeThrough(); + boolean isShowIcon = this.viewStyle.isShowIcon(); // @formatter:off return multiSelectStyleBuilder @@ -65,6 +66,7 @@ public MultiSelectStyle apply(VariableManager variableManager) { .bold(bold) .underline(underline) .strikeThrough(strikeThrough) + .showIcon(isShowIcon) .build(); // @formatter:on } diff --git a/packages/view/backend/sirius-components-view-emf/src/main/java/org/eclipse/sirius/components/view/emf/form/SelectStyleProvider.java b/packages/view/backend/sirius-components-view-emf/src/main/java/org/eclipse/sirius/components/view/emf/form/SelectStyleProvider.java index 433efdd35d..849037631c 100644 --- a/packages/view/backend/sirius-components-view-emf/src/main/java/org/eclipse/sirius/components/view/emf/form/SelectStyleProvider.java +++ b/packages/view/backend/sirius-components-view-emf/src/main/java/org/eclipse/sirius/components/view/emf/form/SelectStyleProvider.java @@ -57,6 +57,7 @@ public SelectStyle apply(VariableManager variableManager) { boolean bold = this.viewStyle.isBold(); boolean underline = this.viewStyle.isUnderline(); boolean strikeThrough = this.viewStyle.isStrikeThrough(); + boolean isShowIcon = this.viewStyle.isShowIcon(); // @formatter:off return selectStyleBuilder @@ -65,6 +66,7 @@ public SelectStyle apply(VariableManager variableManager) { .bold(bold) .underline(underline) .strikeThrough(strikeThrough) + .showIcon(isShowIcon) .build(); // @formatter:on } diff --git a/packages/view/backend/sirius-components-view-emf/src/main/java/org/eclipse/sirius/components/view/emf/form/ViewFormDescriptionConverterSwitch.java b/packages/view/backend/sirius-components-view-emf/src/main/java/org/eclipse/sirius/components/view/emf/form/ViewFormDescriptionConverterSwitch.java index 597db0c0b4..1241478f68 100644 --- a/packages/view/backend/sirius-components-view-emf/src/main/java/org/eclipse/sirius/components/view/emf/form/ViewFormDescriptionConverterSwitch.java +++ b/packages/view/backend/sirius-components-view-emf/src/main/java/org/eclipse/sirius/components/view/emf/form/ViewFormDescriptionConverterSwitch.java @@ -190,6 +190,7 @@ public AbstractWidgetDescription caseSelectDescription(org.eclipse.sirius.compon String descriptionId = this.getDescriptionId(viewSelectDescription); WidgetIdProvider idProvider = new WidgetIdProvider(); StringValueProvider labelProvider = this.getStringValueProvider(viewSelectDescription.getLabelExpression()); + Function optionIconURLProvider = this.getOptionIconURLProvider(); Function valueProvider = this.getSelectValueProvider(viewSelectDescription.getValueExpression()); Function optionIdProvider = this.getOptionIdProvider(); StringValueProvider optionLabelProvider = this.getStringValueProvider(viewSelectDescription.getCandidateLabelExpression()); @@ -215,6 +216,7 @@ public AbstractWidgetDescription caseSelectDescription(org.eclipse.sirius.compon .optionIdProvider(optionIdProvider) .optionLabelProvider(optionLabelProvider) .optionsProvider(optionsProvider) + .optionIconURLProvider(optionIconURLProvider) .newValueHandler(selectNewValueHandler) .diagnosticsProvider(variableManager -> List.of()) .kindProvider(diagnostic -> "") @@ -287,6 +289,7 @@ public AbstractWidgetDescription caseMultiSelectDescription(org.eclipse.sirius.c String descriptionId = this.getDescriptionId(multiSelectDescription); WidgetIdProvider idProvider = new WidgetIdProvider(); StringValueProvider labelProvider = this.getStringValueProvider(multiSelectDescription.getLabelExpression()); + Function optionIconURLProvider = this.getOptionIconURLProvider(); Function> valuesProvider = this.getMultiSelectValuesProvider(multiSelectDescription.getValueExpression()); Function optionIdProvider = this.getOptionIdProvider(); StringValueProvider optionLabelProvider = this.getStringValueProvider(multiSelectDescription.getCandidateLabelExpression()); @@ -311,6 +314,7 @@ public AbstractWidgetDescription caseMultiSelectDescription(org.eclipse.sirius.c .valuesProvider(valuesProvider) .optionIdProvider(optionIdProvider) .optionLabelProvider(optionLabelProvider) + .optionIconURLProvider(optionIconURLProvider) .optionsProvider(optionsProvider) .newValuesHandler(multiSelectNewValueHandler) .diagnosticsProvider(variableManager -> List.of()) @@ -783,6 +787,10 @@ private BiFunction getSelectNewValueHandler(Li }; } + private Function getOptionIconURLProvider() { + return variableManager -> variableManager.get(SelectComponent.CANDIDATE_VARIABLE, Object.class).map(this.objectService::getImagePath).orElse(""); + } + private String getDescriptionId(EObject description) { String descriptionURI = EcoreUtil.getURI(description).toString(); return UUID.nameUUIDFromBytes(descriptionURI.getBytes()).toString(); diff --git a/packages/view/backend/sirius-components-view/src/main/java/org/eclipse/sirius/components/view/MultiSelectDescriptionStyle.java b/packages/view/backend/sirius-components-view/src/main/java/org/eclipse/sirius/components/view/MultiSelectDescriptionStyle.java index abdc33a112..8e2b10d278 100644 --- a/packages/view/backend/sirius-components-view/src/main/java/org/eclipse/sirius/components/view/MultiSelectDescriptionStyle.java +++ b/packages/view/backend/sirius-components-view/src/main/java/org/eclipse/sirius/components/view/MultiSelectDescriptionStyle.java @@ -24,6 +24,7 @@ * Color} *
  • {@link org.eclipse.sirius.components.view.MultiSelectDescriptionStyle#getForegroundColor Foreground * Color}
  • + *
  • {@link org.eclipse.sirius.components.view.MultiSelectDescriptionStyle#isShowIcon Show Icon}
  • * * * @see org.eclipse.sirius.components.view.ViewPackage#getMultiSelectDescriptionStyle() @@ -77,4 +78,26 @@ public interface MultiSelectDescriptionStyle extends WidgetDescriptionStyle, Lab */ void setForegroundColor(UserColor value); + /** + * Returns the value of the 'Show Icon' attribute. + * + * @return the value of the 'Show Icon' attribute. + * @see #setShowIcon(boolean) + * @see org.eclipse.sirius.components.view.ViewPackage#getMultiSelectDescriptionStyle_ShowIcon() + * @model + * @generated + */ + boolean isShowIcon(); + + /** + * Sets the value of the '{@link org.eclipse.sirius.components.view.MultiSelectDescriptionStyle#isShowIcon Show + * Icon}' attribute. + * + * @param value + * the new value of the 'Show Icon' attribute. + * @see #isShowIcon() + * @generated + */ + void setShowIcon(boolean value); + } // MultiSelectDescriptionStyle diff --git a/packages/view/backend/sirius-components-view/src/main/java/org/eclipse/sirius/components/view/SelectDescriptionStyle.java b/packages/view/backend/sirius-components-view/src/main/java/org/eclipse/sirius/components/view/SelectDescriptionStyle.java index 348957a23d..32f10183c5 100644 --- a/packages/view/backend/sirius-components-view/src/main/java/org/eclipse/sirius/components/view/SelectDescriptionStyle.java +++ b/packages/view/backend/sirius-components-view/src/main/java/org/eclipse/sirius/components/view/SelectDescriptionStyle.java @@ -24,6 +24,7 @@ * Color} *
  • {@link org.eclipse.sirius.components.view.SelectDescriptionStyle#getForegroundColor Foreground * Color}
  • + *
  • {@link org.eclipse.sirius.components.view.SelectDescriptionStyle#isShowIcon Show Icon}
  • * * * @see org.eclipse.sirius.components.view.ViewPackage#getSelectDescriptionStyle() @@ -77,4 +78,26 @@ public interface SelectDescriptionStyle extends WidgetDescriptionStyle, LabelSty */ void setForegroundColor(UserColor value); + /** + * Returns the value of the 'Show Icon' attribute. + * + * @return the value of the 'Show Icon' attribute. + * @see #setShowIcon(boolean) + * @see org.eclipse.sirius.components.view.ViewPackage#getSelectDescriptionStyle_ShowIcon() + * @model + * @generated + */ + boolean isShowIcon(); + + /** + * Sets the value of the '{@link org.eclipse.sirius.components.view.SelectDescriptionStyle#isShowIcon Show + * Icon}' attribute. + * + * @param value + * the new value of the 'Show Icon' attribute. + * @see #isShowIcon() + * @generated + */ + void setShowIcon(boolean value); + } // SelectDescriptionStyle diff --git a/packages/view/backend/sirius-components-view/src/main/java/org/eclipse/sirius/components/view/ViewPackage.java b/packages/view/backend/sirius-components-view/src/main/java/org/eclipse/sirius/components/view/ViewPackage.java index 676c80b4f4..30e520a6f2 100644 --- a/packages/view/backend/sirius-components-view/src/main/java/org/eclipse/sirius/components/view/ViewPackage.java +++ b/packages/view/backend/sirius-components-view/src/main/java/org/eclipse/sirius/components/view/ViewPackage.java @@ -4535,6 +4535,14 @@ public interface ViewPackage extends EPackage { */ int SELECT_DESCRIPTION_STYLE__FOREGROUND_COLOR = WIDGET_DESCRIPTION_STYLE_FEATURE_COUNT + 6; + /** + * The feature id for the 'Show Icon' attribute. + * + * @generated + * @ordered + */ + int SELECT_DESCRIPTION_STYLE__SHOW_ICON = WIDGET_DESCRIPTION_STYLE_FEATURE_COUNT + 7; + /** * The number of structural features of the 'Select Description Style' class. @@ -4542,7 +4550,7 @@ public interface ViewPackage extends EPackage { * @generated * @ordered */ - int SELECT_DESCRIPTION_STYLE_FEATURE_COUNT = WIDGET_DESCRIPTION_STYLE_FEATURE_COUNT + 7; + int SELECT_DESCRIPTION_STYLE_FEATURE_COUNT = WIDGET_DESCRIPTION_STYLE_FEATURE_COUNT + 8; /** * The number of operations of the 'Select Description Style' class. + * + * @generated + * @ordered + */ + int CONDITIONAL_SELECT_DESCRIPTION_STYLE__SHOW_ICON = CONDITIONAL_FEATURE_COUNT + 7; + /** * The number of structural features of the 'Conditional Select Description Style' class. @@ -4636,7 +4652,7 @@ public interface ViewPackage extends EPackage { * @generated * @ordered */ - int CONDITIONAL_SELECT_DESCRIPTION_STYLE_FEATURE_COUNT = CONDITIONAL_FEATURE_COUNT + 7; + int CONDITIONAL_SELECT_DESCRIPTION_STYLE_FEATURE_COUNT = CONDITIONAL_FEATURE_COUNT + 8; /** * The number of operations of the 'Conditional Select Description Style' class. @@ -4715,6 +4731,14 @@ public interface ViewPackage extends EPackage { */ int MULTI_SELECT_DESCRIPTION_STYLE__FOREGROUND_COLOR = WIDGET_DESCRIPTION_STYLE_FEATURE_COUNT + 6; + /** + * The feature id for the 'Show Icon' attribute. + * + * @generated + * @ordered + */ + int MULTI_SELECT_DESCRIPTION_STYLE__SHOW_ICON = WIDGET_DESCRIPTION_STYLE_FEATURE_COUNT + 7; + /** * The number of structural features of the 'Multi Select Description Style' class. * @@ -4722,7 +4746,7 @@ public interface ViewPackage extends EPackage { * @generated * @ordered */ - int MULTI_SELECT_DESCRIPTION_STYLE_FEATURE_COUNT = WIDGET_DESCRIPTION_STYLE_FEATURE_COUNT + 7; + int MULTI_SELECT_DESCRIPTION_STYLE_FEATURE_COUNT = WIDGET_DESCRIPTION_STYLE_FEATURE_COUNT + 8; /** * The number of operations of the 'Multi Select Description Style' class. + * + * @generated + * @ordered + */ + int CONDITIONAL_MULTI_SELECT_DESCRIPTION_STYLE__SHOW_ICON = CONDITIONAL_FEATURE_COUNT + 7; + /** * The number of structural features of the 'Conditional Multi Select Description Style' class. @@ -4817,7 +4849,7 @@ public interface ViewPackage extends EPackage { * @generated * @ordered */ - int CONDITIONAL_MULTI_SELECT_DESCRIPTION_STYLE_FEATURE_COUNT = CONDITIONAL_FEATURE_COUNT + 7; + int CONDITIONAL_MULTI_SELECT_DESCRIPTION_STYLE_FEATURE_COUNT = CONDITIONAL_FEATURE_COUNT + 8; /** * The number of operations of the 'Conditional Multi Select Description Style' class. + * + * @return the meta object for the attribute 'Show Icon'. + * @see org.eclipse.sirius.components.view.SelectDescriptionStyle#isShowIcon() + * @see #getSelectDescriptionStyle() + * @generated + */ + EAttribute getSelectDescriptionStyle_ShowIcon(); + /** * Returns the meta object for class '{@link org.eclipse.sirius.components.view.ConditionalSelectDescriptionStyle * Conditional Select Description Style}'. @@ -9317,6 +9361,18 @@ public interface ViewPackage extends EPackage { */ EReference getMultiSelectDescriptionStyle_ForegroundColor(); + /** + * Returns the meta object for the attribute + * '{@link org.eclipse.sirius.components.view.MultiSelectDescriptionStyle#isShowIcon Show Icon}'. + * + * @return the meta object for the attribute 'Show Icon'. + * @see org.eclipse.sirius.components.view.MultiSelectDescriptionStyle#isShowIcon() + * @see #getMultiSelectDescriptionStyle() + * @generated + */ + EAttribute getMultiSelectDescriptionStyle_ShowIcon(); + /** * Returns the meta object for class * '{@link org.eclipse.sirius.components.view.ConditionalMultiSelectDescriptionStyle Conditional Multi Select @@ -12044,6 +12100,14 @@ interface Literals { */ EReference SELECT_DESCRIPTION_STYLE__FOREGROUND_COLOR = eINSTANCE.getSelectDescriptionStyle_ForegroundColor(); + /** + * The meta object literal for the 'Show Icon' attribute feature. + * + * @generated + */ + EAttribute SELECT_DESCRIPTION_STYLE__SHOW_ICON = eINSTANCE.getSelectDescriptionStyle_ShowIcon(); + /** * The meta object literal for the * '{@link org.eclipse.sirius.components.view.impl.ConditionalSelectDescriptionStyleImpl Conditional Select @@ -12082,6 +12146,14 @@ interface Literals { */ EReference MULTI_SELECT_DESCRIPTION_STYLE__FOREGROUND_COLOR = eINSTANCE.getMultiSelectDescriptionStyle_ForegroundColor(); + /** + * The meta object literal for the 'Show Icon' attribute feature. + * + * @generated + */ + EAttribute MULTI_SELECT_DESCRIPTION_STYLE__SHOW_ICON = eINSTANCE.getMultiSelectDescriptionStyle_ShowIcon(); + /** * The meta object literal for the * '{@link org.eclipse.sirius.components.view.impl.ConditionalMultiSelectDescriptionStyleImpl Conditional diff --git a/packages/view/backend/sirius-components-view/src/main/java/org/eclipse/sirius/components/view/impl/ConditionalMultiSelectDescriptionStyleImpl.java b/packages/view/backend/sirius-components-view/src/main/java/org/eclipse/sirius/components/view/impl/ConditionalMultiSelectDescriptionStyleImpl.java index d5d2cebe76..1eb6167816 100644 --- a/packages/view/backend/sirius-components-view/src/main/java/org/eclipse/sirius/components/view/impl/ConditionalMultiSelectDescriptionStyleImpl.java +++ b/packages/view/backend/sirius-components-view/src/main/java/org/eclipse/sirius/components/view/impl/ConditionalMultiSelectDescriptionStyleImpl.java @@ -44,6 +44,8 @@ * Background Color} *
  • {@link org.eclipse.sirius.components.view.impl.ConditionalMultiSelectDescriptionStyleImpl#getForegroundColor * Foreground Color}
  • + *
  • {@link org.eclipse.sirius.components.view.impl.ConditionalMultiSelectDescriptionStyleImpl#isShowIcon Show + * Icon}
  • * * * @generated @@ -169,6 +171,26 @@ public class ConditionalMultiSelectDescriptionStyleImpl extends ConditionalImpl */ protected UserColor foregroundColor; + /** + * The default value of the '{@link #isShowIcon() Show Icon}' attribute. + * + * @see #isShowIcon() + * @generated + * @ordered + */ + protected static final boolean SHOW_ICON_EDEFAULT = false; + + /** + * The cached value of the '{@link #isShowIcon() Show Icon}' attribute. + * + * @see #isShowIcon() + * @generated + * @ordered + */ + protected boolean showIcon = SHOW_ICON_EDEFAULT; + /** * * @@ -383,6 +405,29 @@ public void setForegroundColor(UserColor newForegroundColor) { this.eNotify(new ENotificationImpl(this, Notification.SET, ViewPackage.CONDITIONAL_MULTI_SELECT_DESCRIPTION_STYLE__FOREGROUND_COLOR, oldForegroundColor, this.foregroundColor)); } + /** + * + * + * @generated + */ + @Override + public boolean isShowIcon() { + return this.showIcon; + } + + /** + * + * + * @generated + */ + @Override + public void setShowIcon(boolean newShowIcon) { + boolean oldShowIcon = this.showIcon; + this.showIcon = newShowIcon; + if (this.eNotificationRequired()) + this.eNotify(new ENotificationImpl(this, Notification.SET, ViewPackage.CONDITIONAL_MULTI_SELECT_DESCRIPTION_STYLE__SHOW_ICON, oldShowIcon, this.showIcon)); + } + /** * * @@ -409,6 +454,8 @@ public Object eGet(int featureID, boolean resolve, boolean coreType) { if (resolve) return this.getForegroundColor(); return this.basicGetForegroundColor(); + case ViewPackage.CONDITIONAL_MULTI_SELECT_DESCRIPTION_STYLE__SHOW_ICON: + return this.isShowIcon(); } return super.eGet(featureID, resolve, coreType); } @@ -442,6 +489,9 @@ public void eSet(int featureID, Object newValue) { case ViewPackage.CONDITIONAL_MULTI_SELECT_DESCRIPTION_STYLE__FOREGROUND_COLOR: this.setForegroundColor((UserColor) newValue); return; + case ViewPackage.CONDITIONAL_MULTI_SELECT_DESCRIPTION_STYLE__SHOW_ICON: + this.setShowIcon((Boolean) newValue); + return; } super.eSet(featureID, newValue); } @@ -475,6 +525,9 @@ public void eUnset(int featureID) { case ViewPackage.CONDITIONAL_MULTI_SELECT_DESCRIPTION_STYLE__FOREGROUND_COLOR: this.setForegroundColor((UserColor) null); return; + case ViewPackage.CONDITIONAL_MULTI_SELECT_DESCRIPTION_STYLE__SHOW_ICON: + this.setShowIcon(SHOW_ICON_EDEFAULT); + return; } super.eUnset(featureID); } @@ -501,6 +554,8 @@ public boolean eIsSet(int featureID) { return this.backgroundColor != null; case ViewPackage.CONDITIONAL_MULTI_SELECT_DESCRIPTION_STYLE__FOREGROUND_COLOR: return this.foregroundColor != null; + case ViewPackage.CONDITIONAL_MULTI_SELECT_DESCRIPTION_STYLE__SHOW_ICON: + return this.showIcon != SHOW_ICON_EDEFAULT; } return super.eIsSet(featureID); } @@ -540,6 +595,8 @@ public int eBaseStructuralFeatureID(int derivedFeatureID, Class baseClass) { return ViewPackage.MULTI_SELECT_DESCRIPTION_STYLE__BACKGROUND_COLOR; case ViewPackage.CONDITIONAL_MULTI_SELECT_DESCRIPTION_STYLE__FOREGROUND_COLOR: return ViewPackage.MULTI_SELECT_DESCRIPTION_STYLE__FOREGROUND_COLOR; + case ViewPackage.CONDITIONAL_MULTI_SELECT_DESCRIPTION_STYLE__SHOW_ICON: + return ViewPackage.MULTI_SELECT_DESCRIPTION_STYLE__SHOW_ICON; default: return -1; } @@ -582,6 +639,8 @@ public int eDerivedStructuralFeatureID(int baseFeatureID, Class baseClass) { return ViewPackage.CONDITIONAL_MULTI_SELECT_DESCRIPTION_STYLE__BACKGROUND_COLOR; case ViewPackage.MULTI_SELECT_DESCRIPTION_STYLE__FOREGROUND_COLOR: return ViewPackage.CONDITIONAL_MULTI_SELECT_DESCRIPTION_STYLE__FOREGROUND_COLOR; + case ViewPackage.MULTI_SELECT_DESCRIPTION_STYLE__SHOW_ICON: + return ViewPackage.CONDITIONAL_MULTI_SELECT_DESCRIPTION_STYLE__SHOW_ICON; default: return -1; } @@ -610,6 +669,8 @@ public String toString() { result.append(this.underline); result.append(", strikeThrough: "); result.append(this.strikeThrough); + result.append(", showIcon: "); + result.append(this.showIcon); result.append(')'); return result.toString(); } diff --git a/packages/view/backend/sirius-components-view/src/main/java/org/eclipse/sirius/components/view/impl/ConditionalSelectDescriptionStyleImpl.java b/packages/view/backend/sirius-components-view/src/main/java/org/eclipse/sirius/components/view/impl/ConditionalSelectDescriptionStyleImpl.java index 54dcdec16b..74db5ea72b 100644 --- a/packages/view/backend/sirius-components-view/src/main/java/org/eclipse/sirius/components/view/impl/ConditionalSelectDescriptionStyleImpl.java +++ b/packages/view/backend/sirius-components-view/src/main/java/org/eclipse/sirius/components/view/impl/ConditionalSelectDescriptionStyleImpl.java @@ -43,6 +43,8 @@ * Background Color} *
  • {@link org.eclipse.sirius.components.view.impl.ConditionalSelectDescriptionStyleImpl#getForegroundColor * Foreground Color}
  • + *
  • {@link org.eclipse.sirius.components.view.impl.ConditionalSelectDescriptionStyleImpl#isShowIcon Show + * Icon}
  • * * * @generated @@ -168,6 +170,26 @@ public class ConditionalSelectDescriptionStyleImpl extends ConditionalImpl imple */ protected UserColor foregroundColor; + /** + * The default value of the '{@link #isShowIcon() Show Icon}' attribute. + * + * @see #isShowIcon() + * @generated + * @ordered + */ + protected static final boolean SHOW_ICON_EDEFAULT = false; + + /** + * The cached value of the '{@link #isShowIcon() Show Icon}' attribute. + * + * @see #isShowIcon() + * @generated + * @ordered + */ + protected boolean showIcon = SHOW_ICON_EDEFAULT; + /** * * @@ -382,6 +404,29 @@ public void setForegroundColor(UserColor newForegroundColor) { this.eNotify(new ENotificationImpl(this, Notification.SET, ViewPackage.CONDITIONAL_SELECT_DESCRIPTION_STYLE__FOREGROUND_COLOR, oldForegroundColor, this.foregroundColor)); } + /** + * + * + * @generated + */ + @Override + public boolean isShowIcon() { + return this.showIcon; + } + + /** + * + * + * @generated + */ + @Override + public void setShowIcon(boolean newShowIcon) { + boolean oldShowIcon = this.showIcon; + this.showIcon = newShowIcon; + if (this.eNotificationRequired()) + this.eNotify(new ENotificationImpl(this, Notification.SET, ViewPackage.CONDITIONAL_SELECT_DESCRIPTION_STYLE__SHOW_ICON, oldShowIcon, this.showIcon)); + } + /** * * @@ -408,6 +453,8 @@ public Object eGet(int featureID, boolean resolve, boolean coreType) { if (resolve) return this.getForegroundColor(); return this.basicGetForegroundColor(); + case ViewPackage.CONDITIONAL_SELECT_DESCRIPTION_STYLE__SHOW_ICON: + return this.isShowIcon(); } return super.eGet(featureID, resolve, coreType); } @@ -441,6 +488,9 @@ public void eSet(int featureID, Object newValue) { case ViewPackage.CONDITIONAL_SELECT_DESCRIPTION_STYLE__FOREGROUND_COLOR: this.setForegroundColor((UserColor) newValue); return; + case ViewPackage.CONDITIONAL_SELECT_DESCRIPTION_STYLE__SHOW_ICON: + this.setShowIcon((Boolean) newValue); + return; } super.eSet(featureID, newValue); } @@ -474,6 +524,9 @@ public void eUnset(int featureID) { case ViewPackage.CONDITIONAL_SELECT_DESCRIPTION_STYLE__FOREGROUND_COLOR: this.setForegroundColor((UserColor) null); return; + case ViewPackage.CONDITIONAL_SELECT_DESCRIPTION_STYLE__SHOW_ICON: + this.setShowIcon(SHOW_ICON_EDEFAULT); + return; } super.eUnset(featureID); } @@ -500,6 +553,8 @@ public boolean eIsSet(int featureID) { return this.backgroundColor != null; case ViewPackage.CONDITIONAL_SELECT_DESCRIPTION_STYLE__FOREGROUND_COLOR: return this.foregroundColor != null; + case ViewPackage.CONDITIONAL_SELECT_DESCRIPTION_STYLE__SHOW_ICON: + return this.showIcon != SHOW_ICON_EDEFAULT; } return super.eIsSet(featureID); } @@ -539,6 +594,8 @@ public int eBaseStructuralFeatureID(int derivedFeatureID, Class baseClass) { return ViewPackage.SELECT_DESCRIPTION_STYLE__BACKGROUND_COLOR; case ViewPackage.CONDITIONAL_SELECT_DESCRIPTION_STYLE__FOREGROUND_COLOR: return ViewPackage.SELECT_DESCRIPTION_STYLE__FOREGROUND_COLOR; + case ViewPackage.CONDITIONAL_SELECT_DESCRIPTION_STYLE__SHOW_ICON: + return ViewPackage.SELECT_DESCRIPTION_STYLE__SHOW_ICON; default: return -1; } @@ -581,6 +638,8 @@ public int eDerivedStructuralFeatureID(int baseFeatureID, Class baseClass) { return ViewPackage.CONDITIONAL_SELECT_DESCRIPTION_STYLE__BACKGROUND_COLOR; case ViewPackage.SELECT_DESCRIPTION_STYLE__FOREGROUND_COLOR: return ViewPackage.CONDITIONAL_SELECT_DESCRIPTION_STYLE__FOREGROUND_COLOR; + case ViewPackage.SELECT_DESCRIPTION_STYLE__SHOW_ICON: + return ViewPackage.CONDITIONAL_SELECT_DESCRIPTION_STYLE__SHOW_ICON; default: return -1; } @@ -609,6 +668,8 @@ public String toString() { result.append(this.underline); result.append(", strikeThrough: "); result.append(this.strikeThrough); + result.append(", showIcon: "); + result.append(this.showIcon); result.append(')'); return result.toString(); } diff --git a/packages/view/backend/sirius-components-view/src/main/java/org/eclipse/sirius/components/view/impl/MultiSelectDescriptionStyleImpl.java b/packages/view/backend/sirius-components-view/src/main/java/org/eclipse/sirius/components/view/impl/MultiSelectDescriptionStyleImpl.java index 2e9202ee03..b26544fe10 100644 --- a/packages/view/backend/sirius-components-view/src/main/java/org/eclipse/sirius/components/view/impl/MultiSelectDescriptionStyleImpl.java +++ b/packages/view/backend/sirius-components-view/src/main/java/org/eclipse/sirius/components/view/impl/MultiSelectDescriptionStyleImpl.java @@ -40,6 +40,8 @@ * Color
    } *
  • {@link org.eclipse.sirius.components.view.impl.MultiSelectDescriptionStyleImpl#getForegroundColor Foreground * Color}
  • + *
  • {@link org.eclipse.sirius.components.view.impl.MultiSelectDescriptionStyleImpl#isShowIcon Show + * Icon}
  • * * * @generated @@ -165,6 +167,26 @@ public class MultiSelectDescriptionStyleImpl extends WidgetDescriptionStyleImpl */ protected UserColor foregroundColor; + /** + * The default value of the '{@link #isShowIcon() Show Icon}' attribute. + * + * @see #isShowIcon() + * @generated + * @ordered + */ + protected static final boolean SHOW_ICON_EDEFAULT = false; + + /** + * The cached value of the '{@link #isShowIcon() Show Icon}' attribute. + * + * @see #isShowIcon() + * @generated + * @ordered + */ + protected boolean showIcon = SHOW_ICON_EDEFAULT; + /** * * @@ -379,6 +401,29 @@ public void setForegroundColor(UserColor newForegroundColor) { this.eNotify(new ENotificationImpl(this, Notification.SET, ViewPackage.MULTI_SELECT_DESCRIPTION_STYLE__FOREGROUND_COLOR, oldForegroundColor, this.foregroundColor)); } + /** + * + * + * @generated + */ + @Override + public boolean isShowIcon() { + return this.showIcon; + } + + /** + * + * + * @generated + */ + @Override + public void setShowIcon(boolean newShowIcon) { + boolean oldShowIcon = this.showIcon; + this.showIcon = newShowIcon; + if (this.eNotificationRequired()) + this.eNotify(new ENotificationImpl(this, Notification.SET, ViewPackage.MULTI_SELECT_DESCRIPTION_STYLE__SHOW_ICON, oldShowIcon, this.showIcon)); + } + /** * * @@ -405,6 +450,8 @@ public Object eGet(int featureID, boolean resolve, boolean coreType) { if (resolve) return this.getForegroundColor(); return this.basicGetForegroundColor(); + case ViewPackage.MULTI_SELECT_DESCRIPTION_STYLE__SHOW_ICON: + return this.isShowIcon(); } return super.eGet(featureID, resolve, coreType); } @@ -438,6 +485,9 @@ public void eSet(int featureID, Object newValue) { case ViewPackage.MULTI_SELECT_DESCRIPTION_STYLE__FOREGROUND_COLOR: this.setForegroundColor((UserColor) newValue); return; + case ViewPackage.MULTI_SELECT_DESCRIPTION_STYLE__SHOW_ICON: + this.setShowIcon((Boolean) newValue); + return; } super.eSet(featureID, newValue); } @@ -471,6 +521,9 @@ public void eUnset(int featureID) { case ViewPackage.MULTI_SELECT_DESCRIPTION_STYLE__FOREGROUND_COLOR: this.setForegroundColor((UserColor) null); return; + case ViewPackage.MULTI_SELECT_DESCRIPTION_STYLE__SHOW_ICON: + this.setShowIcon(SHOW_ICON_EDEFAULT); + return; } super.eUnset(featureID); } @@ -497,6 +550,8 @@ public boolean eIsSet(int featureID) { return this.backgroundColor != null; case ViewPackage.MULTI_SELECT_DESCRIPTION_STYLE__FOREGROUND_COLOR: return this.foregroundColor != null; + case ViewPackage.MULTI_SELECT_DESCRIPTION_STYLE__SHOW_ICON: + return this.showIcon != SHOW_ICON_EDEFAULT; } return super.eIsSet(featureID); } @@ -574,6 +629,8 @@ public String toString() { result.append(this.underline); result.append(", strikeThrough: "); result.append(this.strikeThrough); + result.append(", showIcon: "); + result.append(this.showIcon); result.append(')'); return result.toString(); } diff --git a/packages/view/backend/sirius-components-view/src/main/java/org/eclipse/sirius/components/view/impl/SelectDescriptionStyleImpl.java b/packages/view/backend/sirius-components-view/src/main/java/org/eclipse/sirius/components/view/impl/SelectDescriptionStyleImpl.java index a221f283fe..1d7e28b4c3 100644 --- a/packages/view/backend/sirius-components-view/src/main/java/org/eclipse/sirius/components/view/impl/SelectDescriptionStyleImpl.java +++ b/packages/view/backend/sirius-components-view/src/main/java/org/eclipse/sirius/components/view/impl/SelectDescriptionStyleImpl.java @@ -38,6 +38,7 @@ * Color
    } *
  • {@link org.eclipse.sirius.components.view.impl.SelectDescriptionStyleImpl#getForegroundColor Foreground * Color}
  • + *
  • {@link org.eclipse.sirius.components.view.impl.SelectDescriptionStyleImpl#isShowIcon Show Icon}
  • * * * @generated @@ -163,6 +164,26 @@ public class SelectDescriptionStyleImpl extends WidgetDescriptionStyleImpl imple */ protected UserColor foregroundColor; + /** + * The default value of the '{@link #isShowIcon() Show Icon}' attribute. + * + * @see #isShowIcon() + * @generated + * @ordered + */ + protected static final boolean SHOW_ICON_EDEFAULT = false; + + /** + * The cached value of the '{@link #isShowIcon() Show Icon}' attribute. + * + * @see #isShowIcon() + * @generated + * @ordered + */ + protected boolean showIcon = SHOW_ICON_EDEFAULT; + /** * * @@ -377,6 +398,29 @@ public void setForegroundColor(UserColor newForegroundColor) { this.eNotify(new ENotificationImpl(this, Notification.SET, ViewPackage.SELECT_DESCRIPTION_STYLE__FOREGROUND_COLOR, oldForegroundColor, this.foregroundColor)); } + /** + * + * + * @generated + */ + @Override + public boolean isShowIcon() { + return this.showIcon; + } + + /** + * + * + * @generated + */ + @Override + public void setShowIcon(boolean newShowIcon) { + boolean oldShowIcon = this.showIcon; + this.showIcon = newShowIcon; + if (this.eNotificationRequired()) + this.eNotify(new ENotificationImpl(this, Notification.SET, ViewPackage.SELECT_DESCRIPTION_STYLE__SHOW_ICON, oldShowIcon, this.showIcon)); + } + /** * * @@ -403,6 +447,8 @@ public Object eGet(int featureID, boolean resolve, boolean coreType) { if (resolve) return this.getForegroundColor(); return this.basicGetForegroundColor(); + case ViewPackage.SELECT_DESCRIPTION_STYLE__SHOW_ICON: + return this.isShowIcon(); } return super.eGet(featureID, resolve, coreType); } @@ -436,6 +482,9 @@ public void eSet(int featureID, Object newValue) { case ViewPackage.SELECT_DESCRIPTION_STYLE__FOREGROUND_COLOR: this.setForegroundColor((UserColor) newValue); return; + case ViewPackage.SELECT_DESCRIPTION_STYLE__SHOW_ICON: + this.setShowIcon((Boolean) newValue); + return; } super.eSet(featureID, newValue); } @@ -469,6 +518,9 @@ public void eUnset(int featureID) { case ViewPackage.SELECT_DESCRIPTION_STYLE__FOREGROUND_COLOR: this.setForegroundColor((UserColor) null); return; + case ViewPackage.SELECT_DESCRIPTION_STYLE__SHOW_ICON: + this.setShowIcon(SHOW_ICON_EDEFAULT); + return; } super.eUnset(featureID); } @@ -495,6 +547,8 @@ public boolean eIsSet(int featureID) { return this.backgroundColor != null; case ViewPackage.SELECT_DESCRIPTION_STYLE__FOREGROUND_COLOR: return this.foregroundColor != null; + case ViewPackage.SELECT_DESCRIPTION_STYLE__SHOW_ICON: + return this.showIcon != SHOW_ICON_EDEFAULT; } return super.eIsSet(featureID); } @@ -572,6 +626,8 @@ public String toString() { result.append(this.underline); result.append(", strikeThrough: "); result.append(this.strikeThrough); + result.append(", showIcon: "); + result.append(this.showIcon); result.append(')'); return result.toString(); } diff --git a/packages/view/backend/sirius-components-view/src/main/java/org/eclipse/sirius/components/view/impl/ViewPackageImpl.java b/packages/view/backend/sirius-components-view/src/main/java/org/eclipse/sirius/components/view/impl/ViewPackageImpl.java index c4785d5861..775d7f32c5 100644 --- a/packages/view/backend/sirius-components-view/src/main/java/org/eclipse/sirius/components/view/impl/ViewPackageImpl.java +++ b/packages/view/backend/sirius-components-view/src/main/java/org/eclipse/sirius/components/view/impl/ViewPackageImpl.java @@ -3074,6 +3074,16 @@ public EReference getSelectDescriptionStyle_ForegroundColor() { return (EReference) this.selectDescriptionStyleEClass.getEStructuralFeatures().get(1); } + /** + * + * + * @generated + */ + @Override + public EAttribute getSelectDescriptionStyle_ShowIcon() { + return (EAttribute) this.selectDescriptionStyleEClass.getEStructuralFeatures().get(2); + } + /** * * @@ -3114,6 +3124,16 @@ public EReference getMultiSelectDescriptionStyle_ForegroundColor() { return (EReference) this.multiSelectDescriptionStyleEClass.getEStructuralFeatures().get(1); } + /** + * + * + * @generated + */ + @Override + public EAttribute getMultiSelectDescriptionStyle_ShowIcon() { + return (EAttribute) this.multiSelectDescriptionStyleEClass.getEStructuralFeatures().get(2); + } + /** * * @@ -4163,12 +4183,14 @@ public void createPackageContents() { this.selectDescriptionStyleEClass = this.createEClass(SELECT_DESCRIPTION_STYLE); this.createEReference(this.selectDescriptionStyleEClass, SELECT_DESCRIPTION_STYLE__BACKGROUND_COLOR); this.createEReference(this.selectDescriptionStyleEClass, SELECT_DESCRIPTION_STYLE__FOREGROUND_COLOR); + this.createEAttribute(this.selectDescriptionStyleEClass, SELECT_DESCRIPTION_STYLE__SHOW_ICON); this.conditionalSelectDescriptionStyleEClass = this.createEClass(CONDITIONAL_SELECT_DESCRIPTION_STYLE); this.multiSelectDescriptionStyleEClass = this.createEClass(MULTI_SELECT_DESCRIPTION_STYLE); this.createEReference(this.multiSelectDescriptionStyleEClass, MULTI_SELECT_DESCRIPTION_STYLE__BACKGROUND_COLOR); this.createEReference(this.multiSelectDescriptionStyleEClass, MULTI_SELECT_DESCRIPTION_STYLE__FOREGROUND_COLOR); + this.createEAttribute(this.multiSelectDescriptionStyleEClass, MULTI_SELECT_DESCRIPTION_STYLE__SHOW_ICON); this.conditionalMultiSelectDescriptionStyleEClass = this.createEClass(CONDITIONAL_MULTI_SELECT_DESCRIPTION_STYLE); @@ -4838,6 +4860,8 @@ public void initializePackageContents() { IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); this.initEReference(this.getSelectDescriptionStyle_ForegroundColor(), this.getUserColor(), null, "foregroundColor", null, 0, 1, SelectDescriptionStyle.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + this.initEAttribute(this.getSelectDescriptionStyle_ShowIcon(), this.ecorePackage.getEBoolean(), "showIcon", null, 0, 1, SelectDescriptionStyle.class, !IS_TRANSIENT, !IS_VOLATILE, + IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); this.initEClass(this.conditionalSelectDescriptionStyleEClass, ConditionalSelectDescriptionStyle.class, "ConditionalSelectDescriptionStyle", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); @@ -4847,6 +4871,8 @@ public void initializePackageContents() { !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); this.initEReference(this.getMultiSelectDescriptionStyle_ForegroundColor(), this.getUserColor(), null, "foregroundColor", null, 0, 1, MultiSelectDescriptionStyle.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + this.initEAttribute(this.getMultiSelectDescriptionStyle_ShowIcon(), this.ecorePackage.getEBoolean(), "showIcon", null, 0, 1, MultiSelectDescriptionStyle.class, !IS_TRANSIENT, !IS_VOLATILE, + IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); this.initEClass(this.conditionalMultiSelectDescriptionStyleEClass, ConditionalMultiSelectDescriptionStyle.class, "ConditionalMultiSelectDescriptionStyle", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); diff --git a/packages/view/backend/sirius-components-view/src/main/resources/model/view.ecore b/packages/view/backend/sirius-components-view/src/main/resources/model/view.ecore index 5c69f22720..e2f22b7fd6 100644 --- a/packages/view/backend/sirius-components-view/src/main/resources/model/view.ecore +++ b/packages/view/backend/sirius-components-view/src/main/resources/model/view.ecore @@ -433,11 +433,13 @@ + + diff --git a/packages/view/backend/sirius-components-view/src/main/resources/model/view.genmodel b/packages/view/backend/sirius-components-view/src/main/resources/model/view.genmodel index 22a7ac6e27..1b20ec52b5 100644 --- a/packages/view/backend/sirius-components-view/src/main/resources/model/view.genmodel +++ b/packages/view/backend/sirius-components-view/src/main/resources/model/view.genmodel @@ -327,11 +327,13 @@ + +