From c2232370ad025fe61c28e2fdec3001616dab391c Mon Sep 17 00:00:00 2001 From: Jerome Gout Date: Fri, 11 Oct 2024 18:03:23 +0200 Subject: [PATCH] [4095] Add conditional tree item label element description Bug: https://github.com/eclipse-sirius/sirius-web/issues/4095 Signed-off-by: Jerome Gout --- CHANGELOG.adoc | 1 + .../DomainExplorerServices.java | 7 + .../DomainViewTreeDescriptionProvider.java | 34 +- .../TreeItemContextMenuControllerTests.java | 35 +- ...eeItemLabelDescriptionControllerTests.java | 152 ++++++++ .../sirius-components-view-builder/pom.xml | 350 +++++++++--------- ...reeItemLabelElementDescriptionBuilder.java | 68 ++++ .../builder/generated/tree/TreeBuilders.java | 11 +- .../view/emf/tree/TreeItemStyleConverter.java | 19 +- ...hTreeItemContextMenuEntryItemProvider.java | 73 ++-- ...emLabelElementDescriptionItemProvider.java | 146 ++++++++ ...kTreeItemContextMenuEntryItemProvider.java | 91 ++--- .../provider/TreeDescriptionItemProvider.java | 269 ++++++-------- .../view/tree/provider/TreeEditPlugin.java | 176 +++++---- .../TreeItemContextMenuEntryItemProvider.java | 110 +++--- .../TreeItemLabelDescriptionItemProvider.java | 341 ++++++++--------- ...emLabelElementDescriptionItemProvider.java | 150 ++++---- ...mLabelFragmentDescriptionItemProvider.java | 217 +++++------ .../TreeItemProviderAdapterFactory.java | 230 ++++++------ .../IfTreeItemLabelElementDescription.svg | 1 + .../src/main/resources/plugin.properties | 99 ++--- .../FetchTreeItemContextMenuEntryKind.java | 21 +- .../IfTreeItemLabelElementDescription.java | 73 ++++ .../SingleClickTreeItemContextMenuEntry.java | 4 +- .../components/view/tree/TreeDescription.java | 96 ++--- .../components/view/tree/TreeFactory.java | 11 +- .../components/view/tree/TreePackage.java | 317 ++++++++++++---- ...IfTreeItemLabelElementDescriptionImpl.java | 232 ++++++++++++ ...ngleClickTreeItemContextMenuEntryImpl.java | 2 +- .../view/tree/impl/TreeDescriptionImpl.java | 237 ++++++------ .../view/tree/impl/TreeFactoryImpl.java | 33 +- .../impl/TreeItemContextMenuEntryImpl.java | 88 +++-- .../view/tree/impl/TreePackageImpl.java | 57 ++- .../view/tree/util/TreeAdapterFactory.java | 83 +++-- .../components/view/tree/util/TreeSwitch.java | 27 ++ .../src/main/resources/model/tree.ecore | 5 + .../src/main/resources/model/tree.genmodel | 4 + 37 files changed, 2389 insertions(+), 1481 deletions(-) create mode 100644 packages/sirius-web/backend/sirius-web/src/test/java/org/eclipse/sirius/web/application/controllers/trees/TreeItemLabelDescriptionControllerTests.java create mode 100644 packages/view/backend/sirius-components-view-builder/src/main/java/org/eclipse/sirius/components/view/builder/generated/tree/IfTreeItemLabelElementDescriptionBuilder.java create mode 100644 packages/view/backend/sirius-components-view-tree-edit/src/main/java/org/eclipse/sirius/components/view/tree/provider/IfTreeItemLabelElementDescriptionItemProvider.java create mode 100644 packages/view/backend/sirius-components-view-tree-edit/src/main/resources/icons/full/obj16/IfTreeItemLabelElementDescription.svg create mode 100644 packages/view/backend/sirius-components-view-tree/src/main/java/org/eclipse/sirius/components/view/tree/IfTreeItemLabelElementDescription.java create mode 100644 packages/view/backend/sirius-components-view-tree/src/main/java/org/eclipse/sirius/components/view/tree/impl/IfTreeItemLabelElementDescriptionImpl.java diff --git a/CHANGELOG.adoc b/CHANGELOG.adoc index 7cb567544f..8e58423bf2 100644 --- a/CHANGELOG.adoc +++ b/CHANGELOG.adoc @@ -117,6 +117,7 @@ This will allow specifier to create images that fir perfectly in the project tem - https://github.com/eclipse-sirius/sirius-web/issues/2163[#2163] [form] Make EMF default form support non changeable features - https://github.com/eclipse-sirius/sirius-web/issues/4086[#4086] [form] Wrap widget returned by property section in a div with a specific classname - https://github.com/eclipse-sirius/sirius-web/issues/4088[#4088] Change tree item context menu entries internal management +- https://github.com/eclipse-sirius/sirius-web/issues/4095[#4095] Add conditional tree item label element description == v2024.9.0 diff --git a/packages/sirius-web/backend/sirius-web-application/src/main/java/org/eclipse/sirius/web/application/studio/services/representations/DomainExplorerServices.java b/packages/sirius-web/backend/sirius-web-application/src/main/java/org/eclipse/sirius/web/application/studio/services/representations/DomainExplorerServices.java index dea1db1c8d..61bf82f8d2 100644 --- a/packages/sirius-web/backend/sirius-web-application/src/main/java/org/eclipse/sirius/web/application/studio/services/representations/DomainExplorerServices.java +++ b/packages/sirius-web/backend/sirius-web-application/src/main/java/org/eclipse/sirius/web/application/studio/services/representations/DomainExplorerServices.java @@ -294,6 +294,13 @@ public Object toggleAbstractEntity(Object self) { return self; } + public boolean isAbstractEntity(Object self) { + if (self instanceof Entity entity) { + return entity.isAbstract(); + } + return false; + } + /** * Wrapper for {@link org.eclipse.emf.ecore.EStructuralFeature.Setting} to avoid AQL interpreter sees this element as an list. */ diff --git a/packages/sirius-web/backend/sirius-web-application/src/main/java/org/eclipse/sirius/web/application/studio/services/representations/DomainViewTreeDescriptionProvider.java b/packages/sirius-web/backend/sirius-web-application/src/main/java/org/eclipse/sirius/web/application/studio/services/representations/DomainViewTreeDescriptionProvider.java index c9d375bdf3..911413817f 100644 --- a/packages/sirius-web/backend/sirius-web-application/src/main/java/org/eclipse/sirius/web/application/studio/services/representations/DomainViewTreeDescriptionProvider.java +++ b/packages/sirius-web/backend/sirius-web-application/src/main/java/org/eclipse/sirius/web/application/studio/services/representations/DomainViewTreeDescriptionProvider.java @@ -60,6 +60,8 @@ public class DomainViewTreeDescriptionProvider implements IEditingContextProcess private static final String AQL_SELF_IS_AN_ENTITY = "aql:self.oclIsKindOf(domain::Entity)"; + private static final String AQL_SELF_GET_TREE_ITEM_LABEL = "aql:self.getTreeItemLabel()"; + private final IStudioCapableEditingContextPredicate studioCapableEditingContextPredicate; private final ViewBuilders viewBuilderHelper = new ViewBuilders(); @@ -135,7 +137,6 @@ private TreeDescription domainExplorerDescription(TextStylePalette domainTextSty return this.viewDescription; } - private TextStylePalette createTextStylePalette() { return new ViewBuilders() .newTextStylePalette() @@ -154,35 +155,44 @@ private TreeItemLabelDescription attributeStyle(TextStylePalette textStylePalett } private TreeItemLabelDescription entityStyle(TextStylePalette textStylePalette) { - return new TreeBuilders() - .newTreeItemLabelDescription() + return new TreeBuilders().newTreeItemLabelDescription() .name("entity style") .preconditionExpression(AQL_SELF_IS_AN_ENTITY) - .children(this.getEntityKeyFragment(textStylePalette), this.getEntityValueFragment(textStylePalette)) + .children( + this.getEntityKeyFragment(textStylePalette), + this.getEntityValueFragment(textStylePalette), + this.getAbstractEntityValueFragment(textStylePalette)) .build(); } private TreeItemLabelDescription defaultStyle() { - return new TreeBuilders() - .newTreeItemLabelDescription() + return new TreeBuilders().newTreeItemLabelDescription() .name("default style") .preconditionExpression("aql:true") - .children(new TreeBuilders() - .newTreeItemLabelFragmentDescription() - .labelExpression("aql:self.getTreeItemLabel()") + .children(new TreeBuilders().newTreeItemLabelFragmentDescription() + .labelExpression(AQL_SELF_GET_TREE_ITEM_LABEL) // no style specified => default one will be chosen - .build() - ) + .build()) .build(); } private TreeItemLabelElementDescription getEntityValueFragment(TextStylePalette textStylePalette) { return new TreeBuilders().newTreeItemLabelFragmentDescription() - .labelExpression("aql:self.getTreeItemLabel()") + .labelExpression(AQL_SELF_GET_TREE_ITEM_LABEL) .style(this.getTextStyleByName(textStylePalette, NORMAL_TEXT_STYLE_NAME)) .build(); } + private TreeItemLabelElementDescription getAbstractEntityValueFragment(TextStylePalette textStylePalette) { + return new TreeBuilders().newIfTreeItemLabelElementDescription() + .predicateExpression("aql:self.isAbstractEntity()") + .children(new TreeBuilders().newTreeItemLabelFragmentDescription() + .labelExpression(" [abstract]") + .style(this.getTextStyleByName(textStylePalette, BLUE_ITALIC_TEXT_STYLE_NAME)) + .build()) + .build(); + } + private TreeItemLabelElementDescription getEntityKeyFragment(TextStylePalette textStylePalette) { return new TreeBuilders().newTreeItemLabelFragmentDescription() .labelExpression("aql:'[Entity] '") diff --git a/packages/sirius-web/backend/sirius-web/src/test/java/org/eclipse/sirius/web/application/controllers/trees/TreeItemContextMenuControllerTests.java b/packages/sirius-web/backend/sirius-web/src/test/java/org/eclipse/sirius/web/application/controllers/trees/TreeItemContextMenuControllerTests.java index 46047d2bc2..0686b40819 100644 --- a/packages/sirius-web/backend/sirius-web/src/test/java/org/eclipse/sirius/web/application/controllers/trees/TreeItemContextMenuControllerTests.java +++ b/packages/sirius-web/backend/sirius-web/src/test/java/org/eclipse/sirius/web/application/controllers/trees/TreeItemContextMenuControllerTests.java @@ -29,14 +29,15 @@ import org.eclipse.sirius.components.collaborative.trees.dto.InvokeSingleClickTreeItemContextMenuEntryInput; import org.eclipse.sirius.components.collaborative.trees.dto.TreeRefreshedEventPayload; import org.eclipse.sirius.components.core.api.SuccessPayload; +import org.eclipse.sirius.components.trees.Tree; import org.eclipse.sirius.web.AbstractIntegrationTests; import org.eclipse.sirius.web.application.views.explorer.ExplorerEventInput; import org.eclipse.sirius.web.application.views.explorer.services.ExplorerDescriptionProvider; import org.eclipse.sirius.web.data.StudioIdentifiers; import org.eclipse.sirius.web.tests.graphql.ExplorerDescriptionsQueryRunner; +import org.eclipse.sirius.web.tests.graphql.FetchTreeItemContextMenuEntryDataQueryRunner; import org.eclipse.sirius.web.tests.graphql.SingleClickTreeItemContextMenuEntryMutationRunner; import org.eclipse.sirius.web.tests.graphql.TreeItemContextMenuQueryRunner; -import org.eclipse.sirius.web.tests.graphql.FetchTreeItemContextMenuEntryDataQueryRunner; import org.eclipse.sirius.web.tests.services.api.IGivenInitialServerState; import org.eclipse.sirius.web.tests.services.explorer.ExplorerEventSubscriptionRunner; import org.eclipse.sirius.web.tests.services.representation.RepresentationIdBuilder; @@ -80,7 +81,7 @@ public class TreeItemContextMenuControllerTests extends AbstractIntegrationTests private RepresentationIdBuilder representationIdBuilder; @Autowired - private ExplorerEventSubscriptionRunner treeEventSubscriptionRunner; + private ExplorerEventSubscriptionRunner explorerEventSubscriptionRunner; @Autowired private ExplorerDescriptionsQueryRunner explorerDescriptionsQueryRunner; @@ -110,23 +111,16 @@ public void givenAStudioWhenTheContextMenuActionsAreRequestedOnAnEntityThenTheCo explorerDescriptionId.set(explorerIds.get(1)); var explorerRepresentationId = this.representationIdBuilder.buildExplorerRepresentationId(explorerDescriptionId.get(), List.of(StudioIdentifiers.DOMAIN_DOCUMENT.toString(), StudioIdentifiers.DOMAIN_OBJECT.toString(), ROOT_ENTITY_ID), List.of()); - var input = new ExplorerEventInput(UUID.randomUUID(), StudioIdentifiers.EMPTY_STUDIO_PROJECT.toString(), explorerRepresentationId); - var flux = this.treeEventSubscriptionRunner.run(input); + var input = new ExplorerEventInput(UUID.randomUUID(), StudioIdentifiers.SAMPLE_STUDIO_PROJECT.toString(), explorerRepresentationId); + var flux = this.explorerEventSubscriptionRunner.run(input); // 2- Retrieve the representation id (the id of DSL Domain explorer example tree) var treeId = new AtomicReference(); - Consumer initialTreeContentConsumer = object -> Optional.of(object) - .filter(DataFetcherResult.class::isInstance) - .map(DataFetcherResult.class::cast) - .map(DataFetcherResult::getData) - .filter(TreeRefreshedEventPayload.class::isInstance) - .map(TreeRefreshedEventPayload.class::cast) - .map(TreeRefreshedEventPayload::tree) - .ifPresentOrElse(tree -> { - assertThat(tree).isNotNull(); - treeId.set(tree.getId()); - }, () -> fail("Missing tree")); + Consumer initialTreeContentConsumer = this.getTreeSubscriptionConsumer(tree -> { + assertThat(tree).isNotNull(); + treeId.set(tree.getId()); + }); var helpId = new AtomicReference(); var toggleAbstractAction = new AtomicReference(); @@ -190,4 +184,15 @@ public void givenAStudioWhenTheContextMenuActionsAreRequestedOnAnEntityThenTheCo .thenCancel() .verify(Duration.ofSeconds(30)); } + + private Consumer getTreeSubscriptionConsumer(Consumer treeConsumer) { + return object -> Optional.of(object) + .filter(DataFetcherResult.class::isInstance) + .map(DataFetcherResult.class::cast) + .map(DataFetcherResult::getData) + .filter(TreeRefreshedEventPayload.class::isInstance) + .map(TreeRefreshedEventPayload.class::cast) + .map(TreeRefreshedEventPayload::tree) + .ifPresentOrElse(treeConsumer, () -> fail("Missing tree")); + } } diff --git a/packages/sirius-web/backend/sirius-web/src/test/java/org/eclipse/sirius/web/application/controllers/trees/TreeItemLabelDescriptionControllerTests.java b/packages/sirius-web/backend/sirius-web/src/test/java/org/eclipse/sirius/web/application/controllers/trees/TreeItemLabelDescriptionControllerTests.java new file mode 100644 index 0000000000..e270d67838 --- /dev/null +++ b/packages/sirius-web/backend/sirius-web/src/test/java/org/eclipse/sirius/web/application/controllers/trees/TreeItemLabelDescriptionControllerTests.java @@ -0,0 +1,152 @@ +/******************************************************************************* + * Copyright (c) 2024 Obeo. + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v2.0 + * which accompanies this distribution, and is available at + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Obeo - initial API and implementation + *******************************************************************************/ +package org.eclipse.sirius.web.application.controllers.trees; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.fail; + +import com.jayway.jsonpath.JsonPath; + +import java.time.Duration; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.UUID; +import java.util.concurrent.atomic.AtomicReference; +import java.util.function.Consumer; + +import org.eclipse.sirius.components.collaborative.trees.dto.TreeRefreshedEventPayload; +import org.eclipse.sirius.components.core.api.labels.StyledString; +import org.eclipse.sirius.components.trees.Tree; +import org.eclipse.sirius.components.trees.TreeItem; +import org.eclipse.sirius.web.AbstractIntegrationTests; +import org.eclipse.sirius.web.application.views.explorer.ExplorerEventInput; +import org.eclipse.sirius.web.application.views.explorer.services.ExplorerDescriptionProvider; +import org.eclipse.sirius.web.data.StudioIdentifiers; +import org.eclipse.sirius.web.tests.graphql.ExplorerDescriptionsQueryRunner; +import org.eclipse.sirius.web.tests.graphql.FetchTreeItemContextMenuEntryDataQueryRunner; +import org.eclipse.sirius.web.tests.graphql.SingleClickTreeItemContextMenuEntryMutationRunner; +import org.eclipse.sirius.web.tests.graphql.TreeItemContextMenuQueryRunner; +import org.eclipse.sirius.web.tests.services.api.IGivenInitialServerState; +import org.eclipse.sirius.web.tests.services.explorer.ExplorerEventSubscriptionRunner; +import org.eclipse.sirius.web.tests.services.representation.RepresentationIdBuilder; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.api.Test; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.context.jdbc.Sql; +import org.springframework.test.context.jdbc.SqlConfig; +import org.springframework.transaction.annotation.Transactional; + +import graphql.execution.DataFetcherResult; +import reactor.test.StepVerifier; + +/** + * Integration tests of the tree item label description controllers. + * + * @author Jerome Gout + */ +@Transactional +@SuppressWarnings("checkstyle:MultipleStringLiterals") +@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT, properties = { "sirius.web.test.enabled=studio" }) +public class TreeItemLabelDescriptionControllerTests extends AbstractIntegrationTests { + + private static final String ROOT_ENTITY_ID = "c341bf91-d315-4264-9787-c51b121a6375"; + + @Autowired + private IGivenInitialServerState givenInitialServerState; + + @Autowired + private TreeItemContextMenuQueryRunner treeItemContextMenuQueryRunner; + + @Autowired + private FetchTreeItemContextMenuEntryDataQueryRunner treeItemFetchContextActionDataQueryRunner; + + @Autowired + private SingleClickTreeItemContextMenuEntryMutationRunner singleClickTreeItemContexteMenuEntryMutationRunner; + + @Autowired + private RepresentationIdBuilder representationIdBuilder; + + @Autowired + private ExplorerEventSubscriptionRunner explorerEventSubscriptionRunner; + + @Autowired + private ExplorerDescriptionsQueryRunner explorerDescriptionsQueryRunner; + + @BeforeEach + public void beforeEach() { + this.givenInitialServerState.initialize(); + } + + @Test + @DisplayName("Given a studio, when the tree item labels are requested, then the correct styles are returned") + @Sql(scripts = { "/scripts/studio.sql" }, executionPhase = Sql.ExecutionPhase.BEFORE_TEST_METHOD) + @Sql(scripts = { "/scripts/cleanup.sql" }, executionPhase = Sql.ExecutionPhase.AFTER_TEST_METHOD, config = @SqlConfig(transactionMode = SqlConfig.TransactionMode.ISOLATED)) + public void givenAStudioWhenTheTreeItemLabelsAreRequestedThenTheCorrectStylesAreReturned() { + + // 1- retrieve the tree description id of the DSL Domain explorer example + var explorerDescriptionId = new AtomicReference(); + + Map explorerVariables = Map.of( + "editingContextId", StudioIdentifiers.SAMPLE_STUDIO_PROJECT.toString() + ); + var explorerResult = TreeItemLabelDescriptionControllerTests.this.explorerDescriptionsQueryRunner.run(explorerVariables); + List explorerIds = JsonPath.read(explorerResult, "$.data.viewer.editingContext.explorerDescriptions[*].id"); + assertThat(explorerIds).isNotEmpty() + .hasSize(2); + assertThat(explorerIds.get(0)).isEqualTo(ExplorerDescriptionProvider.DESCRIPTION_ID); + assertThat(explorerIds.get(1)).startsWith("siriusComponents://representationDescription?kind=treeDescription"); + explorerDescriptionId.set(explorerIds.get(1)); + + var explorerRepresentationId = this.representationIdBuilder.buildExplorerRepresentationId(explorerDescriptionId.get(), + List.of(StudioIdentifiers.DOMAIN_DOCUMENT.toString(), StudioIdentifiers.DOMAIN_OBJECT.toString(), ROOT_ENTITY_ID), List.of()); + + // 2- check that styles are properly applied + // - check that the ROOT entity has not the abstract style applied. + // - check that the NamedElement entity has the abstract style (if style) + var inputStyle = new ExplorerEventInput(UUID.randomUUID(), StudioIdentifiers.SAMPLE_STUDIO_PROJECT.toString(), explorerRepresentationId); + var fluxStyle = this.explorerEventSubscriptionRunner.run(inputStyle); + + Consumer styleTreeContentConsumer = this.getTreeSubscriptionConsumer(tree -> { + assertThat(tree).isNotNull(); + List domainChildren = tree.getChildren() + .get(0) + .getChildren() + .get(0) + .getChildren(); + StyledString rootLabel = domainChildren.get(0).getLabel(); + StyledString namedElementLabel = domainChildren.get(1).getLabel(); + assertThat(rootLabel.styledStringFragments()).hasSize(2); + assertThat(namedElementLabel.styledStringFragments()).hasSize(3); + assertThat(namedElementLabel.toString()).isEqualTo("[Entity] NamedElement [abstract]"); + }); + + StepVerifier.create(fluxStyle) + .consumeNextWith(styleTreeContentConsumer) + .thenCancel() + .verify(Duration.ofSeconds(30)); + } + + private Consumer getTreeSubscriptionConsumer(Consumer treeConsumer) { + return object -> Optional.of(object) + .filter(DataFetcherResult.class::isInstance) + .map(DataFetcherResult.class::cast) + .map(DataFetcherResult::getData) + .filter(TreeRefreshedEventPayload.class::isInstance) + .map(TreeRefreshedEventPayload.class::cast) + .map(TreeRefreshedEventPayload::tree) + .ifPresentOrElse(treeConsumer, () -> fail("Missing tree")); + } +} diff --git a/packages/view/backend/sirius-components-view-builder/pom.xml b/packages/view/backend/sirius-components-view-builder/pom.xml index 60e096d199..1288b741a8 100644 --- a/packages/view/backend/sirius-components-view-builder/pom.xml +++ b/packages/view/backend/sirius-components-view-builder/pom.xml @@ -12,183 +12,187 @@ Obeo - initial API and implementation --> - 4.0.0 - - org.springframework.boot - spring-boot-starter-parent - 3.3.3 - - - org.eclipse.sirius - sirius-components-view-builder - 2024.9.8 - sirius-components-view-builder - Sirius View Builder + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + 4.0.0 + + org.springframework.boot + spring-boot-starter-parent + 3.3.3 + + + org.eclipse.sirius + sirius-components-view-builder + 2024.9.8 + sirius-components-view-builder + Sirius View Builder - - UTF-8 - 17 - 17 - + + UTF-8 + 17 + 17 + - - - github - Apache Maven Packages - https://maven.pkg.github.com/eclipse-sirius/sirius-web - - + + + github + Apache Maven Packages + https://maven.pkg.github.com/eclipse-sirius/sirius-web + + - - - org.slf4j - slf4j-api - - - ch.qos.logback - logback-classic - - - org.eclipse.emf - org.eclipse.emf.codegen - 2.23.0 - - - org.eclipse.emf - org.eclipse.emf.ecore - 2.23.0 - - - org.eclipse.emf - org.eclipse.emf.codegen.ecore - 2.25.0 - - - org.eclipse.sirius - sirius-components-view-diagram - 2024.9.8 - - - org.eclipse.sirius - sirius-components-view-diagram-customnodes - 2024.9.8 - - - org.eclipse.sirius - sirius-components-view-form - 2024.9.8 - - - org.eclipse.sirius - sirius-components-view-gantt - 2024.9.8 - - - org.eclipse.sirius - sirius-components-view-deck - 2024.9.8 - - - org.eclipse.sirius - sirius-components-view-tree - 2024.9.8 - - - org.eclipse.sirius - sirius-components-widget-reference-view - 2024.9.8 - - - org.eclipse.sirius - sirius-components-tests - 2024.9.8 - test - - + + + org.slf4j + slf4j-api + + + ch.qos.logback + logback-classic + + + org.eclipse.emf + org.eclipse.emf.codegen + 2.23.0 + + + org.eclipse.emf + org.eclipse.emf.ecore + 2.23.0 + + + org.eclipse.emf + org.eclipse.emf.codegen.ecore + 2.25.0 + + + org.eclipse.sirius + sirius-components-view-diagram + 2024.9.8 + + + org.eclipse.sirius + sirius-components-view-diagram-customnodes + 2024.9.8 + + + org.eclipse.sirius + sirius-components-view-form + 2024.9.8 + + + org.eclipse.sirius + sirius-components-view-gantt + 2024.9.8 + + + org.eclipse.sirius + sirius-components-view-deck + 2024.9.8 + + + org.eclipse.sirius + sirius-components-view-tree + 2024.9.8 + + + org.eclipse.sirius + sirius-components-widget-reference-view + 2024.9.8 + + + org.eclipse.sirius + sirius-components-tests + 2024.9.8 + test + + - - - - org.apache.maven.plugins - maven-source-plugin - - - attach-sources - - jar - - - - - - org.jacoco - jacoco-maven-plugin - 0.8.12 - - - - prepare-agent - - - - report - prepare-package - - report - - - - - - org.codehaus.mojo - exec-maven-plugin - 3.1.0 - - - generate builders classes - package - - java - - - - - java - org.eclipse.sirius.components.view.builder.generator.BuilderGenerator - false - - ${project.basedir}/src/main/resources/emf-merge.xml - ${project.basedir} - ${project.basedir}/src/main/java/org/eclipse/sirius/components/view/builder/generated - org.eclipse.sirius.components.view.builder.generated - - - - - org.apache.maven.plugins - maven-checkstyle-plugin - 3.4.0 - - ../../../releng/backend/sirius-components-resources/checkstyle/CheckstyleConfiguration.xml - true - true - true - **/generated/**/* - - - - validate - validate - - check - - - - - - + + + + org.apache.maven.plugins + maven-source-plugin + + + attach-sources + + jar + + + + + + org.jacoco + jacoco-maven-plugin + 0.8.12 + + + + prepare-agent + + + + report + prepare-package + + report + + + + + + org.codehaus.mojo + exec-maven-plugin + 3.1.0 + + + generate builders classes + package + + java + + + + + java + org.eclipse.sirius.components.view.builder.generator.BuilderGenerator + false + + ${project.basedir}/src/main/resources/emf-merge.xml + ${project.basedir} + + ${project.basedir}/src/main/java/org/eclipse/sirius/components/view/builder/generated + + org.eclipse.sirius.components.view.builder.generated + + + + + org.apache.maven.plugins + maven-checkstyle-plugin + 3.4.0 + + + ../../../releng/backend/sirius-components-resources/checkstyle/CheckstyleConfiguration.xml + + true + true + true + **/generated/**/* + + + + validate + validate + + check + + + + + + diff --git a/packages/view/backend/sirius-components-view-builder/src/main/java/org/eclipse/sirius/components/view/builder/generated/tree/IfTreeItemLabelElementDescriptionBuilder.java b/packages/view/backend/sirius-components-view-builder/src/main/java/org/eclipse/sirius/components/view/builder/generated/tree/IfTreeItemLabelElementDescriptionBuilder.java new file mode 100644 index 0000000000..a79cf6b368 --- /dev/null +++ b/packages/view/backend/sirius-components-view-builder/src/main/java/org/eclipse/sirius/components/view/builder/generated/tree/IfTreeItemLabelElementDescriptionBuilder.java @@ -0,0 +1,68 @@ +/******************************************************************************* + * Copyright (c) 2023, 2024 Obeo. + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v2.0 + * which accompanies this distribution, and is available at + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Obeo - initial API and implementation + *******************************************************************************/ +package org.eclipse.sirius.components.view.builder.generated.tree; + +/** + * Builder for IfTreeItemLabelElementDescriptionBuilder. + * + * @author BuilderGenerator + * @generated + */ +public class IfTreeItemLabelElementDescriptionBuilder { + + /** + * Create instance org.eclipse.sirius.components.view.tree.IfTreeItemLabelElementDescription. + * @generated + */ + private org.eclipse.sirius.components.view.tree.IfTreeItemLabelElementDescription ifTreeItemLabelElementDescription = org.eclipse.sirius.components.view.tree.TreeFactory.eINSTANCE.createIfTreeItemLabelElementDescription(); + + /** + * Return instance org.eclipse.sirius.components.view.tree.IfTreeItemLabelElementDescription. + * @generated + */ + protected org.eclipse.sirius.components.view.tree.IfTreeItemLabelElementDescription getIfTreeItemLabelElementDescription() { + return this.ifTreeItemLabelElementDescription; + } + + /** + * Return instance org.eclipse.sirius.components.view.tree.IfTreeItemLabelElementDescription. + * @generated + */ + public org.eclipse.sirius.components.view.tree.IfTreeItemLabelElementDescription build() { + return this.getIfTreeItemLabelElementDescription(); + } + + /** + * Setter for PredicateExpression. + * + * @generated + */ + public IfTreeItemLabelElementDescriptionBuilder predicateExpression(java.lang.String value) { + this.getIfTreeItemLabelElementDescription().setPredicateExpression(value); + return this; + } + /** + * Setter for Children. + * + * @generated + */ + public IfTreeItemLabelElementDescriptionBuilder children(org.eclipse.sirius.components.view.tree.TreeItemLabelElementDescription ... values) { + for (org.eclipse.sirius.components.view.tree.TreeItemLabelElementDescription value : values) { + this.getIfTreeItemLabelElementDescription().getChildren().add(value); + } + return this; + } + + +} + diff --git a/packages/view/backend/sirius-components-view-builder/src/main/java/org/eclipse/sirius/components/view/builder/generated/tree/TreeBuilders.java b/packages/view/backend/sirius-components-view-builder/src/main/java/org/eclipse/sirius/components/view/builder/generated/tree/TreeBuilders.java index 88989fc896..ec33386cb0 100644 --- a/packages/view/backend/sirius-components-view-builder/src/main/java/org/eclipse/sirius/components/view/builder/generated/tree/TreeBuilders.java +++ b/packages/view/backend/sirius-components-view-builder/src/main/java/org/eclipse/sirius/components/view/builder/generated/tree/TreeBuilders.java @@ -39,6 +39,16 @@ public TreeItemLabelDescriptionBuilder newTreeItemLabelDescription() { return new TreeItemLabelDescriptionBuilder(); } + /** + * Instantiate a IfTreeItemLabelElementDescriptionBuilder . + * + * @author BuilderGenerator + * @generated + */ + public IfTreeItemLabelElementDescriptionBuilder newIfTreeItemLabelElementDescription() { + return new IfTreeItemLabelElementDescriptionBuilder(); + } + /** * Instantiate a TreeItemLabelFragmentDescriptionBuilder . * @@ -69,5 +79,4 @@ public FetchTreeItemContextMenuEntryBuilder newFetchTreeItemContextMenuEntry() { return new FetchTreeItemContextMenuEntryBuilder(); } - } diff --git a/packages/view/backend/sirius-components-view-emf/src/main/java/org/eclipse/sirius/components/view/emf/tree/TreeItemStyleConverter.java b/packages/view/backend/sirius-components-view-emf/src/main/java/org/eclipse/sirius/components/view/emf/tree/TreeItemStyleConverter.java index 885fb0d02a..933366a1d4 100644 --- a/packages/view/backend/sirius-components-view-emf/src/main/java/org/eclipse/sirius/components/view/emf/tree/TreeItemStyleConverter.java +++ b/packages/view/backend/sirius-components-view-emf/src/main/java/org/eclipse/sirius/components/view/emf/tree/TreeItemStyleConverter.java @@ -12,6 +12,7 @@ *******************************************************************************/ package org.eclipse.sirius.components.view.emf.tree; +import java.util.List; import java.util.Map; import java.util.Objects; import java.util.Optional; @@ -21,6 +22,7 @@ import org.eclipse.sirius.components.core.api.labels.StyledStringFragmentStyle; import org.eclipse.sirius.components.core.api.labels.UnderLineStyle; import org.eclipse.sirius.components.interpreter.AQLInterpreter; +import org.eclipse.sirius.components.view.tree.IfTreeItemLabelElementDescription; import org.eclipse.sirius.components.view.tree.TreeItemLabelDescription; import org.eclipse.sirius.components.view.tree.TreeItemLabelElementDescription; import org.eclipse.sirius.components.view.tree.TreeItemLabelFragmentDescription; @@ -43,17 +45,24 @@ public TreeItemStyleConverter(AQLInterpreter interpreter, Map va public StyledString convert(TreeItemLabelDescription tild) { var fragments = tild.getChildren().stream() - .map(this::convertElement) - .filter(Objects::nonNull) + .flatMap(tiled -> this.convertElement(tiled).stream()) .toList(); return new StyledString(fragments); } - private StyledStringFragment convertElement(TreeItemLabelElementDescription element) { + private List convertElement(TreeItemLabelElementDescription element) { + List result = List.of(); if (element instanceof TreeItemLabelFragmentDescription fragment) { - return this.convertFragment(fragment); + result = List.of(this.convertFragment(fragment)); + } else if (element instanceof IfTreeItemLabelElementDescription ifElement) { + var isValid = evaluateBoolean(ifElement.getPredicateExpression()).orElse(false); + if (isValid) { + result = ifElement.getChildren().stream() + .flatMap(tiled -> this.convertElement(tiled).stream()) + .toList(); + } } - return null; + return result; } private StyledStringFragment convertFragment(TreeItemLabelFragmentDescription fragment) { diff --git a/packages/view/backend/sirius-components-view-tree-edit/src/main/java/org/eclipse/sirius/components/view/tree/provider/FetchTreeItemContextMenuEntryItemProvider.java b/packages/view/backend/sirius-components-view-tree-edit/src/main/java/org/eclipse/sirius/components/view/tree/provider/FetchTreeItemContextMenuEntryItemProvider.java index a7604e5ae9..d0237eb159 100644 --- a/packages/view/backend/sirius-components-view-tree-edit/src/main/java/org/eclipse/sirius/components/view/tree/provider/FetchTreeItemContextMenuEntryItemProvider.java +++ b/packages/view/backend/sirius-components-view-tree-edit/src/main/java/org/eclipse/sirius/components/view/tree/provider/FetchTreeItemContextMenuEntryItemProvider.java @@ -25,8 +25,7 @@ import org.eclipse.sirius.components.view.tree.TreePackage; /** - * This is the item provider adapter for a - * {@link org.eclipse.sirius.components.view.tree.FetchTreeItemContextMenuEntry} + * This is the item provider adapter for a {@link org.eclipse.sirius.components.view.tree.FetchTreeItemContextMenuEntry} * object. * * @generated @@ -34,8 +33,7 @@ public class FetchTreeItemContextMenuEntryItemProvider extends TreeItemContextMenuEntryItemProvider { /** - * This constructs an instance from a factory and a notifier. + * This constructs an instance from a factory and a notifier. * * @generated */ @@ -44,65 +42,53 @@ public FetchTreeItemContextMenuEntryItemProvider(AdapterFactory adapterFactory) } /** - * This returns the property descriptors for the adapted class. + * This returns the property descriptors for the adapted class. * * @generated */ @Override public List getPropertyDescriptors(Object object) { - if (this.itemPropertyDescriptors == null) { + if (itemPropertyDescriptors == null) { super.getPropertyDescriptors(object); - this.addUrlExressionPropertyDescriptor(object); - this.addKindPropertyDescriptor(object); + addUrlExressionPropertyDescriptor(object); + addKindPropertyDescriptor(object); } - return this.itemPropertyDescriptors; + return itemPropertyDescriptors; } /** - * This adds a property descriptor for the Url Exression feature. + * This adds a property descriptor for the Url Exression feature. * * @generated */ protected void addUrlExressionPropertyDescriptor(Object object) { - this.itemPropertyDescriptors - .add(this.createItemPropertyDescriptor(((ComposeableAdapterFactory) this.adapterFactory).getRootAdapterFactory(), - this.getResourceLocator(), this.getString("_UI_FetchTreeItemContextMenuEntry_urlExression_feature"), - this.getString("_UI_PropertyDescriptor_description", - "_UI_FetchTreeItemContextMenuEntry_urlExression_feature", - "_UI_FetchTreeItemContextMenuEntry_type"), - TreePackage.Literals.FETCH_TREE_ITEM_CONTEXT_MENU_ENTRY__URL_EXRESSION, true, false, false, - ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); + itemPropertyDescriptors.add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getResourceLocator(), + getString("_UI_FetchTreeItemContextMenuEntry_urlExression_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_FetchTreeItemContextMenuEntry_urlExression_feature", "_UI_FetchTreeItemContextMenuEntry_type"), + TreePackage.Literals.FETCH_TREE_ITEM_CONTEXT_MENU_ENTRY__URL_EXRESSION, true, false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); } /** - * This adds a property descriptor for the Kind feature. - * + * This adds a property descriptor for the Kind feature. * * @generated */ protected void addKindPropertyDescriptor(Object object) { - this.itemPropertyDescriptors.add(this.createItemPropertyDescriptor( - ((ComposeableAdapterFactory) this.adapterFactory).getRootAdapterFactory(), this.getResourceLocator(), - this.getString("_UI_FetchTreeItemContextMenuEntry_kind_feature"), - this.getString("_UI_PropertyDescriptor_description", "_UI_FetchTreeItemContextMenuEntry_kind_feature", - "_UI_FetchTreeItemContextMenuEntry_type"), - TreePackage.Literals.FETCH_TREE_ITEM_CONTEXT_MENU_ENTRY__KIND, true, false, false, - ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); + itemPropertyDescriptors.add( + createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString("_UI_FetchTreeItemContextMenuEntry_kind_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_FetchTreeItemContextMenuEntry_kind_feature", "_UI_FetchTreeItemContextMenuEntry_type"), + TreePackage.Literals.FETCH_TREE_ITEM_CONTEXT_MENU_ENTRY__KIND, true, false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); } /** - * This returns FetchTreeItemContextMenuEntry.gif. + * This returns FetchTreeItemContextMenuEntry.gif. * * @generated NOT */ @Override public Object getImage(Object object) { - return this.overlayImage(object, - this.getResourceLocator().getImage("full/obj16/FetchTreeItemContextMenuEntry.svg")); + return this.overlayImage(object, this.getResourceLocator().getImage("full/obj16/FetchTreeItemContextMenuEntry.svg")); } /** @@ -116,42 +102,39 @@ protected boolean shouldComposeCreationImage() { } /** - * This returns the label text for the adapted class. - * + * This returns the label text for the adapted class. * * @generated */ @Override public String getText(Object object) { String label = ((FetchTreeItemContextMenuEntry) object).getName(); - return label == null || label.length() == 0 ? this.getString("_UI_FetchTreeItemContextMenuEntry_type") - : this.getString("_UI_FetchTreeItemContextMenuEntry_type") + " " + label; + return label == null || label.length() == 0 ? getString("_UI_FetchTreeItemContextMenuEntry_type") : getString("_UI_FetchTreeItemContextMenuEntry_type") + " " + label; } /** - * This handles model notifications by calling {@link #updateChildren} to update - * any cached children and by creating a viewer notification, which it passes to - * {@link #fireNotifyChanged}. + * This handles model notifications by calling {@link #updateChildren} to update any cached children and by creating + * a viewer notification, which it passes to {@link #fireNotifyChanged}. * * @generated */ @Override public void notifyChanged(Notification notification) { - this.updateChildren(notification); + updateChildren(notification); switch (notification.getFeatureID(FetchTreeItemContextMenuEntry.class)) { case TreePackage.FETCH_TREE_ITEM_CONTEXT_MENU_ENTRY__URL_EXRESSION: case TreePackage.FETCH_TREE_ITEM_CONTEXT_MENU_ENTRY__KIND: - this.fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true)); + fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true)); return; } super.notifyChanged(notification); } /** - * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing - * the children that can be created under this object. - * + * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children that can be created + * under this object. * * @generated */ diff --git a/packages/view/backend/sirius-components-view-tree-edit/src/main/java/org/eclipse/sirius/components/view/tree/provider/IfTreeItemLabelElementDescriptionItemProvider.java b/packages/view/backend/sirius-components-view-tree-edit/src/main/java/org/eclipse/sirius/components/view/tree/provider/IfTreeItemLabelElementDescriptionItemProvider.java new file mode 100644 index 0000000000..19943f7397 --- /dev/null +++ b/packages/view/backend/sirius-components-view-tree-edit/src/main/java/org/eclipse/sirius/components/view/tree/provider/IfTreeItemLabelElementDescriptionItemProvider.java @@ -0,0 +1,146 @@ +/******************************************************************************* + * Copyright (c) 2024 Obeo. + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v2.0 + * which accompanies this distribution, and is available at + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Obeo - initial API and implementation + *******************************************************************************/ +package org.eclipse.sirius.components.view.tree.provider; + +import java.util.Collection; +import java.util.List; + +import org.eclipse.emf.common.notify.AdapterFactory; +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; +import org.eclipse.emf.edit.provider.IItemPropertyDescriptor; +import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; +import org.eclipse.emf.edit.provider.ViewerNotification; +import org.eclipse.sirius.components.view.tree.IfTreeItemLabelElementDescription; +import org.eclipse.sirius.components.view.tree.TreePackage; + +/** + * This is the item provider adapter for a + * {@link org.eclipse.sirius.components.view.tree.IfTreeItemLabelElementDescription} object. + * + * + * @generated + */ +public class IfTreeItemLabelElementDescriptionItemProvider extends TreeItemLabelElementDescriptionItemProvider { + /** + * This constructs an instance from a factory and a notifier. + * + * @generated + */ + public IfTreeItemLabelElementDescriptionItemProvider(AdapterFactory adapterFactory) { + super(adapterFactory); + } + + /** + * This returns the property descriptors for the adapted class. + * + * @generated + */ + @Override + public List getPropertyDescriptors(Object object) { + if (itemPropertyDescriptors == null) { + super.getPropertyDescriptors(object); + + addPredicateExpressionPropertyDescriptor(object); + addChildrenPropertyDescriptor(object); + } + return itemPropertyDescriptors; + } + + /** + * This adds a property descriptor for the Predicate Expression feature. + * + * @generated + */ + protected void addPredicateExpressionPropertyDescriptor(Object object) { + itemPropertyDescriptors.add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getResourceLocator(), + getString("_UI_IfTreeItemLabelElementDescription_predicateExpression_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_IfTreeItemLabelElementDescription_predicateExpression_feature", "_UI_IfTreeItemLabelElementDescription_type"), + TreePackage.Literals.IF_TREE_ITEM_LABEL_ELEMENT_DESCRIPTION__PREDICATE_EXPRESSION, true, false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); + } + + /** + * This adds a property descriptor for the Children feature. + * + * @generated + */ + protected void addChildrenPropertyDescriptor(Object object) { + itemPropertyDescriptors.add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getResourceLocator(), + getString("_UI_IfTreeItemLabelElementDescription_children_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_IfTreeItemLabelElementDescription_children_feature", "_UI_IfTreeItemLabelElementDescription_type"), + TreePackage.Literals.IF_TREE_ITEM_LABEL_ELEMENT_DESCRIPTION__CHILDREN, true, false, true, null, null, null)); + } + + /** + * This returns IfTreeItemLabelElementDescription.gif. + * + * @generated NOT + */ + @Override + public Object getImage(Object object) { + return overlayImage(object, getResourceLocator().getImage("full/obj16/IfTreeItemLabelElementDescription.svg")); + } + + /** + * + * + * @generated + */ + @Override + protected boolean shouldComposeCreationImage() { + return true; + } + + /** + * This returns the label text for the adapted class. + * + * @generated + */ + @Override + public String getText(Object object) { + String label = ((IfTreeItemLabelElementDescription) object).getPredicateExpression(); + return label == null || label.length() == 0 ? getString("_UI_IfTreeItemLabelElementDescription_type") : getString("_UI_IfTreeItemLabelElementDescription_type") + " " + label; + } + + /** + * This handles model notifications by calling {@link #updateChildren} to update any cached children and by creating + * a viewer notification, which it passes to {@link #fireNotifyChanged}. + * + * @generated + */ + @Override + public void notifyChanged(Notification notification) { + updateChildren(notification); + + switch (notification.getFeatureID(IfTreeItemLabelElementDescription.class)) { + case TreePackage.IF_TREE_ITEM_LABEL_ELEMENT_DESCRIPTION__PREDICATE_EXPRESSION: + fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true)); + return; + } + super.notifyChanged(notification); + } + + /** + * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children that can be created + * under this object. + * + * @generated + */ + @Override + protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { + super.collectNewChildDescriptors(newChildDescriptors, object); + } + +} diff --git a/packages/view/backend/sirius-components-view-tree-edit/src/main/java/org/eclipse/sirius/components/view/tree/provider/SingleClickTreeItemContextMenuEntryItemProvider.java b/packages/view/backend/sirius-components-view-tree-edit/src/main/java/org/eclipse/sirius/components/view/tree/provider/SingleClickTreeItemContextMenuEntryItemProvider.java index a468433a74..562636e594 100644 --- a/packages/view/backend/sirius-components-view-tree-edit/src/main/java/org/eclipse/sirius/components/view/tree/provider/SingleClickTreeItemContextMenuEntryItemProvider.java +++ b/packages/view/backend/sirius-components-view-tree-edit/src/main/java/org/eclipse/sirius/components/view/tree/provider/SingleClickTreeItemContextMenuEntryItemProvider.java @@ -26,16 +26,15 @@ /** * This is the item provider adapter for a - * {@link org.eclipse.sirius.components.view.tree.SingleClickTreeItemContextMenuEntry} - * object. + * {@link org.eclipse.sirius.components.view.tree.SingleClickTreeItemContextMenuEntry} object. + * * * @generated */ public class SingleClickTreeItemContextMenuEntryItemProvider extends TreeItemContextMenuEntryItemProvider { /** - * This constructs an instance from a factory and a notifier. + * This constructs an instance from a factory and a notifier. * * @generated */ @@ -44,36 +43,34 @@ public SingleClickTreeItemContextMenuEntryItemProvider(AdapterFactory adapterFac } /** - * This returns the property descriptors for the adapted class. + * This returns the property descriptors for the adapted class. * * @generated */ @Override public List getPropertyDescriptors(Object object) { - if (this.itemPropertyDescriptors == null) { + if (itemPropertyDescriptors == null) { super.getPropertyDescriptors(object); } - return this.itemPropertyDescriptors; + return itemPropertyDescriptors; } /** - * This specifies how to implement {@link #getChildren} and is used to deduce an - * appropriate feature for an {@link org.eclipse.emf.edit.command.AddCommand}, - * {@link org.eclipse.emf.edit.command.RemoveCommand} or - * {@link org.eclipse.emf.edit.command.MoveCommand} in {@link #createCommand}. - * + * This specifies how to implement {@link #getChildren} and is used to deduce an appropriate feature for an + * {@link org.eclipse.emf.edit.command.AddCommand}, {@link org.eclipse.emf.edit.command.RemoveCommand} or + * {@link org.eclipse.emf.edit.command.MoveCommand} in {@link #createCommand}. * * @generated */ @Override public Collection getChildrenFeatures(Object object) { - if (this.childrenFeatures == null) { + if (childrenFeatures == null) { super.getChildrenFeatures(object); - this.childrenFeatures.add(TreePackage.Literals.SINGLE_CLICK_TREE_ITEM_CONTEXT_MENU_ENTRY__BODY); + childrenFeatures.add(TreePackage.Literals.SINGLE_CLICK_TREE_ITEM_CONTEXT_MENU_ENTRY__BODY); } - return this.childrenFeatures; + return childrenFeatures; } /** @@ -83,23 +80,20 @@ public Collection getChildrenFeatures(Object objec */ @Override protected EStructuralFeature getChildFeature(Object object, Object child) { - // Check the type of the specified child object and return the proper feature to - // use for + // Check the type of the specified child object and return the proper feature to use for // adding (see {@link AddCommand}) it as a child. return super.getChildFeature(object, child); } /** - * This returns SingleClickTreeItemContextMenuEntry.gif. - * + * This returns SingleClickTreeItemContextMenuEntry.gif. * * @generated NOT */ @Override public Object getImage(Object object) { - return this.overlayImage(object, - this.getResourceLocator().getImage("full/obj16/SingleClickTreeItemContextMenuEntry.svg")); + return this.overlayImage(object, this.getResourceLocator().getImage("full/obj16/SingleClickTreeItemContextMenuEntry.svg")); } /** @@ -113,41 +107,38 @@ protected boolean shouldComposeCreationImage() { } /** - * This returns the label text for the adapted class. - * + * This returns the label text for the adapted class. * * @generated */ @Override public String getText(Object object) { String label = ((SingleClickTreeItemContextMenuEntry) object).getName(); - return label == null || label.length() == 0 ? this.getString("_UI_SingleClickTreeItemContextMenuEntry_type") - : this.getString("_UI_SingleClickTreeItemContextMenuEntry_type") + " " + label; + return label == null || label.length() == 0 ? getString("_UI_SingleClickTreeItemContextMenuEntry_type") : getString("_UI_SingleClickTreeItemContextMenuEntry_type") + " " + label; } /** - * This handles model notifications by calling {@link #updateChildren} to update - * any cached children and by creating a viewer notification, which it passes to - * {@link #fireNotifyChanged}. + * This handles model notifications by calling {@link #updateChildren} to update any cached children and by creating + * a viewer notification, which it passes to {@link #fireNotifyChanged}. * * @generated */ @Override public void notifyChanged(Notification notification) { - this.updateChildren(notification); + updateChildren(notification); switch (notification.getFeatureID(SingleClickTreeItemContextMenuEntry.class)) { case TreePackage.SINGLE_CLICK_TREE_ITEM_CONTEXT_MENU_ENTRY__BODY: - this.fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, false)); + fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, false)); return; } super.notifyChanged(notification); } /** - * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing - * the children that can be created under this object. - * + * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children that can be created + * under this object. * * @generated */ @@ -155,37 +146,21 @@ public void notifyChanged(Notification notification) { protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { super.collectNewChildDescriptors(newChildDescriptors, object); - newChildDescriptors - .add(this.createChildParameter(TreePackage.Literals.SINGLE_CLICK_TREE_ITEM_CONTEXT_MENU_ENTRY__BODY, - ViewFactory.eINSTANCE.createChangeContext())); + newChildDescriptors.add(createChildParameter(TreePackage.Literals.SINGLE_CLICK_TREE_ITEM_CONTEXT_MENU_ENTRY__BODY, ViewFactory.eINSTANCE.createChangeContext())); - newChildDescriptors - .add(this.createChildParameter(TreePackage.Literals.SINGLE_CLICK_TREE_ITEM_CONTEXT_MENU_ENTRY__BODY, - ViewFactory.eINSTANCE.createCreateInstance())); + newChildDescriptors.add(createChildParameter(TreePackage.Literals.SINGLE_CLICK_TREE_ITEM_CONTEXT_MENU_ENTRY__BODY, ViewFactory.eINSTANCE.createCreateInstance())); - newChildDescriptors - .add(this.createChildParameter(TreePackage.Literals.SINGLE_CLICK_TREE_ITEM_CONTEXT_MENU_ENTRY__BODY, - ViewFactory.eINSTANCE.createSetValue())); + newChildDescriptors.add(createChildParameter(TreePackage.Literals.SINGLE_CLICK_TREE_ITEM_CONTEXT_MENU_ENTRY__BODY, ViewFactory.eINSTANCE.createSetValue())); - newChildDescriptors - .add(this.createChildParameter(TreePackage.Literals.SINGLE_CLICK_TREE_ITEM_CONTEXT_MENU_ENTRY__BODY, - ViewFactory.eINSTANCE.createUnsetValue())); + newChildDescriptors.add(createChildParameter(TreePackage.Literals.SINGLE_CLICK_TREE_ITEM_CONTEXT_MENU_ENTRY__BODY, ViewFactory.eINSTANCE.createUnsetValue())); - newChildDescriptors - .add(this.createChildParameter(TreePackage.Literals.SINGLE_CLICK_TREE_ITEM_CONTEXT_MENU_ENTRY__BODY, - ViewFactory.eINSTANCE.createDeleteElement())); + newChildDescriptors.add(createChildParameter(TreePackage.Literals.SINGLE_CLICK_TREE_ITEM_CONTEXT_MENU_ENTRY__BODY, ViewFactory.eINSTANCE.createDeleteElement())); - newChildDescriptors - .add(this.createChildParameter(TreePackage.Literals.SINGLE_CLICK_TREE_ITEM_CONTEXT_MENU_ENTRY__BODY, - ViewFactory.eINSTANCE.createLet())); + newChildDescriptors.add(createChildParameter(TreePackage.Literals.SINGLE_CLICK_TREE_ITEM_CONTEXT_MENU_ENTRY__BODY, ViewFactory.eINSTANCE.createLet())); - newChildDescriptors - .add(this.createChildParameter(TreePackage.Literals.SINGLE_CLICK_TREE_ITEM_CONTEXT_MENU_ENTRY__BODY, - ViewFactory.eINSTANCE.createIf())); + newChildDescriptors.add(createChildParameter(TreePackage.Literals.SINGLE_CLICK_TREE_ITEM_CONTEXT_MENU_ENTRY__BODY, ViewFactory.eINSTANCE.createIf())); - newChildDescriptors - .add(this.createChildParameter(TreePackage.Literals.SINGLE_CLICK_TREE_ITEM_CONTEXT_MENU_ENTRY__BODY, - ViewFactory.eINSTANCE.createFor())); + newChildDescriptors.add(createChildParameter(TreePackage.Literals.SINGLE_CLICK_TREE_ITEM_CONTEXT_MENU_ENTRY__BODY, ViewFactory.eINSTANCE.createFor())); } } diff --git a/packages/view/backend/sirius-components-view-tree-edit/src/main/java/org/eclipse/sirius/components/view/tree/provider/TreeDescriptionItemProvider.java b/packages/view/backend/sirius-components-view-tree-edit/src/main/java/org/eclipse/sirius/components/view/tree/provider/TreeDescriptionItemProvider.java index e3cc62c8eb..45f940a7ef 100644 --- a/packages/view/backend/sirius-components-view-tree-edit/src/main/java/org/eclipse/sirius/components/view/tree/provider/TreeDescriptionItemProvider.java +++ b/packages/view/backend/sirius-components-view-tree-edit/src/main/java/org/eclipse/sirius/components/view/tree/provider/TreeDescriptionItemProvider.java @@ -28,8 +28,7 @@ import org.eclipse.sirius.components.view.tree.TreePackage; /** - * This is the item provider adapter for a - * {@link org.eclipse.sirius.components.view.tree.TreeDescription} object. * * @generated @@ -37,8 +36,7 @@ public class TreeDescriptionItemProvider extends RepresentationDescriptionItemProvider { /** - * This constructs an instance from a factory and a notifier. + * This constructs an instance from a factory and a notifier. * * @generated */ @@ -47,241 +45,199 @@ public TreeDescriptionItemProvider(AdapterFactory adapterFactory) { } /** - * This returns the property descriptors for the adapted class. + * This returns the property descriptors for the adapted class. * * @generated */ @Override public List getPropertyDescriptors(Object object) { - if (this.itemPropertyDescriptors == null) { + if (itemPropertyDescriptors == null) { super.getPropertyDescriptors(object); - this.addKindExpressionPropertyDescriptor(object); - this.addIconURLExpressionPropertyDescriptor(object); - this.addTreeItemIdExpressionPropertyDescriptor(object); - this.addTreeItemObjectExpressionPropertyDescriptor(object); - this.addElementsExpressionPropertyDescriptor(object); - this.addHasChildrenExpressionPropertyDescriptor(object); - this.addChildrenExpressionPropertyDescriptor(object); - this.addParentExpressionPropertyDescriptor(object); - this.addEditableExpressionPropertyDescriptor(object); - this.addSelectableExpressionPropertyDescriptor(object); - this.addDeletableExpressionPropertyDescriptor(object); - this.addTreeItemLabelDescriptionsPropertyDescriptor(object); + addKindExpressionPropertyDescriptor(object); + addIconURLExpressionPropertyDescriptor(object); + addTreeItemIdExpressionPropertyDescriptor(object); + addTreeItemObjectExpressionPropertyDescriptor(object); + addElementsExpressionPropertyDescriptor(object); + addHasChildrenExpressionPropertyDescriptor(object); + addChildrenExpressionPropertyDescriptor(object); + addParentExpressionPropertyDescriptor(object); + addEditableExpressionPropertyDescriptor(object); + addSelectableExpressionPropertyDescriptor(object); + addDeletableExpressionPropertyDescriptor(object); + addTreeItemLabelDescriptionsPropertyDescriptor(object); } - return this.itemPropertyDescriptors; + return itemPropertyDescriptors; } /** - * This adds a property descriptor for the Kind Expression feature. + * This adds a property descriptor for the Kind Expression feature. * * @generated */ protected void addKindExpressionPropertyDescriptor(Object object) { - this.itemPropertyDescriptors - .add(this.createItemPropertyDescriptor(((ComposeableAdapterFactory) this.adapterFactory).getRootAdapterFactory(), - this.getResourceLocator(), this.getString("_UI_TreeDescription_kindExpression_feature"), - this.getString("_UI_PropertyDescriptor_description", "_UI_TreeDescription_kindExpression_feature", - "_UI_TreeDescription_type"), - TreePackage.Literals.TREE_DESCRIPTION__KIND_EXPRESSION, true, false, false, - ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); + itemPropertyDescriptors.add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getResourceLocator(), + getString("_UI_TreeDescription_kindExpression_feature"), getString("_UI_PropertyDescriptor_description", "_UI_TreeDescription_kindExpression_feature", "_UI_TreeDescription_type"), + TreePackage.Literals.TREE_DESCRIPTION__KIND_EXPRESSION, true, false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); } /** - * This adds a property descriptor for the Icon URL Expression feature. + * This adds a property descriptor for the Icon URL Expression feature. * * @generated */ protected void addIconURLExpressionPropertyDescriptor(Object object) { - this.itemPropertyDescriptors - .add(this.createItemPropertyDescriptor(((ComposeableAdapterFactory) this.adapterFactory).getRootAdapterFactory(), - this.getResourceLocator(), this.getString("_UI_TreeDescription_iconURLExpression_feature"), - this.getString("_UI_PropertyDescriptor_description", "_UI_TreeDescription_iconURLExpression_feature", - "_UI_TreeDescription_type"), - TreePackage.Literals.TREE_DESCRIPTION__ICON_URL_EXPRESSION, true, false, false, - ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); + itemPropertyDescriptors.add( + createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString("_UI_TreeDescription_iconURLExpression_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_TreeDescription_iconURLExpression_feature", "_UI_TreeDescription_type"), + TreePackage.Literals.TREE_DESCRIPTION__ICON_URL_EXPRESSION, true, false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); } /** - * This adds a property descriptor for the Tree Item Id Expression feature. + * This adds a property descriptor for the Tree Item Id Expression feature. * * @generated */ protected void addTreeItemIdExpressionPropertyDescriptor(Object object) { - this.itemPropertyDescriptors.add(this.createItemPropertyDescriptor( - ((ComposeableAdapterFactory) this.adapterFactory).getRootAdapterFactory(), this.getResourceLocator(), - this.getString("_UI_TreeDescription_treeItemIdExpression_feature"), - this.getString("_UI_PropertyDescriptor_description", "_UI_TreeDescription_treeItemIdExpression_feature", - "_UI_TreeDescription_type"), - TreePackage.Literals.TREE_DESCRIPTION__TREE_ITEM_ID_EXPRESSION, true, false, false, - ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); + itemPropertyDescriptors.add( + createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString("_UI_TreeDescription_treeItemIdExpression_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_TreeDescription_treeItemIdExpression_feature", "_UI_TreeDescription_type"), + TreePackage.Literals.TREE_DESCRIPTION__TREE_ITEM_ID_EXPRESSION, true, false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); } /** - * This adds a property descriptor for the Tree Item Object Expression feature. - * + * This adds a property descriptor for the Tree Item Object Expression feature. * * @generated */ protected void addTreeItemObjectExpressionPropertyDescriptor(Object object) { - this.itemPropertyDescriptors.add(this.createItemPropertyDescriptor( - ((ComposeableAdapterFactory) this.adapterFactory).getRootAdapterFactory(), this.getResourceLocator(), - this.getString("_UI_TreeDescription_treeItemObjectExpression_feature"), - this.getString("_UI_PropertyDescriptor_description", "_UI_TreeDescription_treeItemObjectExpression_feature", - "_UI_TreeDescription_type"), - TreePackage.Literals.TREE_DESCRIPTION__TREE_ITEM_OBJECT_EXPRESSION, true, false, false, - ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); + itemPropertyDescriptors.add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getResourceLocator(), + getString("_UI_TreeDescription_treeItemObjectExpression_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_TreeDescription_treeItemObjectExpression_feature", "_UI_TreeDescription_type"), + TreePackage.Literals.TREE_DESCRIPTION__TREE_ITEM_OBJECT_EXPRESSION, true, false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); } /** - * This adds a property descriptor for the Elements Expression feature. + * This adds a property descriptor for the Elements Expression feature. * * @generated */ protected void addElementsExpressionPropertyDescriptor(Object object) { - this.itemPropertyDescriptors.add(this.createItemPropertyDescriptor( - ((ComposeableAdapterFactory) this.adapterFactory).getRootAdapterFactory(), this.getResourceLocator(), - this.getString("_UI_TreeDescription_elementsExpression_feature"), - this.getString("_UI_PropertyDescriptor_description", "_UI_TreeDescription_elementsExpression_feature", - "_UI_TreeDescription_type"), - TreePackage.Literals.TREE_DESCRIPTION__ELEMENTS_EXPRESSION, true, false, false, - ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); + itemPropertyDescriptors.add( + createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString("_UI_TreeDescription_elementsExpression_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_TreeDescription_elementsExpression_feature", "_UI_TreeDescription_type"), + TreePackage.Literals.TREE_DESCRIPTION__ELEMENTS_EXPRESSION, true, false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); } /** - * This adds a property descriptor for the Has Children Expression feature. + * This adds a property descriptor for the Has Children Expression feature. * * @generated */ protected void addHasChildrenExpressionPropertyDescriptor(Object object) { - this.itemPropertyDescriptors.add(this.createItemPropertyDescriptor( - ((ComposeableAdapterFactory) this.adapterFactory).getRootAdapterFactory(), this.getResourceLocator(), - this.getString("_UI_TreeDescription_hasChildrenExpression_feature"), - this.getString("_UI_PropertyDescriptor_description", "_UI_TreeDescription_hasChildrenExpression_feature", - "_UI_TreeDescription_type"), - TreePackage.Literals.TREE_DESCRIPTION__HAS_CHILDREN_EXPRESSION, true, false, false, - ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); + itemPropertyDescriptors.add( + createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString("_UI_TreeDescription_hasChildrenExpression_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_TreeDescription_hasChildrenExpression_feature", "_UI_TreeDescription_type"), + TreePackage.Literals.TREE_DESCRIPTION__HAS_CHILDREN_EXPRESSION, true, false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); } /** - * This adds a property descriptor for the Children Expression feature. + * This adds a property descriptor for the Children Expression feature. * * @generated */ protected void addChildrenExpressionPropertyDescriptor(Object object) { - this.itemPropertyDescriptors.add(this.createItemPropertyDescriptor( - ((ComposeableAdapterFactory) this.adapterFactory).getRootAdapterFactory(), this.getResourceLocator(), - this.getString("_UI_TreeDescription_childrenExpression_feature"), - this.getString("_UI_PropertyDescriptor_description", "_UI_TreeDescription_childrenExpression_feature", - "_UI_TreeDescription_type"), - TreePackage.Literals.TREE_DESCRIPTION__CHILDREN_EXPRESSION, true, false, false, - ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); + itemPropertyDescriptors.add( + createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString("_UI_TreeDescription_childrenExpression_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_TreeDescription_childrenExpression_feature", "_UI_TreeDescription_type"), + TreePackage.Literals.TREE_DESCRIPTION__CHILDREN_EXPRESSION, true, false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); } /** - * This adds a property descriptor for the Parent Expression feature. + * This adds a property descriptor for the Parent Expression feature. * * @generated */ protected void addParentExpressionPropertyDescriptor(Object object) { - this.itemPropertyDescriptors - .add(this.createItemPropertyDescriptor(((ComposeableAdapterFactory) this.adapterFactory).getRootAdapterFactory(), - this.getResourceLocator(), this.getString("_UI_TreeDescription_parentExpression_feature"), - this.getString("_UI_PropertyDescriptor_description", "_UI_TreeDescription_parentExpression_feature", - "_UI_TreeDescription_type"), - TreePackage.Literals.TREE_DESCRIPTION__PARENT_EXPRESSION, true, false, false, - ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); + itemPropertyDescriptors.add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getResourceLocator(), + getString("_UI_TreeDescription_parentExpression_feature"), getString("_UI_PropertyDescriptor_description", "_UI_TreeDescription_parentExpression_feature", "_UI_TreeDescription_type"), + TreePackage.Literals.TREE_DESCRIPTION__PARENT_EXPRESSION, true, false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); } /** - * This adds a property descriptor for the Editable Expression feature. + * This adds a property descriptor for the Editable Expression feature. * * @generated */ protected void addEditableExpressionPropertyDescriptor(Object object) { - this.itemPropertyDescriptors.add(this.createItemPropertyDescriptor( - ((ComposeableAdapterFactory) this.adapterFactory).getRootAdapterFactory(), this.getResourceLocator(), - this.getString("_UI_TreeDescription_editableExpression_feature"), - this.getString("_UI_PropertyDescriptor_description", "_UI_TreeDescription_editableExpression_feature", - "_UI_TreeDescription_type"), - TreePackage.Literals.TREE_DESCRIPTION__EDITABLE_EXPRESSION, true, false, false, - ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); + itemPropertyDescriptors.add( + createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString("_UI_TreeDescription_editableExpression_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_TreeDescription_editableExpression_feature", "_UI_TreeDescription_type"), + TreePackage.Literals.TREE_DESCRIPTION__EDITABLE_EXPRESSION, true, false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); } /** - * This adds a property descriptor for the Selectable Expression feature. + * This adds a property descriptor for the Selectable Expression feature. * * @generated */ protected void addSelectableExpressionPropertyDescriptor(Object object) { - this.itemPropertyDescriptors.add(this.createItemPropertyDescriptor( - ((ComposeableAdapterFactory) this.adapterFactory).getRootAdapterFactory(), this.getResourceLocator(), - this.getString("_UI_TreeDescription_selectableExpression_feature"), - this.getString("_UI_PropertyDescriptor_description", "_UI_TreeDescription_selectableExpression_feature", - "_UI_TreeDescription_type"), - TreePackage.Literals.TREE_DESCRIPTION__SELECTABLE_EXPRESSION, true, false, false, - ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); + itemPropertyDescriptors.add( + createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString("_UI_TreeDescription_selectableExpression_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_TreeDescription_selectableExpression_feature", "_UI_TreeDescription_type"), + TreePackage.Literals.TREE_DESCRIPTION__SELECTABLE_EXPRESSION, true, false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); } /** - * This adds a property descriptor for the Deletable Expression feature. + * This adds a property descriptor for the Deletable Expression feature. * * @generated */ protected void addDeletableExpressionPropertyDescriptor(Object object) { - this.itemPropertyDescriptors.add(this.createItemPropertyDescriptor( - ((ComposeableAdapterFactory) this.adapterFactory).getRootAdapterFactory(), this.getResourceLocator(), - this.getString("_UI_TreeDescription_deletableExpression_feature"), - this.getString("_UI_PropertyDescriptor_description", "_UI_TreeDescription_deletableExpression_feature", - "_UI_TreeDescription_type"), - TreePackage.Literals.TREE_DESCRIPTION__DELETABLE_EXPRESSION, true, false, false, - ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); + itemPropertyDescriptors.add( + createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString("_UI_TreeDescription_deletableExpression_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_TreeDescription_deletableExpression_feature", "_UI_TreeDescription_type"), + TreePackage.Literals.TREE_DESCRIPTION__DELETABLE_EXPRESSION, true, false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); } /** - * This adds a property descriptor for the Tree Item Label Descriptions feature. - * + * This adds a property descriptor for the Tree Item Label Descriptions feature. * * @generated */ protected void addTreeItemLabelDescriptionsPropertyDescriptor(Object object) { - this.itemPropertyDescriptors - .add(this.createItemPropertyDescriptor(((ComposeableAdapterFactory) this.adapterFactory).getRootAdapterFactory(), - this.getResourceLocator(), this.getString("_UI_TreeDescription_treeItemLabelDescriptions_feature"), - this.getString("_UI_PropertyDescriptor_description", - "_UI_TreeDescription_treeItemLabelDescriptions_feature", "_UI_TreeDescription_type"), - TreePackage.Literals.TREE_DESCRIPTION__TREE_ITEM_LABEL_DESCRIPTIONS, true, false, true, null, - null, null)); + itemPropertyDescriptors.add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getResourceLocator(), + getString("_UI_TreeDescription_treeItemLabelDescriptions_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_TreeDescription_treeItemLabelDescriptions_feature", "_UI_TreeDescription_type"), + TreePackage.Literals.TREE_DESCRIPTION__TREE_ITEM_LABEL_DESCRIPTIONS, true, false, true, null, null, null)); } /** - * This specifies how to implement {@link #getChildren} and is used to deduce an - * appropriate feature for an {@link org.eclipse.emf.edit.command.AddCommand}, - * {@link org.eclipse.emf.edit.command.RemoveCommand} or - * {@link org.eclipse.emf.edit.command.MoveCommand} in {@link #createCommand}. - * + * This specifies how to implement {@link #getChildren} and is used to deduce an appropriate feature for an + * {@link org.eclipse.emf.edit.command.AddCommand}, {@link org.eclipse.emf.edit.command.RemoveCommand} or + * {@link org.eclipse.emf.edit.command.MoveCommand} in {@link #createCommand}. * * @generated */ @Override public Collection getChildrenFeatures(Object object) { - if (this.childrenFeatures == null) { + if (childrenFeatures == null) { super.getChildrenFeatures(object); - this.childrenFeatures.add(TreePackage.Literals.TREE_DESCRIPTION__TREE_ITEM_LABEL_DESCRIPTIONS); - this.childrenFeatures.add(TreePackage.Literals.TREE_DESCRIPTION__CONTEXT_MENU_ENTRIES); + childrenFeatures.add(TreePackage.Literals.TREE_DESCRIPTION__TREE_ITEM_LABEL_DESCRIPTIONS); + childrenFeatures.add(TreePackage.Literals.TREE_DESCRIPTION__CONTEXT_MENU_ENTRIES); } - return this.childrenFeatures; + return childrenFeatures; } /** @@ -291,16 +247,14 @@ public Collection getChildrenFeatures(Object objec */ @Override protected EStructuralFeature getChildFeature(Object object, Object child) { - // Check the type of the specified child object and return the proper feature to - // use for + // Check the type of the specified child object and return the proper feature to use for // adding (see {@link AddCommand}) it as a child. return super.getChildFeature(object, child); } /** - * This returns TreeDescription.gif. + * This returns TreeDescription.gif. * * @generated NOT */ @@ -320,28 +274,26 @@ protected boolean shouldComposeCreationImage() { } /** - * This returns the label text for the adapted class. - * + * This returns the label text for the adapted class. * * @generated */ @Override public String getText(Object object) { String label = ((TreeDescription) object).getName(); - return label == null || label.length() == 0 ? this.getString("_UI_TreeDescription_type") - : this.getString("_UI_TreeDescription_type") + " " + label; + return label == null || label.length() == 0 ? getString("_UI_TreeDescription_type") : getString("_UI_TreeDescription_type") + " " + label; } /** - * This handles model notifications by calling {@link #updateChildren} to update - * any cached children and by creating a viewer notification, which it passes to - * {@link #fireNotifyChanged}. + * This handles model notifications by calling {@link #updateChildren} to update any cached children and by creating + * a viewer notification, which it passes to {@link #fireNotifyChanged}. * * @generated */ @Override public void notifyChanged(Notification notification) { - this.updateChildren(notification); + updateChildren(notification); switch (notification.getFeatureID(TreeDescription.class)) { case TreePackage.TREE_DESCRIPTION__KIND_EXPRESSION: @@ -355,20 +307,19 @@ public void notifyChanged(Notification notification) { case TreePackage.TREE_DESCRIPTION__EDITABLE_EXPRESSION: case TreePackage.TREE_DESCRIPTION__SELECTABLE_EXPRESSION: case TreePackage.TREE_DESCRIPTION__DELETABLE_EXPRESSION: - this.fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true)); + fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true)); return; case TreePackage.TREE_DESCRIPTION__TREE_ITEM_LABEL_DESCRIPTIONS: case TreePackage.TREE_DESCRIPTION__CONTEXT_MENU_ENTRIES: - this.fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, false)); + fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, false)); return; } super.notifyChanged(notification); } /** - * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing - * the children that can be created under this object. - * + * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children that can be created + * under this object. * * @generated */ @@ -376,15 +327,11 @@ public void notifyChanged(Notification notification) { protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { super.collectNewChildDescriptors(newChildDescriptors, object); - newChildDescriptors - .add(this.createChildParameter(TreePackage.Literals.TREE_DESCRIPTION__TREE_ITEM_LABEL_DESCRIPTIONS, - TreeFactory.eINSTANCE.createTreeItemLabelDescription())); + newChildDescriptors.add(createChildParameter(TreePackage.Literals.TREE_DESCRIPTION__TREE_ITEM_LABEL_DESCRIPTIONS, TreeFactory.eINSTANCE.createTreeItemLabelDescription())); - newChildDescriptors.add(this.createChildParameter(TreePackage.Literals.TREE_DESCRIPTION__CONTEXT_MENU_ENTRIES, - TreeFactory.eINSTANCE.createSingleClickTreeItemContextMenuEntry())); + newChildDescriptors.add(createChildParameter(TreePackage.Literals.TREE_DESCRIPTION__CONTEXT_MENU_ENTRIES, TreeFactory.eINSTANCE.createSingleClickTreeItemContextMenuEntry())); - newChildDescriptors.add(this.createChildParameter(TreePackage.Literals.TREE_DESCRIPTION__CONTEXT_MENU_ENTRIES, - TreeFactory.eINSTANCE.createFetchTreeItemContextMenuEntry())); + newChildDescriptors.add(createChildParameter(TreePackage.Literals.TREE_DESCRIPTION__CONTEXT_MENU_ENTRIES, TreeFactory.eINSTANCE.createFetchTreeItemContextMenuEntry())); } } diff --git a/packages/view/backend/sirius-components-view-tree-edit/src/main/java/org/eclipse/sirius/components/view/tree/provider/TreeEditPlugin.java b/packages/view/backend/sirius-components-view-tree-edit/src/main/java/org/eclipse/sirius/components/view/tree/provider/TreeEditPlugin.java index 62ac6e4753..7517b8a18b 100644 --- a/packages/view/backend/sirius-components-view-tree-edit/src/main/java/org/eclipse/sirius/components/view/tree/provider/TreeEditPlugin.java +++ b/packages/view/backend/sirius-components-view-tree-edit/src/main/java/org/eclipse/sirius/components/view/tree/provider/TreeEditPlugin.java @@ -21,111 +21,103 @@ import org.eclipse.sirius.components.view.provider.ViewEditPlugin; /** - * This is the central singleton for the Tree edit plugin. + * This is the central singleton for the Tree edit plugin. * * @generated */ public final class TreeEditPlugin extends EMFPlugin { - /** - * Keep track of the singleton. - * - * @generated - */ - public static final TreeEditPlugin INSTANCE = new TreeEditPlugin(); + /** + * Keep track of the singleton. + * + * @generated + */ + public static final TreeEditPlugin INSTANCE = new TreeEditPlugin(); - /** - * Keep track of the singleton. - * - * @generated - */ - private static Implementation plugin; + /** + * Keep track of the singleton. + * + * @generated + */ + private static Implementation plugin; - /** - * Create the instance. - * - * @generated - */ - public TreeEditPlugin() { - super(new ResourceLocator[] { ViewEditPlugin.INSTANCE, }); - } + /** + * Create the instance. + * + * @generated + */ + public TreeEditPlugin() { + super(new ResourceLocator[] { ViewEditPlugin.INSTANCE, }); + } - /** - * Returns the singleton instance of the Eclipse plugin. - * - * - * @return the singleton instance. - * @generated - */ - @Override - public ResourceLocator getPluginResourceLocator() { - return plugin; - } + /** + * Returns the singleton instance of the Eclipse plugin. + * + * @return the singleton instance. + * @generated + */ + @Override + public ResourceLocator getPluginResourceLocator() { + return plugin; + } - /** - * Returns the singleton instance of the Eclipse plugin. - * - * - * @return the singleton instance. - * @generated - */ - public static Implementation getPlugin() { - return plugin; - } + /** + * Returns the singleton instance of the Eclipse plugin. + * + * @return the singleton instance. + * @generated + */ + public static Implementation getPlugin() { + return plugin; + } - @Override - protected Object doGetImage(String key) throws IOException { - URL url = new URL(this.getBaseURL() + "icons/" + key + extensionFor(key)); - InputStream inputStream = url.openStream(); - inputStream.close(); - return url; - } + @Override + protected Object doGetImage(String key) throws IOException { + URL url = new URL(this.getBaseURL() + "icons/" + key + extensionFor(key)); + InputStream inputStream = url.openStream(); + inputStream.close(); + return url; + } - /** - * Computes the file extension to be used with the key to specify an image - * resource. - * - * @param key the key for the imagine. - * @return the file extension to be used with the key to specify an image - * resource. - */ - protected static String extensionFor(String key) { - String result = ".gif"; - int index = key.lastIndexOf('.'); - if (index != -1) { - String extension = key.substring(index + 1); - if ("png".equalsIgnoreCase(extension) || "gif".equalsIgnoreCase(extension) - || "bmp".equalsIgnoreCase(extension) || "ico".equalsIgnoreCase(extension) - || "jpg".equalsIgnoreCase(extension) || "jpeg".equalsIgnoreCase(extension) - || "tif".equalsIgnoreCase(extension) || "tiff".equalsIgnoreCase(extension) - || "svg".equalsIgnoreCase(extension)) { - result = ""; - } - } - return result; - } + /** + * Computes the file extension to be used with the key to specify an image resource. + * + * @param key + * the key for the imagine. + * @return the file extension to be used with the key to specify an image resource. + */ + protected static String extensionFor(String key) { + String result = ".gif"; + int index = key.lastIndexOf('.'); + if (index != -1) { + String extension = key.substring(index + 1); + if ("png".equalsIgnoreCase(extension) || "gif".equalsIgnoreCase(extension) || "bmp".equalsIgnoreCase(extension) || "ico".equalsIgnoreCase(extension) || "jpg".equalsIgnoreCase(extension) + || "jpeg".equalsIgnoreCase(extension) || "tif".equalsIgnoreCase(extension) || "tiff".equalsIgnoreCase(extension) || "svg".equalsIgnoreCase(extension)) { + result = ""; + } + } + return result; + } - /** - * The actual implementation of the Eclipse Plugin. - * - * @generated - */ - public static class Implementation extends EclipsePlugin { + /** + * The actual implementation of the Eclipse Plugin. + * + * @generated + */ + public static class Implementation extends EclipsePlugin { - /** - * Creates an instance. - * - * @generated - */ - public Implementation() { - super(); + /** + * Creates an instance. + * + * @generated + */ + public Implementation() { + super(); - // Remember the static instance. - // - plugin = this; - } - } + // Remember the static instance. + // + plugin = this; + } + } } diff --git a/packages/view/backend/sirius-components-view-tree-edit/src/main/java/org/eclipse/sirius/components/view/tree/provider/TreeItemContextMenuEntryItemProvider.java b/packages/view/backend/sirius-components-view-tree-edit/src/main/java/org/eclipse/sirius/components/view/tree/provider/TreeItemContextMenuEntryItemProvider.java index 11848805de..ab6dd88b3e 100644 --- a/packages/view/backend/sirius-components-view-tree-edit/src/main/java/org/eclipse/sirius/components/view/tree/provider/TreeItemContextMenuEntryItemProvider.java +++ b/packages/view/backend/sirius-components-view-tree-edit/src/main/java/org/eclipse/sirius/components/view/tree/provider/TreeItemContextMenuEntryItemProvider.java @@ -33,18 +33,16 @@ import org.eclipse.sirius.components.view.tree.TreePackage; /** - * This is the item provider adapter for a - * {@link org.eclipse.sirius.components.view.tree.TreeItemContextMenuEntry} + * This is the item provider adapter for a {@link org.eclipse.sirius.components.view.tree.TreeItemContextMenuEntry} * object. * * @generated */ -public class TreeItemContextMenuEntryItemProvider extends ItemProviderAdapter implements IEditingDomainItemProvider, - IStructuredItemContentProvider, ITreeItemContentProvider, IItemLabelProvider, IItemPropertySource { +public class TreeItemContextMenuEntryItemProvider extends ItemProviderAdapter + implements IEditingDomainItemProvider, IStructuredItemContentProvider, ITreeItemContentProvider, IItemLabelProvider, IItemPropertySource { /** - * This constructs an instance from a factory and a notifier. + * This constructs an instance from a factory and a notifier. * * @generated */ @@ -53,87 +51,71 @@ public TreeItemContextMenuEntryItemProvider(AdapterFactory adapterFactory) { } /** - * This returns the property descriptors for the adapted class. + * This returns the property descriptors for the adapted class. * * @generated */ @Override public List getPropertyDescriptors(Object object) { - if (this.itemPropertyDescriptors == null) { + if (itemPropertyDescriptors == null) { super.getPropertyDescriptors(object); - this.addNamePropertyDescriptor(object); - this.addLabelExpressionPropertyDescriptor(object); - this.addIconURLExpressionPropertyDescriptor(object); - this.addPreconditionExpressionPropertyDescriptor(object); + addNamePropertyDescriptor(object); + addLabelExpressionPropertyDescriptor(object); + addIconURLExpressionPropertyDescriptor(object); + addPreconditionExpressionPropertyDescriptor(object); } - return this.itemPropertyDescriptors; + return itemPropertyDescriptors; } /** - * This adds a property descriptor for the Name feature. - * + * This adds a property descriptor for the Name feature. * * @generated */ protected void addNamePropertyDescriptor(Object object) { - this.itemPropertyDescriptors.add(this.createItemPropertyDescriptor( - ((ComposeableAdapterFactory) this.adapterFactory).getRootAdapterFactory(), this.getResourceLocator(), - this.getString("_UI_TreeItemContextMenuEntry_name_feature"), - this.getString("_UI_PropertyDescriptor_description", "_UI_TreeItemContextMenuEntry_name_feature", - "_UI_TreeItemContextMenuEntry_type"), - TreePackage.Literals.TREE_ITEM_CONTEXT_MENU_ENTRY__NAME, true, false, false, - ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); + itemPropertyDescriptors + .add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString("_UI_TreeItemContextMenuEntry_name_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_TreeItemContextMenuEntry_name_feature", "_UI_TreeItemContextMenuEntry_type"), + TreePackage.Literals.TREE_ITEM_CONTEXT_MENU_ENTRY__NAME, true, false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); } /** - * This adds a property descriptor for the Label Expression feature. + * This adds a property descriptor for the Label Expression feature. * * @generated */ protected void addLabelExpressionPropertyDescriptor(Object object) { - this.itemPropertyDescriptors.add(this.createItemPropertyDescriptor( - ((ComposeableAdapterFactory) this.adapterFactory).getRootAdapterFactory(), this.getResourceLocator(), - this.getString("_UI_TreeItemContextMenuEntry_labelExpression_feature"), - this.getString("_UI_PropertyDescriptor_description", "_UI_TreeItemContextMenuEntry_labelExpression_feature", - "_UI_TreeItemContextMenuEntry_type"), - TreePackage.Literals.TREE_ITEM_CONTEXT_MENU_ENTRY__LABEL_EXPRESSION, true, false, false, - ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); + itemPropertyDescriptors.add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getResourceLocator(), + getString("_UI_TreeItemContextMenuEntry_labelExpression_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_TreeItemContextMenuEntry_labelExpression_feature", "_UI_TreeItemContextMenuEntry_type"), + TreePackage.Literals.TREE_ITEM_CONTEXT_MENU_ENTRY__LABEL_EXPRESSION, true, false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); } /** - * This adds a property descriptor for the Icon URL Expression feature. + * This adds a property descriptor for the Icon URL Expression feature. * * @generated */ protected void addIconURLExpressionPropertyDescriptor(Object object) { - this.itemPropertyDescriptors.add(this.createItemPropertyDescriptor( - ((ComposeableAdapterFactory) this.adapterFactory).getRootAdapterFactory(), this.getResourceLocator(), - this.getString("_UI_TreeItemContextMenuEntry_iconURLExpression_feature"), - this.getString("_UI_PropertyDescriptor_description", - "_UI_TreeItemContextMenuEntry_iconURLExpression_feature", "_UI_TreeItemContextMenuEntry_type"), - TreePackage.Literals.TREE_ITEM_CONTEXT_MENU_ENTRY__ICON_URL_EXPRESSION, true, false, false, - ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); + itemPropertyDescriptors.add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getResourceLocator(), + getString("_UI_TreeItemContextMenuEntry_iconURLExpression_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_TreeItemContextMenuEntry_iconURLExpression_feature", "_UI_TreeItemContextMenuEntry_type"), + TreePackage.Literals.TREE_ITEM_CONTEXT_MENU_ENTRY__ICON_URL_EXPRESSION, true, false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); } /** - * This adds a property descriptor for the Precondition Expression feature. + * This adds a property descriptor for the Precondition Expression feature. * * @generated */ protected void addPreconditionExpressionPropertyDescriptor(Object object) { - this.itemPropertyDescriptors - .add(this.createItemPropertyDescriptor(((ComposeableAdapterFactory) this.adapterFactory).getRootAdapterFactory(), - this.getResourceLocator(), this.getString("_UI_TreeItemContextMenuEntry_preconditionExpression_feature"), - this.getString("_UI_PropertyDescriptor_description", - "_UI_TreeItemContextMenuEntry_preconditionExpression_feature", - "_UI_TreeItemContextMenuEntry_type"), - TreePackage.Literals.TREE_ITEM_CONTEXT_MENU_ENTRY__PRECONDITION_EXPRESSION, true, false, false, - ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); + itemPropertyDescriptors.add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getResourceLocator(), + getString("_UI_TreeItemContextMenuEntry_preconditionExpression_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_TreeItemContextMenuEntry_preconditionExpression_feature", "_UI_TreeItemContextMenuEntry_type"), + TreePackage.Literals.TREE_ITEM_CONTEXT_MENU_ENTRY__PRECONDITION_EXPRESSION, true, false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); } /** @@ -147,44 +129,41 @@ protected boolean shouldComposeCreationImage() { } /** - * This returns the label text for the adapted class. - * + * This returns the label text for the adapted class. * * @generated */ @Override public String getText(Object object) { String label = ((TreeItemContextMenuEntry) object).getName(); - return label == null || label.length() == 0 ? this.getString("_UI_TreeItemContextMenuEntry_type") - : this.getString("_UI_TreeItemContextMenuEntry_type") + " " + label; + return label == null || label.length() == 0 ? getString("_UI_TreeItemContextMenuEntry_type") : getString("_UI_TreeItemContextMenuEntry_type") + " " + label; } /** - * This handles model notifications by calling {@link #updateChildren} to update - * any cached children and by creating a viewer notification, which it passes to - * {@link #fireNotifyChanged}. + * This handles model notifications by calling {@link #updateChildren} to update any cached children and by creating + * a viewer notification, which it passes to {@link #fireNotifyChanged}. * * @generated */ @Override public void notifyChanged(Notification notification) { - this.updateChildren(notification); + updateChildren(notification); switch (notification.getFeatureID(TreeItemContextMenuEntry.class)) { case TreePackage.TREE_ITEM_CONTEXT_MENU_ENTRY__NAME: case TreePackage.TREE_ITEM_CONTEXT_MENU_ENTRY__LABEL_EXPRESSION: case TreePackage.TREE_ITEM_CONTEXT_MENU_ENTRY__ICON_URL_EXPRESSION: case TreePackage.TREE_ITEM_CONTEXT_MENU_ENTRY__PRECONDITION_EXPRESSION: - this.fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true)); + fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true)); return; } super.notifyChanged(notification); } /** - * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing - * the children that can be created under this object. - * + * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children that can be created + * under this object. * * @generated */ @@ -194,14 +173,13 @@ protected void collectNewChildDescriptors(Collection newChildDescriptors } /** - * Return the resource locator for this item provider's resources. + * Return the resource locator for this item provider's resources. * * @generated */ @Override public ResourceLocator getResourceLocator() { - return ((IChildCreationExtender) this.adapterFactory).getResourceLocator(); + return ((IChildCreationExtender) adapterFactory).getResourceLocator(); } } diff --git a/packages/view/backend/sirius-components-view-tree-edit/src/main/java/org/eclipse/sirius/components/view/tree/provider/TreeItemLabelDescriptionItemProvider.java b/packages/view/backend/sirius-components-view-tree-edit/src/main/java/org/eclipse/sirius/components/view/tree/provider/TreeItemLabelDescriptionItemProvider.java index f8adc7af4c..92c053ee37 100644 --- a/packages/view/backend/sirius-components-view-tree-edit/src/main/java/org/eclipse/sirius/components/view/tree/provider/TreeItemLabelDescriptionItemProvider.java +++ b/packages/view/backend/sirius-components-view-tree-edit/src/main/java/org/eclipse/sirius/components/view/tree/provider/TreeItemLabelDescriptionItemProvider.java @@ -35,188 +35,171 @@ import org.eclipse.sirius.components.view.tree.TreePackage; /** - * This is the item provider adapter for a - * {@link org.eclipse.sirius.components.view.tree.TreeItemLabelDescription} + * This is the item provider adapter for a {@link org.eclipse.sirius.components.view.tree.TreeItemLabelDescription} * object. * * @generated */ -public class TreeItemLabelDescriptionItemProvider extends ItemProviderAdapter implements IEditingDomainItemProvider, - IStructuredItemContentProvider, ITreeItemContentProvider, IItemLabelProvider, IItemPropertySource { - - /** - * This constructs an instance from a factory and a notifier. - * - * @generated - */ - public TreeItemLabelDescriptionItemProvider(AdapterFactory adapterFactory) { - super(adapterFactory); - } - - /** - * This returns the property descriptors for the adapted class. - * - * @generated - */ - @Override - public List getPropertyDescriptors(Object object) { - if (itemPropertyDescriptors == null) { - super.getPropertyDescriptors(object); - - addNamePropertyDescriptor(object); - addPreconditionExpressionPropertyDescriptor(object); - } - return itemPropertyDescriptors; - } - - /** - * This adds a property descriptor for the Name feature. - * - * - * @generated - */ - protected void addNamePropertyDescriptor(Object object) { - itemPropertyDescriptors.add(createItemPropertyDescriptor( - ((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getResourceLocator(), - getString("_UI_TreeItemLabelDescription_name_feature"), - getString("_UI_PropertyDescriptor_description", "_UI_TreeItemLabelDescription_name_feature", - "_UI_TreeItemLabelDescription_type"), - TreePackage.Literals.TREE_ITEM_LABEL_DESCRIPTION__NAME, true, false, false, - ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); - } - - /** - * This adds a property descriptor for the Precondition Expression feature. - * - * @generated - */ - protected void addPreconditionExpressionPropertyDescriptor(Object object) { - itemPropertyDescriptors - .add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), - getResourceLocator(), getString("_UI_TreeItemLabelDescription_preconditionExpression_feature"), - getString("_UI_PropertyDescriptor_description", - "_UI_TreeItemLabelDescription_preconditionExpression_feature", - "_UI_TreeItemLabelDescription_type"), - TreePackage.Literals.TREE_ITEM_LABEL_DESCRIPTION__PRECONDITION_EXPRESSION, true, false, false, - ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); - } - - /** - * This specifies how to implement {@link #getChildren} and is used to deduce an - * appropriate feature for an {@link org.eclipse.emf.edit.command.AddCommand}, - * {@link org.eclipse.emf.edit.command.RemoveCommand} or - * {@link org.eclipse.emf.edit.command.MoveCommand} in {@link #createCommand}. - * - * - * @generated - */ - @Override - public Collection getChildrenFeatures(Object object) { - if (childrenFeatures == null) { - super.getChildrenFeatures(object); - childrenFeatures.add(TreePackage.Literals.TREE_ITEM_LABEL_DESCRIPTION__CHILDREN); - } - return childrenFeatures; - } - - /** - * - * - * @generated - */ - @Override - protected EStructuralFeature getChildFeature(Object object, Object child) { - // Check the type of the specified child object and return the proper feature to - // use for - // adding (see {@link AddCommand}) it as a child. - - return super.getChildFeature(object, child); - } - - /** - * This returns TreeItemLabelDescription.gif. - * - * @generated NOT - */ - @Override - public Object getImage(Object object) { - return this.overlayImage(object, this.getResourceLocator().getImage("full/obj16/TreeItemLabelDescription.svg")); - } - - /** - * - * - * @generated - */ - @Override - protected boolean shouldComposeCreationImage() { - return true; - } - - /** - * This returns the label text for the adapted class. - * - * - * @generated - */ - @Override - public String getText(Object object) { - String label = ((TreeItemLabelDescription) object).getName(); - return label == null || label.length() == 0 ? getString("_UI_TreeItemLabelDescription_type") - : getString("_UI_TreeItemLabelDescription_type") + " " + label; - } - - /** - * This handles model notifications by calling {@link #updateChildren} to update - * any cached children and by creating a viewer notification, which it passes to - * {@link #fireNotifyChanged}. - * - * @generated - */ - @Override - public void notifyChanged(Notification notification) { - updateChildren(notification); - - switch (notification.getFeatureID(TreeItemLabelDescription.class)) { - case TreePackage.TREE_ITEM_LABEL_DESCRIPTION__NAME: - case TreePackage.TREE_ITEM_LABEL_DESCRIPTION__PRECONDITION_EXPRESSION: - fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true)); - return; - case TreePackage.TREE_ITEM_LABEL_DESCRIPTION__CHILDREN: - fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, false)); - return; - } - super.notifyChanged(notification); - } - - /** - * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing - * the children that can be created under this object. - * - * - * @generated - */ - @Override - protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { - super.collectNewChildDescriptors(newChildDescriptors, object); - - newChildDescriptors.add(createChildParameter(TreePackage.Literals.TREE_ITEM_LABEL_DESCRIPTION__CHILDREN, - TreeFactory.eINSTANCE.createTreeItemLabelFragmentDescription())); - } - - /** - * Return the resource locator for this item provider's resources. - * - * @generated - */ - @Override - public ResourceLocator getResourceLocator() { - return ((IChildCreationExtender) adapterFactory).getResourceLocator(); - } +public class TreeItemLabelDescriptionItemProvider extends ItemProviderAdapter + implements IEditingDomainItemProvider, IStructuredItemContentProvider, ITreeItemContentProvider, IItemLabelProvider, IItemPropertySource { + + /** + * This constructs an instance from a factory and a notifier. + * + * @generated + */ + public TreeItemLabelDescriptionItemProvider(AdapterFactory adapterFactory) { + super(adapterFactory); + } + + /** + * This returns the property descriptors for the adapted class. + * + * @generated + */ + @Override + public List getPropertyDescriptors(Object object) { + if (itemPropertyDescriptors == null) { + super.getPropertyDescriptors(object); + + addNamePropertyDescriptor(object); + addPreconditionExpressionPropertyDescriptor(object); + } + return itemPropertyDescriptors; + } + + /** + * This adds a property descriptor for the Name feature. + * + * @generated + */ + protected void addNamePropertyDescriptor(Object object) { + itemPropertyDescriptors + .add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString("_UI_TreeItemLabelDescription_name_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_TreeItemLabelDescription_name_feature", "_UI_TreeItemLabelDescription_type"), + TreePackage.Literals.TREE_ITEM_LABEL_DESCRIPTION__NAME, true, false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); + } + + /** + * This adds a property descriptor for the Precondition Expression feature. + * + * @generated + */ + protected void addPreconditionExpressionPropertyDescriptor(Object object) { + itemPropertyDescriptors.add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getResourceLocator(), + getString("_UI_TreeItemLabelDescription_preconditionExpression_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_TreeItemLabelDescription_preconditionExpression_feature", "_UI_TreeItemLabelDescription_type"), + TreePackage.Literals.TREE_ITEM_LABEL_DESCRIPTION__PRECONDITION_EXPRESSION, true, false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); + } + + /** + * This specifies how to implement {@link #getChildren} and is used to deduce an appropriate feature for an + * {@link org.eclipse.emf.edit.command.AddCommand}, {@link org.eclipse.emf.edit.command.RemoveCommand} or + * {@link org.eclipse.emf.edit.command.MoveCommand} in {@link #createCommand}. + * + * @generated + */ + @Override + public Collection getChildrenFeatures(Object object) { + if (childrenFeatures == null) { + super.getChildrenFeatures(object); + childrenFeatures.add(TreePackage.Literals.TREE_ITEM_LABEL_DESCRIPTION__CHILDREN); + } + return childrenFeatures; + } + + /** + * + * + * @generated + */ + @Override + protected EStructuralFeature getChildFeature(Object object, Object child) { + // Check the type of the specified child object and return the proper feature to use for + // adding (see {@link AddCommand}) it as a child. + + return super.getChildFeature(object, child); + } + + /** + * This returns TreeItemLabelDescription.gif. + * + * @generated NOT + */ + @Override + public Object getImage(Object object) { + return this.overlayImage(object, this.getResourceLocator().getImage("full/obj16/TreeItemLabelDescription.svg")); + } + + /** + * + * + * @generated + */ + @Override + protected boolean shouldComposeCreationImage() { + return true; + } + + /** + * This returns the label text for the adapted class. + * + * @generated + */ + @Override + public String getText(Object object) { + String label = ((TreeItemLabelDescription) object).getName(); + return label == null || label.length() == 0 ? getString("_UI_TreeItemLabelDescription_type") : getString("_UI_TreeItemLabelDescription_type") + " " + label; + } + + /** + * This handles model notifications by calling {@link #updateChildren} to update any cached children and by creating + * a viewer notification, which it passes to {@link #fireNotifyChanged}. + * + * @generated + */ + @Override + public void notifyChanged(Notification notification) { + updateChildren(notification); + + switch (notification.getFeatureID(TreeItemLabelDescription.class)) { + case TreePackage.TREE_ITEM_LABEL_DESCRIPTION__NAME: + case TreePackage.TREE_ITEM_LABEL_DESCRIPTION__PRECONDITION_EXPRESSION: + fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true)); + return; + case TreePackage.TREE_ITEM_LABEL_DESCRIPTION__CHILDREN: + fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, false)); + return; + } + super.notifyChanged(notification); + } + + /** + * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children that can be created + * under this object. + * + * @generated + */ + @Override + protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { + super.collectNewChildDescriptors(newChildDescriptors, object); + + newChildDescriptors.add(createChildParameter(TreePackage.Literals.TREE_ITEM_LABEL_DESCRIPTION__CHILDREN, TreeFactory.eINSTANCE.createIfTreeItemLabelElementDescription())); + + newChildDescriptors.add(createChildParameter(TreePackage.Literals.TREE_ITEM_LABEL_DESCRIPTION__CHILDREN, TreeFactory.eINSTANCE.createTreeItemLabelFragmentDescription())); + } + + /** + * Return the resource locator for this item provider's resources. + * + * @generated + */ + @Override + public ResourceLocator getResourceLocator() { + return ((IChildCreationExtender) adapterFactory).getResourceLocator(); + } } diff --git a/packages/view/backend/sirius-components-view-tree-edit/src/main/java/org/eclipse/sirius/components/view/tree/provider/TreeItemLabelElementDescriptionItemProvider.java b/packages/view/backend/sirius-components-view-tree-edit/src/main/java/org/eclipse/sirius/components/view/tree/provider/TreeItemLabelElementDescriptionItemProvider.java index f05ad8054d..ed809fe816 100644 --- a/packages/view/backend/sirius-components-view-tree-edit/src/main/java/org/eclipse/sirius/components/view/tree/provider/TreeItemLabelElementDescriptionItemProvider.java +++ b/packages/view/backend/sirius-components-view-tree-edit/src/main/java/org/eclipse/sirius/components/view/tree/provider/TreeItemLabelElementDescriptionItemProvider.java @@ -29,94 +29,88 @@ /** * This is the item provider adapter for a - * {@link org.eclipse.sirius.components.view.tree.TreeItemLabelElementDescription} - * object. + * {@link org.eclipse.sirius.components.view.tree.TreeItemLabelElementDescription} object. * * @generated */ public class TreeItemLabelElementDescriptionItemProvider extends ItemProviderAdapter - implements IEditingDomainItemProvider, IStructuredItemContentProvider, ITreeItemContentProvider, - IItemLabelProvider, IItemPropertySource { - /** - * This constructs an instance from a factory and a notifier. - * - * @generated - */ - public TreeItemLabelElementDescriptionItemProvider(AdapterFactory adapterFactory) { - super(adapterFactory); - } + implements IEditingDomainItemProvider, IStructuredItemContentProvider, ITreeItemContentProvider, IItemLabelProvider, IItemPropertySource { + /** + * This constructs an instance from a factory and a notifier. + * + * @generated + */ + public TreeItemLabelElementDescriptionItemProvider(AdapterFactory adapterFactory) { + super(adapterFactory); + } - /** - * This returns the property descriptors for the adapted class. - * - * @generated - */ - @Override - public List getPropertyDescriptors(Object object) { - if (itemPropertyDescriptors == null) { - super.getPropertyDescriptors(object); + /** + * This returns the property descriptors for the adapted class. + * + * @generated + */ + @Override + public List getPropertyDescriptors(Object object) { + if (itemPropertyDescriptors == null) { + super.getPropertyDescriptors(object); - } - return itemPropertyDescriptors; - } + } + return itemPropertyDescriptors; + } - /** - * - * - * @generated - */ - @Override - protected boolean shouldComposeCreationImage() { - return true; - } + /** + * + * + * @generated + */ + @Override + protected boolean shouldComposeCreationImage() { + return true; + } - /** - * This returns the label text for the adapted class. - * - * - * @generated - */ - @Override - public String getText(Object object) { - return getString("_UI_TreeItemLabelElementDescription_type"); - } + /** + * This returns the label text for the adapted class. + * + * @generated + */ + @Override + public String getText(Object object) { + return getString("_UI_TreeItemLabelElementDescription_type"); + } - /** - * This handles model notifications by calling {@link #updateChildren} to update - * any cached children and by creating a viewer notification, which it passes to - * {@link #fireNotifyChanged}. - * - * @generated - */ - @Override - public void notifyChanged(Notification notification) { - updateChildren(notification); - super.notifyChanged(notification); - } + /** + * This handles model notifications by calling {@link #updateChildren} to update any cached children and by creating + * a viewer notification, which it passes to {@link #fireNotifyChanged}. + * + * @generated + */ + @Override + public void notifyChanged(Notification notification) { + updateChildren(notification); + super.notifyChanged(notification); + } - /** - * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing - * the children that can be created under this object. - * - * - * @generated - */ - @Override - protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { - super.collectNewChildDescriptors(newChildDescriptors, object); - } + /** + * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children that can be created + * under this object. + * + * @generated + */ + @Override + protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { + super.collectNewChildDescriptors(newChildDescriptors, object); + } - /** - * Return the resource locator for this item provider's resources. - * - * @generated - */ - @Override - public ResourceLocator getResourceLocator() { - return ((IChildCreationExtender) adapterFactory).getResourceLocator(); - } + /** + * Return the resource locator for this item provider's resources. + * + * @generated + */ + @Override + public ResourceLocator getResourceLocator() { + return ((IChildCreationExtender) adapterFactory).getResourceLocator(); + } } diff --git a/packages/view/backend/sirius-components-view-tree-edit/src/main/java/org/eclipse/sirius/components/view/tree/provider/TreeItemLabelFragmentDescriptionItemProvider.java b/packages/view/backend/sirius-components-view-tree-edit/src/main/java/org/eclipse/sirius/components/view/tree/provider/TreeItemLabelFragmentDescriptionItemProvider.java index 7bbd965cb5..05d3809c38 100644 --- a/packages/view/backend/sirius-components-view-tree-edit/src/main/java/org/eclipse/sirius/components/view/tree/provider/TreeItemLabelFragmentDescriptionItemProvider.java +++ b/packages/view/backend/sirius-components-view-tree-edit/src/main/java/org/eclipse/sirius/components/view/tree/provider/TreeItemLabelFragmentDescriptionItemProvider.java @@ -26,136 +26,121 @@ /** * This is the item provider adapter for a - * {@link org.eclipse.sirius.components.view.tree.TreeItemLabelFragmentDescription} - * object. + * {@link org.eclipse.sirius.components.view.tree.TreeItemLabelFragmentDescription} object. * * @generated */ public class TreeItemLabelFragmentDescriptionItemProvider extends TreeItemLabelElementDescriptionItemProvider { - /** - * This constructs an instance from a factory and a notifier. - * - * @generated - */ - public TreeItemLabelFragmentDescriptionItemProvider(AdapterFactory adapterFactory) { - super(adapterFactory); - } + /** + * This constructs an instance from a factory and a notifier. + * + * @generated + */ + public TreeItemLabelFragmentDescriptionItemProvider(AdapterFactory adapterFactory) { + super(adapterFactory); + } - /** - * This returns the property descriptors for the adapted class. - * - * @generated - */ - @Override - public List getPropertyDescriptors(Object object) { - if (itemPropertyDescriptors == null) { - super.getPropertyDescriptors(object); + /** + * This returns the property descriptors for the adapted class. + * + * @generated + */ + @Override + public List getPropertyDescriptors(Object object) { + if (itemPropertyDescriptors == null) { + super.getPropertyDescriptors(object); - addLabelExpressionPropertyDescriptor(object); - addStylePropertyDescriptor(object); - } - return itemPropertyDescriptors; - } + addLabelExpressionPropertyDescriptor(object); + addStylePropertyDescriptor(object); + } + return itemPropertyDescriptors; + } - /** - * This adds a property descriptor for the Label Expression feature. - * - * @generated - */ - protected void addLabelExpressionPropertyDescriptor(Object object) { - itemPropertyDescriptors - .add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), - getResourceLocator(), getString("_UI_TreeItemLabelFragmentDescription_labelExpression_feature"), - getString("_UI_PropertyDescriptor_description", - "_UI_TreeItemLabelFragmentDescription_labelExpression_feature", - "_UI_TreeItemLabelFragmentDescription_type"), - TreePackage.Literals.TREE_ITEM_LABEL_FRAGMENT_DESCRIPTION__LABEL_EXPRESSION, true, false, false, - ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); - } + /** + * This adds a property descriptor for the Label Expression feature. + * + * @generated + */ + protected void addLabelExpressionPropertyDescriptor(Object object) { + itemPropertyDescriptors.add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getResourceLocator(), + getString("_UI_TreeItemLabelFragmentDescription_labelExpression_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_TreeItemLabelFragmentDescription_labelExpression_feature", "_UI_TreeItemLabelFragmentDescription_type"), + TreePackage.Literals.TREE_ITEM_LABEL_FRAGMENT_DESCRIPTION__LABEL_EXPRESSION, true, false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); + } - /** - * This adds a property descriptor for the Style feature. - * - * @generated - */ - protected void addStylePropertyDescriptor(Object object) { - itemPropertyDescriptors.add(createItemPropertyDescriptor( - ((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getResourceLocator(), - getString("_UI_TreeItemLabelFragmentDescription_style_feature"), - getString("_UI_PropertyDescriptor_description", "_UI_TreeItemLabelFragmentDescription_style_feature", - "_UI_TreeItemLabelFragmentDescription_type"), - TreePackage.Literals.TREE_ITEM_LABEL_FRAGMENT_DESCRIPTION__STYLE, true, false, true, null, null, null)); - } + /** + * This adds a property descriptor for the Style feature. + * + * @generated + */ + protected void addStylePropertyDescriptor(Object object) { + itemPropertyDescriptors.add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getResourceLocator(), + getString("_UI_TreeItemLabelFragmentDescription_style_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_TreeItemLabelFragmentDescription_style_feature", "_UI_TreeItemLabelFragmentDescription_type"), + TreePackage.Literals.TREE_ITEM_LABEL_FRAGMENT_DESCRIPTION__STYLE, true, false, true, null, null, null)); + } - /** - * This returns TreeItemLabelFragmentDescription.gif. - * - * - * @generated NOT - */ - @Override - public Object getImage(Object object) { - return this.overlayImage(object, - this.getResourceLocator().getImage("full/obj16/TreeItemLabelFragmentDescription.svg")); - } + /** + * This returns TreeItemLabelFragmentDescription.gif. + * + * @generated NOT + */ + @Override + public Object getImage(Object object) { + return this.overlayImage(object, this.getResourceLocator().getImage("full/obj16/TreeItemLabelFragmentDescription.svg")); + } - /** - * - * - * @generated - */ - @Override - protected boolean shouldComposeCreationImage() { - return true; - } + /** + * + * + * @generated + */ + @Override + protected boolean shouldComposeCreationImage() { + return true; + } - /** - * This returns the label text for the adapted class. - * - * - * @generated - */ - @Override - public String getText(Object object) { - String label = ((TreeItemLabelFragmentDescription) object).getLabelExpression(); - return label == null || label.length() == 0 ? getString("_UI_TreeItemLabelFragmentDescription_type") - : getString("_UI_TreeItemLabelFragmentDescription_type") + " " + label; - } + /** + * This returns the label text for the adapted class. + * + * @generated + */ + @Override + public String getText(Object object) { + String label = ((TreeItemLabelFragmentDescription) object).getLabelExpression(); + return label == null || label.length() == 0 ? getString("_UI_TreeItemLabelFragmentDescription_type") : getString("_UI_TreeItemLabelFragmentDescription_type") + " " + label; + } - /** - * This handles model notifications by calling {@link #updateChildren} to update - * any cached children and by creating a viewer notification, which it passes to - * {@link #fireNotifyChanged}. - * - * @generated - */ - @Override - public void notifyChanged(Notification notification) { - updateChildren(notification); + /** + * This handles model notifications by calling {@link #updateChildren} to update any cached children and by creating + * a viewer notification, which it passes to {@link #fireNotifyChanged}. + * + * @generated + */ + @Override + public void notifyChanged(Notification notification) { + updateChildren(notification); - switch (notification.getFeatureID(TreeItemLabelFragmentDescription.class)) { - case TreePackage.TREE_ITEM_LABEL_FRAGMENT_DESCRIPTION__LABEL_EXPRESSION: - fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true)); - return; - } - super.notifyChanged(notification); - } + switch (notification.getFeatureID(TreeItemLabelFragmentDescription.class)) { + case TreePackage.TREE_ITEM_LABEL_FRAGMENT_DESCRIPTION__LABEL_EXPRESSION: + fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true)); + return; + } + super.notifyChanged(notification); + } - /** - * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing - * the children that can be created under this object. - * - * - * @generated - */ - @Override - protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { - super.collectNewChildDescriptors(newChildDescriptors, object); - } + /** + * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children that can be created + * under this object. + * + * @generated + */ + @Override + protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { + super.collectNewChildDescriptors(newChildDescriptors, object); + } } diff --git a/packages/view/backend/sirius-components-view-tree-edit/src/main/java/org/eclipse/sirius/components/view/tree/provider/TreeItemProviderAdapterFactory.java b/packages/view/backend/sirius-components-view-tree-edit/src/main/java/org/eclipse/sirius/components/view/tree/provider/TreeItemProviderAdapterFactory.java index 3a0d307802..da0d6c90a4 100644 --- a/packages/view/backend/sirius-components-view-tree-edit/src/main/java/org/eclipse/sirius/components/view/tree/provider/TreeItemProviderAdapterFactory.java +++ b/packages/view/backend/sirius-components-view-tree-edit/src/main/java/org/eclipse/sirius/components/view/tree/provider/TreeItemProviderAdapterFactory.java @@ -45,88 +45,85 @@ import org.eclipse.sirius.components.view.util.ViewSwitch; /** - * This is the factory that is used to provide the interfaces needed to support - * Viewers. The adapters generated by this factory convert EMF adapter - * notifications into calls to {@link #fireNotifyChanged fireNotifyChanged}. The - * adapters also support Eclipse property sheets. Note that most of the adapters - * are shared among multiple instances. + * This is the factory that is used to provide the interfaces needed to support Viewers. The adapters generated by this + * factory convert EMF adapter notifications into calls to {@link #fireNotifyChanged fireNotifyChanged}. The adapters + * also support Eclipse property sheets. Note that most of the adapters are shared among multiple instances. * * @generated */ -public class TreeItemProviderAdapterFactory extends TreeAdapterFactory - implements ComposeableAdapterFactory, IChangeNotifier, IDisposable, IChildCreationExtender { +public class TreeItemProviderAdapterFactory extends TreeAdapterFactory implements ComposeableAdapterFactory, IChangeNotifier, IDisposable, IChildCreationExtender { /** - * This keeps track of the root adapter factory that delegates to this adapter - * factory. + * This keeps track of the root adapter factory that delegates to this adapter factory. * * @generated */ protected ComposedAdapterFactory parentAdapterFactory; /** - * This is used to implement - * {@link org.eclipse.emf.edit.provider.IChangeNotifier}. + * This is used to implement {@link org.eclipse.emf.edit.provider.IChangeNotifier}. * * @generated */ protected IChangeNotifier changeNotifier = new ChangeNotifier(); /** - * This helps manage the child creation extenders. + * This helps manage the child creation extenders. * * @generated */ - protected ChildCreationExtenderManager childCreationExtenderManager = new ChildCreationExtenderManager( - TreeEditPlugin.INSTANCE, TreePackage.eNS_URI); + protected ChildCreationExtenderManager childCreationExtenderManager = new ChildCreationExtenderManager(TreeEditPlugin.INSTANCE, TreePackage.eNS_URI); /** - * This keeps track of all the supported types checked by - * {@link #isFactoryForType isFactoryForType}. + * This keeps track of all the supported types checked by {@link #isFactoryForType isFactoryForType}. * * @generated */ protected Collection supportedTypes = new ArrayList<>(); + /** - * This keeps track of the one adapter used for all - * {@link org.eclipse.sirius.components.view.tree.TreeDescription} instances. - * + * This keeps track of the one adapter used for all {@link org.eclipse.sirius.components.view.tree.TreeDescription} + * instances. * * @generated */ protected TreeDescriptionItemProvider treeDescriptionItemProvider; + /** * This keeps track of the one adapter used for all - * {@link org.eclipse.sirius.components.view.tree.TreeItemLabelDescription} - * instances. + * {@link org.eclipse.sirius.components.view.tree.TreeItemLabelDescription} instances. * * @generated */ protected TreeItemLabelDescriptionItemProvider treeItemLabelDescriptionItemProvider; + /** * This keeps track of the one adapter used for all - * {@link org.eclipse.sirius.components.view.tree.TreeItemLabelFragmentDescription} - * instances. + * {@link org.eclipse.sirius.components.view.tree.TreeItemLabelFragmentDescription} instances. * * @generated */ protected TreeItemLabelFragmentDescriptionItemProvider treeItemLabelFragmentDescriptionItemProvider; + /** * This keeps track of the one adapter used for all - * {@link org.eclipse.sirius.components.view.tree.SingleClickTreeItemContextMenuEntry} - * instances. + * {@link org.eclipse.sirius.components.view.tree.SingleClickTreeItemContextMenuEntry} instances. * * @generated */ protected SingleClickTreeItemContextMenuEntryItemProvider singleClickTreeItemContextMenuEntryItemProvider; + /** * This keeps track of the one adapter used for all - * {@link org.eclipse.sirius.components.view.tree.FetchTreeItemContextMenuEntry} - * instances. + * {@link org.eclipse.sirius.components.view.tree.FetchTreeItemContextMenuEntry} instances. + * * * @generated */ @@ -138,107 +135,125 @@ public class TreeItemProviderAdapterFactory extends TreeAdapterFactory * @generated */ public TreeItemProviderAdapterFactory() { - this.supportedTypes.add(IEditingDomainItemProvider.class); - this.supportedTypes.add(IStructuredItemContentProvider.class); - this.supportedTypes.add(ITreeItemContentProvider.class); - this.supportedTypes.add(IItemLabelProvider.class); - this.supportedTypes.add(IItemPropertySource.class); + supportedTypes.add(IEditingDomainItemProvider.class); + supportedTypes.add(IStructuredItemContentProvider.class); + supportedTypes.add(ITreeItemContentProvider.class); + supportedTypes.add(IItemLabelProvider.class); + supportedTypes.add(IItemPropertySource.class); } /** - * This creates an adapter for a - * {@link org.eclipse.sirius.components.view.tree.TreeDescription}. * * @generated */ @Override public Adapter createTreeDescriptionAdapter() { - if (this.treeDescriptionItemProvider == null) { - this.treeDescriptionItemProvider = new TreeDescriptionItemProvider(this); + if (treeDescriptionItemProvider == null) { + treeDescriptionItemProvider = new TreeDescriptionItemProvider(this); } - return this.treeDescriptionItemProvider; + return treeDescriptionItemProvider; } /** - * This creates an adapter for a - * {@link org.eclipse.sirius.components.view.tree.TreeItemLabelDescription}. - * + * This creates an adapter for a {@link org.eclipse.sirius.components.view.tree.TreeItemLabelDescription}. * * @generated */ @Override public Adapter createTreeItemLabelDescriptionAdapter() { - if (this.treeItemLabelDescriptionItemProvider == null) { - this.treeItemLabelDescriptionItemProvider = new TreeItemLabelDescriptionItemProvider(this); + if (treeItemLabelDescriptionItemProvider == null) { + treeItemLabelDescriptionItemProvider = new TreeItemLabelDescriptionItemProvider(this); } - return this.treeItemLabelDescriptionItemProvider; + return treeItemLabelDescriptionItemProvider; } /** - * This creates an adapter for a - * {@link org.eclipse.sirius.components.view.tree.TreeItemLabelFragmentDescription}. + * This keeps track of the one adapter used for all + * {@link org.eclipse.sirius.components.view.tree.IfTreeItemLabelElementDescription} instances. + * + * @generated + */ + protected IfTreeItemLabelElementDescriptionItemProvider ifTreeItemLabelElementDescriptionItemProvider; + + /** + * This creates an adapter for a {@link org.eclipse.sirius.components.view.tree.IfTreeItemLabelElementDescription}. + * + * + * @generated + */ + @Override + public Adapter createIfTreeItemLabelElementDescriptionAdapter() { + if (ifTreeItemLabelElementDescriptionItemProvider == null) { + ifTreeItemLabelElementDescriptionItemProvider = new IfTreeItemLabelElementDescriptionItemProvider(this); + } + + return ifTreeItemLabelElementDescriptionItemProvider; + } + + /** + * This creates an adapter for a {@link org.eclipse.sirius.components.view.tree.TreeItemLabelFragmentDescription}. * * * @generated */ @Override public Adapter createTreeItemLabelFragmentDescriptionAdapter() { - if (this.treeItemLabelFragmentDescriptionItemProvider == null) { - this.treeItemLabelFragmentDescriptionItemProvider = new TreeItemLabelFragmentDescriptionItemProvider(this); + if (treeItemLabelFragmentDescriptionItemProvider == null) { + treeItemLabelFragmentDescriptionItemProvider = new TreeItemLabelFragmentDescriptionItemProvider(this); } - return this.treeItemLabelFragmentDescriptionItemProvider; + return treeItemLabelFragmentDescriptionItemProvider; } /** * This creates an adapter for a - * {@link org.eclipse.sirius.components.view.tree.SingleClickTreeItemContextMenuEntry}. - * + * {@link org.eclipse.sirius.components.view.tree.SingleClickTreeItemContextMenuEntry}. * * @generated */ @Override public Adapter createSingleClickTreeItemContextMenuEntryAdapter() { - if (this.singleClickTreeItemContextMenuEntryItemProvider == null) { - this.singleClickTreeItemContextMenuEntryItemProvider = new SingleClickTreeItemContextMenuEntryItemProvider(this); + if (singleClickTreeItemContextMenuEntryItemProvider == null) { + singleClickTreeItemContextMenuEntryItemProvider = new SingleClickTreeItemContextMenuEntryItemProvider(this); } - return this.singleClickTreeItemContextMenuEntryItemProvider; + return singleClickTreeItemContextMenuEntryItemProvider; } /** - * This creates an adapter for a - * {@link org.eclipse.sirius.components.view.tree.FetchTreeItemContextMenuEntry}. - * + * This creates an adapter for a {@link org.eclipse.sirius.components.view.tree.FetchTreeItemContextMenuEntry}. * * @generated */ @Override public Adapter createFetchTreeItemContextMenuEntryAdapter() { - if (this.fetchTreeItemContextMenuEntryItemProvider == null) { - this.fetchTreeItemContextMenuEntryItemProvider = new FetchTreeItemContextMenuEntryItemProvider(this); + if (fetchTreeItemContextMenuEntryItemProvider == null) { + fetchTreeItemContextMenuEntryItemProvider = new FetchTreeItemContextMenuEntryItemProvider(this); } - return this.fetchTreeItemContextMenuEntryItemProvider; + return fetchTreeItemContextMenuEntryItemProvider; } /** - * This returns the root adapter factory that contains this factory. + * This returns the root adapter factory that contains this factory. * * @generated */ @Override public ComposeableAdapterFactory getRootAdapterFactory() { - return this.parentAdapterFactory == null ? this : this.parentAdapterFactory.getRootAdapterFactory(); + return parentAdapterFactory == null ? this : parentAdapterFactory.getRootAdapterFactory(); } /** - * This sets the composed adapter factory that contains this factory. + * This sets the composed adapter factory that contains this factory. * * @generated */ @@ -254,12 +269,12 @@ public void setParentAdapterFactory(ComposedAdapterFactory parentAdapterFactory) */ @Override public boolean isFactoryForType(Object type) { - return this.supportedTypes.contains(type) || super.isFactoryForType(type); + return supportedTypes.contains(type) || super.isFactoryForType(type); } /** - * This implementation substitutes the factory itself as the key for the - * adapter. + * This implementation substitutes the factory itself as the key for the adapter. * * @generated */ @@ -275,7 +290,7 @@ public Adapter adapt(Notifier notifier, Object type) { */ @Override public Object adapt(Object object, Object type) { - if (this.isFactoryForType(type)) { + if (isFactoryForType(type)) { Object adapter = super.adapt(object, type); if (!(type instanceof Class) || (((Class) type).isInstance(adapter))) { return adapter; @@ -291,7 +306,7 @@ public Object adapt(Object object, Object type) { * @generated */ public List getChildCreationExtenders() { - return this.childCreationExtenderManager.getChildCreationExtenders(); + return childCreationExtenderManager.getChildCreationExtenders(); } /** @@ -301,7 +316,7 @@ public List getChildCreationExtenders() { */ @Override public Collection getNewChildDescriptors(Object object, EditingDomain editingDomain) { - return this.childCreationExtenderManager.getNewChildDescriptors(object, editingDomain); + return childCreationExtenderManager.getNewChildDescriptors(object, editingDomain); } /** @@ -311,7 +326,7 @@ public Collection getNewChildDescriptors(Object object, EditingDomain editing */ @Override public ResourceLocator getResourceLocator() { - return this.childCreationExtenderManager; + return childCreationExtenderManager; } /** @@ -321,7 +336,7 @@ public ResourceLocator getResourceLocator() { */ @Override public void addListener(INotifyChangedListener notifyChangedListener) { - this.changeNotifier.addListener(notifyChangedListener); + changeNotifier.addListener(notifyChangedListener); } /** @@ -331,47 +346,53 @@ public void addListener(INotifyChangedListener notifyChangedListener) { */ @Override public void removeListener(INotifyChangedListener notifyChangedListener) { - this.changeNotifier.removeListener(notifyChangedListener); + changeNotifier.removeListener(notifyChangedListener); } /** - * This delegates to {@link #changeNotifier} and to - * {@link #parentAdapterFactory}. + * This delegates to {@link #changeNotifier} and to {@link #parentAdapterFactory}. * * @generated */ @Override public void fireNotifyChanged(Notification notification) { - this.changeNotifier.fireNotifyChanged(notification); + changeNotifier.fireNotifyChanged(notification); - if (this.parentAdapterFactory != null) { - this.parentAdapterFactory.fireNotifyChanged(notification); + if (parentAdapterFactory != null) { + parentAdapterFactory.fireNotifyChanged(notification); } } /** - * This disposes all of the item providers created by this factory. + * This disposes all of the item providers created by this factory. * * @generated */ @Override public void dispose() { - if (this.treeDescriptionItemProvider != null) - this.treeDescriptionItemProvider.dispose(); - if (this.treeItemLabelDescriptionItemProvider != null) - this.treeItemLabelDescriptionItemProvider.dispose(); - if (this.treeItemLabelFragmentDescriptionItemProvider != null) - this.treeItemLabelFragmentDescriptionItemProvider.dispose(); - if (this.singleClickTreeItemContextMenuEntryItemProvider != null) - this.singleClickTreeItemContextMenuEntryItemProvider.dispose(); - if (this.fetchTreeItemContextMenuEntryItemProvider != null) - this.fetchTreeItemContextMenuEntryItemProvider.dispose(); + if (treeDescriptionItemProvider != null) { + treeDescriptionItemProvider.dispose(); + } + if (treeItemLabelDescriptionItemProvider != null) { + treeItemLabelDescriptionItemProvider.dispose(); + } + if (ifTreeItemLabelElementDescriptionItemProvider != null) { + ifTreeItemLabelElementDescriptionItemProvider.dispose(); + } + if (treeItemLabelFragmentDescriptionItemProvider != null) { + treeItemLabelFragmentDescriptionItemProvider.dispose(); + } + if (singleClickTreeItemContextMenuEntryItemProvider != null) { + singleClickTreeItemContextMenuEntryItemProvider.dispose(); + } + if (fetchTreeItemContextMenuEntryItemProvider != null) { + fetchTreeItemContextMenuEntryItemProvider.dispose(); + } } /** - * A child creation extender for the {@link ViewPackage}. + * A child creation extender for the {@link ViewPackage}. * * @generated */ @@ -400,32 +421,30 @@ public ResourceLocator getResourceLocator() { } /** - * The switch for creating child descriptors specific to each extended class. - * + * The switch for creating child descriptors specific to each extended class. * * @generated */ protected static class CreationSwitch extends ViewSwitch { /** - * The child descriptors being populated. + * The child descriptors being populated. * * @generated */ protected List newChildDescriptors; /** - * The domain in which to create the children. + * The domain in which to create the children. * * @generated */ protected EditingDomain editingDomain; /** - * Creates the a switch for populating child descriptors in the given domain. - * + * Creates the a switch for populating child descriptors in the given domain. * * @generated */ @@ -444,8 +463,7 @@ public Object caseView(View object) { TreeDescription treeDescription = TreeFactory.eINSTANCE.createTreeDescription(); treeDescription.setName("New Tree Description"); treeDescription.setTitleExpression("aql:'New Tree Representation'"); - this.newChildDescriptors - .add(this.createChildParameter(ViewPackage.Literals.VIEW__DESCRIPTIONS, treeDescription)); + this.newChildDescriptors.add(this.createChildParameter(ViewPackage.Literals.VIEW__DESCRIPTIONS, treeDescription)); return null; } diff --git a/packages/view/backend/sirius-components-view-tree-edit/src/main/resources/icons/full/obj16/IfTreeItemLabelElementDescription.svg b/packages/view/backend/sirius-components-view-tree-edit/src/main/resources/icons/full/obj16/IfTreeItemLabelElementDescription.svg new file mode 100644 index 0000000000..a647c68296 --- /dev/null +++ b/packages/view/backend/sirius-components-view-tree-edit/src/main/resources/icons/full/obj16/IfTreeItemLabelElementDescription.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/packages/view/backend/sirius-components-view-tree-edit/src/main/resources/plugin.properties b/packages/view/backend/sirius-components-view-tree-edit/src/main/resources/plugin.properties index 1309abf2fd..ad6502f3b7 100644 --- a/packages/view/backend/sirius-components-view-tree-edit/src/main/resources/plugin.properties +++ b/packages/view/backend/sirius-components-view-tree-edit/src/main/resources/plugin.properties @@ -4,62 +4,65 @@ # 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 ################################################################################# -pluginName=Tree Edit Support -providerName=www.example.org +pluginName = Tree Edit Support +providerName = www.example.org -_UI_CreateChild_text={0} -_UI_CreateChild_text2={1} {0} -_UI_CreateChild_text3={1} -_UI_CreateChild_tooltip=Create New {0} Under {1} Feature -_UI_CreateChild_description=Create a new child of type {0} for the {1} feature of the selected {2}. -_UI_CreateSibling_description=Create a new sibling of type {0} for the selected {2}, under the {1} feature of their parent. +_UI_CreateChild_text = {0} +_UI_CreateChild_text2 = {1} {0} +_UI_CreateChild_text3 = {1} +_UI_CreateChild_tooltip = Create New {0} Under {1} Feature +_UI_CreateChild_description = Create a new child of type {0} for the {1} feature of the selected {2}. +_UI_CreateSibling_description = Create a new sibling of type {0} for the selected {2}, under the {1} feature of their parent. -_UI_PropertyDescriptor_description=The {0} of the {1} +_UI_PropertyDescriptor_description = The {0} of the {1} -_UI_TreeDescription_type=Tree Description -_UI_TreeItemLabelDescription_type=Item Label Description -_UI_TreeItemLabelFragmentDescription_type=Item Label Fragment Description -_UI_TreeItemLabelElementDescription_type=Item Label Element Description -_UI_TreeItemContextMenuEntry_type=Item Context Menu Entry -_UI_SingleClickTreeItemContextMenuEntry_type=Single Click Tree Item Context Menu Entry -_UI_FetchTreeItemContextMenuEntry_type=Fetch Tree Item Context Menu Entry -_UI_Unknown_type=Object +_UI_TreeDescription_type =Tree Description +_UI_TreeItemLabelDescription_type = Item Label Description +_UI_IfTreeItemLabelElementDescription_type = If Tree Item Label Element Description +_UI_TreeItemLabelFragmentDescription_type = Item Label Fragment Description +_UI_TreeItemLabelElementDescription_type = Item Label Element Description +_UI_TreeItemContextMenuEntry_type = Item Context Menu Entry +_UI_SingleClickTreeItemContextMenuEntry_type = Single Click Tree Item Context Menu Entry +_UI_FetchTreeItemContextMenuEntry_type = Fetch Tree Item Context Menu Entry +_UI_Unknown_type = Object -_UI_Unknown_datatype=Value +_UI_Unknown_datatype= Value -_UI_TreeDescription_kindExpression_feature=Kind Expression -_UI_TreeDescription_iconURLExpression_feature=Icon URL Expression -_UI_TreeDescription_treeItemIdExpression_feature=Tree Item Id Expression -_UI_TreeDescription_treeItemObjectExpression_feature=Tree Item Object Expression -_UI_TreeDescription_elementsExpression_feature=Elements Expression -_UI_TreeDescription_hasChildrenExpression_feature=Has Children Expression -_UI_TreeDescription_childrenExpression_feature=Children Expression -_UI_TreeDescription_parentExpression_feature=Parent Expression -_UI_TreeDescription_editableExpression_feature=Editable Expression -_UI_TreeDescription_selectableExpression_feature=Selectable Expression -_UI_TreeDescription_deletableExpression_feature=Deletable Expression -_UI_TreeDescription_treeItemLabelDescriptions_feature=Tree Item Label Descriptions -_UI_TreeDescription_contextMenuEntries_feature=Context Menu Entries -_UI_TreeItemLabelDescription_name_feature=Name -_UI_TreeItemLabelDescription_preconditionExpression_feature=Precondition Expression -_UI_TreeItemLabelDescription_children_feature=Children -_UI_TreeItemLabelFragmentDescription_labelExpression_feature=Label Expression -_UI_TreeItemLabelFragmentDescription_style_feature=Style -_UI_TreeItemContextMenuEntry_name_feature=Name -_UI_TreeItemContextMenuEntry_labelExpression_feature=Label Expression -_UI_TreeItemContextMenuEntry_iconURLExpression_feature=Icon URL Expression -_UI_TreeItemContextMenuEntry_preconditionExpression_feature=Precondition Expression -_UI_SingleClickTreeItemContextMenuEntry_body_feature=Body -_UI_FetchTreeItemContextMenuEntry_urlExression_feature=Url Exression -_UI_FetchTreeItemContextMenuEntry_kind_feature=Kind -_UI_Unknown_feature=Unspecified +_UI_TreeDescription_kindExpression_feature = Kind Expression +_UI_TreeDescription_iconURLExpression_feature = Icon URL Expression +_UI_TreeDescription_treeItemIdExpression_feature = Tree Item Id Expression +_UI_TreeDescription_treeItemObjectExpression_feature = Tree Item Object Expression +_UI_TreeDescription_elementsExpression_feature = Elements Expression +_UI_TreeDescription_hasChildrenExpression_feature = Has Children Expression +_UI_TreeDescription_childrenExpression_feature = Children Expression +_UI_TreeDescription_parentExpression_feature = Parent Expression +_UI_TreeDescription_editableExpression_feature = Editable Expression +_UI_TreeDescription_selectableExpression_feature = Selectable Expression +_UI_TreeDescription_deletableExpression_feature = Deletable Expression +_UI_TreeDescription_treeItemLabelDescriptions_feature = Tree Item Label Descriptions +_UI_TreeDescription_contextMenuEntries_feature = Context Menu Entries +_UI_TreeItemLabelDescription_name_feature = Name +_UI_TreeItemLabelDescription_preconditionExpression_feature = Precondition Expression +_UI_TreeItemLabelDescription_children_feature = Children +_UI_IfTreeItemLabelElementDescription_predicateExpression_feature = Predicate Expression +_UI_IfTreeItemLabelElementDescription_children_feature = Children +_UI_TreeItemLabelFragmentDescription_labelExpression_feature = Label Expression +_UI_TreeItemLabelFragmentDescription_style_feature = Style +_UI_TreeItemContextMenuEntry_name_feature = Name +_UI_TreeItemContextMenuEntry_labelExpression_feature = Label Expression +_UI_TreeItemContextMenuEntry_iconURLExpression_feature = Icon URL Expression +_UI_TreeItemContextMenuEntry_preconditionExpression_feature = Precondition Expression +_UI_SingleClickTreeItemContextMenuEntry_body_feature = Body +_UI_FetchTreeItemContextMenuEntry_urlExression_feature = Url Exression +_UI_FetchTreeItemContextMenuEntry_kind_feature = Kind +_UI_Unknown_feature = Unspecified -_UI_FetchTreeItemContextMenuEntryKind_DOWNLOAD_literal=DOWNLOAD -_UI_FetchTreeItemContextMenuEntryKind_OPEN_literal=OPEN +_UI_FetchTreeItemContextMenuEntryKind_DOWNLOAD_literal = DOWNLOAD +_UI_FetchTreeItemContextMenuEntryKind_OPEN_literal = OPEN diff --git a/packages/view/backend/sirius-components-view-tree/src/main/java/org/eclipse/sirius/components/view/tree/FetchTreeItemContextMenuEntryKind.java b/packages/view/backend/sirius-components-view-tree/src/main/java/org/eclipse/sirius/components/view/tree/FetchTreeItemContextMenuEntryKind.java index 0a647c1a9f..1631744e8a 100644 --- a/packages/view/backend/sirius-components-view-tree/src/main/java/org/eclipse/sirius/components/view/tree/FetchTreeItemContextMenuEntryKind.java +++ b/packages/view/backend/sirius-components-view-tree/src/main/java/org/eclipse/sirius/components/view/tree/FetchTreeItemContextMenuEntryKind.java @@ -22,46 +22,46 @@ * A representation of the literals of the enumeration 'Fetch Tree Item Context Menu * Entry Kind', and utility methods for working with them. * + * @see org.eclipse.sirius.components.view.tree.TreePackage#getFetchTreeItemContextMenuEntryKind() * @model * @generated - * @see org.eclipse.sirius.components.view.tree.TreePackage#getFetchTreeItemContextMenuEntryKind() */ public enum FetchTreeItemContextMenuEntryKind implements Enumerator { /** * The 'DOWNLOAD' literal object. * + * @see #DOWNLOAD_VALUE * @generated * @ordered - * @see #DOWNLOAD_VALUE */ DOWNLOAD(0, "DOWNLOAD", "DOWNLOAD"), /** * The 'OPEN' literal object. * + * @see #OPEN_VALUE * @generated * @ordered - * @see #OPEN_VALUE */ OPEN(1, "OPEN", "OPEN"); /** * The 'DOWNLOAD' literal value. * + * @see #DOWNLOAD * @model * @generated * @ordered - * @see #DOWNLOAD */ public static final int DOWNLOAD_VALUE = 0; /** * The 'OPEN' literal value. * + * @see #OPEN * @model * @generated * @ordered - * @see #OPEN */ public static final int OPEN_VALUE = 1; @@ -80,18 +80,21 @@ public enum FetchTreeItemContextMenuEntryKind implements Enumerator { * @generated */ public static final List VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY)); + /** * * * @generated */ private final int value; + /** * * * @generated */ private final String name; + /** * * @@ -104,7 +107,7 @@ public enum FetchTreeItemContextMenuEntryKind implements Enumerator { * * @generated */ - FetchTreeItemContextMenuEntryKind(int value, String name, String literal) { + private FetchTreeItemContextMenuEntryKind(int value, String name, String literal) { this.value = value; this.name = name; this.literal = literal; @@ -115,7 +118,7 @@ public enum FetchTreeItemContextMenuEntryKind implements Enumerator { * * * @param literal - * the literal. + * the literal. * @return the matching enumerator or null. * @generated */ @@ -134,7 +137,7 @@ public static FetchTreeItemContextMenuEntryKind get(String literal) { * begin-user-doc --> * * @param name - * the name. + * the name. * @return the matching enumerator or null. * @generated */ @@ -153,7 +156,7 @@ public static FetchTreeItemContextMenuEntryKind getByName(String name) { * * * @param value - * the integer value. + * the integer value. * @return the matching enumerator or null. * @generated */ diff --git a/packages/view/backend/sirius-components-view-tree/src/main/java/org/eclipse/sirius/components/view/tree/IfTreeItemLabelElementDescription.java b/packages/view/backend/sirius-components-view-tree/src/main/java/org/eclipse/sirius/components/view/tree/IfTreeItemLabelElementDescription.java new file mode 100644 index 0000000000..1f2fd48a0d --- /dev/null +++ b/packages/view/backend/sirius-components-view-tree/src/main/java/org/eclipse/sirius/components/view/tree/IfTreeItemLabelElementDescription.java @@ -0,0 +1,73 @@ +/******************************************************************************* + * Copyright (c) 2024 Obeo. + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v2.0 + * which accompanies this distribution, and is available at + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Obeo - initial API and implementation + *******************************************************************************/ +package org.eclipse.sirius.components.view.tree; + +import org.eclipse.emf.common.util.EList; + +/** + * A representation of the model object 'If Tree Item Label Element + * Description'. + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link org.eclipse.sirius.components.view.tree.IfTreeItemLabelElementDescription#getPredicateExpression + * Predicate Expression}
  • + *
  • {@link org.eclipse.sirius.components.view.tree.IfTreeItemLabelElementDescription#getChildren + * Children}
  • + *
+ * + * @see org.eclipse.sirius.components.view.tree.TreePackage#getIfTreeItemLabelElementDescription() + * @model + * @generated + */ +public interface IfTreeItemLabelElementDescription extends TreeItemLabelElementDescription { + + /** + * Returns the value of the 'Predicate Expression' attribute. + * + * @return the value of the 'Predicate Expression' attribute. + * @see #setPredicateExpression(String) + * @see org.eclipse.sirius.components.view.tree.TreePackage#getIfTreeItemLabelElementDescription_PredicateExpression() + * @model dataType="org.eclipse.sirius.components.view.InterpretedExpression" + * @generated + */ + String getPredicateExpression(); + + /** + * Sets the value of the + * '{@link org.eclipse.sirius.components.view.tree.IfTreeItemLabelElementDescription#getPredicateExpression + * Predicate Expression}' attribute. + * + * @param value + * the new value of the 'Predicate Expression' attribute. + * @see #getPredicateExpression() + * @generated + */ + void setPredicateExpression(String value); + + /** + * Returns the value of the 'Children' containment reference list. The list contents are of type + * {@link org.eclipse.sirius.components.view.tree.TreeItemLabelElementDescription}. + * + * @return the value of the 'Children' containment reference list. + * @see org.eclipse.sirius.components.view.tree.TreePackage#getIfTreeItemLabelElementDescription_Children() + * @model containment="true" required="true" + * @generated + */ + EList getChildren(); + +} // IfTreeItemLabelElementDescription diff --git a/packages/view/backend/sirius-components-view-tree/src/main/java/org/eclipse/sirius/components/view/tree/SingleClickTreeItemContextMenuEntry.java b/packages/view/backend/sirius-components-view-tree/src/main/java/org/eclipse/sirius/components/view/tree/SingleClickTreeItemContextMenuEntry.java index 8e5432ec49..fc84751f0b 100644 --- a/packages/view/backend/sirius-components-view-tree/src/main/java/org/eclipse/sirius/components/view/tree/SingleClickTreeItemContextMenuEntry.java +++ b/packages/view/backend/sirius-components-view-tree/src/main/java/org/eclipse/sirius/components/view/tree/SingleClickTreeItemContextMenuEntry.java @@ -26,9 +26,9 @@ *
  • {@link org.eclipse.sirius.components.view.tree.SingleClickTreeItemContextMenuEntry#getBody Body}
  • * * + * @see org.eclipse.sirius.components.view.tree.TreePackage#getSingleClickTreeItemContextMenuEntry() * @model * @generated - * @see org.eclipse.sirius.components.view.tree.TreePackage#getSingleClickTreeItemContextMenuEntry() */ public interface SingleClickTreeItemContextMenuEntry extends TreeItemContextMenuEntry { @@ -37,9 +37,9 @@ public interface SingleClickTreeItemContextMenuEntry extends TreeItemContextMenu * {@link org.eclipse.sirius.components.view.Operation}. * * @return the value of the 'Body' containment reference list. + * @see org.eclipse.sirius.components.view.tree.TreePackage#getSingleClickTreeItemContextMenuEntry_Body() * @model containment="true" * @generated - * @see org.eclipse.sirius.components.view.tree.TreePackage#getSingleClickTreeItemContextMenuEntry_Body() */ EList getBody(); diff --git a/packages/view/backend/sirius-components-view-tree/src/main/java/org/eclipse/sirius/components/view/tree/TreeDescription.java b/packages/view/backend/sirius-components-view-tree/src/main/java/org/eclipse/sirius/components/view/tree/TreeDescription.java index c34690cf06..627521e3ca 100644 --- a/packages/view/backend/sirius-components-view-tree/src/main/java/org/eclipse/sirius/components/view/tree/TreeDescription.java +++ b/packages/view/backend/sirius-components-view-tree/src/main/java/org/eclipse/sirius/components/view/tree/TreeDescription.java @@ -49,9 +49,9 @@ * Entries} * * + * @see org.eclipse.sirius.components.view.tree.TreePackage#getTreeDescription() * @model * @generated - * @see org.eclipse.sirius.components.view.tree.TreePackage#getTreeDescription() */ public interface TreeDescription extends RepresentationDescription { @@ -60,10 +60,10 @@ public interface TreeDescription extends RepresentationDescription { * --> * * @return the value of the 'Kind Expression' attribute. - * @model dataType="org.eclipse.sirius.components.view.InterpretedExpression" - * @generated * @see #setKindExpression(String) * @see org.eclipse.sirius.components.view.tree.TreePackage#getTreeDescription_KindExpression() + * @model dataType="org.eclipse.sirius.components.view.InterpretedExpression" + * @generated */ String getKindExpression(); @@ -72,9 +72,9 @@ public interface TreeDescription extends RepresentationDescription { * Expression}' attribute. * * @param value - * the new value of the 'Kind Expression' attribute. - * @generated + * the new value of the 'Kind Expression' attribute. * @see #getKindExpression() + * @generated */ void setKindExpression(String value); @@ -83,10 +83,10 @@ public interface TreeDescription extends RepresentationDescription { * end-user-doc --> * * @return the value of the 'Icon URL Expression' attribute. - * @model dataType="org.eclipse.sirius.components.view.InterpretedExpression" - * @generated * @see #setIconURLExpression(String) * @see org.eclipse.sirius.components.view.tree.TreePackage#getTreeDescription_IconURLExpression() + * @model dataType="org.eclipse.sirius.components.view.InterpretedExpression" + * @generated */ String getIconURLExpression(); @@ -95,9 +95,9 @@ public interface TreeDescription extends RepresentationDescription { * Icon URL Expression}' attribute. * * @param value - * the new value of the 'Icon URL Expression' attribute. - * @generated + * the new value of the 'Icon URL Expression' attribute. * @see #getIconURLExpression() + * @generated */ void setIconURLExpression(String value); @@ -106,10 +106,10 @@ public interface TreeDescription extends RepresentationDescription { * end-user-doc --> * * @return the value of the 'Tree Item Id Expression' attribute. - * @model dataType="org.eclipse.sirius.components.view.InterpretedExpression" - * @generated * @see #setTreeItemIdExpression(String) * @see org.eclipse.sirius.components.view.tree.TreePackage#getTreeDescription_TreeItemIdExpression() + * @model dataType="org.eclipse.sirius.components.view.InterpretedExpression" + * @generated */ String getTreeItemIdExpression(); @@ -118,9 +118,9 @@ public interface TreeDescription extends RepresentationDescription { * Tree Item Id Expression}' attribute. * * @param value - * the new value of the 'Tree Item Id Expression' attribute. - * @generated + * the new value of the 'Tree Item Id Expression' attribute. * @see #getTreeItemIdExpression() + * @generated */ void setTreeItemIdExpression(String value); @@ -129,10 +129,10 @@ public interface TreeDescription extends RepresentationDescription { * end-user-doc --> * * @return the value of the 'Tree Item Object Expression' attribute. - * @model dataType="org.eclipse.sirius.components.view.InterpretedExpression" - * @generated * @see #setTreeItemObjectExpression(String) * @see org.eclipse.sirius.components.view.tree.TreePackage#getTreeDescription_TreeItemObjectExpression() + * @model dataType="org.eclipse.sirius.components.view.InterpretedExpression" + * @generated */ String getTreeItemObjectExpression(); @@ -141,9 +141,9 @@ public interface TreeDescription extends RepresentationDescription { * Tree Item Object Expression}' attribute. * * @param value - * the new value of the 'Tree Item Object Expression' attribute. - * @generated + * the new value of the 'Tree Item Object Expression' attribute. * @see #getTreeItemObjectExpression() + * @generated */ void setTreeItemObjectExpression(String value); @@ -152,10 +152,10 @@ public interface TreeDescription extends RepresentationDescription { * end-user-doc --> * * @return the value of the 'Elements Expression' attribute. - * @model dataType="org.eclipse.sirius.components.view.InterpretedExpression" - * @generated * @see #setElementsExpression(String) * @see org.eclipse.sirius.components.view.tree.TreePackage#getTreeDescription_ElementsExpression() + * @model dataType="org.eclipse.sirius.components.view.InterpretedExpression" + * @generated */ String getElementsExpression(); @@ -164,9 +164,9 @@ public interface TreeDescription extends RepresentationDescription { * Elements Expression}' attribute. * * @param value - * the new value of the 'Elements Expression' attribute. - * @generated + * the new value of the 'Elements Expression' attribute. * @see #getElementsExpression() + * @generated */ void setElementsExpression(String value); @@ -175,10 +175,10 @@ public interface TreeDescription extends RepresentationDescription { * end-user-doc --> * * @return the value of the 'Has Children Expression' attribute. - * @model dataType="org.eclipse.sirius.components.view.InterpretedExpression" - * @generated * @see #setHasChildrenExpression(String) * @see org.eclipse.sirius.components.view.tree.TreePackage#getTreeDescription_HasChildrenExpression() + * @model dataType="org.eclipse.sirius.components.view.InterpretedExpression" + * @generated */ String getHasChildrenExpression(); @@ -187,9 +187,9 @@ public interface TreeDescription extends RepresentationDescription { * Has Children Expression}' attribute. * * @param value - * the new value of the 'Has Children Expression' attribute. - * @generated + * the new value of the 'Has Children Expression' attribute. * @see #getHasChildrenExpression() + * @generated */ void setHasChildrenExpression(String value); @@ -198,10 +198,10 @@ public interface TreeDescription extends RepresentationDescription { * end-user-doc --> * * @return the value of the 'Children Expression' attribute. - * @model dataType="org.eclipse.sirius.components.view.InterpretedExpression" - * @generated * @see #setChildrenExpression(String) * @see org.eclipse.sirius.components.view.tree.TreePackage#getTreeDescription_ChildrenExpression() + * @model dataType="org.eclipse.sirius.components.view.InterpretedExpression" + * @generated */ String getChildrenExpression(); @@ -210,9 +210,9 @@ public interface TreeDescription extends RepresentationDescription { * Children Expression}' attribute. * * @param value - * the new value of the 'Children Expression' attribute. - * @generated + * the new value of the 'Children Expression' attribute. * @see #getChildrenExpression() + * @generated */ void setChildrenExpression(String value); @@ -221,10 +221,10 @@ public interface TreeDescription extends RepresentationDescription { * --> * * @return the value of the 'Parent Expression' attribute. - * @model dataType="org.eclipse.sirius.components.view.InterpretedExpression" - * @generated * @see #setParentExpression(String) * @see org.eclipse.sirius.components.view.tree.TreePackage#getTreeDescription_ParentExpression() + * @model dataType="org.eclipse.sirius.components.view.InterpretedExpression" + * @generated */ String getParentExpression(); @@ -233,9 +233,9 @@ public interface TreeDescription extends RepresentationDescription { * Parent Expression}' attribute. * * @param value - * the new value of the 'Parent Expression' attribute. - * @generated + * the new value of the 'Parent Expression' attribute. * @see #getParentExpression() + * @generated */ void setParentExpression(String value); @@ -244,10 +244,10 @@ public interface TreeDescription extends RepresentationDescription { * end-user-doc --> * * @return the value of the 'Editable Expression' attribute. - * @model dataType="org.eclipse.sirius.components.view.InterpretedExpression" - * @generated * @see #setEditableExpression(String) * @see org.eclipse.sirius.components.view.tree.TreePackage#getTreeDescription_EditableExpression() + * @model dataType="org.eclipse.sirius.components.view.InterpretedExpression" + * @generated */ String getEditableExpression(); @@ -256,9 +256,9 @@ public interface TreeDescription extends RepresentationDescription { * Editable Expression}' attribute. * * @param value - * the new value of the 'Editable Expression' attribute. - * @generated + * the new value of the 'Editable Expression' attribute. * @see #getEditableExpression() + * @generated */ void setEditableExpression(String value); @@ -267,10 +267,10 @@ public interface TreeDescription extends RepresentationDescription { * end-user-doc --> * * @return the value of the 'Selectable Expression' attribute. - * @model dataType="org.eclipse.sirius.components.view.InterpretedExpression" - * @generated * @see #setSelectableExpression(String) * @see org.eclipse.sirius.components.view.tree.TreePackage#getTreeDescription_SelectableExpression() + * @model dataType="org.eclipse.sirius.components.view.InterpretedExpression" + * @generated */ String getSelectableExpression(); @@ -279,9 +279,9 @@ public interface TreeDescription extends RepresentationDescription { * Selectable Expression}' attribute. * * @param value - * the new value of the 'Selectable Expression' attribute. - * @generated + * the new value of the 'Selectable Expression' attribute. * @see #getSelectableExpression() + * @generated */ void setSelectableExpression(String value); @@ -290,10 +290,10 @@ public interface TreeDescription extends RepresentationDescription { * end-user-doc --> * * @return the value of the 'Deletable Expression' attribute. - * @model dataType="org.eclipse.sirius.components.view.InterpretedExpression" - * @generated * @see #setDeletableExpression(String) * @see org.eclipse.sirius.components.view.tree.TreePackage#getTreeDescription_DeletableExpression() + * @model dataType="org.eclipse.sirius.components.view.InterpretedExpression" + * @generated */ String getDeletableExpression(); @@ -302,9 +302,9 @@ public interface TreeDescription extends RepresentationDescription { * Deletable Expression}' attribute. * * @param value - * the new value of the 'Deletable Expression' attribute. - * @generated + * the new value of the 'Deletable Expression' attribute. * @see #getDeletableExpression() + * @generated */ void setDeletableExpression(String value); @@ -314,9 +314,9 @@ public interface TreeDescription extends RepresentationDescription { * begin-user-doc --> * * @return the value of the 'Tree Item Label Descriptions' containment reference list. - * @model containment="true" - * @generated * @see org.eclipse.sirius.components.view.tree.TreePackage#getTreeDescription_TreeItemLabelDescriptions() + * @model containment="true" keys="name" + * @generated */ EList getTreeItemLabelDescriptions(); @@ -326,9 +326,9 @@ public interface TreeDescription extends RepresentationDescription { * end-user-doc --> * * @return the value of the 'Context Menu Entries' containment reference list. + * @see org.eclipse.sirius.components.view.tree.TreePackage#getTreeDescription_ContextMenuEntries() * @model containment="true" * @generated - * @see org.eclipse.sirius.components.view.tree.TreePackage#getTreeDescription_ContextMenuEntries() */ EList getContextMenuEntries(); diff --git a/packages/view/backend/sirius-components-view-tree/src/main/java/org/eclipse/sirius/components/view/tree/TreeFactory.java b/packages/view/backend/sirius-components-view-tree/src/main/java/org/eclipse/sirius/components/view/tree/TreeFactory.java index 3347d82f6e..349ea24a6d 100644 --- a/packages/view/backend/sirius-components-view-tree/src/main/java/org/eclipse/sirius/components/view/tree/TreeFactory.java +++ b/packages/view/backend/sirius-components-view-tree/src/main/java/org/eclipse/sirius/components/view/tree/TreeFactory.java @@ -18,8 +18,8 @@ * The Factory for the model. It provides a create method for each non-abstract class of * the model. * - * @generated * @see org.eclipse.sirius.components.view.tree.TreePackage + * @generated */ public interface TreeFactory extends EFactory { @@ -46,6 +46,15 @@ public interface TreeFactory extends EFactory { */ TreeItemLabelDescription createTreeItemLabelDescription(); + /** + * Returns a new object of class 'If Tree Item Label Element Description'. + * + * @return a new object of class 'If Tree Item Label Element Description'. + * @generated + */ + IfTreeItemLabelElementDescription createIfTreeItemLabelElementDescription(); + /** * Returns a new object of class 'Item Label Fragment Description'. diff --git a/packages/view/backend/sirius-components-view-tree/src/main/java/org/eclipse/sirius/components/view/tree/TreePackage.java b/packages/view/backend/sirius-components-view-tree/src/main/java/org/eclipse/sirius/components/view/tree/TreePackage.java index edb3f9d0be..55ca1d786c 100644 --- a/packages/view/backend/sirius-components-view-tree/src/main/java/org/eclipse/sirius/components/view/tree/TreePackage.java +++ b/packages/view/backend/sirius-components-view-tree/src/main/java/org/eclipse/sirius/components/view/tree/TreePackage.java @@ -30,9 +30,9 @@ * * * + * @see org.eclipse.sirius.components.view.tree.TreeFactory * @model kind="package" * @generated - * @see org.eclipse.sirius.components.view.tree.TreeFactory */ public interface TreePackage extends EPackage { @@ -56,15 +56,17 @@ public interface TreePackage extends EPackage { * @generated */ String eNS_PREFIX = "tree"; + /** * The meta object id for the '{@link org.eclipse.sirius.components.view.tree.impl.TreeDescriptionImpl * Description}' class. * - * @generated * @see org.eclipse.sirius.components.view.tree.impl.TreeDescriptionImpl * @see org.eclipse.sirius.components.view.tree.impl.TreePackageImpl#getTreeDescription() + * @generated */ int TREE_DESCRIPTION = 0; + /** * The feature id for the 'Name' attribute. * @@ -72,6 +74,7 @@ public interface TreePackage extends EPackage { * @ordered */ int TREE_DESCRIPTION__NAME = ViewPackage.REPRESENTATION_DESCRIPTION__NAME; + /** * The feature id for the 'Domain Type' attribute. * @@ -79,6 +82,7 @@ public interface TreePackage extends EPackage { * @ordered */ int TREE_DESCRIPTION__DOMAIN_TYPE = ViewPackage.REPRESENTATION_DESCRIPTION__DOMAIN_TYPE; + /** * The feature id for the 'Precondition Expression' attribute. @@ -87,6 +91,7 @@ public interface TreePackage extends EPackage { * @ordered */ int TREE_DESCRIPTION__PRECONDITION_EXPRESSION = ViewPackage.REPRESENTATION_DESCRIPTION__PRECONDITION_EXPRESSION; + /** * The feature id for the 'Title Expression' attribute. @@ -95,13 +100,15 @@ public interface TreePackage extends EPackage { * @ordered */ int TREE_DESCRIPTION__TITLE_EXPRESSION = ViewPackage.REPRESENTATION_DESCRIPTION__TITLE_EXPRESSION; + /** * The feature id for the 'Kind Expression' attribute. * * @generated * @ordered */ - int TREE_DESCRIPTION__KIND_EXPRESSION = ViewPackage.REPRESENTATION_DESCRIPTION_FEATURE_COUNT; + int TREE_DESCRIPTION__KIND_EXPRESSION = ViewPackage.REPRESENTATION_DESCRIPTION_FEATURE_COUNT + 0; + /** * The feature id for the 'Icon URL Expression' attribute. @@ -110,6 +117,7 @@ public interface TreePackage extends EPackage { * @ordered */ int TREE_DESCRIPTION__ICON_URL_EXPRESSION = ViewPackage.REPRESENTATION_DESCRIPTION_FEATURE_COUNT + 1; + /** * The feature id for the 'Tree Item Id Expression' attribute. @@ -118,6 +126,7 @@ public interface TreePackage extends EPackage { * @ordered */ int TREE_DESCRIPTION__TREE_ITEM_ID_EXPRESSION = ViewPackage.REPRESENTATION_DESCRIPTION_FEATURE_COUNT + 2; + /** * The feature id for the 'Tree Item Object Expression' attribute. @@ -126,6 +135,7 @@ public interface TreePackage extends EPackage { * @ordered */ int TREE_DESCRIPTION__TREE_ITEM_OBJECT_EXPRESSION = ViewPackage.REPRESENTATION_DESCRIPTION_FEATURE_COUNT + 3; + /** * The feature id for the 'Elements Expression' attribute. @@ -134,6 +144,7 @@ public interface TreePackage extends EPackage { * @ordered */ int TREE_DESCRIPTION__ELEMENTS_EXPRESSION = ViewPackage.REPRESENTATION_DESCRIPTION_FEATURE_COUNT + 4; + /** * The feature id for the 'Has Children Expression' attribute. @@ -142,6 +153,7 @@ public interface TreePackage extends EPackage { * @ordered */ int TREE_DESCRIPTION__HAS_CHILDREN_EXPRESSION = ViewPackage.REPRESENTATION_DESCRIPTION_FEATURE_COUNT + 5; + /** * The feature id for the 'Children Expression' attribute. @@ -150,6 +162,7 @@ public interface TreePackage extends EPackage { * @ordered */ int TREE_DESCRIPTION__CHILDREN_EXPRESSION = ViewPackage.REPRESENTATION_DESCRIPTION_FEATURE_COUNT + 6; + /** * The feature id for the 'Parent Expression' attribute. @@ -158,6 +171,7 @@ public interface TreePackage extends EPackage { * @ordered */ int TREE_DESCRIPTION__PARENT_EXPRESSION = ViewPackage.REPRESENTATION_DESCRIPTION_FEATURE_COUNT + 7; + /** * The feature id for the 'Editable Expression' attribute. @@ -166,6 +180,7 @@ public interface TreePackage extends EPackage { * @ordered */ int TREE_DESCRIPTION__EDITABLE_EXPRESSION = ViewPackage.REPRESENTATION_DESCRIPTION_FEATURE_COUNT + 8; + /** * The feature id for the 'Selectable Expression' attribute. @@ -174,6 +189,7 @@ public interface TreePackage extends EPackage { * @ordered */ int TREE_DESCRIPTION__SELECTABLE_EXPRESSION = ViewPackage.REPRESENTATION_DESCRIPTION_FEATURE_COUNT + 9; + /** * The feature id for the 'Deletable Expression' attribute. @@ -182,6 +198,7 @@ public interface TreePackage extends EPackage { * @ordered */ int TREE_DESCRIPTION__DELETABLE_EXPRESSION = ViewPackage.REPRESENTATION_DESCRIPTION_FEATURE_COUNT + 10; + /** * The feature id for the 'Tree Item Label Descriptions' containment reference list. @@ -190,6 +207,7 @@ public interface TreePackage extends EPackage { * @ordered */ int TREE_DESCRIPTION__TREE_ITEM_LABEL_DESCRIPTIONS = ViewPackage.REPRESENTATION_DESCRIPTION_FEATURE_COUNT + 11; + /** * The feature id for the 'Context Menu Entries' containment reference list. * @@ -198,6 +216,7 @@ public interface TreePackage extends EPackage { * @ordered */ int TREE_DESCRIPTION__CONTEXT_MENU_ENTRIES = ViewPackage.REPRESENTATION_DESCRIPTION_FEATURE_COUNT + 12; + /** * The number of structural features of the 'Description' class. @@ -206,22 +225,25 @@ public interface TreePackage extends EPackage { * @ordered */ int TREE_DESCRIPTION_FEATURE_COUNT = ViewPackage.REPRESENTATION_DESCRIPTION_FEATURE_COUNT + 13; + /** * The number of operations of the 'Description' class. * * @generated * @ordered */ - int TREE_DESCRIPTION_OPERATION_COUNT = ViewPackage.REPRESENTATION_DESCRIPTION_OPERATION_COUNT; + int TREE_DESCRIPTION_OPERATION_COUNT = ViewPackage.REPRESENTATION_DESCRIPTION_OPERATION_COUNT + 0; + /** * The meta object id for the '{@link org.eclipse.sirius.components.view.tree.impl.TreeItemLabelDescriptionImpl * Item Label Description}' class. * - * @generated * @see org.eclipse.sirius.components.view.tree.impl.TreeItemLabelDescriptionImpl * @see org.eclipse.sirius.components.view.tree.impl.TreePackageImpl#getTreeItemLabelDescription() + * @generated */ int TREE_ITEM_LABEL_DESCRIPTION = 1; + /** * The feature id for the 'Name' attribute. * @@ -229,6 +251,7 @@ public interface TreePackage extends EPackage { * @ordered */ int TREE_ITEM_LABEL_DESCRIPTION__NAME = 0; + /** * The feature id for the 'Precondition Expression' attribute. @@ -237,6 +260,7 @@ public interface TreePackage extends EPackage { * @ordered */ int TREE_ITEM_LABEL_DESCRIPTION__PRECONDITION_EXPRESSION = 1; + /** * The feature id for the 'Children' containment reference list. @@ -245,6 +269,7 @@ public interface TreePackage extends EPackage { * @ordered */ int TREE_ITEM_LABEL_DESCRIPTION__CHILDREN = 2; + /** * The number of structural features of the 'Item Label Description' class. @@ -253,6 +278,7 @@ public interface TreePackage extends EPackage { * @ordered */ int TREE_ITEM_LABEL_DESCRIPTION_FEATURE_COUNT = 3; + /** * The number of operations of the 'Item Label Description' class. @@ -261,16 +287,18 @@ public interface TreePackage extends EPackage { * @ordered */ int TREE_ITEM_LABEL_DESCRIPTION_OPERATION_COUNT = 0; + /** * The meta object id for the * '{@link org.eclipse.sirius.components.view.tree.impl.TreeItemLabelElementDescriptionImpl Item Label Element * Description}' class. * - * @generated * @see org.eclipse.sirius.components.view.tree.impl.TreeItemLabelElementDescriptionImpl * @see org.eclipse.sirius.components.view.tree.impl.TreePackageImpl#getTreeItemLabelElementDescription() + * @generated */ - int TREE_ITEM_LABEL_ELEMENT_DESCRIPTION = 3; + int TREE_ITEM_LABEL_ELEMENT_DESCRIPTION = 4; + /** * The number of structural features of the 'Item Label Element Description' class. * @@ -279,6 +307,7 @@ public interface TreePackage extends EPackage { * @ordered */ int TREE_ITEM_LABEL_ELEMENT_DESCRIPTION_FEATURE_COUNT = 0; + /** * The number of operations of the 'Item Label Element Description' class. @@ -287,16 +316,65 @@ public interface TreePackage extends EPackage { * @ordered */ int TREE_ITEM_LABEL_ELEMENT_DESCRIPTION_OPERATION_COUNT = 0; + + /** + * The meta object id for the + * '{@link org.eclipse.sirius.components.view.tree.impl.IfTreeItemLabelElementDescriptionImpl If Tree Item Label + * Element Description}' class. + * + * @see org.eclipse.sirius.components.view.tree.impl.IfTreeItemLabelElementDescriptionImpl + * @see org.eclipse.sirius.components.view.tree.impl.TreePackageImpl#getIfTreeItemLabelElementDescription() + * @generated + */ + int IF_TREE_ITEM_LABEL_ELEMENT_DESCRIPTION = 2; + + /** + * The feature id for the 'Predicate Expression' attribute. + * + * @generated + * @ordered + */ + int IF_TREE_ITEM_LABEL_ELEMENT_DESCRIPTION__PREDICATE_EXPRESSION = TREE_ITEM_LABEL_ELEMENT_DESCRIPTION_FEATURE_COUNT + 0; + + /** + * The feature id for the 'Children' containment reference list. + * + * @generated + * @ordered + */ + int IF_TREE_ITEM_LABEL_ELEMENT_DESCRIPTION__CHILDREN = TREE_ITEM_LABEL_ELEMENT_DESCRIPTION_FEATURE_COUNT + 1; + + /** + * The number of structural features of the 'If Tree Item Label Element Description' class. + * + * @generated + * @ordered + */ + int IF_TREE_ITEM_LABEL_ELEMENT_DESCRIPTION_FEATURE_COUNT = TREE_ITEM_LABEL_ELEMENT_DESCRIPTION_FEATURE_COUNT + 2; + + /** + * The number of operations of the 'If Tree Item Label Element Description' class. + * + * + * @generated + * @ordered + */ + int IF_TREE_ITEM_LABEL_ELEMENT_DESCRIPTION_OPERATION_COUNT = TREE_ITEM_LABEL_ELEMENT_DESCRIPTION_OPERATION_COUNT + 0; + /** * The meta object id for the * '{@link org.eclipse.sirius.components.view.tree.impl.TreeItemLabelFragmentDescriptionImpl Item Label Fragment * Description}' class. * - * @generated * @see org.eclipse.sirius.components.view.tree.impl.TreeItemLabelFragmentDescriptionImpl * @see org.eclipse.sirius.components.view.tree.impl.TreePackageImpl#getTreeItemLabelFragmentDescription() + * @generated */ - int TREE_ITEM_LABEL_FRAGMENT_DESCRIPTION = 2; + int TREE_ITEM_LABEL_FRAGMENT_DESCRIPTION = 3; + /** * The feature id for the 'Label Expression' attribute. @@ -304,7 +382,8 @@ public interface TreePackage extends EPackage { * @generated * @ordered */ - int TREE_ITEM_LABEL_FRAGMENT_DESCRIPTION__LABEL_EXPRESSION = TREE_ITEM_LABEL_ELEMENT_DESCRIPTION_FEATURE_COUNT; + int TREE_ITEM_LABEL_FRAGMENT_DESCRIPTION__LABEL_EXPRESSION = TREE_ITEM_LABEL_ELEMENT_DESCRIPTION_FEATURE_COUNT + 0; + /** * The feature id for the 'Style' reference. * @@ -312,6 +391,7 @@ public interface TreePackage extends EPackage { * @ordered */ int TREE_ITEM_LABEL_FRAGMENT_DESCRIPTION__STYLE = TREE_ITEM_LABEL_ELEMENT_DESCRIPTION_FEATURE_COUNT + 1; + /** * The number of structural features of the 'Item Label Fragment Description' class. @@ -320,6 +400,7 @@ public interface TreePackage extends EPackage { * @ordered */ int TREE_ITEM_LABEL_FRAGMENT_DESCRIPTION_FEATURE_COUNT = TREE_ITEM_LABEL_ELEMENT_DESCRIPTION_FEATURE_COUNT + 2; + /** * The number of operations of the 'Item Label Fragment Description' class. @@ -327,16 +408,18 @@ public interface TreePackage extends EPackage { * @generated * @ordered */ - int TREE_ITEM_LABEL_FRAGMENT_DESCRIPTION_OPERATION_COUNT = TREE_ITEM_LABEL_ELEMENT_DESCRIPTION_OPERATION_COUNT; + int TREE_ITEM_LABEL_FRAGMENT_DESCRIPTION_OPERATION_COUNT = TREE_ITEM_LABEL_ELEMENT_DESCRIPTION_OPERATION_COUNT + 0; + /** * The meta object id for the '{@link org.eclipse.sirius.components.view.tree.impl.TreeItemContextMenuEntryImpl * Item Context Menu Entry}' class. * - * @generated * @see org.eclipse.sirius.components.view.tree.impl.TreeItemContextMenuEntryImpl * @see org.eclipse.sirius.components.view.tree.impl.TreePackageImpl#getTreeItemContextMenuEntry() + * @generated */ - int TREE_ITEM_CONTEXT_MENU_ENTRY = 4; + int TREE_ITEM_CONTEXT_MENU_ENTRY = 5; + /** * The feature id for the 'Name' attribute. * @@ -344,6 +427,7 @@ public interface TreePackage extends EPackage { * @ordered */ int TREE_ITEM_CONTEXT_MENU_ENTRY__NAME = 0; + /** * The feature id for the 'Label Expression' attribute. @@ -352,6 +436,7 @@ public interface TreePackage extends EPackage { * @ordered */ int TREE_ITEM_CONTEXT_MENU_ENTRY__LABEL_EXPRESSION = 1; + /** * The feature id for the 'Icon URL Expression' attribute. @@ -360,6 +445,7 @@ public interface TreePackage extends EPackage { * @ordered */ int TREE_ITEM_CONTEXT_MENU_ENTRY__ICON_URL_EXPRESSION = 2; + /** * The feature id for the 'Precondition Expression' attribute. @@ -368,6 +454,7 @@ public interface TreePackage extends EPackage { * @ordered */ int TREE_ITEM_CONTEXT_MENU_ENTRY__PRECONDITION_EXPRESSION = 3; + /** * The number of structural features of the 'Item Context Menu Entry' class. @@ -376,6 +463,7 @@ public interface TreePackage extends EPackage { * @ordered */ int TREE_ITEM_CONTEXT_MENU_ENTRY_FEATURE_COUNT = 4; + /** * The number of operations of the 'Item Context Menu Entry' class. @@ -384,16 +472,18 @@ public interface TreePackage extends EPackage { * @ordered */ int TREE_ITEM_CONTEXT_MENU_ENTRY_OPERATION_COUNT = 0; + /** * The meta object id for the * '{@link org.eclipse.sirius.components.view.tree.impl.SingleClickTreeItemContextMenuEntryImpl Single Click * Tree Item Context Menu Entry}' class. * - * @generated * @see org.eclipse.sirius.components.view.tree.impl.SingleClickTreeItemContextMenuEntryImpl * @see org.eclipse.sirius.components.view.tree.impl.TreePackageImpl#getSingleClickTreeItemContextMenuEntry() + * @generated */ - int SINGLE_CLICK_TREE_ITEM_CONTEXT_MENU_ENTRY = 5; + int SINGLE_CLICK_TREE_ITEM_CONTEXT_MENU_ENTRY = 6; + /** * The feature id for the 'Name' attribute. * @@ -401,6 +491,7 @@ public interface TreePackage extends EPackage { * @ordered */ int SINGLE_CLICK_TREE_ITEM_CONTEXT_MENU_ENTRY__NAME = TREE_ITEM_CONTEXT_MENU_ENTRY__NAME; + /** * The feature id for the 'Label Expression' attribute. @@ -409,6 +500,7 @@ public interface TreePackage extends EPackage { * @ordered */ int SINGLE_CLICK_TREE_ITEM_CONTEXT_MENU_ENTRY__LABEL_EXPRESSION = TREE_ITEM_CONTEXT_MENU_ENTRY__LABEL_EXPRESSION; + /** * The feature id for the 'Icon URL Expression' attribute. @@ -417,6 +509,7 @@ public interface TreePackage extends EPackage { * @ordered */ int SINGLE_CLICK_TREE_ITEM_CONTEXT_MENU_ENTRY__ICON_URL_EXPRESSION = TREE_ITEM_CONTEXT_MENU_ENTRY__ICON_URL_EXPRESSION; + /** * The feature id for the 'Precondition Expression' attribute. @@ -425,6 +518,7 @@ public interface TreePackage extends EPackage { * @ordered */ int SINGLE_CLICK_TREE_ITEM_CONTEXT_MENU_ENTRY__PRECONDITION_EXPRESSION = TREE_ITEM_CONTEXT_MENU_ENTRY__PRECONDITION_EXPRESSION; + /** * The feature id for the 'Body' containment reference list. @@ -432,7 +526,8 @@ public interface TreePackage extends EPackage { * @generated * @ordered */ - int SINGLE_CLICK_TREE_ITEM_CONTEXT_MENU_ENTRY__BODY = TREE_ITEM_CONTEXT_MENU_ENTRY_FEATURE_COUNT; + int SINGLE_CLICK_TREE_ITEM_CONTEXT_MENU_ENTRY__BODY = TREE_ITEM_CONTEXT_MENU_ENTRY_FEATURE_COUNT + 0; + /** * The number of structural features of the 'Single Click Tree Item Context Menu Entry' class. @@ -441,6 +536,7 @@ public interface TreePackage extends EPackage { * @ordered */ int SINGLE_CLICK_TREE_ITEM_CONTEXT_MENU_ENTRY_FEATURE_COUNT = TREE_ITEM_CONTEXT_MENU_ENTRY_FEATURE_COUNT + 1; + /** * The number of operations of the 'Single Click Tree Item Context Menu Entry' class. @@ -448,16 +544,18 @@ public interface TreePackage extends EPackage { * @generated * @ordered */ - int SINGLE_CLICK_TREE_ITEM_CONTEXT_MENU_ENTRY_OPERATION_COUNT = TREE_ITEM_CONTEXT_MENU_ENTRY_OPERATION_COUNT; + int SINGLE_CLICK_TREE_ITEM_CONTEXT_MENU_ENTRY_OPERATION_COUNT = TREE_ITEM_CONTEXT_MENU_ENTRY_OPERATION_COUNT + 0; + /** * The meta object id for the '{@link org.eclipse.sirius.components.view.tree.impl.FetchTreeItemContextMenuEntryImpl * Fetch Tree Item Context Menu Entry}' class. * - * @generated * @see org.eclipse.sirius.components.view.tree.impl.FetchTreeItemContextMenuEntryImpl * @see org.eclipse.sirius.components.view.tree.impl.TreePackageImpl#getFetchTreeItemContextMenuEntry() + * @generated */ - int FETCH_TREE_ITEM_CONTEXT_MENU_ENTRY = 6; + int FETCH_TREE_ITEM_CONTEXT_MENU_ENTRY = 7; + /** * The feature id for the 'Name' attribute. * @@ -465,6 +563,7 @@ public interface TreePackage extends EPackage { * @ordered */ int FETCH_TREE_ITEM_CONTEXT_MENU_ENTRY__NAME = TREE_ITEM_CONTEXT_MENU_ENTRY__NAME; + /** * The feature id for the 'Label Expression' attribute. @@ -473,6 +572,7 @@ public interface TreePackage extends EPackage { * @ordered */ int FETCH_TREE_ITEM_CONTEXT_MENU_ENTRY__LABEL_EXPRESSION = TREE_ITEM_CONTEXT_MENU_ENTRY__LABEL_EXPRESSION; + /** * The feature id for the 'Icon URL Expression' attribute. @@ -481,6 +581,7 @@ public interface TreePackage extends EPackage { * @ordered */ int FETCH_TREE_ITEM_CONTEXT_MENU_ENTRY__ICON_URL_EXPRESSION = TREE_ITEM_CONTEXT_MENU_ENTRY__ICON_URL_EXPRESSION; + /** * The feature id for the 'Precondition Expression' attribute. @@ -489,13 +590,15 @@ public interface TreePackage extends EPackage { * @ordered */ int FETCH_TREE_ITEM_CONTEXT_MENU_ENTRY__PRECONDITION_EXPRESSION = TREE_ITEM_CONTEXT_MENU_ENTRY__PRECONDITION_EXPRESSION; + /** * The feature id for the 'Url Exression' attribute. * * @generated * @ordered */ - int FETCH_TREE_ITEM_CONTEXT_MENU_ENTRY__URL_EXRESSION = TREE_ITEM_CONTEXT_MENU_ENTRY_FEATURE_COUNT; + int FETCH_TREE_ITEM_CONTEXT_MENU_ENTRY__URL_EXRESSION = TREE_ITEM_CONTEXT_MENU_ENTRY_FEATURE_COUNT + 0; + /** * The feature id for the 'Kind' attribute. * @@ -503,6 +606,14 @@ public interface TreePackage extends EPackage { * @ordered */ int FETCH_TREE_ITEM_CONTEXT_MENU_ENTRY__KIND = TREE_ITEM_CONTEXT_MENU_ENTRY_FEATURE_COUNT + 1; + + /** + * The singleton instance of the package. + * + * @generated + */ + TreePackage eINSTANCE = org.eclipse.sirius.components.view.tree.impl.TreePackageImpl.init(); + /** * The number of structural features of the 'Fetch Tree Item Context Menu Entry' class. @@ -511,6 +622,7 @@ public interface TreePackage extends EPackage { * @ordered */ int FETCH_TREE_ITEM_CONTEXT_MENU_ENTRY_FEATURE_COUNT = TREE_ITEM_CONTEXT_MENU_ENTRY_FEATURE_COUNT + 2; + /** * The number of operations of the 'Fetch Tree Item Context Menu Entry' class. @@ -518,30 +630,25 @@ public interface TreePackage extends EPackage { * @generated * @ordered */ - int FETCH_TREE_ITEM_CONTEXT_MENU_ENTRY_OPERATION_COUNT = TREE_ITEM_CONTEXT_MENU_ENTRY_OPERATION_COUNT; + int FETCH_TREE_ITEM_CONTEXT_MENU_ENTRY_OPERATION_COUNT = TREE_ITEM_CONTEXT_MENU_ENTRY_OPERATION_COUNT + 0; + /** * The meta object id for the '{@link org.eclipse.sirius.components.view.tree.FetchTreeItemContextMenuEntryKind * Fetch Tree Item Context Menu Entry Kind}' enum. * - * @generated * @see org.eclipse.sirius.components.view.tree.FetchTreeItemContextMenuEntryKind * @see org.eclipse.sirius.components.view.tree.impl.TreePackageImpl#getFetchTreeItemContextMenuEntryKind() - */ - int FETCH_TREE_ITEM_CONTEXT_MENU_ENTRY_KIND = 7; - /** - * The singleton instance of the package. - * * @generated */ - TreePackage eINSTANCE = org.eclipse.sirius.components.view.tree.impl.TreePackageImpl.init(); + int FETCH_TREE_ITEM_CONTEXT_MENU_ENTRY_KIND = 8; /** * Returns the meta object for class '{@link org.eclipse.sirius.components.view.tree.TreeDescription * Description}'. * * @return the meta object for class 'Description'. - * @generated * @see org.eclipse.sirius.components.view.tree.TreeDescription + * @generated */ EClass getTreeDescription(); @@ -551,9 +658,9 @@ public interface TreePackage extends EPackage { * * * @return the meta object for the attribute 'Kind Expression'. - * @generated * @see org.eclipse.sirius.components.view.tree.TreeDescription#getKindExpression() * @see #getTreeDescription() + * @generated */ EAttribute getTreeDescription_KindExpression(); @@ -563,9 +670,9 @@ public interface TreePackage extends EPackage { * Expression}'. * * @return the meta object for the attribute 'Icon URL Expression'. - * @generated * @see org.eclipse.sirius.components.view.tree.TreeDescription#getIconURLExpression() * @see #getTreeDescription() + * @generated */ EAttribute getTreeDescription_IconURLExpression(); @@ -575,9 +682,9 @@ public interface TreePackage extends EPackage { * Expression}'. * * @return the meta object for the attribute 'Tree Item Id Expression'. - * @generated * @see org.eclipse.sirius.components.view.tree.TreeDescription#getTreeItemIdExpression() * @see #getTreeDescription() + * @generated */ EAttribute getTreeDescription_TreeItemIdExpression(); @@ -587,9 +694,9 @@ public interface TreePackage extends EPackage { * Expression}'. * * @return the meta object for the attribute 'Tree Item Object Expression'. - * @generated * @see org.eclipse.sirius.components.view.tree.TreeDescription#getTreeItemObjectExpression() * @see #getTreeDescription() + * @generated */ EAttribute getTreeDescription_TreeItemObjectExpression(); @@ -599,9 +706,9 @@ public interface TreePackage extends EPackage { * Expression}'. * * @return the meta object for the attribute 'Elements Expression'. - * @generated * @see org.eclipse.sirius.components.view.tree.TreeDescription#getElementsExpression() * @see #getTreeDescription() + * @generated */ EAttribute getTreeDescription_ElementsExpression(); @@ -611,9 +718,9 @@ public interface TreePackage extends EPackage { * Expression}'. * * @return the meta object for the attribute 'Has Children Expression'. - * @generated * @see org.eclipse.sirius.components.view.tree.TreeDescription#getHasChildrenExpression() * @see #getTreeDescription() + * @generated */ EAttribute getTreeDescription_HasChildrenExpression(); @@ -623,9 +730,9 @@ public interface TreePackage extends EPackage { * Expression}'. * * @return the meta object for the attribute 'Children Expression'. - * @generated * @see org.eclipse.sirius.components.view.tree.TreeDescription#getChildrenExpression() * @see #getTreeDescription() + * @generated */ EAttribute getTreeDescription_ChildrenExpression(); @@ -635,9 +742,9 @@ public interface TreePackage extends EPackage { * * * @return the meta object for the attribute 'Parent Expression'. - * @generated * @see org.eclipse.sirius.components.view.tree.TreeDescription#getParentExpression() * @see #getTreeDescription() + * @generated */ EAttribute getTreeDescription_ParentExpression(); @@ -647,9 +754,9 @@ public interface TreePackage extends EPackage { * Expression}'. * * @return the meta object for the attribute 'Editable Expression'. - * @generated * @see org.eclipse.sirius.components.view.tree.TreeDescription#getEditableExpression() * @see #getTreeDescription() + * @generated */ EAttribute getTreeDescription_EditableExpression(); @@ -659,9 +766,9 @@ public interface TreePackage extends EPackage { * Expression}'. * * @return the meta object for the attribute 'Selectable Expression'. - * @generated * @see org.eclipse.sirius.components.view.tree.TreeDescription#getSelectableExpression() * @see #getTreeDescription() + * @generated */ EAttribute getTreeDescription_SelectableExpression(); @@ -671,9 +778,9 @@ public interface TreePackage extends EPackage { * Expression}'. * * @return the meta object for the attribute 'Deletable Expression'. - * @generated * @see org.eclipse.sirius.components.view.tree.TreeDescription#getDeletableExpression() * @see #getTreeDescription() + * @generated */ EAttribute getTreeDescription_DeletableExpression(); @@ -683,9 +790,9 @@ public interface TreePackage extends EPackage { * Descriptions}'. * * @return the meta object for the containment reference list 'Tree Item Label Descriptions'. - * @generated * @see org.eclipse.sirius.components.view.tree.TreeDescription#getTreeItemLabelDescriptions() * @see #getTreeDescription() + * @generated */ EReference getTreeDescription_TreeItemLabelDescriptions(); @@ -695,9 +802,9 @@ public interface TreePackage extends EPackage { * Entries}'. * * @return the meta object for the containment reference list 'Context Menu Entries'. - * @generated * @see org.eclipse.sirius.components.view.tree.TreeDescription#getContextMenuEntries() * @see #getTreeDescription() + * @generated */ EReference getTreeDescription_ContextMenuEntries(); @@ -706,8 +813,8 @@ public interface TreePackage extends EPackage { * Item Label Description}'. * * @return the meta object for class 'Item Label Description'. - * @generated * @see org.eclipse.sirius.components.view.tree.TreeItemLabelDescription + * @generated */ EClass getTreeItemLabelDescription(); @@ -717,9 +824,9 @@ public interface TreePackage extends EPackage { * begin-user-doc --> * * @return the meta object for the attribute 'Name'. - * @generated * @see org.eclipse.sirius.components.view.tree.TreeItemLabelDescription#getName() * @see #getTreeItemLabelDescription() + * @generated */ EAttribute getTreeItemLabelDescription_Name(); @@ -729,9 +836,9 @@ public interface TreePackage extends EPackage { * Precondition Expression}'. * * @return the meta object for the attribute 'Precondition Expression'. - * @generated * @see org.eclipse.sirius.components.view.tree.TreeItemLabelDescription#getPreconditionExpression() * @see #getTreeItemLabelDescription() + * @generated */ EAttribute getTreeItemLabelDescription_PreconditionExpression(); @@ -741,20 +848,55 @@ public interface TreePackage extends EPackage { * begin-user-doc --> * * @return the meta object for the containment reference list 'Children'. - * @generated * @see org.eclipse.sirius.components.view.tree.TreeItemLabelDescription#getChildren() * @see #getTreeItemLabelDescription() + * @generated */ EReference getTreeItemLabelDescription_Children(); + /** + * Returns the meta object for class + * '{@link org.eclipse.sirius.components.view.tree.IfTreeItemLabelElementDescription If Tree Item Label Element + * Description}'. + * + * @return the meta object for class 'If Tree Item Label Element Description'. + * @see org.eclipse.sirius.components.view.tree.IfTreeItemLabelElementDescription + * @generated + */ + EClass getIfTreeItemLabelElementDescription(); + + /** + * Returns the meta object for the attribute + * '{@link org.eclipse.sirius.components.view.tree.IfTreeItemLabelElementDescription#getPredicateExpression + * Predicate Expression}'. + * + * @return the meta object for the attribute 'Predicate Expression'. + * @see org.eclipse.sirius.components.view.tree.IfTreeItemLabelElementDescription#getPredicateExpression() + * @see #getIfTreeItemLabelElementDescription() + * @generated + */ + EAttribute getIfTreeItemLabelElementDescription_PredicateExpression(); + + /** + * Returns the meta object for the containment reference list + * '{@link org.eclipse.sirius.components.view.tree.IfTreeItemLabelElementDescription#getChildren + * Children}'. + * + * @return the meta object for the containment reference list 'Children'. + * @see org.eclipse.sirius.components.view.tree.IfTreeItemLabelElementDescription#getChildren() + * @see #getIfTreeItemLabelElementDescription() + * @generated + */ + EReference getIfTreeItemLabelElementDescription_Children(); + /** * Returns the meta object for class * '{@link org.eclipse.sirius.components.view.tree.TreeItemLabelFragmentDescription Item Label Fragment * Description}'. * * @return the meta object for class 'Item Label Fragment Description'. - * @generated * @see org.eclipse.sirius.components.view.tree.TreeItemLabelFragmentDescription + * @generated */ EClass getTreeItemLabelFragmentDescription(); @@ -764,9 +906,9 @@ public interface TreePackage extends EPackage { * Expression}'. * * @return the meta object for the attribute 'Label Expression'. - * @generated * @see org.eclipse.sirius.components.view.tree.TreeItemLabelFragmentDescription#getLabelExpression() * @see #getTreeItemLabelFragmentDescription() + * @generated */ EAttribute getTreeItemLabelFragmentDescription_LabelExpression(); @@ -787,8 +929,8 @@ public interface TreePackage extends EPackage { * Item Label Element Description}'. * * @return the meta object for class 'Item Label Element Description'. - * @generated * @see org.eclipse.sirius.components.view.tree.TreeItemLabelElementDescription + * @generated */ EClass getTreeItemLabelElementDescription(); @@ -797,8 +939,8 @@ public interface TreePackage extends EPackage { * Item Context Menu Entry}'. * * @return the meta object for class 'Item Context Menu Entry'. - * @generated * @see org.eclipse.sirius.components.view.tree.TreeItemContextMenuEntry + * @generated */ EClass getTreeItemContextMenuEntry(); @@ -808,9 +950,9 @@ public interface TreePackage extends EPackage { * begin-user-doc --> * * @return the meta object for the attribute 'Name'. - * @generated * @see org.eclipse.sirius.components.view.tree.TreeItemContextMenuEntry#getName() * @see #getTreeItemContextMenuEntry() + * @generated */ EAttribute getTreeItemContextMenuEntry_Name(); @@ -820,9 +962,9 @@ public interface TreePackage extends EPackage { * Expression}'. * * @return the meta object for the attribute 'Label Expression'. - * @generated * @see org.eclipse.sirius.components.view.tree.TreeItemContextMenuEntry#getLabelExpression() * @see #getTreeItemContextMenuEntry() + * @generated */ EAttribute getTreeItemContextMenuEntry_LabelExpression(); @@ -832,9 +974,9 @@ public interface TreePackage extends EPackage { * Expression}'. * * @return the meta object for the attribute 'Icon URL Expression'. - * @generated * @see org.eclipse.sirius.components.view.tree.TreeItemContextMenuEntry#getIconURLExpression() * @see #getTreeItemContextMenuEntry() + * @generated */ EAttribute getTreeItemContextMenuEntry_IconURLExpression(); @@ -844,9 +986,9 @@ public interface TreePackage extends EPackage { * Precondition Expression}'. * * @return the meta object for the attribute 'Precondition Expression'. - * @generated * @see org.eclipse.sirius.components.view.tree.TreeItemContextMenuEntry#getPreconditionExpression() * @see #getTreeItemContextMenuEntry() + * @generated */ EAttribute getTreeItemContextMenuEntry_PreconditionExpression(); @@ -856,20 +998,20 @@ public interface TreePackage extends EPackage { * Context Menu Entry}'. * * @return the meta object for class 'Single Click Tree Item Context Menu Entry'. - * @generated * @see org.eclipse.sirius.components.view.tree.SingleClickTreeItemContextMenuEntry + * @generated */ EClass getSingleClickTreeItemContextMenuEntry(); /** - * Returns the meta object for the reference list + * Returns the meta object for the containment reference list * '{@link org.eclipse.sirius.components.view.tree.SingleClickTreeItemContextMenuEntry#getBody Body}'. * - * @return the meta object for the reference list 'Body'. - * @generated + * @return the meta object for the containment reference list 'Body'. * @see org.eclipse.sirius.components.view.tree.SingleClickTreeItemContextMenuEntry#getBody() * @see #getSingleClickTreeItemContextMenuEntry() + * @generated */ EReference getSingleClickTreeItemContextMenuEntry_Body(); @@ -878,8 +1020,8 @@ public interface TreePackage extends EPackage { * Fetch Tree Item Context Menu Entry}'. * * @return the meta object for class 'Fetch Tree Item Context Menu Entry'. - * @generated * @see org.eclipse.sirius.components.view.tree.FetchTreeItemContextMenuEntry + * @generated */ EClass getFetchTreeItemContextMenuEntry(); @@ -889,9 +1031,9 @@ public interface TreePackage extends EPackage { * Exression}'. * * @return the meta object for the attribute 'Url Exression'. - * @generated * @see org.eclipse.sirius.components.view.tree.FetchTreeItemContextMenuEntry#getUrlExression() * @see #getFetchTreeItemContextMenuEntry() + * @generated */ EAttribute getFetchTreeItemContextMenuEntry_UrlExression(); @@ -901,9 +1043,9 @@ public interface TreePackage extends EPackage { * begin-user-doc --> * * @return the meta object for the attribute 'Kind'. - * @generated * @see org.eclipse.sirius.components.view.tree.FetchTreeItemContextMenuEntry#getKind() * @see #getFetchTreeItemContextMenuEntry() + * @generated */ EAttribute getFetchTreeItemContextMenuEntry_Kind(); @@ -913,8 +1055,8 @@ public interface TreePackage extends EPackage { * Menu Entry Kind}'. * * @return the meta object for enum 'Fetch Tree Item Context Menu Entry Kind'. - * @generated * @see org.eclipse.sirius.components.view.tree.FetchTreeItemContextMenuEntryKind + * @generated */ EEnum getFetchTreeItemContextMenuEntryKind(); @@ -945,9 +1087,9 @@ interface Literals { * The meta object literal for the '{@link org.eclipse.sirius.components.view.tree.impl.TreeDescriptionImpl * Description}' class. * - * @generated * @see org.eclipse.sirius.components.view.tree.impl.TreeDescriptionImpl * @see org.eclipse.sirius.components.view.tree.impl.TreePackageImpl#getTreeDescription() + * @generated */ EClass TREE_DESCRIPTION = eINSTANCE.getTreeDescription(); @@ -1040,16 +1182,16 @@ interface Literals { EAttribute TREE_DESCRIPTION__DELETABLE_EXPRESSION = eINSTANCE.getTreeDescription_DeletableExpression(); /** - * The meta object literal for the 'Tree Item Label Descriptions' reference list feature. + * The meta object literal for the 'Tree Item Label Descriptions' containment reference list + * feature. * * @generated */ EReference TREE_DESCRIPTION__TREE_ITEM_LABEL_DESCRIPTIONS = eINSTANCE.getTreeDescription_TreeItemLabelDescriptions(); /** - * The meta object literal for the 'Context Menu Entries' reference list feature. + * The meta object literal for the 'Context Menu Entries' containment reference list feature. + * * * @generated */ @@ -1060,9 +1202,9 @@ interface Literals { * '{@link org.eclipse.sirius.components.view.tree.impl.TreeItemLabelDescriptionImpl Item Label * Description}' class. * - * @generated * @see org.eclipse.sirius.components.view.tree.impl.TreeItemLabelDescriptionImpl * @see org.eclipse.sirius.components.view.tree.impl.TreePackageImpl#getTreeItemLabelDescription() + * @generated */ EClass TREE_ITEM_LABEL_DESCRIPTION = eINSTANCE.getTreeItemLabelDescription(); @@ -1090,14 +1232,41 @@ interface Literals { */ EReference TREE_ITEM_LABEL_DESCRIPTION__CHILDREN = eINSTANCE.getTreeItemLabelDescription_Children(); + /** + * The meta object literal for the + * '{@link org.eclipse.sirius.components.view.tree.impl.IfTreeItemLabelElementDescriptionImpl If Tree Item + * Label Element Description}' class. + * + * @see org.eclipse.sirius.components.view.tree.impl.IfTreeItemLabelElementDescriptionImpl + * @see org.eclipse.sirius.components.view.tree.impl.TreePackageImpl#getIfTreeItemLabelElementDescription() + * @generated + */ + EClass IF_TREE_ITEM_LABEL_ELEMENT_DESCRIPTION = eINSTANCE.getIfTreeItemLabelElementDescription(); + + /** + * The meta object literal for the 'Predicate Expression' attribute feature. + * + * @generated + */ + EAttribute IF_TREE_ITEM_LABEL_ELEMENT_DESCRIPTION__PREDICATE_EXPRESSION = eINSTANCE.getIfTreeItemLabelElementDescription_PredicateExpression(); + + /** + * The meta object literal for the 'Children' containment reference list feature. + * + * @generated + */ + EReference IF_TREE_ITEM_LABEL_ELEMENT_DESCRIPTION__CHILDREN = eINSTANCE.getIfTreeItemLabelElementDescription_Children(); + /** * The meta object literal for the * '{@link org.eclipse.sirius.components.view.tree.impl.TreeItemLabelFragmentDescriptionImpl Item Label * Fragment Description}' class. * - * @generated * @see org.eclipse.sirius.components.view.tree.impl.TreeItemLabelFragmentDescriptionImpl * @see org.eclipse.sirius.components.view.tree.impl.TreePackageImpl#getTreeItemLabelFragmentDescription() + * @generated */ EClass TREE_ITEM_LABEL_FRAGMENT_DESCRIPTION = eINSTANCE.getTreeItemLabelFragmentDescription(); @@ -1122,9 +1291,9 @@ interface Literals { * '{@link org.eclipse.sirius.components.view.tree.impl.TreeItemLabelElementDescriptionImpl Item Label * Element Description}' class. * - * @generated * @see org.eclipse.sirius.components.view.tree.impl.TreeItemLabelElementDescriptionImpl * @see org.eclipse.sirius.components.view.tree.impl.TreePackageImpl#getTreeItemLabelElementDescription() + * @generated */ EClass TREE_ITEM_LABEL_ELEMENT_DESCRIPTION = eINSTANCE.getTreeItemLabelElementDescription(); @@ -1133,9 +1302,9 @@ interface Literals { * '{@link org.eclipse.sirius.components.view.tree.impl.TreeItemContextMenuEntryImpl Item Context Menu * Entry}' class. * - * @generated * @see org.eclipse.sirius.components.view.tree.impl.TreeItemContextMenuEntryImpl * @see org.eclipse.sirius.components.view.tree.impl.TreePackageImpl#getTreeItemContextMenuEntry() + * @generated */ EClass TREE_ITEM_CONTEXT_MENU_ENTRY = eINSTANCE.getTreeItemContextMenuEntry(); @@ -1176,9 +1345,9 @@ interface Literals { * '{@link org.eclipse.sirius.components.view.tree.impl.SingleClickTreeItemContextMenuEntryImpl Single Click * Tree Item Context Menu Entry}' class. * - * @generated * @see org.eclipse.sirius.components.view.tree.impl.SingleClickTreeItemContextMenuEntryImpl * @see org.eclipse.sirius.components.view.tree.impl.TreePackageImpl#getSingleClickTreeItemContextMenuEntry() + * @generated */ EClass SINGLE_CLICK_TREE_ITEM_CONTEXT_MENU_ENTRY = eINSTANCE.getSingleClickTreeItemContextMenuEntry(); @@ -1195,9 +1364,9 @@ interface Literals { * '{@link org.eclipse.sirius.components.view.tree.impl.FetchTreeItemContextMenuEntryImpl Fetch Tree Item * Context Menu Entry}' class. * - * @generated * @see org.eclipse.sirius.components.view.tree.impl.FetchTreeItemContextMenuEntryImpl * @see org.eclipse.sirius.components.view.tree.impl.TreePackageImpl#getFetchTreeItemContextMenuEntry() + * @generated */ EClass FETCH_TREE_ITEM_CONTEXT_MENU_ENTRY = eINSTANCE.getFetchTreeItemContextMenuEntry(); @@ -1222,9 +1391,9 @@ interface Literals { * '{@link org.eclipse.sirius.components.view.tree.FetchTreeItemContextMenuEntryKind Fetch Tree Item Context * Menu Entry Kind}' enum. * - * @generated * @see org.eclipse.sirius.components.view.tree.FetchTreeItemContextMenuEntryKind * @see org.eclipse.sirius.components.view.tree.impl.TreePackageImpl#getFetchTreeItemContextMenuEntryKind() + * @generated */ EEnum FETCH_TREE_ITEM_CONTEXT_MENU_ENTRY_KIND = eINSTANCE.getFetchTreeItemContextMenuEntryKind(); diff --git a/packages/view/backend/sirius-components-view-tree/src/main/java/org/eclipse/sirius/components/view/tree/impl/IfTreeItemLabelElementDescriptionImpl.java b/packages/view/backend/sirius-components-view-tree/src/main/java/org/eclipse/sirius/components/view/tree/impl/IfTreeItemLabelElementDescriptionImpl.java new file mode 100644 index 0000000000..542ed63974 --- /dev/null +++ b/packages/view/backend/sirius-components-view-tree/src/main/java/org/eclipse/sirius/components/view/tree/impl/IfTreeItemLabelElementDescriptionImpl.java @@ -0,0 +1,232 @@ +/******************************************************************************* + * Copyright (c) 2024 Obeo. + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v2.0 + * which accompanies this distribution, and is available at + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Obeo - initial API and implementation + *******************************************************************************/ +package org.eclipse.sirius.components.view.tree.impl; + +import java.util.Collection; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.common.notify.NotificationChain; +import org.eclipse.emf.common.util.EList; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; +import org.eclipse.emf.ecore.impl.ENotificationImpl; +import org.eclipse.emf.ecore.util.EObjectContainmentEList; +import org.eclipse.emf.ecore.util.InternalEList; +import org.eclipse.sirius.components.view.tree.IfTreeItemLabelElementDescription; +import org.eclipse.sirius.components.view.tree.TreeItemLabelElementDescription; +import org.eclipse.sirius.components.view.tree.TreePackage; + +/** + * An implementation of the model object 'If Tree Item Label Element + * Description'. + *

    + * The following features are implemented: + *

    + *
      + *
    • {@link org.eclipse.sirius.components.view.tree.impl.IfTreeItemLabelElementDescriptionImpl#getPredicateExpression + * Predicate Expression}
    • + *
    • {@link org.eclipse.sirius.components.view.tree.impl.IfTreeItemLabelElementDescriptionImpl#getChildren + * Children}
    • + *
    + * + * @generated + */ +public class IfTreeItemLabelElementDescriptionImpl extends TreeItemLabelElementDescriptionImpl implements IfTreeItemLabelElementDescription { + + /** + * The default value of the '{@link #getPredicateExpression() Predicate Expression}' attribute. + * + * @see #getPredicateExpression() + * @generated + * @ordered + */ + protected static final String PREDICATE_EXPRESSION_EDEFAULT = null; + + /** + * The cached value of the '{@link #getPredicateExpression() Predicate Expression}' attribute. + * + * @see #getPredicateExpression() + * @generated + * @ordered + */ + protected String predicateExpression = PREDICATE_EXPRESSION_EDEFAULT; + + /** + * The cached value of the '{@link #getChildren() Children}' containment reference list. + * + * @see #getChildren() + * @generated + * @ordered + */ + protected EList children; + + /** + * + * + * @generated + */ + protected IfTreeItemLabelElementDescriptionImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return TreePackage.Literals.IF_TREE_ITEM_LABEL_ELEMENT_DESCRIPTION; + } + + /** + * + * + * @generated + */ + @Override + public String getPredicateExpression() { + return this.predicateExpression; + } + + /** + * + * + * @generated + */ + @Override + public void setPredicateExpression(String newPredicateExpression) { + String oldPredicateExpression = this.predicateExpression; + this.predicateExpression = newPredicateExpression; + if (this.eNotificationRequired()) + this.eNotify(new ENotificationImpl(this, Notification.SET, TreePackage.IF_TREE_ITEM_LABEL_ELEMENT_DESCRIPTION__PREDICATE_EXPRESSION, oldPredicateExpression, this.predicateExpression)); + } + + /** + * + * + * @generated + */ + @Override + public EList getChildren() { + if (this.children == null) { + this.children = new EObjectContainmentEList<>(TreeItemLabelElementDescription.class, this, TreePackage.IF_TREE_ITEM_LABEL_ELEMENT_DESCRIPTION__CHILDREN); + } + return this.children; + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case TreePackage.IF_TREE_ITEM_LABEL_ELEMENT_DESCRIPTION__CHILDREN: + return ((InternalEList) this.getChildren()).basicRemove(otherEnd, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case TreePackage.IF_TREE_ITEM_LABEL_ELEMENT_DESCRIPTION__PREDICATE_EXPRESSION: + return this.getPredicateExpression(); + case TreePackage.IF_TREE_ITEM_LABEL_ELEMENT_DESCRIPTION__CHILDREN: + return this.getChildren(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case TreePackage.IF_TREE_ITEM_LABEL_ELEMENT_DESCRIPTION__PREDICATE_EXPRESSION: + this.setPredicateExpression((String) newValue); + return; + case TreePackage.IF_TREE_ITEM_LABEL_ELEMENT_DESCRIPTION__CHILDREN: + this.getChildren().clear(); + this.getChildren().addAll((Collection) newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case TreePackage.IF_TREE_ITEM_LABEL_ELEMENT_DESCRIPTION__PREDICATE_EXPRESSION: + this.setPredicateExpression(PREDICATE_EXPRESSION_EDEFAULT); + return; + case TreePackage.IF_TREE_ITEM_LABEL_ELEMENT_DESCRIPTION__CHILDREN: + this.getChildren().clear(); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case TreePackage.IF_TREE_ITEM_LABEL_ELEMENT_DESCRIPTION__PREDICATE_EXPRESSION: + return PREDICATE_EXPRESSION_EDEFAULT == null ? this.predicateExpression != null : !PREDICATE_EXPRESSION_EDEFAULT.equals(this.predicateExpression); + case TreePackage.IF_TREE_ITEM_LABEL_ELEMENT_DESCRIPTION__CHILDREN: + return this.children != null && !this.children.isEmpty(); + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public String toString() { + if (this.eIsProxy()) + return super.toString(); + + StringBuilder result = new StringBuilder(super.toString()); + result.append(" (predicateExpression: "); + result.append(this.predicateExpression); + result.append(')'); + return result.toString(); + } + +} // IfTreeItemLabelElementDescriptionImpl diff --git a/packages/view/backend/sirius-components-view-tree/src/main/java/org/eclipse/sirius/components/view/tree/impl/SingleClickTreeItemContextMenuEntryImpl.java b/packages/view/backend/sirius-components-view-tree/src/main/java/org/eclipse/sirius/components/view/tree/impl/SingleClickTreeItemContextMenuEntryImpl.java index 8a156ec171..e990a208e7 100644 --- a/packages/view/backend/sirius-components-view-tree/src/main/java/org/eclipse/sirius/components/view/tree/impl/SingleClickTreeItemContextMenuEntryImpl.java +++ b/packages/view/backend/sirius-components-view-tree/src/main/java/org/eclipse/sirius/components/view/tree/impl/SingleClickTreeItemContextMenuEntryImpl.java @@ -43,9 +43,9 @@ public class SingleClickTreeItemContextMenuEntryImpl extends TreeItemContextMenu * The cached value of the '{@link #getBody() Body}' containment reference list. * * + * @see #getBody() * @generated * @ordered - * @see #getBody() */ protected EList body; diff --git a/packages/view/backend/sirius-components-view-tree/src/main/java/org/eclipse/sirius/components/view/tree/impl/TreeDescriptionImpl.java b/packages/view/backend/sirius-components-view-tree/src/main/java/org/eclipse/sirius/components/view/tree/impl/TreeDescriptionImpl.java index 753a765159..053db3c19f 100644 --- a/packages/view/backend/sirius-components-view-tree/src/main/java/org/eclipse/sirius/components/view/tree/impl/TreeDescriptionImpl.java +++ b/packages/view/backend/sirius-components-view-tree/src/main/java/org/eclipse/sirius/components/view/tree/impl/TreeDescriptionImpl.java @@ -13,7 +13,6 @@ package org.eclipse.sirius.components.view.tree.impl; import java.util.Collection; -import java.util.Objects; import org.eclipse.emf.common.notify.Notification; import org.eclipse.emf.common.notify.NotificationChain; @@ -71,198 +70,219 @@ public class TreeDescriptionImpl extends RepresentationDescriptionImpl implement * The default value of the '{@link #getKindExpression() Kind Expression}' attribute. * + * @see #getKindExpression() * @generated * @ordered - * @see #getKindExpression() */ protected static final String KIND_EXPRESSION_EDEFAULT = null; + /** - * The default value of the '{@link #getIconURLExpression() Icon URL Expression}' attribute. + * The cached value of the '{@link #getKindExpression() Kind Expression}' attribute. * + * @see #getKindExpression() * @generated * @ordered - * @see #getIconURLExpression() */ - protected static final String ICON_URL_EXPRESSION_EDEFAULT = null; + protected String kindExpression = KIND_EXPRESSION_EDEFAULT; + /** - * The default value of the '{@link #getTreeItemIdExpression() Tree Item Id Expression}' attribute. * + * @see #getIconURLExpression() * @generated * @ordered - * @see #getTreeItemIdExpression() */ - protected static final String TREE_ITEM_ID_EXPRESSION_EDEFAULT = null; + protected static final String ICON_URL_EXPRESSION_EDEFAULT = null; + /** - * The default value of the '{@link #getTreeItemObjectExpression() Tree Item Object Expression}' attribute. - * + * The cached value of the '{@link #getIconURLExpression() Icon URL Expression}' attribute. * + * @see #getIconURLExpression() * @generated * @ordered - * @see #getTreeItemObjectExpression() */ - protected static final String TREE_ITEM_OBJECT_EXPRESSION_EDEFAULT = null; + protected String iconURLExpression = ICON_URL_EXPRESSION_EDEFAULT; + /** - * The default value of the '{@link #getElementsExpression() Elements Expression}' attribute. * + * @see #getTreeItemIdExpression() * @generated * @ordered - * @see #getElementsExpression() */ - protected static final String ELEMENTS_EXPRESSION_EDEFAULT = null; + protected static final String TREE_ITEM_ID_EXPRESSION_EDEFAULT = null; + /** - * The default value of the '{@link #getHasChildrenExpression() Has Children Expression}' attribute. * + * @see #getTreeItemIdExpression() * @generated * @ordered - * @see #getHasChildrenExpression() */ - protected static final String HAS_CHILDREN_EXPRESSION_EDEFAULT = null; + protected String treeItemIdExpression = TREE_ITEM_ID_EXPRESSION_EDEFAULT; + /** - * The default value of the '{@link #getChildrenExpression() Children Expression}' attribute. + * The default value of the '{@link #getTreeItemObjectExpression() Tree Item Object Expression}' attribute. + * * + * @see #getTreeItemObjectExpression() * @generated * @ordered - * @see #getChildrenExpression() */ - protected static final String CHILDREN_EXPRESSION_EDEFAULT = null; + protected static final String TREE_ITEM_OBJECT_EXPRESSION_EDEFAULT = null; + /** - * The default value of the '{@link #getParentExpression() Parent Expression}' attribute. + * The cached value of the '{@link #getTreeItemObjectExpression() Tree Item Object Expression}' attribute. + * * + * @see #getTreeItemObjectExpression() * @generated * @ordered - * @see #getParentExpression() */ - protected static final String PARENT_EXPRESSION_EDEFAULT = null; + protected String treeItemObjectExpression = TREE_ITEM_OBJECT_EXPRESSION_EDEFAULT; + /** - * The default value of the '{@link #getEditableExpression() Editable Expression}' attribute. * + * @see #getElementsExpression() * @generated * @ordered - * @see #getEditableExpression() */ - protected static final String EDITABLE_EXPRESSION_EDEFAULT = null; + protected static final String ELEMENTS_EXPRESSION_EDEFAULT = null; + /** - * The default value of the '{@link #getSelectableExpression() Selectable Expression}' attribute. * + * @see #getElementsExpression() * @generated * @ordered - * @see #getSelectableExpression() */ - protected static final String SELECTABLE_EXPRESSION_EDEFAULT = null; + protected String elementsExpression = ELEMENTS_EXPRESSION_EDEFAULT; + /** - * The default value of the '{@link #getDeletableExpression() Deletable Expression}' attribute. * + * @see #getHasChildrenExpression() * @generated * @ordered - * @see #getDeletableExpression() */ - protected static final String DELETABLE_EXPRESSION_EDEFAULT = null; + protected static final String HAS_CHILDREN_EXPRESSION_EDEFAULT = null; + /** - * The cached value of the '{@link #getKindExpression() Kind Expression}' attribute. + * The cached value of the '{@link #getHasChildrenExpression() Has Children Expression}' attribute. * + * @see #getHasChildrenExpression() * @generated * @ordered - * @see #getKindExpression() */ - protected String kindExpression = KIND_EXPRESSION_EDEFAULT; + protected String hasChildrenExpression = HAS_CHILDREN_EXPRESSION_EDEFAULT; + /** - * The cached value of the '{@link #getIconURLExpression() Icon URL Expression}' attribute. * + * @see #getChildrenExpression() * @generated * @ordered - * @see #getIconURLExpression() */ - protected String iconURLExpression = ICON_URL_EXPRESSION_EDEFAULT; + protected static final String CHILDREN_EXPRESSION_EDEFAULT = null; + /** - * The cached value of the '{@link #getTreeItemIdExpression() Tree Item Id Expression}' attribute. * + * @see #getChildrenExpression() * @generated * @ordered - * @see #getTreeItemIdExpression() */ - protected String treeItemIdExpression = TREE_ITEM_ID_EXPRESSION_EDEFAULT; + protected String childrenExpression = CHILDREN_EXPRESSION_EDEFAULT; + /** - * The cached value of the '{@link #getTreeItemObjectExpression() Tree Item Object Expression}' attribute. - * + * The default value of the '{@link #getParentExpression() Parent Expression}' attribute. * + * @see #getParentExpression() * @generated * @ordered - * @see #getTreeItemObjectExpression() */ - protected String treeItemObjectExpression = TREE_ITEM_OBJECT_EXPRESSION_EDEFAULT; + protected static final String PARENT_EXPRESSION_EDEFAULT = null; + /** - * The cached value of the '{@link #getElementsExpression() Elements Expression}' attribute. * + * @see #getParentExpression() * @generated * @ordered - * @see #getElementsExpression() */ - protected String elementsExpression = ELEMENTS_EXPRESSION_EDEFAULT; + protected String parentExpression = PARENT_EXPRESSION_EDEFAULT; + /** - * The cached value of the '{@link #getHasChildrenExpression() Has Children Expression}' attribute. * + * @see #getEditableExpression() * @generated * @ordered - * @see #getHasChildrenExpression() */ - protected String hasChildrenExpression = HAS_CHILDREN_EXPRESSION_EDEFAULT; + protected static final String EDITABLE_EXPRESSION_EDEFAULT = null; + /** - * The cached value of the '{@link #getChildrenExpression() Children Expression}' attribute. * + * @see #getEditableExpression() * @generated * @ordered - * @see #getChildrenExpression() */ - protected String childrenExpression = CHILDREN_EXPRESSION_EDEFAULT; + protected String editableExpression = EDITABLE_EXPRESSION_EDEFAULT; + /** - * The cached value of the '{@link #getParentExpression() Parent Expression}' attribute. * + * @see #getSelectableExpression() * @generated * @ordered - * @see #getParentExpression() */ - protected String parentExpression = PARENT_EXPRESSION_EDEFAULT; + protected static final String SELECTABLE_EXPRESSION_EDEFAULT = null; + /** - * The cached value of the '{@link #getEditableExpression() Editable Expression}' attribute. * + * @see #getSelectableExpression() * @generated * @ordered - * @see #getEditableExpression() */ - protected String editableExpression = EDITABLE_EXPRESSION_EDEFAULT; + protected String selectableExpression = SELECTABLE_EXPRESSION_EDEFAULT; + /** - * The cached value of the '{@link #getSelectableExpression() Selectable Expression}' attribute. * + * @see #getDeletableExpression() * @generated * @ordered - * @see #getSelectableExpression() */ - protected String selectableExpression = SELECTABLE_EXPRESSION_EDEFAULT; + protected static final String DELETABLE_EXPRESSION_EDEFAULT = null; + /** * The cached value of the '{@link #getDeletableExpression() Deletable Expression}' attribute. * + * @see #getDeletableExpression() * @generated * @ordered - * @see #getDeletableExpression() */ protected String deletableExpression = DELETABLE_EXPRESSION_EDEFAULT; @@ -270,19 +290,19 @@ public class TreeDescriptionImpl extends RepresentationDescriptionImpl implement * The cached value of the '{@link #getTreeItemLabelDescriptions() Tree Item Label Descriptions}' * containment reference list. * + * @see #getTreeItemLabelDescriptions() * @generated * @ordered - * @see #getTreeItemLabelDescriptions() */ protected EList treeItemLabelDescriptions; /** - * The cached value of the '{@link #getContextMenuEntries() Context Menu Entries}' reference list. + * The cached value of the '{@link #getContextMenuEntries() Context Menu Entries}' containment reference + * list. * + * @see #getContextMenuEntries() * @generated * @ordered - * @see #getContextMenuEntries() */ protected EList contextMenuEntries; @@ -752,27 +772,27 @@ public void eUnset(int featureID) { public boolean eIsSet(int featureID) { switch (featureID) { case TreePackage.TREE_DESCRIPTION__KIND_EXPRESSION: - return !Objects.equals(KIND_EXPRESSION_EDEFAULT, this.kindExpression); + return KIND_EXPRESSION_EDEFAULT == null ? this.kindExpression != null : !KIND_EXPRESSION_EDEFAULT.equals(this.kindExpression); case TreePackage.TREE_DESCRIPTION__ICON_URL_EXPRESSION: - return !Objects.equals(ICON_URL_EXPRESSION_EDEFAULT, this.iconURLExpression); + return ICON_URL_EXPRESSION_EDEFAULT == null ? this.iconURLExpression != null : !ICON_URL_EXPRESSION_EDEFAULT.equals(this.iconURLExpression); case TreePackage.TREE_DESCRIPTION__TREE_ITEM_ID_EXPRESSION: - return !Objects.equals(TREE_ITEM_ID_EXPRESSION_EDEFAULT, this.treeItemIdExpression); + return TREE_ITEM_ID_EXPRESSION_EDEFAULT == null ? this.treeItemIdExpression != null : !TREE_ITEM_ID_EXPRESSION_EDEFAULT.equals(this.treeItemIdExpression); case TreePackage.TREE_DESCRIPTION__TREE_ITEM_OBJECT_EXPRESSION: - return !Objects.equals(TREE_ITEM_OBJECT_EXPRESSION_EDEFAULT, this.treeItemObjectExpression); + return TREE_ITEM_OBJECT_EXPRESSION_EDEFAULT == null ? this.treeItemObjectExpression != null : !TREE_ITEM_OBJECT_EXPRESSION_EDEFAULT.equals(this.treeItemObjectExpression); case TreePackage.TREE_DESCRIPTION__ELEMENTS_EXPRESSION: - return !Objects.equals(ELEMENTS_EXPRESSION_EDEFAULT, this.elementsExpression); + return ELEMENTS_EXPRESSION_EDEFAULT == null ? this.elementsExpression != null : !ELEMENTS_EXPRESSION_EDEFAULT.equals(this.elementsExpression); case TreePackage.TREE_DESCRIPTION__HAS_CHILDREN_EXPRESSION: - return !Objects.equals(HAS_CHILDREN_EXPRESSION_EDEFAULT, this.hasChildrenExpression); + return HAS_CHILDREN_EXPRESSION_EDEFAULT == null ? this.hasChildrenExpression != null : !HAS_CHILDREN_EXPRESSION_EDEFAULT.equals(this.hasChildrenExpression); case TreePackage.TREE_DESCRIPTION__CHILDREN_EXPRESSION: - return !Objects.equals(CHILDREN_EXPRESSION_EDEFAULT, this.childrenExpression); + return CHILDREN_EXPRESSION_EDEFAULT == null ? this.childrenExpression != null : !CHILDREN_EXPRESSION_EDEFAULT.equals(this.childrenExpression); case TreePackage.TREE_DESCRIPTION__PARENT_EXPRESSION: - return !Objects.equals(PARENT_EXPRESSION_EDEFAULT, this.parentExpression); + return PARENT_EXPRESSION_EDEFAULT == null ? this.parentExpression != null : !PARENT_EXPRESSION_EDEFAULT.equals(this.parentExpression); case TreePackage.TREE_DESCRIPTION__EDITABLE_EXPRESSION: - return !Objects.equals(EDITABLE_EXPRESSION_EDEFAULT, this.editableExpression); + return EDITABLE_EXPRESSION_EDEFAULT == null ? this.editableExpression != null : !EDITABLE_EXPRESSION_EDEFAULT.equals(this.editableExpression); case TreePackage.TREE_DESCRIPTION__SELECTABLE_EXPRESSION: - return !Objects.equals(SELECTABLE_EXPRESSION_EDEFAULT, this.selectableExpression); + return SELECTABLE_EXPRESSION_EDEFAULT == null ? this.selectableExpression != null : !SELECTABLE_EXPRESSION_EDEFAULT.equals(this.selectableExpression); case TreePackage.TREE_DESCRIPTION__DELETABLE_EXPRESSION: - return !Objects.equals(DELETABLE_EXPRESSION_EDEFAULT, this.deletableExpression); + return DELETABLE_EXPRESSION_EDEFAULT == null ? this.deletableExpression != null : !DELETABLE_EXPRESSION_EDEFAULT.equals(this.deletableExpression); case TreePackage.TREE_DESCRIPTION__TREE_ITEM_LABEL_DESCRIPTIONS: return this.treeItemLabelDescriptions != null && !this.treeItemLabelDescriptions.isEmpty(); case TreePackage.TREE_DESCRIPTION__CONTEXT_MENU_ENTRIES: @@ -791,30 +811,31 @@ public String toString() { if (this.eIsProxy()) return super.toString(); - String result = super.toString() + " (kindExpression: " + - this.kindExpression + - ", iconURLExpression: " + - this.iconURLExpression + - ", treeItemIdExpression: " + - this.treeItemIdExpression + - ", treeItemObjectExpression: " + - this.treeItemObjectExpression + - ", elementsExpression: " + - this.elementsExpression + - ", hasChildrenExpression: " + - this.hasChildrenExpression + - ", childrenExpression: " + - this.childrenExpression + - ", parentExpression: " + - this.parentExpression + - ", editableExpression: " + - this.editableExpression + - ", selectableExpression: " + - this.selectableExpression + - ", deletableExpression: " + - this.deletableExpression + - ')'; - return result; + StringBuilder result = new StringBuilder(super.toString()); + result.append(" (kindExpression: "); + result.append(this.kindExpression); + result.append(", iconURLExpression: "); + result.append(this.iconURLExpression); + result.append(", treeItemIdExpression: "); + result.append(this.treeItemIdExpression); + result.append(", treeItemObjectExpression: "); + result.append(this.treeItemObjectExpression); + result.append(", elementsExpression: "); + result.append(this.elementsExpression); + result.append(", hasChildrenExpression: "); + result.append(this.hasChildrenExpression); + result.append(", childrenExpression: "); + result.append(this.childrenExpression); + result.append(", parentExpression: "); + result.append(this.parentExpression); + result.append(", editableExpression: "); + result.append(this.editableExpression); + result.append(", selectableExpression: "); + result.append(this.selectableExpression); + result.append(", deletableExpression: "); + result.append(this.deletableExpression); + result.append(')'); + return result.toString(); } } // TreeDescriptionImpl diff --git a/packages/view/backend/sirius-components-view-tree/src/main/java/org/eclipse/sirius/components/view/tree/impl/TreeFactoryImpl.java b/packages/view/backend/sirius-components-view-tree/src/main/java/org/eclipse/sirius/components/view/tree/impl/TreeFactoryImpl.java index 33e1d96aa3..e17782c42d 100644 --- a/packages/view/backend/sirius-components-view-tree/src/main/java/org/eclipse/sirius/components/view/tree/impl/TreeFactoryImpl.java +++ b/packages/view/backend/sirius-components-view-tree/src/main/java/org/eclipse/sirius/components/view/tree/impl/TreeFactoryImpl.java @@ -20,6 +20,7 @@ import org.eclipse.emf.ecore.plugin.EcorePlugin; import org.eclipse.sirius.components.view.tree.FetchTreeItemContextMenuEntry; import org.eclipse.sirius.components.view.tree.FetchTreeItemContextMenuEntryKind; +import org.eclipse.sirius.components.view.tree.IfTreeItemLabelElementDescription; import org.eclipse.sirius.components.view.tree.SingleClickTreeItemContextMenuEntry; import org.eclipse.sirius.components.view.tree.TreeDescription; import org.eclipse.sirius.components.view.tree.TreeFactory; @@ -33,6 +34,16 @@ * @generated */ public class TreeFactoryImpl extends EFactoryImpl implements TreeFactory { + + /** + * Creates an instance of the factory. + * + * @generated + */ + public TreeFactoryImpl() { + super(); + } + /** * Creates the default factory implementation. * @@ -50,15 +61,6 @@ public static TreeFactory init() { return new TreeFactoryImpl(); } - /** - * Creates an instance of the factory. - * - * @generated - */ - public TreeFactoryImpl() { - super(); - } - /** * * @@ -71,6 +73,8 @@ public EObject create(EClass eClass) { return this.createTreeDescription(); case TreePackage.TREE_ITEM_LABEL_DESCRIPTION: return this.createTreeItemLabelDescription(); + case TreePackage.IF_TREE_ITEM_LABEL_ELEMENT_DESCRIPTION: + return this.createIfTreeItemLabelElementDescription(); case TreePackage.TREE_ITEM_LABEL_FRAGMENT_DESCRIPTION: return this.createTreeItemLabelFragmentDescription(); case TreePackage.SINGLE_CLICK_TREE_ITEM_CONTEXT_MENU_ENTRY: @@ -134,6 +138,17 @@ public TreeItemLabelDescription createTreeItemLabelDescription() { return treeItemLabelDescription; } + /** + * + * + * @generated + */ + @Override + public IfTreeItemLabelElementDescription createIfTreeItemLabelElementDescription() { + IfTreeItemLabelElementDescriptionImpl ifTreeItemLabelElementDescription = new IfTreeItemLabelElementDescriptionImpl(); + return ifTreeItemLabelElementDescription; + } + /** * * diff --git a/packages/view/backend/sirius-components-view-tree/src/main/java/org/eclipse/sirius/components/view/tree/impl/TreeItemContextMenuEntryImpl.java b/packages/view/backend/sirius-components-view-tree/src/main/java/org/eclipse/sirius/components/view/tree/impl/TreeItemContextMenuEntryImpl.java index f113a2ea45..e72b6ee0c5 100644 --- a/packages/view/backend/sirius-components-view-tree/src/main/java/org/eclipse/sirius/components/view/tree/impl/TreeItemContextMenuEntryImpl.java +++ b/packages/view/backend/sirius-components-view-tree/src/main/java/org/eclipse/sirius/components/view/tree/impl/TreeItemContextMenuEntryImpl.java @@ -12,8 +12,6 @@ *******************************************************************************/ package org.eclipse.sirius.components.view.tree.impl; -import java.util.Objects; - import org.eclipse.emf.common.notify.Notification; import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.impl.ENotificationImpl; @@ -45,72 +43,79 @@ public abstract class TreeItemContextMenuEntryImpl extends MinimalEObjectImpl.Co * The default value of the '{@link #getName() Name}' attribute. * + * @see #getName() * @generated * @ordered - * @see #getName() */ protected static final String NAME_EDEFAULT = null; + /** - * The default value of the '{@link #getLabelExpression() Label Expression}' attribute. + * The cached value of the '{@link #getName() Name}' attribute. * + * @see #getName() * @generated * @ordered - * @see #getLabelExpression() */ - protected static final String LABEL_EXPRESSION_EDEFAULT = null; + protected String name = NAME_EDEFAULT; + /** - * The default value of the '{@link #getIconURLExpression() Icon URL Expression}' attribute. + * The default value of the '{@link #getLabelExpression() Label Expression}' attribute. * + * @see #getLabelExpression() * @generated * @ordered - * @see #getIconURLExpression() */ - protected static final String ICON_URL_EXPRESSION_EDEFAULT = null; + protected static final String LABEL_EXPRESSION_EDEFAULT = null; + /** - * The default value of the '{@link #getPreconditionExpression() Precondition Expression}' attribute. + * The cached value of the '{@link #getLabelExpression() Label Expression}' attribute. * + * @see #getLabelExpression() * @generated * @ordered - * @see #getPreconditionExpression() */ - protected static final String PRECONDITION_EXPRESSION_EDEFAULT = null; + protected String labelExpression = LABEL_EXPRESSION_EDEFAULT; + /** - * The cached value of the '{@link #getName() Name}' attribute. + * The default value of the '{@link #getIconURLExpression() Icon URL Expression}' attribute. * + * @see #getIconURLExpression() * @generated * @ordered - * @see #getName() */ - protected String name = NAME_EDEFAULT; + protected static final String ICON_URL_EXPRESSION_EDEFAULT = null; + /** - * The cached value of the '{@link #getLabelExpression() Label Expression}' attribute. + * The cached value of the '{@link #getIconURLExpression() Icon URL Expression}' attribute. * + * @see #getIconURLExpression() * @generated * @ordered - * @see #getLabelExpression() */ - protected String labelExpression = LABEL_EXPRESSION_EDEFAULT; + protected String iconURLExpression = ICON_URL_EXPRESSION_EDEFAULT; + /** - * The cached value of the '{@link #getIconURLExpression() Icon URL Expression}' attribute. * + * @see #getPreconditionExpression() * @generated * @ordered - * @see #getIconURLExpression() */ - protected String iconURLExpression = ICON_URL_EXPRESSION_EDEFAULT; + protected static final String PRECONDITION_EXPRESSION_EDEFAULT = null; + /** * The cached value of the '{@link #getPreconditionExpression() Precondition Expression}' attribute. * + * @see #getPreconditionExpression() * @generated * @ordered - * @see #getPreconditionExpression() */ protected String preconditionExpression = PRECONDITION_EXPRESSION_EDEFAULT; @@ -302,13 +307,13 @@ public void eUnset(int featureID) { public boolean eIsSet(int featureID) { switch (featureID) { case TreePackage.TREE_ITEM_CONTEXT_MENU_ENTRY__NAME: - return !Objects.equals(NAME_EDEFAULT, this.name); + return NAME_EDEFAULT == null ? this.name != null : !NAME_EDEFAULT.equals(this.name); case TreePackage.TREE_ITEM_CONTEXT_MENU_ENTRY__LABEL_EXPRESSION: - return !Objects.equals(LABEL_EXPRESSION_EDEFAULT, this.labelExpression); + return LABEL_EXPRESSION_EDEFAULT == null ? this.labelExpression != null : !LABEL_EXPRESSION_EDEFAULT.equals(this.labelExpression); case TreePackage.TREE_ITEM_CONTEXT_MENU_ENTRY__ICON_URL_EXPRESSION: - return !Objects.equals(ICON_URL_EXPRESSION_EDEFAULT, this.iconURLExpression); + return ICON_URL_EXPRESSION_EDEFAULT == null ? this.iconURLExpression != null : !ICON_URL_EXPRESSION_EDEFAULT.equals(this.iconURLExpression); case TreePackage.TREE_ITEM_CONTEXT_MENU_ENTRY__PRECONDITION_EXPRESSION: - return !Objects.equals(PRECONDITION_EXPRESSION_EDEFAULT, this.preconditionExpression); + return PRECONDITION_EXPRESSION_EDEFAULT == null ? this.preconditionExpression != null : !PRECONDITION_EXPRESSION_EDEFAULT.equals(this.preconditionExpression); } return super.eIsSet(featureID); } @@ -323,16 +328,17 @@ public String toString() { if (this.eIsProxy()) return super.toString(); - String result = super.toString() + " (name: " + - this.name + - ", labelExpression: " + - this.labelExpression + - ", iconURLExpression: " + - this.iconURLExpression + - ", preconditionExpression: " + - this.preconditionExpression + - ')'; - return result; + StringBuilder result = new StringBuilder(super.toString()); + result.append(" (name: "); + result.append(this.name); + result.append(", labelExpression: "); + result.append(this.labelExpression); + result.append(", iconURLExpression: "); + result.append(this.iconURLExpression); + result.append(", preconditionExpression: "); + result.append(this.preconditionExpression); + result.append(')'); + return result.toString(); } } // TreeItemContextMenuEntryImpl diff --git a/packages/view/backend/sirius-components-view-tree/src/main/java/org/eclipse/sirius/components/view/tree/impl/TreePackageImpl.java b/packages/view/backend/sirius-components-view-tree/src/main/java/org/eclipse/sirius/components/view/tree/impl/TreePackageImpl.java index bb2abca330..d61fcd8791 100644 --- a/packages/view/backend/sirius-components-view-tree/src/main/java/org/eclipse/sirius/components/view/tree/impl/TreePackageImpl.java +++ b/packages/view/backend/sirius-components-view-tree/src/main/java/org/eclipse/sirius/components/view/tree/impl/TreePackageImpl.java @@ -21,6 +21,7 @@ import org.eclipse.sirius.components.view.ViewPackage; import org.eclipse.sirius.components.view.tree.FetchTreeItemContextMenuEntry; import org.eclipse.sirius.components.view.tree.FetchTreeItemContextMenuEntryKind; +import org.eclipse.sirius.components.view.tree.IfTreeItemLabelElementDescription; import org.eclipse.sirius.components.view.tree.SingleClickTreeItemContextMenuEntry; import org.eclipse.sirius.components.view.tree.TreeDescription; import org.eclipse.sirius.components.view.tree.TreeFactory; @@ -51,6 +52,13 @@ public class TreePackageImpl extends EPackageImpl implements TreePackage { */ private EClass treeItemLabelDescriptionEClass = null; + /** + * + * + * @generated + */ + private EClass ifTreeItemLabelElementDescriptionEClass = null; + /** * * @@ -92,18 +100,21 @@ public class TreePackageImpl extends EPackageImpl implements TreePackage { * @generated */ private EEnum fetchTreeItemContextMenuEntryKindEEnum = null; + /** * * * @generated */ private static boolean isInited = false; + /** * * * @generated */ private boolean isCreated = false; + /** * * @@ -119,10 +130,10 @@ public class TreePackageImpl extends EPackageImpl implements TreePackage { * performs initialization of the package, or returns the registered package, if one already exists. * - * @generated * @see org.eclipse.emf.ecore.EPackage.Registry * @see org.eclipse.sirius.components.view.tree.TreePackage#eNS_URI * @see #init() + * @generated */ private TreePackageImpl() { super(eNS_URI, TreeFactory.eINSTANCE); @@ -136,10 +147,10 @@ private TreePackageImpl() { * invoke it directly. Instead, they should simply access that field to obtain the package. * * - * @generated * @see #eNS_URI * @see #createPackageContents() * @see #initializePackageContents() + * @generated */ public static TreePackage init() { if (isInited) @@ -348,6 +359,36 @@ public EReference getTreeItemLabelDescription_Children() { return (EReference) this.treeItemLabelDescriptionEClass.getEStructuralFeatures().get(2); } + /** + * + * + * @generated + */ + @Override + public EClass getIfTreeItemLabelElementDescription() { + return this.ifTreeItemLabelElementDescriptionEClass; + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getIfTreeItemLabelElementDescription_PredicateExpression() { + return (EAttribute) this.ifTreeItemLabelElementDescriptionEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EReference getIfTreeItemLabelElementDescription_Children() { + return (EReference) this.ifTreeItemLabelElementDescriptionEClass.getEStructuralFeatures().get(1); + } + /** * * @@ -540,6 +581,10 @@ public void createPackageContents() { this.createEAttribute(this.treeItemLabelDescriptionEClass, TREE_ITEM_LABEL_DESCRIPTION__PRECONDITION_EXPRESSION); this.createEReference(this.treeItemLabelDescriptionEClass, TREE_ITEM_LABEL_DESCRIPTION__CHILDREN); + this.ifTreeItemLabelElementDescriptionEClass = this.createEClass(IF_TREE_ITEM_LABEL_ELEMENT_DESCRIPTION); + this.createEAttribute(this.ifTreeItemLabelElementDescriptionEClass, IF_TREE_ITEM_LABEL_ELEMENT_DESCRIPTION__PREDICATE_EXPRESSION); + this.createEReference(this.ifTreeItemLabelElementDescriptionEClass, IF_TREE_ITEM_LABEL_ELEMENT_DESCRIPTION__CHILDREN); + this.treeItemLabelFragmentDescriptionEClass = this.createEClass(TREE_ITEM_LABEL_FRAGMENT_DESCRIPTION); this.createEAttribute(this.treeItemLabelFragmentDescriptionEClass, TREE_ITEM_LABEL_FRAGMENT_DESCRIPTION__LABEL_EXPRESSION); this.createEReference(this.treeItemLabelFragmentDescriptionEClass, TREE_ITEM_LABEL_FRAGMENT_DESCRIPTION__STYLE); @@ -588,6 +633,7 @@ public void initializePackageContents() { // Add supertypes to classes this.treeDescriptionEClass.getESuperTypes().add(theViewPackage.getRepresentationDescription()); + this.ifTreeItemLabelElementDescriptionEClass.getESuperTypes().add(this.getTreeItemLabelElementDescription()); this.treeItemLabelFragmentDescriptionEClass.getESuperTypes().add(this.getTreeItemLabelElementDescription()); this.singleClickTreeItemContextMenuEntryEClass.getESuperTypes().add(this.getTreeItemContextMenuEntry()); this.fetchTreeItemContextMenuEntryEClass.getESuperTypes().add(this.getTreeItemContextMenuEntry()); @@ -630,6 +676,13 @@ public void initializePackageContents() { this.initEReference(this.getTreeItemLabelDescription_Children(), this.getTreeItemLabelElementDescription(), null, "children", null, 0, -1, TreeItemLabelDescription.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + this.initEClass(this.ifTreeItemLabelElementDescriptionEClass, IfTreeItemLabelElementDescription.class, "IfTreeItemLabelElementDescription", !IS_ABSTRACT, !IS_INTERFACE, + IS_GENERATED_INSTANCE_CLASS); + this.initEAttribute(this.getIfTreeItemLabelElementDescription_PredicateExpression(), theViewPackage.getInterpretedExpression(), "predicateExpression", null, 0, 1, + IfTreeItemLabelElementDescription.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + this.initEReference(this.getIfTreeItemLabelElementDescription_Children(), this.getTreeItemLabelElementDescription(), null, "children", null, 1, -1, IfTreeItemLabelElementDescription.class, + !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + this.initEClass(this.treeItemLabelFragmentDescriptionEClass, TreeItemLabelFragmentDescription.class, "TreeItemLabelFragmentDescription", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); this.initEAttribute(this.getTreeItemLabelFragmentDescription_LabelExpression(), theViewPackage.getInterpretedExpression(), "labelExpression", null, 0, 1, diff --git a/packages/view/backend/sirius-components-view-tree/src/main/java/org/eclipse/sirius/components/view/tree/util/TreeAdapterFactory.java b/packages/view/backend/sirius-components-view-tree/src/main/java/org/eclipse/sirius/components/view/tree/util/TreeAdapterFactory.java index 657a5133e1..0ba0ab05c1 100644 --- a/packages/view/backend/sirius-components-view-tree/src/main/java/org/eclipse/sirius/components/view/tree/util/TreeAdapterFactory.java +++ b/packages/view/backend/sirius-components-view-tree/src/main/java/org/eclipse/sirius/components/view/tree/util/TreeAdapterFactory.java @@ -18,6 +18,7 @@ import org.eclipse.emf.ecore.EObject; import org.eclipse.sirius.components.view.RepresentationDescription; import org.eclipse.sirius.components.view.tree.FetchTreeItemContextMenuEntry; +import org.eclipse.sirius.components.view.tree.IfTreeItemLabelElementDescription; import org.eclipse.sirius.components.view.tree.SingleClickTreeItemContextMenuEntry; import org.eclipse.sirius.components.view.tree.TreeDescription; import org.eclipse.sirius.components.view.tree.TreeItemContextMenuEntry; @@ -34,6 +35,7 @@ * @generated */ public class TreeAdapterFactory extends AdapterFactoryImpl { + /** * The cached model package. * @@ -41,36 +43,6 @@ public class TreeAdapterFactory extends AdapterFactoryImpl { */ protected static TreePackage modelPackage; - /** - * Creates an instance of the adapter factory. - * - * @generated - */ - public TreeAdapterFactory() { - if (modelPackage == null) { - modelPackage = TreePackage.eINSTANCE; - } - } - - /** - * Returns whether this factory is applicable for the type of the object. This - * implementation returns true if the object is either the model's package or is an instance object of - * the model. - * - * @return whether this factory is applicable for the type of the object. - * @generated - */ - @Override - public boolean isFactoryForType(Object object) { - if (object == modelPackage) { - return true; - } - if (object instanceof EObject) { - return ((EObject) object).eClass().getEPackage() == modelPackage; - } - return false; - } - /** * The switch that delegates to the createXXX methods. * @@ -87,6 +59,11 @@ public Adapter caseTreeItemLabelDescription(TreeItemLabelDescription object) { return TreeAdapterFactory.this.createTreeItemLabelDescriptionAdapter(); } + @Override + public Adapter caseIfTreeItemLabelElementDescription(IfTreeItemLabelElementDescription object) { + return TreeAdapterFactory.this.createIfTreeItemLabelElementDescriptionAdapter(); + } + @Override public Adapter caseTreeItemLabelFragmentDescription(TreeItemLabelFragmentDescription object) { return TreeAdapterFactory.this.createTreeItemLabelFragmentDescriptionAdapter(); @@ -123,6 +100,36 @@ public Adapter defaultCase(EObject object) { } }; + /** + * Creates an instance of the adapter factory. + * + * @generated + */ + public TreeAdapterFactory() { + if (modelPackage == null) { + modelPackage = TreePackage.eINSTANCE; + } + } + + /** + * Returns whether this factory is applicable for the type of the object. This + * implementation returns true if the object is either the model's package or is an instance object of + * the model. + * + * @return whether this factory is applicable for the type of the object. + * @generated + */ + @Override + public boolean isFactoryForType(Object object) { + if (object == modelPackage) { + return true; + } + if (object instanceof EObject) { + return ((EObject) object).eClass().getEPackage() == modelPackage; + } + return false; + } + /** * Creates an adapter for the target. * @@ -164,6 +171,20 @@ public Adapter createTreeItemLabelDescriptionAdapter() { return null; } + /** + * Creates a new adapter for an object of class + * '{@link org.eclipse.sirius.components.view.tree.IfTreeItemLabelElementDescription If Tree Item Label Element + * Description}'. This default implementation returns null so that we can easily ignore + * cases; it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.sirius.components.view.tree.IfTreeItemLabelElementDescription + * @generated + */ + public Adapter createIfTreeItemLabelElementDescriptionAdapter() { + return null; + } + /** * Creates a new adapter for an object of class * '{@link org.eclipse.sirius.components.view.tree.TreeItemLabelFragmentDescription Item Label Fragment @@ -214,8 +235,8 @@ public Adapter createTreeItemContextMenuEntryAdapter() { * --> * * @return the new adapter. - * @see org.eclipse.sirius.components.view.tree.SingleClickTreeItemContextMenuEntry * @generated + * @see org.eclipse.sirius.components.view.tree.SingleClickTreeItemContextMenuEntry */ public Adapter createSingleClickTreeItemContextMenuEntryAdapter() { return null; diff --git a/packages/view/backend/sirius-components-view-tree/src/main/java/org/eclipse/sirius/components/view/tree/util/TreeSwitch.java b/packages/view/backend/sirius-components-view-tree/src/main/java/org/eclipse/sirius/components/view/tree/util/TreeSwitch.java index 9d0fd1cc57..e2190990f6 100644 --- a/packages/view/backend/sirius-components-view-tree/src/main/java/org/eclipse/sirius/components/view/tree/util/TreeSwitch.java +++ b/packages/view/backend/sirius-components-view-tree/src/main/java/org/eclipse/sirius/components/view/tree/util/TreeSwitch.java @@ -17,6 +17,7 @@ import org.eclipse.emf.ecore.util.Switch; import org.eclipse.sirius.components.view.RepresentationDescription; import org.eclipse.sirius.components.view.tree.FetchTreeItemContextMenuEntry; +import org.eclipse.sirius.components.view.tree.IfTreeItemLabelElementDescription; import org.eclipse.sirius.components.view.tree.SingleClickTreeItemContextMenuEntry; import org.eclipse.sirius.components.view.tree.TreeDescription; import org.eclipse.sirius.components.view.tree.TreeItemContextMenuEntry; @@ -35,6 +36,7 @@ * @generated */ public class TreeSwitch extends Switch { + /** * The cached model package * @@ -92,6 +94,15 @@ protected T doSwitch(int classifierID, EObject theEObject) { result = this.defaultCase(theEObject); return result; } + case TreePackage.IF_TREE_ITEM_LABEL_ELEMENT_DESCRIPTION: { + IfTreeItemLabelElementDescription ifTreeItemLabelElementDescription = (IfTreeItemLabelElementDescription) theEObject; + T result = this.caseIfTreeItemLabelElementDescription(ifTreeItemLabelElementDescription); + if (result == null) + result = this.caseTreeItemLabelElementDescription(ifTreeItemLabelElementDescription); + if (result == null) + result = this.defaultCase(theEObject); + return result; + } case TreePackage.TREE_ITEM_LABEL_FRAGMENT_DESCRIPTION: { TreeItemLabelFragmentDescription treeItemLabelFragmentDescription = (TreeItemLabelFragmentDescription) theEObject; T result = this.caseTreeItemLabelFragmentDescription(treeItemLabelFragmentDescription); @@ -167,6 +178,22 @@ public T caseTreeItemLabelDescription(TreeItemLabelDescription object) { return null; } + /** + * Returns the result of interpreting the object as an instance of 'If Tree Item Label Element + * Description'. This implementation returns null; returning a non-null result will + * terminate the switch. + * + * @param object + * the target of the switch. + * @return the result of interpreting the object as an instance of 'If Tree Item Label Element + * Description'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseIfTreeItemLabelElementDescription(IfTreeItemLabelElementDescription object) { + return null; + } + /** * Returns the result of interpreting the object as an instance of 'Item Label Fragment Description'. This implementation returns null; returning a non-null result will terminate the switch.