From 57507d0b90da7b88e17ea135091dbdb045c8ba96 Mon Sep 17 00:00:00 2001 From: Stefan Kapferer Date: Wed, 21 Oct 2026 23:03:49 +0200 Subject: [PATCH 1/7] Move Freemarker sample templates out of the Eclipse plugin The templates were only reachable via an Eclipse example wizard. They now live in samples/freemarker at the repository root. --- .../generation/GenericTextFileGeneratorCommandTest.xtend | 4 ++-- samples/freemarker/README.md | 8 ++++++++ .../freemarker/csv-files/stakeholders.csv.ftl | 0 .../freemarker/csv-files/value-registers.csv.ftl | 0 .../samples => samples}/freemarker/jhipster/JDL.ftl | 0 .../freemarker/jhipster/JHipster-Microservices.jdl.ftl | 0 .../freemarker/jhipster/JHipster-Monolith.jdl.ftl | 0 .../markdown-templates/FullReportTemplate.md.ftl | 0 .../freemarker/markdown-templates/GlossaryTemplate.md.ftl | 0 .../bounded-contexts/bounded-context-list-detailed.ftl | 0 .../bounded-contexts/bounded-context-list-glossary.ftl | 0 .../bounded-contexts/bounded-context-list-simple.ftl | 0 .../freemarker/markdown-templates/common/header.md.ftl | 0 .../domain-object-attribute-and-operation-tables.ftl | 0 .../domains/domain-list-glossary.md.ftl | 0 .../markdown-templates/domains/domain-list.md.ftl | 0 .../markdown-templates/flows/application_flow.ftl | 0 .../markdown-templates/states/state_transition.ftl | 0 .../freemarker/sample-models/OnlineShopScenario.cml | 0 .../freemarker/sample-models/TacticDDDModelSkeleton.cml | 0 20 files changed, 10 insertions(+), 2 deletions(-) create mode 100644 samples/freemarker/README.md rename {org.contextmapper.dsl.ui/samples => samples}/freemarker/csv-files/stakeholders.csv.ftl (100%) rename {org.contextmapper.dsl.ui/samples => samples}/freemarker/csv-files/value-registers.csv.ftl (100%) rename {org.contextmapper.dsl.ui/samples => samples}/freemarker/jhipster/JDL.ftl (100%) rename {org.contextmapper.dsl.ui/samples => samples}/freemarker/jhipster/JHipster-Microservices.jdl.ftl (100%) rename {org.contextmapper.dsl.ui/samples => samples}/freemarker/jhipster/JHipster-Monolith.jdl.ftl (100%) rename {org.contextmapper.dsl.ui/samples => samples}/freemarker/markdown-templates/FullReportTemplate.md.ftl (100%) rename {org.contextmapper.dsl.ui/samples => samples}/freemarker/markdown-templates/GlossaryTemplate.md.ftl (100%) rename {org.contextmapper.dsl.ui/samples => samples}/freemarker/markdown-templates/bounded-contexts/bounded-context-list-detailed.ftl (100%) rename {org.contextmapper.dsl.ui/samples => samples}/freemarker/markdown-templates/bounded-contexts/bounded-context-list-glossary.ftl (100%) rename {org.contextmapper.dsl.ui/samples => samples}/freemarker/markdown-templates/bounded-contexts/bounded-context-list-simple.ftl (100%) rename {org.contextmapper.dsl.ui/samples => samples}/freemarker/markdown-templates/common/header.md.ftl (100%) rename {org.contextmapper.dsl.ui/samples => samples}/freemarker/markdown-templates/domain-objects/domain-object-attribute-and-operation-tables.ftl (100%) rename {org.contextmapper.dsl.ui/samples => samples}/freemarker/markdown-templates/domains/domain-list-glossary.md.ftl (100%) rename {org.contextmapper.dsl.ui/samples => samples}/freemarker/markdown-templates/domains/domain-list.md.ftl (100%) rename {org.contextmapper.dsl.ui/samples => samples}/freemarker/markdown-templates/flows/application_flow.ftl (100%) rename {org.contextmapper.dsl.ui/samples => samples}/freemarker/markdown-templates/states/state_transition.ftl (100%) rename {org.contextmapper.dsl.ui/samples => samples}/freemarker/sample-models/OnlineShopScenario.cml (100%) rename {org.contextmapper.dsl.ui/samples => samples}/freemarker/sample-models/TacticDDDModelSkeleton.cml (100%) diff --git a/org.contextmapper.dsl.ide.tests/src/org/contextmapper/dsl/ide/tests/commands/generation/GenericTextFileGeneratorCommandTest.xtend b/org.contextmapper.dsl.ide.tests/src/org/contextmapper/dsl/ide/tests/commands/generation/GenericTextFileGeneratorCommandTest.xtend index 6bef5d90..3f1f0876 100644 --- a/org.contextmapper.dsl.ide.tests/src/org/contextmapper/dsl/ide/tests/commands/generation/GenericTextFileGeneratorCommandTest.xtend +++ b/org.contextmapper.dsl.ide.tests/src/org/contextmapper/dsl/ide/tests/commands/generation/GenericTextFileGeneratorCommandTest.xtend @@ -46,7 +46,7 @@ class GenericTextFileGeneratorCommandTest extends AbstractCMLCommandTest { val paramObject = new JsonObject paramObject.add("templateUri", new JsonPrimitive( - new File("./../org.contextmapper.dsl.ui/samples/freemarker/jhipster/JDL.ftl").toURI.toString)) + new File("./../samples/freemarker/jhipster/JDL.ftl").toURI.toString)) paramObject.add("outputFileName", new JsonPrimitive("entities.jdl")) val paramArray = new JsonArray paramArray.add(paramObject) @@ -100,7 +100,7 @@ class GenericTextFileGeneratorCommandTest extends AbstractCMLCommandTest { // when val paramObject = new JsonObject paramObject.add("templateUri", - new JsonPrimitive(new File("./../org.contextmapper.dsl.ui/samples/freemarker/jhipster/JDL.ftl").toString)) // no correct URI (does not start with file:) + new JsonPrimitive(new File("./../samples/freemarker/jhipster/JDL.ftl").toString)) // no correct URI (does not start with file:) paramObject.add("outputFileName", new JsonPrimitive("entities.jdl")) val paramArray = new JsonArray paramArray.add(paramObject) diff --git a/samples/freemarker/README.md b/samples/freemarker/README.md new file mode 100644 index 00000000..64de1e8c --- /dev/null +++ b/samples/freemarker/README.md @@ -0,0 +1,8 @@ +# Freemarker Template Samples + +Sample templates for the [generic generator](https://contextmapper.org/docs/generic-freemarker-generator/) ("Generate Text File with Freemarker Template"): + +* `markdown-templates`: Markdown reports (full report, glossary, Bounded Context lists, flows, state transitions) +* `jhipster`: JHipster Domain Language (JDL) files for monoliths and microservices +* `csv-files`: CSV exports of stakeholders and value registers +* `sample-models`: CML models to try the templates with diff --git a/org.contextmapper.dsl.ui/samples/freemarker/csv-files/stakeholders.csv.ftl b/samples/freemarker/csv-files/stakeholders.csv.ftl similarity index 100% rename from org.contextmapper.dsl.ui/samples/freemarker/csv-files/stakeholders.csv.ftl rename to samples/freemarker/csv-files/stakeholders.csv.ftl diff --git a/org.contextmapper.dsl.ui/samples/freemarker/csv-files/value-registers.csv.ftl b/samples/freemarker/csv-files/value-registers.csv.ftl similarity index 100% rename from org.contextmapper.dsl.ui/samples/freemarker/csv-files/value-registers.csv.ftl rename to samples/freemarker/csv-files/value-registers.csv.ftl diff --git a/org.contextmapper.dsl.ui/samples/freemarker/jhipster/JDL.ftl b/samples/freemarker/jhipster/JDL.ftl similarity index 100% rename from org.contextmapper.dsl.ui/samples/freemarker/jhipster/JDL.ftl rename to samples/freemarker/jhipster/JDL.ftl diff --git a/org.contextmapper.dsl.ui/samples/freemarker/jhipster/JHipster-Microservices.jdl.ftl b/samples/freemarker/jhipster/JHipster-Microservices.jdl.ftl similarity index 100% rename from org.contextmapper.dsl.ui/samples/freemarker/jhipster/JHipster-Microservices.jdl.ftl rename to samples/freemarker/jhipster/JHipster-Microservices.jdl.ftl diff --git a/org.contextmapper.dsl.ui/samples/freemarker/jhipster/JHipster-Monolith.jdl.ftl b/samples/freemarker/jhipster/JHipster-Monolith.jdl.ftl similarity index 100% rename from org.contextmapper.dsl.ui/samples/freemarker/jhipster/JHipster-Monolith.jdl.ftl rename to samples/freemarker/jhipster/JHipster-Monolith.jdl.ftl diff --git a/org.contextmapper.dsl.ui/samples/freemarker/markdown-templates/FullReportTemplate.md.ftl b/samples/freemarker/markdown-templates/FullReportTemplate.md.ftl similarity index 100% rename from org.contextmapper.dsl.ui/samples/freemarker/markdown-templates/FullReportTemplate.md.ftl rename to samples/freemarker/markdown-templates/FullReportTemplate.md.ftl diff --git a/org.contextmapper.dsl.ui/samples/freemarker/markdown-templates/GlossaryTemplate.md.ftl b/samples/freemarker/markdown-templates/GlossaryTemplate.md.ftl similarity index 100% rename from org.contextmapper.dsl.ui/samples/freemarker/markdown-templates/GlossaryTemplate.md.ftl rename to samples/freemarker/markdown-templates/GlossaryTemplate.md.ftl diff --git a/org.contextmapper.dsl.ui/samples/freemarker/markdown-templates/bounded-contexts/bounded-context-list-detailed.ftl b/samples/freemarker/markdown-templates/bounded-contexts/bounded-context-list-detailed.ftl similarity index 100% rename from org.contextmapper.dsl.ui/samples/freemarker/markdown-templates/bounded-contexts/bounded-context-list-detailed.ftl rename to samples/freemarker/markdown-templates/bounded-contexts/bounded-context-list-detailed.ftl diff --git a/org.contextmapper.dsl.ui/samples/freemarker/markdown-templates/bounded-contexts/bounded-context-list-glossary.ftl b/samples/freemarker/markdown-templates/bounded-contexts/bounded-context-list-glossary.ftl similarity index 100% rename from org.contextmapper.dsl.ui/samples/freemarker/markdown-templates/bounded-contexts/bounded-context-list-glossary.ftl rename to samples/freemarker/markdown-templates/bounded-contexts/bounded-context-list-glossary.ftl diff --git a/org.contextmapper.dsl.ui/samples/freemarker/markdown-templates/bounded-contexts/bounded-context-list-simple.ftl b/samples/freemarker/markdown-templates/bounded-contexts/bounded-context-list-simple.ftl similarity index 100% rename from org.contextmapper.dsl.ui/samples/freemarker/markdown-templates/bounded-contexts/bounded-context-list-simple.ftl rename to samples/freemarker/markdown-templates/bounded-contexts/bounded-context-list-simple.ftl diff --git a/org.contextmapper.dsl.ui/samples/freemarker/markdown-templates/common/header.md.ftl b/samples/freemarker/markdown-templates/common/header.md.ftl similarity index 100% rename from org.contextmapper.dsl.ui/samples/freemarker/markdown-templates/common/header.md.ftl rename to samples/freemarker/markdown-templates/common/header.md.ftl diff --git a/org.contextmapper.dsl.ui/samples/freemarker/markdown-templates/domain-objects/domain-object-attribute-and-operation-tables.ftl b/samples/freemarker/markdown-templates/domain-objects/domain-object-attribute-and-operation-tables.ftl similarity index 100% rename from org.contextmapper.dsl.ui/samples/freemarker/markdown-templates/domain-objects/domain-object-attribute-and-operation-tables.ftl rename to samples/freemarker/markdown-templates/domain-objects/domain-object-attribute-and-operation-tables.ftl diff --git a/org.contextmapper.dsl.ui/samples/freemarker/markdown-templates/domains/domain-list-glossary.md.ftl b/samples/freemarker/markdown-templates/domains/domain-list-glossary.md.ftl similarity index 100% rename from org.contextmapper.dsl.ui/samples/freemarker/markdown-templates/domains/domain-list-glossary.md.ftl rename to samples/freemarker/markdown-templates/domains/domain-list-glossary.md.ftl diff --git a/org.contextmapper.dsl.ui/samples/freemarker/markdown-templates/domains/domain-list.md.ftl b/samples/freemarker/markdown-templates/domains/domain-list.md.ftl similarity index 100% rename from org.contextmapper.dsl.ui/samples/freemarker/markdown-templates/domains/domain-list.md.ftl rename to samples/freemarker/markdown-templates/domains/domain-list.md.ftl diff --git a/org.contextmapper.dsl.ui/samples/freemarker/markdown-templates/flows/application_flow.ftl b/samples/freemarker/markdown-templates/flows/application_flow.ftl similarity index 100% rename from org.contextmapper.dsl.ui/samples/freemarker/markdown-templates/flows/application_flow.ftl rename to samples/freemarker/markdown-templates/flows/application_flow.ftl diff --git a/org.contextmapper.dsl.ui/samples/freemarker/markdown-templates/states/state_transition.ftl b/samples/freemarker/markdown-templates/states/state_transition.ftl similarity index 100% rename from org.contextmapper.dsl.ui/samples/freemarker/markdown-templates/states/state_transition.ftl rename to samples/freemarker/markdown-templates/states/state_transition.ftl diff --git a/org.contextmapper.dsl.ui/samples/freemarker/sample-models/OnlineShopScenario.cml b/samples/freemarker/sample-models/OnlineShopScenario.cml similarity index 100% rename from org.contextmapper.dsl.ui/samples/freemarker/sample-models/OnlineShopScenario.cml rename to samples/freemarker/sample-models/OnlineShopScenario.cml diff --git a/org.contextmapper.dsl.ui/samples/freemarker/sample-models/TacticDDDModelSkeleton.cml b/samples/freemarker/sample-models/TacticDDDModelSkeleton.cml similarity index 100% rename from org.contextmapper.dsl.ui/samples/freemarker/sample-models/TacticDDDModelSkeleton.cml rename to samples/freemarker/sample-models/TacticDDDModelSkeleton.cml From 83a2425fc44be61391eb1e6c0b00cde220e67f05 Mon Sep 17 00:00:00 2001 From: Stefan Kapferer Date: Wed, 21 Oct 2026 23:04:00 +0200 Subject: [PATCH 2/7] Remove the Eclipse plugin Context Mapper is only provided as language server (VS Code extension) and standalone library from now on. Removed modules: UI, UI tests, feature, p2 update site and target platform. --- org.contextmapper.dsl.feature/.project | 23 - .../build.properties | 1 - org.contextmapper.dsl.feature/feature.xml | 246 ---- org.contextmapper.dsl.feature/pom.xml | 14 - org.contextmapper.dsl.repository/.project | 17 - org.contextmapper.dsl.repository/category.xml | 18 - .../packaging-p2composite.ant | 121 -- org.contextmapper.dsl.repository/pom.xml | 329 ------ org.contextmapper.dsl.target/.project | 17 - .../org.contextmapper.dsl.target.target | 61 - org.contextmapper.dsl.target/pom.xml | 11 - org.contextmapper.dsl.ui.tests/.classpath | 15 - org.contextmapper.dsl.ui.tests/.project | 40 - .../META-INF/MANIFEST.MF | 21 - .../build.properties | 6 - org.contextmapper.dsl.ui.tests/pom.xml | 10 - org.contextmapper.dsl.ui/.classpath | 9 - org.contextmapper.dsl.ui/.project | 40 - org.contextmapper.dsl.ui/META-INF/MANIFEST.MF | 31 - org.contextmapper.dsl.ui/about.ini | 7 - org.contextmapper.dsl.ui/build.properties | 10 - org.contextmapper.dsl.ui/icons/cml-32x32.png | Bin 2331 -> 0 bytes .../icons/cml-dialog-image.png | Bin 4443 -> 0 bytes org.contextmapper.dsl.ui/icons/cml.png | Bin 1613 -> 0 bytes org.contextmapper.dsl.ui/plugin.xml | 1010 ----------------- org.contextmapper.dsl.ui/pom.xml | 20 - .../dsl/ui/ContextMappingDSLUiModule.xtend | 43 - .../dsl/ui/actions/GeneratorsActionGroup.java | 125 -- .../ui/actions/RefactoringActionGroup.java | 116 -- .../ContextMappingDSLProposalProvider.xtend | 24 - .../dsl/ui/editor/CMLEditor.java | 69 -- .../dsl/ui/editor/CMLQuickMenuCreator.java | 35 - .../dsl/ui/editor/XtextEditorHelper.java | 75 -- .../ui/handler/AbstractGenerationHandler.java | 227 ---- .../handler/AbstractRefactoringHandler.java | 173 --- ...stractRefactoringWithUserInputHandler.java | 41 - ...dEthicalValueAssessmentToStoryHandler.java | 50 - .../handler/ContextMapGenerationHandler.java | 117 -- ...ggregatesByCohesionRefactoringHandler.java | 60 - ...regatesByVolatilityRefactoringHandler.java | 63 - ...ExtractSharedKernelRefactoringHandler.java | 49 - ...ystemsFromFeatureBCRefactoringHandler.java | 85 -- ...ontextFromSubdomainRefactoringHandler.java | 61 - ...romUserRequirementsRefactoringHandler.java | 75 -- .../GenericTextFileGenerationHandler.java | 126 -- .../dsl/ui/handler/MDSLGenerationHandler.java | 33 - .../MergeAggregatesRefactoringHandler.java | 75 -- ...ergeBoundedContextsRefactoringHandler.java | 75 -- .../ui/handler/PlantUMLGenerationHandler.java | 33 - .../handler/SketchMinerGenerationHandler.java | 33 - ...AggregateByEntitiesRefactoringHandler.java | 60 - ...undedContextByOwnerRefactoringHandler.java | 54 - ...edContextByUseCasesRefactoringHandler.java | 56 - ...ystemIntoSubsystemsRefactoringHandler.java | 82 -- .../SuspendPartnershipRefactoringHandler.java | 72 -- ...rshipToSharedKernelRefactoringHandler.java | 49 - ...KernelToPartnershipRefactoringHandler.java | 49 - .../dsl/ui/handler/XMIGenerationHandler.java | 33 - ...ateStakeholderForUserStoryRoleHandler.java | 56 - .../CreateValue4StakeholderHandler.java | 49 - .../MoveStakeholderToNewGroupHandler.java | 49 - ...ValueRegisterForBoundedContextHandler.java | 56 - .../WrapValueInClusterHandler.java | 54 - .../ChooseName4NewBoundedContextContext.java | 34 - .../ChooseName4NewBoundedContextWizard.java | 53 - ...riveBackendFrontendFromFeatureContext.java | 114 -- ...ckendFrontendSystemsFromFeatureWizard.java | 60 - ...veBoundedContextFromSubdomainsContext.java | 56 - ...iveBoundedContextFromSubdomainsWizard.java | 54 - ...riveSubdomainsFromRequirementsContext.java | 65 -- ...eriveSubdomainsFromRequirementsWizard.java | 54 - .../ExtractAggregatesByCohesionContext.java | 51 - ...AggregatesByCohesionRefactoringWizard.java | 54 - .../ExtractAggregatesByVolatilityContext.java | 43 - ...gregatesByVolatilityRefactoringWizard.java | 53 - .../wizard/GenerateContextMapContext.java | 99 -- .../wizard/GenerateContextMapWizard.java | 60 - .../GenerateGenericTextFileContext.java | 45 - .../wizard/GenerateGenericTextFileWizard.java | 56 - .../wizard/MergeAggregatesContext.java | 65 -- .../MergeAggregatesRefactoringWizard.java | 55 - .../wizard/MergeBoundedContextsContext.java | 65 -- ...MergeBoundedContextsRefactoringWizard.java | 55 - .../SplitSystemIntoSubsystemsContext.java | 106 -- .../SplitSystemIntoSubsystemsWizard.java | 59 - .../wizard/SuspendPartnershipContext.java | 82 -- .../SuspendPartnershipRefactoringWizard.java | 87 -- .../pages/AggregateSelectionWizardPage.java | 145 --- .../wizard/pages/ContextMapperWizardPage.java | 24 - ...dFrontendSystemsFromFeatureWizardPage.java | 249 ---- ...oundedContextFromSubdomainsWizardPage.java | 131 --- ...veSubdomainFromRequirementsWizardPage.java | 200 ---- .../pages/GenerateContextMapWizardPage.java | 252 ---- .../GenerateGenericTextFileWizardPage.java | 115 -- ...ikelihoodForChangeSelectionWizardPage.java | 118 -- .../NewBoundedContextNameWizardPage.java | 89 -- .../SplitSystemIntoSubsystemsWizardPage.java | 263 ----- .../pages/SuspendPartnershipWizardPage.java | 183 --- .../TwoAggregatesSelectionWizardPage.java | 158 --- .../TwoBoundedContextSelectionWizardPage.java | 180 --- .../components/FileByExtensionChooser.java | 182 --- .../components/FreemarkerFileChooser.java | 41 - .../pages/components/SCLFileChooser.java | 40 - .../dsl/ui/hover/CMLHoverProvider.java | 56 - .../ui/hover/CMLKeywordAtOffsetHelper.java | 49 - .../CMLXbaseDispatchingEObjectTextHover.java | 78 -- .../ui/images/CMLImageDescriptionFactory.java | 46 - ...xtMappingDSLDescriptionLabelProvider.xtend | 36 - .../ContextMappingDSLLabelProvider.xtend | 43 - ...ContextMappingDSLOutlineTreeProvider.xtend | 27 - .../dsl/ui/quickfix/CMLTextEditComposer.java | 34 - .../ContextMappingDSLQuickfixProvider.xtend | 116 -- .../context/SelectStoryVerbsContext.java | 58 - .../SelectStoryVerbsContextCreator.java | 36 - .../wizard/SelectStoryVerbsWizard.java | 50 - .../page/SelectUserStoryVerbsWizardPage.java | 124 -- .../dsl/ui/wizard/NewCMLFileWizard.java | 90 -- .../page/WizardNewCMLFileCreationPage.java | 27 - ...erviceCutterConfigurationDSLUiModule.xtend | 25 - .../dsl/ui/actions/GeneratorsActionGroup.java | 117 -- ...tterConfigurationDSLProposalProvider.xtend | 24 - .../dsl/ui/editor/SCLEditor.java | 62 - ...igurationDSLDescriptionLabelProvider.xtend | 36 - ...eCutterConfigurationDSLLabelProvider.xtend | 43 - ...rConfigurationDSLOutlineTreeProvider.xtend | 27 - ...tterConfigurationDSLQuickfixProvider.xtend | 36 - .../dsl/ui/TacticDDDLanguageUiModule.xtend | 25 - .../TacticDDDLanguageProposalProvider.xtend | 24 - ...cDDDLanguageDescriptionLabelProvider.xtend | 36 - .../TacticDDDLanguageLabelProvider.xtend | 43 - ...TacticDDDLanguageOutlineTreeProvider.xtend | 27 - .../TacticDDDLanguageQuickfixProvider.xtend | 36 - 132 files changed, 9985 deletions(-) delete mode 100644 org.contextmapper.dsl.feature/.project delete mode 100644 org.contextmapper.dsl.feature/build.properties delete mode 100644 org.contextmapper.dsl.feature/feature.xml delete mode 100644 org.contextmapper.dsl.feature/pom.xml delete mode 100644 org.contextmapper.dsl.repository/.project delete mode 100644 org.contextmapper.dsl.repository/category.xml delete mode 100644 org.contextmapper.dsl.repository/packaging-p2composite.ant delete mode 100644 org.contextmapper.dsl.repository/pom.xml delete mode 100644 org.contextmapper.dsl.target/.project delete mode 100644 org.contextmapper.dsl.target/org.contextmapper.dsl.target.target delete mode 100644 org.contextmapper.dsl.target/pom.xml delete mode 100644 org.contextmapper.dsl.ui.tests/.classpath delete mode 100644 org.contextmapper.dsl.ui.tests/.project delete mode 100644 org.contextmapper.dsl.ui.tests/META-INF/MANIFEST.MF delete mode 100644 org.contextmapper.dsl.ui.tests/build.properties delete mode 100644 org.contextmapper.dsl.ui.tests/pom.xml delete mode 100644 org.contextmapper.dsl.ui/.classpath delete mode 100644 org.contextmapper.dsl.ui/.project delete mode 100644 org.contextmapper.dsl.ui/META-INF/MANIFEST.MF delete mode 100644 org.contextmapper.dsl.ui/about.ini delete mode 100644 org.contextmapper.dsl.ui/build.properties delete mode 100644 org.contextmapper.dsl.ui/icons/cml-32x32.png delete mode 100644 org.contextmapper.dsl.ui/icons/cml-dialog-image.png delete mode 100644 org.contextmapper.dsl.ui/icons/cml.png delete mode 100644 org.contextmapper.dsl.ui/plugin.xml delete mode 100644 org.contextmapper.dsl.ui/pom.xml delete mode 100644 org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/ContextMappingDSLUiModule.xtend delete mode 100644 org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/actions/GeneratorsActionGroup.java delete mode 100644 org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/actions/RefactoringActionGroup.java delete mode 100644 org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/contentassist/ContextMappingDSLProposalProvider.xtend delete mode 100644 org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/editor/CMLEditor.java delete mode 100644 org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/editor/CMLQuickMenuCreator.java delete mode 100644 org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/editor/XtextEditorHelper.java delete mode 100644 org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/AbstractGenerationHandler.java delete mode 100644 org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/AbstractRefactoringHandler.java delete mode 100644 org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/AbstractRefactoringWithUserInputHandler.java delete mode 100644 org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/AddEthicalValueAssessmentToStoryHandler.java delete mode 100644 org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/ContextMapGenerationHandler.java delete mode 100644 org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/ExtractAggregatesByCohesionRefactoringHandler.java delete mode 100644 org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/ExtractAggregatesByVolatilityRefactoringHandler.java delete mode 100644 org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/ExtractSharedKernelRefactoringHandler.java delete mode 100644 org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/GenerateBackendFrontendSystemsFromFeatureBCRefactoringHandler.java delete mode 100644 org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/GenerateBoundedContextFromSubdomainRefactoringHandler.java delete mode 100644 org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/GenerateSubdomainFromUserRequirementsRefactoringHandler.java delete mode 100644 org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/GenericTextFileGenerationHandler.java delete mode 100644 org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/MDSLGenerationHandler.java delete mode 100644 org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/MergeAggregatesRefactoringHandler.java delete mode 100644 org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/MergeBoundedContextsRefactoringHandler.java delete mode 100644 org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/PlantUMLGenerationHandler.java delete mode 100644 org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/SketchMinerGenerationHandler.java delete mode 100644 org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/SplitAggregateByEntitiesRefactoringHandler.java delete mode 100644 org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/SplitBoundedContextByOwnerRefactoringHandler.java delete mode 100644 org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/SplitBoundedContextByUseCasesRefactoringHandler.java delete mode 100644 org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/SplitSystemIntoSubsystemsRefactoringHandler.java delete mode 100644 org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/SuspendPartnershipRefactoringHandler.java delete mode 100644 org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/SwitchFromPartnershipToSharedKernelRefactoringHandler.java delete mode 100644 org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/SwitchFromSharedKernelToPartnershipRefactoringHandler.java delete mode 100644 org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/XMIGenerationHandler.java delete mode 100644 org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/stakeholders/CreateStakeholderForUserStoryRoleHandler.java delete mode 100644 org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/stakeholders/CreateValue4StakeholderHandler.java delete mode 100644 org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/stakeholders/MoveStakeholderToNewGroupHandler.java delete mode 100644 org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/value_registers/CreateValueRegisterForBoundedContextHandler.java delete mode 100644 org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/value_registers/WrapValueInClusterHandler.java delete mode 100644 org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/wizard/ChooseName4NewBoundedContextContext.java delete mode 100644 org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/wizard/ChooseName4NewBoundedContextWizard.java delete mode 100644 org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/wizard/DeriveBackendFrontendFromFeatureContext.java delete mode 100644 org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/wizard/DeriveBackendFrontendSystemsFromFeatureWizard.java delete mode 100644 org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/wizard/DeriveBoundedContextFromSubdomainsContext.java delete mode 100644 org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/wizard/DeriveBoundedContextFromSubdomainsWizard.java delete mode 100644 org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/wizard/DeriveSubdomainsFromRequirementsContext.java delete mode 100644 org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/wizard/DeriveSubdomainsFromRequirementsWizard.java delete mode 100644 org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/wizard/ExtractAggregatesByCohesionContext.java delete mode 100644 org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/wizard/ExtractAggregatesByCohesionRefactoringWizard.java delete mode 100644 org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/wizard/ExtractAggregatesByVolatilityContext.java delete mode 100644 org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/wizard/ExtractAggregatesByVolatilityRefactoringWizard.java delete mode 100644 org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/wizard/GenerateContextMapContext.java delete mode 100644 org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/wizard/GenerateContextMapWizard.java delete mode 100644 org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/wizard/GenerateGenericTextFileContext.java delete mode 100644 org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/wizard/GenerateGenericTextFileWizard.java delete mode 100644 org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/wizard/MergeAggregatesContext.java delete mode 100644 org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/wizard/MergeAggregatesRefactoringWizard.java delete mode 100644 org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/wizard/MergeBoundedContextsContext.java delete mode 100644 org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/wizard/MergeBoundedContextsRefactoringWizard.java delete mode 100644 org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/wizard/SplitSystemIntoSubsystemsContext.java delete mode 100644 org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/wizard/SplitSystemIntoSubsystemsWizard.java delete mode 100644 org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/wizard/SuspendPartnershipContext.java delete mode 100644 org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/wizard/SuspendPartnershipRefactoringWizard.java delete mode 100644 org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/wizard/pages/AggregateSelectionWizardPage.java delete mode 100644 org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/wizard/pages/ContextMapperWizardPage.java delete mode 100644 org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/wizard/pages/DeriveBackendFrontendSystemsFromFeatureWizardPage.java delete mode 100644 org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/wizard/pages/DeriveBoundedContextFromSubdomainsWizardPage.java delete mode 100644 org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/wizard/pages/DeriveSubdomainFromRequirementsWizardPage.java delete mode 100644 org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/wizard/pages/GenerateContextMapWizardPage.java delete mode 100644 org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/wizard/pages/GenerateGenericTextFileWizardPage.java delete mode 100644 org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/wizard/pages/LikelihoodForChangeSelectionWizardPage.java delete mode 100644 org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/wizard/pages/NewBoundedContextNameWizardPage.java delete mode 100644 org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/wizard/pages/SplitSystemIntoSubsystemsWizardPage.java delete mode 100644 org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/wizard/pages/SuspendPartnershipWizardPage.java delete mode 100644 org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/wizard/pages/TwoAggregatesSelectionWizardPage.java delete mode 100644 org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/wizard/pages/TwoBoundedContextSelectionWizardPage.java delete mode 100644 org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/wizard/pages/components/FileByExtensionChooser.java delete mode 100644 org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/wizard/pages/components/FreemarkerFileChooser.java delete mode 100644 org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/wizard/pages/components/SCLFileChooser.java delete mode 100644 org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/hover/CMLHoverProvider.java delete mode 100644 org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/hover/CMLKeywordAtOffsetHelper.java delete mode 100644 org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/hover/CMLXbaseDispatchingEObjectTextHover.java delete mode 100644 org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/images/CMLImageDescriptionFactory.java delete mode 100644 org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/labeling/ContextMappingDSLDescriptionLabelProvider.xtend delete mode 100644 org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/labeling/ContextMappingDSLLabelProvider.xtend delete mode 100644 org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/outline/ContextMappingDSLOutlineTreeProvider.xtend delete mode 100644 org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/quickfix/CMLTextEditComposer.java delete mode 100644 org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/quickfix/ContextMappingDSLQuickfixProvider.xtend delete mode 100644 org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/quickfix/context/SelectStoryVerbsContext.java delete mode 100644 org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/quickfix/context/SelectStoryVerbsContextCreator.java delete mode 100644 org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/quickfix/wizard/SelectStoryVerbsWizard.java delete mode 100644 org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/quickfix/wizard/page/SelectUserStoryVerbsWizardPage.java delete mode 100644 org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/wizard/NewCMLFileWizard.java delete mode 100644 org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/wizard/page/WizardNewCMLFileCreationPage.java delete mode 100644 org.contextmapper.dsl.ui/src/org/contextmapper/servicecutter/dsl/ui/ServiceCutterConfigurationDSLUiModule.xtend delete mode 100644 org.contextmapper.dsl.ui/src/org/contextmapper/servicecutter/dsl/ui/actions/GeneratorsActionGroup.java delete mode 100644 org.contextmapper.dsl.ui/src/org/contextmapper/servicecutter/dsl/ui/contentassist/ServiceCutterConfigurationDSLProposalProvider.xtend delete mode 100644 org.contextmapper.dsl.ui/src/org/contextmapper/servicecutter/dsl/ui/editor/SCLEditor.java delete mode 100644 org.contextmapper.dsl.ui/src/org/contextmapper/servicecutter/dsl/ui/labeling/ServiceCutterConfigurationDSLDescriptionLabelProvider.xtend delete mode 100644 org.contextmapper.dsl.ui/src/org/contextmapper/servicecutter/dsl/ui/labeling/ServiceCutterConfigurationDSLLabelProvider.xtend delete mode 100644 org.contextmapper.dsl.ui/src/org/contextmapper/servicecutter/dsl/ui/outline/ServiceCutterConfigurationDSLOutlineTreeProvider.xtend delete mode 100644 org.contextmapper.dsl.ui/src/org/contextmapper/servicecutter/dsl/ui/quickfix/ServiceCutterConfigurationDSLQuickfixProvider.xtend delete mode 100644 org.contextmapper.dsl.ui/src/org/contextmapper/tactic/dsl/ui/TacticDDDLanguageUiModule.xtend delete mode 100644 org.contextmapper.dsl.ui/src/org/contextmapper/tactic/dsl/ui/contentassist/TacticDDDLanguageProposalProvider.xtend delete mode 100644 org.contextmapper.dsl.ui/src/org/contextmapper/tactic/dsl/ui/labeling/TacticDDDLanguageDescriptionLabelProvider.xtend delete mode 100644 org.contextmapper.dsl.ui/src/org/contextmapper/tactic/dsl/ui/labeling/TacticDDDLanguageLabelProvider.xtend delete mode 100644 org.contextmapper.dsl.ui/src/org/contextmapper/tactic/dsl/ui/outline/TacticDDDLanguageOutlineTreeProvider.xtend delete mode 100644 org.contextmapper.dsl.ui/src/org/contextmapper/tactic/dsl/ui/quickfix/TacticDDDLanguageQuickfixProvider.xtend diff --git a/org.contextmapper.dsl.feature/.project b/org.contextmapper.dsl.feature/.project deleted file mode 100644 index 6b5bce2b..00000000 --- a/org.contextmapper.dsl.feature/.project +++ /dev/null @@ -1,23 +0,0 @@ - - - org.contextmapper.dsl.feature - - - - - - org.eclipse.pde.FeatureBuilder - - - - - org.eclipse.m2e.core.maven2Builder - - - - - - org.eclipse.m2e.core.maven2Nature - org.eclipse.pde.FeatureNature - - diff --git a/org.contextmapper.dsl.feature/build.properties b/org.contextmapper.dsl.feature/build.properties deleted file mode 100644 index 64f93a9f..00000000 --- a/org.contextmapper.dsl.feature/build.properties +++ /dev/null @@ -1 +0,0 @@ -bin.includes = feature.xml diff --git a/org.contextmapper.dsl.feature/feature.xml b/org.contextmapper.dsl.feature/feature.xml deleted file mode 100644 index 6ff4d4b0..00000000 --- a/org.contextmapper.dsl.feature/feature.xml +++ /dev/null @@ -1,246 +0,0 @@ - - - - - Eclipse Plugin for the Context Mapper DSL. - - - - Copyright 2019 Context Mapper Project Team, including the original author or authors. - - - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright 2019 Context Mapper Project Team - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - - - - - - - - - - - - - diff --git a/org.contextmapper.dsl.feature/pom.xml b/org.contextmapper.dsl.feature/pom.xml deleted file mode 100644 index 95cddfb7..00000000 --- a/org.contextmapper.dsl.feature/pom.xml +++ /dev/null @@ -1,14 +0,0 @@ - - 4.0.0 - - org.contextmapper.dsl - org.contextmapper.dsl.parent - 6.12.1-SNAPSHOT - - org.contextmapper.dsl.feature - eclipse-feature - - - - - diff --git a/org.contextmapper.dsl.repository/.project b/org.contextmapper.dsl.repository/.project deleted file mode 100644 index 2761b144..00000000 --- a/org.contextmapper.dsl.repository/.project +++ /dev/null @@ -1,17 +0,0 @@ - - - org.contextmapper.dsl.repository - - - - - - org.eclipse.m2e.core.maven2Builder - - - - - - org.eclipse.m2e.core.maven2Nature - - diff --git a/org.contextmapper.dsl.repository/category.xml b/org.contextmapper.dsl.repository/category.xml deleted file mode 100644 index 890e9910..00000000 --- a/org.contextmapper.dsl.repository/category.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - - - - - - - - - - diff --git a/org.contextmapper.dsl.repository/packaging-p2composite.ant b/org.contextmapper.dsl.repository/packaging-p2composite.ant deleted file mode 100644 index e25cadb1..00000000 --- a/org.contextmapper.dsl.repository/packaging-p2composite.ant +++ /dev/null @@ -1,121 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - version=1 -metadata.repository.factory.order=compositeContent.xml,\! -artifact.repository.factory.order=compositeArtifacts.xml,\! - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/org.contextmapper.dsl.repository/pom.xml b/org.contextmapper.dsl.repository/pom.xml deleted file mode 100644 index e5af9cd5..00000000 --- a/org.contextmapper.dsl.repository/pom.xml +++ /dev/null @@ -1,329 +0,0 @@ - - 4.0.0 - - org.contextmapper.dsl - org.contextmapper.dsl.parent - 6.12.1-SNAPSHOT - - org.contextmapper.dsl.repository - eclipse-repository - - - ContextMapper DSL Composite Site - ${GH_REPO_NAME} - git@github.com:ContextMapper/${github-repo-name}.git - ${project.build.directory}/checkout - ${github-local-clone}/releases - ${releases-directory}/${qualifiedVersion} - - - - - - org.eclipse.tycho - tycho-p2-repository-plugin - ${tycho-version} - - ${project.artifactId}-${qualifiedVersion} - - - - - - - - org.eclipse.m2e - lifecycle-mapping - 1.0.0 - - - - - - - org.apache.maven.plugins - - - maven-clean-plugin - - - [2.5,) - - - clean - - - - - - - - - - - - - - - - - org.codehaus.groovy - groovy-all - 3.0.13 - pom - - - - - - release-composite - - false - - - - - - org.codehaus.mojo - build-helper-maven-plugin - 3.3.0 - - - initialize - parse-version - - parse-version - - - - - - org.codehaus.mojo - exec-maven-plugin - - git - - - - git-clone - prepare-package - - exec - - - - clone - --depth=1 - -b - master - ${github-update-repo} - ${github-local-clone} - - - - - git-add - verify - - exec - - - - -C - ${github-local-clone} - add - -A - - - - - git-commit - verify - - exec - - - - -C - ${github-local-clone} - commit - -m - Release ${qualifiedVersion} - - - - - git-push - deploy - - exec - - - - -C - ${github-local-clone} - push - origin - master - - - - - - - maven-resources-plugin - - - copy-repository - package - - copy-resources - - - ${current-release-directory} - - - ${project.build.directory}/repository - - - - - - - - - - - release-snapshot-version - - false - - - - - - org.eclipse.tycho - tycho-eclipse-plugin - ${tycho-version} - - - - -application org.eclipse.ant.core.antRunner -buildfile packaging-p2composite.ant p2.composite.add -DparsedVersion.majorVersion="${parsedVersion.majorVersion}" -DparsedVersion.minorVersion="${parsedVersion.minorVersion}" -DbuildQualifier=${buildQualifier} -DcmFullVersion="${unqualifiedVersion}.${buildQualifier}" -Dsite.label="${site.label}" -Dcomposite.base.dir=${github-local-clone} -DunqualifiedVersion=${unqualifiedVersion} -Dchild.repository.path.prefix="${child.repository.path.prefix}" - - --add-opens=java.base/java.net=ALL-UNNAMED - - - - 2022-09 - p2 - https://download.eclipse.org/releases/2022-09 - - - - - org.eclipse.ant.core - eclipse-plugin - - - org.apache.ant - eclipse-plugin - - - org.eclipse.equinox.p2.repository.tools - eclipse-plugin - - - org.eclipse.equinox.p2.core.feature - eclipse-feature - - - org.eclipse.equinox.p2.extras.feature - eclipse-feature - - - org.eclipse.equinox.ds - eclipse-plugin - - - - - - add-p2-composite-repository - package - - eclipse-run - - - - - - - - - release-final-version - - false - - - - - - org.eclipse.tycho - tycho-eclipse-plugin - ${tycho-version} - - - - -application org.eclipse.ant.core.antRunner -buildfile packaging-p2composite.ant p2.composite.add -DparsedVersion.majorVersion="${parsedVersion.majorVersion}" -DparsedVersion.minorVersion="${parsedVersion.minorVersion}" -DcmFullVersion="${unqualifiedVersion}" -Dsite.label="${site.label}" -Dcomposite.base.dir=${github-local-clone} -DunqualifiedVersion=${unqualifiedVersion} -Dchild.repository.path.prefix="${child.repository.path.prefix}" - - --add-opens=java.base/java.net=ALL-UNNAMED - - - - 2022-09 - p2 - https://download.eclipse.org/releases/2022-09 - - - - - org.eclipse.ant.core - eclipse-plugin - - - org.apache.ant - eclipse-plugin - - - org.eclipse.equinox.p2.repository.tools - eclipse-plugin - - - org.eclipse.equinox.p2.core.feature - eclipse-feature - - - org.eclipse.equinox.p2.extras.feature - eclipse-feature - - - org.eclipse.equinox.ds - eclipse-plugin - - - - - - add-p2-composite-repository - package - - eclipse-run - - - - - - - - - diff --git a/org.contextmapper.dsl.target/.project b/org.contextmapper.dsl.target/.project deleted file mode 100644 index 875868ad..00000000 --- a/org.contextmapper.dsl.target/.project +++ /dev/null @@ -1,17 +0,0 @@ - - - org.contextmapper.dsl.target - - - - - - org.eclipse.m2e.core.maven2Builder - - - - - - org.eclipse.m2e.core.maven2Nature - - diff --git a/org.contextmapper.dsl.target/org.contextmapper.dsl.target.target b/org.contextmapper.dsl.target/org.contextmapper.dsl.target.target deleted file mode 100644 index b94a19ed..00000000 --- a/org.contextmapper.dsl.target/org.contextmapper.dsl.target.target +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/org.contextmapper.dsl.target/pom.xml b/org.contextmapper.dsl.target/pom.xml deleted file mode 100644 index e4155313..00000000 --- a/org.contextmapper.dsl.target/pom.xml +++ /dev/null @@ -1,11 +0,0 @@ - - 4.0.0 - - org.contextmapper.dsl - org.contextmapper.dsl.parent - 6.12.1-SNAPSHOT - - org.contextmapper.dsl.target - eclipse-target-definition - - \ No newline at end of file diff --git a/org.contextmapper.dsl.ui.tests/.classpath b/org.contextmapper.dsl.ui.tests/.classpath deleted file mode 100644 index 6b07955e..00000000 --- a/org.contextmapper.dsl.ui.tests/.classpath +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - - - - - - diff --git a/org.contextmapper.dsl.ui.tests/.project b/org.contextmapper.dsl.ui.tests/.project deleted file mode 100644 index fb305310..00000000 --- a/org.contextmapper.dsl.ui.tests/.project +++ /dev/null @@ -1,40 +0,0 @@ - - - org.contextmapper.dsl.ui.tests - - - - - - org.eclipse.xtext.ui.shared.xtextBuilder - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.pde.ManifestBuilder - - - - - org.eclipse.pde.SchemaBuilder - - - - - org.eclipse.m2e.core.maven2Builder - - - - - - org.eclipse.m2e.core.maven2Nature - org.eclipse.xtext.ui.shared.xtextNature - org.eclipse.jdt.core.javanature - org.eclipse.pde.PluginNature - - diff --git a/org.contextmapper.dsl.ui.tests/META-INF/MANIFEST.MF b/org.contextmapper.dsl.ui.tests/META-INF/MANIFEST.MF deleted file mode 100644 index 362e25a2..00000000 --- a/org.contextmapper.dsl.ui.tests/META-INF/MANIFEST.MF +++ /dev/null @@ -1,21 +0,0 @@ -Manifest-Version: 1.0 -Automatic-Module-Name: org.contextmapper.dsl.ui.tests -Bundle-ManifestVersion: 2 -Bundle-Name: org.contextmapper.dsl.ui.tests -Bundle-Vendor: Context Mapper -Bundle-Version: 6.12.1.qualifier -Bundle-SymbolicName: org.contextmapper.dsl.ui.tests; singleton:=true -Bundle-ActivationPolicy: lazy -Require-Bundle: org.contextmapper.dsl.ui, - org.eclipse.xtext.testing, - org.eclipse.xtext.ui.testing, - org.eclipse.xtext.xbase.testing, - org.eclipse.xtext.xbase.ui.testing, - org.eclipse.core.runtime, - org.eclipse.ui.workbench;resolution:=optional -Import-Package: org.junit.jupiter.api;version="[5.1.0,6.0.0)", - org.junit.jupiter.api.extension;version="[5.1.0,6.0.0)" -Bundle-RequiredExecutionEnvironment: JavaSE-17 -Export-Package: org.contextmapper.dsl.ui.tests;x-internal=true, - org.contextmapper.tactic.dsl.ui.tests;x-internal=true, - org.contextmapper.servicecutter.dsl.ui.tests;x-internal=true diff --git a/org.contextmapper.dsl.ui.tests/build.properties b/org.contextmapper.dsl.ui.tests/build.properties deleted file mode 100644 index 5c6bbf99..00000000 --- a/org.contextmapper.dsl.ui.tests/build.properties +++ /dev/null @@ -1,6 +0,0 @@ -source.. = src/,\ - src-gen/,\ - xtend-gen/ -bin.includes = .,\ - META-INF/ -bin.excludes = **/*.xtend diff --git a/org.contextmapper.dsl.ui.tests/pom.xml b/org.contextmapper.dsl.ui.tests/pom.xml deleted file mode 100644 index 717d3602..00000000 --- a/org.contextmapper.dsl.ui.tests/pom.xml +++ /dev/null @@ -1,10 +0,0 @@ - - 4.0.0 - - org.contextmapper.dsl - org.contextmapper.dsl.parent - 6.12.1-SNAPSHOT - - org.contextmapper.dsl.ui.tests - eclipse-test-plugin - diff --git a/org.contextmapper.dsl.ui/.classpath b/org.contextmapper.dsl.ui/.classpath deleted file mode 100644 index 277a6027..00000000 --- a/org.contextmapper.dsl.ui/.classpath +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/org.contextmapper.dsl.ui/.project b/org.contextmapper.dsl.ui/.project deleted file mode 100644 index 3b20abca..00000000 --- a/org.contextmapper.dsl.ui/.project +++ /dev/null @@ -1,40 +0,0 @@ - - - org.contextmapper.dsl.ui - - - - - - org.eclipse.xtext.ui.shared.xtextBuilder - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.pde.ManifestBuilder - - - - - org.eclipse.pde.SchemaBuilder - - - - - org.eclipse.m2e.core.maven2Builder - - - - - - org.eclipse.m2e.core.maven2Nature - org.eclipse.xtext.ui.shared.xtextNature - org.eclipse.jdt.core.javanature - org.eclipse.pde.PluginNature - - diff --git a/org.contextmapper.dsl.ui/META-INF/MANIFEST.MF b/org.contextmapper.dsl.ui/META-INF/MANIFEST.MF deleted file mode 100644 index 4576b3e4..00000000 --- a/org.contextmapper.dsl.ui/META-INF/MANIFEST.MF +++ /dev/null @@ -1,31 +0,0 @@ -Manifest-Version: 1.0 -Automatic-Module-Name: org.contextmapper.dsl.ui -Bundle-ManifestVersion: 2 -Bundle-Name: org.contextmapper.dsl.ui -Bundle-Vendor: Context Mapper -Bundle-Version: 6.12.1.qualifier -Bundle-SymbolicName: org.contextmapper.dsl.ui; singleton:=true -Bundle-ActivationPolicy: lazy -Require-Bundle: org.contextmapper.dsl, - org.contextmapper.dsl.ide, - org.eclipse.xtext.ui, - org.eclipse.xtext.ui.shared, - org.eclipse.xtext.ui.codetemplates.ui, - org.eclipse.ui.editors;bundle-version="3.5.0", - org.eclipse.ui.ide;bundle-version="3.5.0", - org.eclipse.ui, - org.eclipse.compare, - org.eclipse.xtext.builder, - org.eclipse.xtext.xbase.lib;bundle-version="2.14.0", - org.eclipse.xtend.lib;bundle-version="2.14.0";resolution:=optional -Import-Package: org.apache.log4j, - org.eclipse.xtext.xbase.ui.hover -Bundle-RequiredExecutionEnvironment: JavaSE-17 -Export-Package: org.contextmapper.dsl.ui.contentassist, - org.contextmapper.dsl.ui.quickfix, - org.contextmapper.dsl.ui.internal, - org.contextmapper.tactic.dsl.ui.quickfix, - org.contextmapper.tactic.dsl.ui.contentassist, - org.contextmapper.servicecutter.dsl.ui.quickfix, - org.contextmapper.servicecutter.dsl.ui.contentassist -Bundle-Activator: org.contextmapper.dsl.ui.internal.DslActivator diff --git a/org.contextmapper.dsl.ui/about.ini b/org.contextmapper.dsl.ui/about.ini deleted file mode 100644 index 3049d21f..00000000 --- a/org.contextmapper.dsl.ui/about.ini +++ /dev/null @@ -1,7 +0,0 @@ -aboutText=Context Mapper DSL Editor\n\ -\n\ -(c) Copyright 2020 Context Mapper Project Team, including the original author or authors.\n\ -\n\ -Visit https://contextmapper.org/ - -featureImage=icons/cml-32x32.png diff --git a/org.contextmapper.dsl.ui/build.properties b/org.contextmapper.dsl.ui/build.properties deleted file mode 100644 index 8a846962..00000000 --- a/org.contextmapper.dsl.ui/build.properties +++ /dev/null @@ -1,10 +0,0 @@ -source.. = src/,\ - src-gen/,\ - xtend-gen/ -bin.includes = .,\ - META-INF/,\ - icons/,\ - samples/,\ - plugin.xml,\ - about.ini -bin.excludes = **/*.xtend diff --git a/org.contextmapper.dsl.ui/icons/cml-32x32.png b/org.contextmapper.dsl.ui/icons/cml-32x32.png deleted file mode 100644 index 8a80cb154d02d5e86de13c92d2d247c658624477..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2331 zcmZ{l3pA8l8^`y|AdHD25{lfCV#W+(j7u(qaVz9{2y?^KxQ@%XWfBr4l}-^QDqSa+ zFSpW6a;OwZg;EVFmx?)sD1CEYXMJmZeP^w2z3bV}+WYxE|Nq`=uXpW(-rHSK@*460 z0F)br>SrbUB?P(g;~;YtRQm9MJ3_Bga67f%W10Dx3k2^c7^ zP=}~uH?o6Y(7o#?S?th2)$Z(xcFUqoDUlklsJA;krk`T(V%Ow6jNI&~dcyHMS>8n7 z`?uW#N-#&b-}f@bOB8AUH9pf%2U|A8RlAK;!Z#(%4SM0nu?u8M&b-nvXC&l0sf*aY6skv*YVi?Azb|) z;R#hufFv>%wBZ*Ei%yru~LRM4jT~X^Z9ic48Zz27WfgUV|&c zl{;1H+WeSw{z?Hwv+nt|O2opcr7UNj(O&;;vRe^nq*GjXUwc!AK5}NK-Q|BT8zhk$ zL&;5|v~P%1IBYydjhJ(PKsQEBtsWplB0dH2t$8R_P8jZf~)ZRe}Q(aG`T*< zp`s9rU;F*RT$sTVZzo0!GC;>>lSz4xWxC#F?X-ciqOqVITQwryJ-0+(v*%}@np?U` zwtM5Q-+xFoKEB(ROW$l>i5RTG;_iCRsy?0IE3x7((7aS=!Q7gi-0{uNJ;S`&KO?Go z5VB1PurG)j&rof>j42KOJt5~r<$B<&UX}aI&y9%)J;qzjsxJ$M_f-p3>`M|4@SV#x zHg;x24{F zB-)_h5!~aTm4|Ad@%0n#*Ieo zQ8_Mq9FHes=IZ|>D;^%qSHdfz-|(-0uF*p*E;l@a}!ug(pdWN=W~H*Q3J zeeXaJ{Mc~3{=L@rk*=d3T=Ho>a-`M#kGK=j#(an?_DSiTed&c0&1Rzu9zvg<1DtYpf!;wNFrrrSlWkt+ z9ix7DBf6~Tten*T4BNif?}C=6$is{NsYX3-rGki#`e!JugWVYz)Lr z9jK{)wQGLei?~B+$Ezz0do?$WO2N}asO2pSSgb{N-K?ng(DBpzwg^>($Ogi&kIl;v z1xl^kW4p}Y6gdP<2aH{5+pNW(WJj~S4s?uGUiq$p-A(7Dbg$Pxw!V{YCezhDc*?=0L>Y>{59 zNvMuGH*0s>49za>8{6{ovCwM#0aD25o2t>bYu^ys9HbqBnll#dFiflscBlIq>cT`G zh9^@I5~-B2a123gk?H@_OvFSisYyKc1jw9+3(zJD1>NEwU40-M?;Qtkm4tA9lhH5C zzQ3$4u+3H=%6ejM+Da7VVyfxni5T{bRbJ}6RZW~s^eou(1}h;iYH+(si~=^tQ8sxh&GK&j2g-R3<(1D6-B@3 zM2@2;$1r1)NF;9vY5xVjje-{YB?LOdyMq z6up8BT-zuMA?toYyjU^Jq_lV@_QHi;bxn zK~#9!?VNdh6lI#nzi;&sNCUx;KsW=)Aq_$k41uRCQ?D9G#GmFq7w> zq`RJ~e(LxB-sgDheF{3HLpr2GI;2B7q;15}-VE~kREiJp$Lmv-)U@=Z)U-756H-Yzn2Z7E&GVmDi ziPtyzg`b`?`Ja=4qcT)>Zq*`SxPjjRe*oN3YJPi=qra;FvO!r2X2{Srygn5}*Zw(t zV8o9V74BzLhT0>gSNcrgP2k2Tdn$pqfO){%fCm^F1?JVjRG=a?Eq%YCYXN{!K9!;~ z>?6gQ1~0-CuTPx=JP8blvEyUlZeX9GYhhd01q=jM0i&XHO`rg{&Cs=V0An&$wr|${ zaeQFJS4Do$>r=;jeX0R01JZ5qOkg)K!O*qKfjtrM01RCV0=o@eJ0F+^90H_m|3F}^ z*Qah8IaVDJ2%K5JF3tqo?9Y>dn}Dns)vtlK4PAStiPwJ$xB?g(bLbi19Yfc?0=VF! zE2yljB!BzoXXg|im7#VwO;!Uwpi9)DYT#dhuMJ%*jWD&bU=ZU5dH_>^<$xx#i;ECmKeJBY;=G-9b1|eu}0e2 zf0!`SnU2?|-s1JCrN9F*;JquLpP_3DfxYnqaMb7M|Fmje1{U^qdW)1M4fM)1g4S;u?im^p&c>uj* zRg7)523-L>1Y8(n&_>`9U_->9Q9hNOO_(AwJGZZWQ&WL+qWtGOz^_HlY%~6ua&q9j zJ~a`z40r+<6QvfgS^B7zS0-?L>xPf?OJ1)mF;>lTW0LbS)KrFbbsnNSH@GILTB}N@O3S8dU8e}|C zc$N*Gv_C%#jsb?Q{l(C=BCk)4D}qHw)A_)Uoo9X&I8gjNZdY@`1E*t*SzNX}FzxZn z0K|f;kl7y+Pvnlu2o4##_O!jI@#iR&6rj=3a5g1k3z(3nYhPOiOu^9CHJXw{`6xwZ z=bjJTjN7@uzw1D#WnvVv^f3Mr+m@)Is93lj)BUFWC2B{On8 zz(P3suE?3a3qUT+MLaXR!L%pJ^&A84_xjX5z~Z>auqgvBK}Mpgp|5L{aS`xrKlh}) z=GToth)zTMIXewZ!@vKC^TcP{q;M}{*h7TP>xST@i)!nHi zx%z*4(9 z>2!)xC=5c-X;2!S2KNy)`wnyT&9%6CCClU+Cqp18YT2j=Fr^IbK7=%-aP~_PA~6A^ zJn2|YN-tm`lDlMf?u#O4_QQ3|h88O>T5RpCeDXs`S$j8qWp?gNpb)t2C*Z}<8q*|U zP#V4NxdBIKw>bR#N~-e<2v_=%fe>bKnGEC=2+_5(aC!R+k?6L-Ygm$jhh%o{4>CJ< zDv%0b-uG(zTu|-0{z-%o$c3-pjm!Bdu+nzK@k!W(K!~I(e@4$+t`MQJN{+2sM`-U6 za45n(asZCBb08S5i**gjxxmLbl>d_pmfff`W_cCGE7uY%Dg~FT8O5pq2#59+`2zU|=Ct&BptB_}mLO6wD{Cm* z_^qRI`|fb^4HpYnN|K^@I#~>B=q61Q83+;j;YVay6(S*_Hd758KStpztLQ#qEFRx5 z97&!?G;Z*kG8lr&ns9JmkwBUXLWp(^VC04b4#Jgw$I;wRq^oxi*(Gy0iM}C%VAujO z`ZgR2va*Kop<|epe(Sj7rwHnuEvi zzrIFzMh=xpmyHwD1PJaaL^vGvvO_dfX;w?hH|J5lIgg$polZ} zz}Cqb6M?`@McxlWmizGx?T>IdPxFcnKvJ}94c*6$!kyAxv^L{fH44Y~gHEKB2&d8< zGS@vY!i@}uIn&^^34pCg@HP>pJp*C}gAg*?^|-YtfC0rNTm)UR1?ZpzLZsd_71z)- z1pXEwsLM3n?Ha(r<|_ZIGp>2JrbmJdIh}|m)?7kLq!3heN?=>Sr1-7R2^=ip!1xLH zyL7gJXxcRuDG53hiW57_KTphD+P*818950LkLr8v;)}B6oIO9vtF%qZh`gOt(V50r z=?;cC+`TLBd57~}@1AVw*@Fjqr_iZ?8h531xps#xEck{SrcI6 z@WH%4cwqRQe!U6%Yvy6?@M@m`272|7@xDJ4bt zPuZwo0~ZPtRs_p4$FOYJxfBEgbauHJ5el<<#&i@ZnN(59S0~C@-!}>M(R;c5gAGjj zcpV@J)&ZnD5MXbwR2EGdFTeJ9%u>H!5hu!pupUaa?@}&OZUzGZ#mLKJx5s0yS(GjA ze0!ak{?R&I6#;~l2nj)l!dHX(kaOuo4pjM3f+2b*CE;`kt17hD13exOKg$?PNogr- z^>5iSEt5$zE+^~1UgO-|1-L@t+Uf5Xf)_5G#EKyU&GO?X1eH||AzCj)w`w9SoKAv% zzp~}?FUTK1OujW{h`4Fz4_y5B0=^kOnAL;RS(}oKyV6fmf{QNQx*(;jbB!Pr3X#;U z8y8Qyh=PL$Syy;~FK@k;nS~`>xp^mpoPzZijA7-V{&KHSa2zXD6d_uz25$9Q_+)J_ zz~P{3?|$*I!@;H@X^fjPp7O**szM=B6$N)U4+5eWWa|{uv{IV%{{89KyEjG0jdNwskpG~!Jl#_QSaOluM3J)G&V0t?J`t-)_b`uWA_dG`tf?zmI zd36od!E&5#7m8?`nxIVp1c^ftR9E@=?)&fAUr@ln^Z^VSkd7(MdZ)6mm$r^qR8irt zAuJ_MXB*u@+X4s@Q5&)SH8tdaw~PG+2gn#R8jr_Q_X<`pL~&VpZIBUdT?n@VfRcuu zz{P4tvrAE^s;Xkc#xLpBs}}e{ybqR_1MiKw!6b@i*;v3d<#P zZ6N;}x#W(GV*X2gu=Xj>CAOaBcO&iym6JxOje@D%{j&98>AalcN3RjVK+V$TlkB8~!=cc? zAww@N{N&>1%16 zffuM4-&hwI?NdD=tC{9TU_^}LeGY5G`Ig8OX>7x}9cZFI{|@*$b{Bv{C=5Flz)ykK z^RqJl76}fG`?ym<@cPt?fPbwcC){S+pL5zPCv}hDDLofG?WlThjMFUxUICspbnVBX zz6(htk?s1YP01y@0&{>z6rrTq4BQPo3arS_$_&RpJtt%6>mxP~!fHsI$*B#AN3eG5 z|4(GPM)$-eC$)X2Z84eU8}C|9$OT^`oOfO#l2Yl9zCMe^6jYh zk)dmaaf5mH%gDv2_Ixx2H2ePnSPj_^Vs*wxGwve=a(3!kUUNWe5diBpdh%$Hj{!Ht zsC^GSW$4;#r)zKnb_he)q}@AwhdndWW7J*;9yfGtSFBrVcKO;u#z&8QB*HC=Nqr*G zbDp7V@3j<=(Y<(HpL#o1zi?`d+G-)hJ=N9K2mb!uCR%b3MGLbaHsa04>R7)Z=C@X2 zwRUZ?Unp@p1D0qZEF9R4kb~1TQNUzQ~fc4yLq8<4j!P@X0ks$CM zh$jqv{kC{n5eaCi>3+K8w7J=X~EKgb0zZpQUf@sAI|{V6{?B z1Nz0NE&$$&yc(d6>kI{Mwo9*Q*$2D}{KgI>jaCq66@c}CF$}APc43Si1$K@5n4xP` zcA)5KTAlH~!0JSbNEPq|3d@bHTAREVPqYDWQEZ$dz)Zt>HOZ_P)lxeZImZS$wg&%; z5aQv4P^e_*PMb@(hzo|q76wf$;&|qPl7`Xmk1(>ASyM<%gfP{geHLy@fsxv z$N*m0V(`EN6~y9Htsql7Sgk^7r?xs{r8*t4)?>U;5q;fYtMu^Azx(gM|F{4D@4lU_ z%*sp&3YZuG00>G;Rb)dQ;%ziC>{;AkB~%ncVn!kW?X`i!8Y;9&_UsfnXzPpk0~!o0 zH9G@JstDo0q}{;nyX5J00&7RpqdBxBV%a3 zOPIWPCO`gvy)3>A`1=qm4iPKcK%g%)|BJC96CO_FZ6u2K5GDHv=U$?CFJavcCQV@@ zZ}~8mnAmZSDBV9?;2F}^zq0OpWp5%}&BUheh-k^1uxupZ(d<<(E!&}YSX&QGmUkob zZcws@(%eK|Hw%#wB+D-}<-LpwV%6=D6f#hEdDg-WOV)J-69fkq2}>&P111l1Yj4yb z0SJO*+y;eR-vfm+QWY;+0&FcLlgH261YN8x=cm=4X4m(!4_@c6#c%3?uxw&DfZH)N zKoT;Xt-Y)rmpCEsc@rTC(R`WA570~7CvP|_pm>k{wM6q~a-jTez8<_R+({I9PYG`D zX;#Hxy8HHI>}giziv=}ywpt&ZzJ4weF@_ zcQM>wiabBSvZvObrkZz7ult4|i0{#RSK#%iaAaqCuOGabix2EyNT(&&x|mU=3O}l> zdJT^hL?^l+^>pX!_Z`O_z@a;mR-Mx~S-kbA02=}$&EeA1X8pRzbg6nlA% zJTIpt=e`kELei$ED2|H8EJ}xle_?8#9e}`b-bMlqo-hcI(-euSunU+PemWhF{eJDb zR;N<~`w3Uc^Ji3w%UzZzua0ce{x)`F_K(6Nwub?c)%2=4=Q#&Ix;3$3(Pgw_nQe&f zTTq^ShPiKYqyEN(`kadr`my4>!MOm z^^{(I94<0^w_VhI_EIqG+LREf^VeZ&U?}&)vEw6r#?yiVmv$69uiDa*bGWjC;{Plq z>1=EM@s-_YGTJ|x@!%xg*S|9D9Q(kw<9qfRbb9=e@cOp{HwHq-Pk4Xp=K3u?>vKV4 z8-t&lw;*3RX;E|T)l;-VPsm|4rnINGAXmOxV!jh`H{>1}sMN`n!GJRt;Te74NLuL7 zX&g9;*>I?U5D`eZ0wEU>s)RxmK~Rw-8ukbhH$8ItKNgs+I+Nb@?ggo?2KcyuWN!w$ zRqt?WY&b|WYYcdX#$dueW=MFkJSjJh0aJ>(NDR!%m@kkpj1EU3%I7R-eisG=Vcv);W06^lq6#ZkWX3HH6wQLD9SE9qt)Kzv5)5AO!?5Vo|JA ziijk84nN!lk>F8rl%{1kK;-hxO$m3PD`%8zL3SF@n+kBaeZJY^D6ks%dQGtjvs&!@ zw?Bp-tCNT{h*qe_a7=<}H5wd?5yxSeM5qyKg|P?^uHeD?w2gI*Fat - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Add new CML file - - - - - - - A few example templates for the Context Mapper generic generator based on Freemarker. - - - - - - - - - - - - - - - - - - - - - - diff --git a/org.contextmapper.dsl.ui/pom.xml b/org.contextmapper.dsl.ui/pom.xml deleted file mode 100644 index fcdeb5c9..00000000 --- a/org.contextmapper.dsl.ui/pom.xml +++ /dev/null @@ -1,20 +0,0 @@ - - 4.0.0 - - org.contextmapper.dsl - org.contextmapper.dsl.parent - 6.12.1-SNAPSHOT - - org.contextmapper.dsl.ui - eclipse-plugin - - - - - org.eclipse.xtext - xtend-maven-plugin - - - - - diff --git a/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/ContextMappingDSLUiModule.xtend b/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/ContextMappingDSLUiModule.xtend deleted file mode 100644 index 840430f9..00000000 --- a/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/ContextMappingDSLUiModule.xtend +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright 2018 The Context Mapper Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.contextmapper.dsl.ui - -import org.contextmapper.dsl.ui.hover.CMLHoverProvider -import org.contextmapper.dsl.ui.hover.CMLXbaseDispatchingEObjectTextHover -import org.eclipse.xtend.lib.annotations.FinalFieldsConstructor -import org.eclipse.xtext.ui.editor.hover.IEObjectHoverProvider -import org.eclipse.xtext.ui.editor.model.edit.ITextEditComposer -import org.contextmapper.dsl.ui.quickfix.CMLTextEditComposer - -/** - * Use this class to register components to be used within the Eclipse IDE. - */ -@FinalFieldsConstructor -class ContextMappingDSLUiModule extends AbstractContextMappingDSLUiModule { - - override bindIEObjectHover() { - return CMLXbaseDispatchingEObjectTextHover - } - - def Class bindIEObjectHoverProvider() { - return CMLHoverProvider - } - - def Class bindITextEditComposer() { - return CMLTextEditComposer - } - -} diff --git a/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/actions/GeneratorsActionGroup.java b/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/actions/GeneratorsActionGroup.java deleted file mode 100644 index d578bc08..00000000 --- a/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/actions/GeneratorsActionGroup.java +++ /dev/null @@ -1,125 +0,0 @@ -/* - * Copyright 2020 The Context Mapper Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.contextmapper.dsl.ui.actions; - -import java.util.List; -import java.util.Optional; - -import org.contextmapper.dsl.exception.ContextMapperApplicationException; -import org.contextmapper.dsl.ui.editor.CMLQuickMenuCreator; -import org.contextmapper.dsl.ui.images.CMLImageDescriptionFactory; -import org.eclipse.core.commands.Command; -import org.eclipse.core.commands.IHandler; -import org.eclipse.core.commands.common.NotDefinedException; -import org.eclipse.jface.action.Action; -import org.eclipse.jface.action.IMenuManager; -import org.eclipse.jface.action.MenuManager; -import org.eclipse.jface.action.Separator; -import org.eclipse.ui.actions.ActionGroup; -import org.eclipse.ui.commands.ICommandService; -import org.eclipse.ui.handlers.IHandlerService; -import org.eclipse.xtext.ui.editor.XtextEditor; - -import com.google.common.collect.Lists; - -public class GeneratorsActionGroup extends ActionGroup { - - private static final String QUICK_MENU_ID = "org.contextmapper.ui.edit.cml.generator.quickMenu"; - - private IHandlerService handlerService; - private ICommandService commandService; - private List allCommands; - - public GeneratorsActionGroup(XtextEditor editor) { - this.handlerService = editor.getEditorSite().getService(IHandlerService.class); - this.commandService = editor.getEditorSite().getService(ICommandService.class); - allCommands = Lists.newArrayList(commandService.getDefinedCommands()); - installQuickAccessAction(); - } - - @Override - public void fillContextMenu(IMenuManager menu) { - super.fillContextMenu(menu); - addGeneratorSubmenu(menu); - } - - private void installQuickAccessAction() { - if (handlerService != null) { - IHandler handler = new CMLQuickMenuCreator() { - @Override - protected void fillMenu(IMenuManager menu) { - fillRefactorMenu(menu); - } - }.createHandler(); - handlerService.activateHandler(QUICK_MENU_ID, handler); - } - } - - private int fillRefactorMenu(IMenuManager generatorSubmenu) { - int added = 0; - added += addAction(generatorSubmenu, createAction("org.contextmapper.dsl.ui.handler.ContextMapGenerationCommand")); - added += addAction(generatorSubmenu, createAction("org.contextmapper.dsl.ui.handler.PlantUMLGenerationCommand")); - added += addAction(generatorSubmenu, createAction("org.contextmapper.dsl.ui.handler.SketchMinerGenerationCommand")); - added += addAction(generatorSubmenu, createAction("org.contextmapper.dsl.ui.handler.GenericTextFileGenerationCommand")); - generatorSubmenu.add(new Separator()); - added += addAction(generatorSubmenu, createAction("org.contextmapper.dsl.ui.handler.MDSLGenerationCommand")); - generatorSubmenu.add(new Separator()); - added += addAction(generatorSubmenu, createAction("org.contextmapper.dsl.ui.handler.XMIGenerationCommand")); - return added; - } - - private Action createAction(String commandId) { - Optional optCommand = allCommands.stream().filter(c -> c.getId().equals(commandId)).findFirst(); - if (!optCommand.isPresent()) - return null; - - Command command = optCommand.get(); - Action action = new Action() { - public void run() { - try { - handlerService.executeCommand(command.getId(), null); - } catch (Exception e) { - throw new ContextMapperApplicationException("Could not execute command with id '" + command.getId() + "'.", e); - } - }; - }; - try { - action.setActionDefinitionId(command.getId()); - action.setText(command.getName()); - action.setEnabled(command.isEnabled()); - } catch (NotDefinedException e) { - throw new ContextMapperApplicationException("The command with the id '" + command.getId() + "' is not properly defined!", e); - } - return action; - } - - private void addGeneratorSubmenu(IMenuManager menu) { - MenuManager contextMenu = new MenuManager("Context Mapper", "org.contextmapper.dsl.ui.generator.menu"); - contextMenu.setActionDefinitionId(QUICK_MENU_ID); - contextMenu.setImageDescriptor(CMLImageDescriptionFactory.createContextMapperLogoDescriptor()); - if (fillRefactorMenu(contextMenu) > 0) - menu.insertAfter("additions", contextMenu); - } - - private int addAction(IMenuManager menu, Action action) { - if (action != null && action.isEnabled()) { - menu.add(action); - return 1; - } - return 0; - } - -} diff --git a/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/actions/RefactoringActionGroup.java b/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/actions/RefactoringActionGroup.java deleted file mode 100644 index 131c83c8..00000000 --- a/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/actions/RefactoringActionGroup.java +++ /dev/null @@ -1,116 +0,0 @@ -/* - * Copyright 2020 The Context Mapper Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.contextmapper.dsl.ui.actions; - -import java.net.URL; -import java.util.List; -import java.util.stream.Collectors; - -import org.contextmapper.dsl.exception.ContextMapperApplicationException; -import org.contextmapper.dsl.ui.editor.CMLQuickMenuCreator; -import org.contextmapper.dsl.ui.images.CMLImageDescriptionFactory; -import org.contextmapper.dsl.ui.internal.DslActivator; -import org.eclipse.core.commands.Command; -import org.eclipse.core.commands.IHandler; -import org.eclipse.core.commands.common.NotDefinedException; -import org.eclipse.core.runtime.Platform; -import org.eclipse.jface.action.Action; -import org.eclipse.jface.action.IMenuManager; -import org.eclipse.jface.action.MenuManager; -import org.eclipse.jface.resource.ImageDescriptor; -import org.eclipse.ui.actions.ActionGroup; -import org.eclipse.ui.commands.ICommandService; -import org.eclipse.ui.handlers.IHandlerService; -import org.eclipse.xtext.ui.editor.XtextEditor; -import org.osgi.framework.Bundle; - -import com.google.common.collect.Lists; - -public class RefactoringActionGroup extends ActionGroup { - - private static final String QUICK_MENU_ID = "org.contextmapper.ui.edit.cml.refactor.quickMenu"; - - private IHandlerService handlerService; - private ICommandService commandService; - - public RefactoringActionGroup(XtextEditor editor) { - this.handlerService = editor.getEditorSite().getService(IHandlerService.class); - this.commandService = editor.getEditorSite().getService(ICommandService.class); - installQuickAccessAction(); - } - - @Override - public void fillContextMenu(IMenuManager menu) { - super.fillContextMenu(menu); - addRefactorSubmenu(menu); - } - - private void installQuickAccessAction() { - if (handlerService != null) { - IHandler handler = new CMLQuickMenuCreator() { - @Override - protected void fillMenu(IMenuManager menu) { - fillRefactorMenu(menu); - } - }.createHandler(); - handlerService.activateHandler(QUICK_MENU_ID, handler); - } - } - - private int fillRefactorMenu(IMenuManager refactorSubmenu) { - int added = 0; - List allCommands = Lists.newArrayList(commandService.getDefinedCommands()); - for (Command command : allCommands.stream().filter(c -> c.getId().startsWith("org.contextmapper") && c.getId().endsWith("RefactoringCommand")) - .collect(Collectors.toList())) { - Action action = new Action() { - public void run() { - try { - handlerService.executeCommand(command.getId(), null); - } catch (Exception e) { - throw new ContextMapperApplicationException("Could not execute command with id '" + command.getId() + "'.", e); - } - }; - }; - try { - action.setActionDefinitionId(command.getId()); - action.setText(command.getName()); - action.setEnabled(command.isEnabled()); - - added += addAction(refactorSubmenu, action); - } catch (NotDefinedException e) { - throw new ContextMapperApplicationException("The command with the id '" + command.getId() + "' is not properly defined!", e); - } - } - return added; - } - - private void addRefactorSubmenu(IMenuManager menu) { - MenuManager contextMenu = new MenuManager("Context Mapper: Refactor", "org.contextmapper.dsl.ui.refactoring.menu"); - contextMenu.setActionDefinitionId(QUICK_MENU_ID); - contextMenu.setImageDescriptor(CMLImageDescriptionFactory.createContextMapperLogoDescriptor()); - if (fillRefactorMenu(contextMenu) > 0) - menu.insertAfter("group.edit", contextMenu); - } - - private int addAction(IMenuManager menu, Action action) { - if (action != null && action.isEnabled()) { - menu.add(action); - return 1; - } - return 0; - } - -} diff --git a/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/contentassist/ContextMappingDSLProposalProvider.xtend b/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/contentassist/ContextMappingDSLProposalProvider.xtend deleted file mode 100644 index 3f75356a..00000000 --- a/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/contentassist/ContextMappingDSLProposalProvider.xtend +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright 2018 The Context Mapper Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.contextmapper.dsl.ui.contentassist - - -/** - * See https://www.eclipse.org/Xtext/documentation/304_ide_concepts.html#content-assist - * on how to customize the content assistant. - */ -class ContextMappingDSLProposalProvider extends AbstractContextMappingDSLProposalProvider { -} diff --git a/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/editor/CMLEditor.java b/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/editor/CMLEditor.java deleted file mode 100644 index 0b6a3bfc..00000000 --- a/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/editor/CMLEditor.java +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright 2020 The Context Mapper Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.contextmapper.dsl.ui.editor; - -import java.util.Arrays; -import java.util.Set; - -import org.contextmapper.dsl.ui.actions.GeneratorsActionGroup; -import org.contextmapper.dsl.ui.actions.RefactoringActionGroup; -import org.eclipse.jface.action.IMenuManager; -import org.eclipse.ui.actions.ActionContext; -import org.eclipse.ui.actions.ActionGroup; -import org.eclipse.xtext.ui.editor.XtextEditor; - -import com.google.common.collect.Sets; - -public class CMLEditor extends XtextEditor { - - private ActionGroup refactoringGroup; - private ActionGroup generatorsGroup; - - private static final String CML_EDITOR_KEYBINDING_SCOPE = "org.contextmapper.ui.cml.editor.CMLEditorScope"; - - @Override - protected void createActions() { - super.createActions(); - - refactoringGroup = new RefactoringActionGroup(this); - generatorsGroup = new GeneratorsActionGroup(this); - } - - @Override - protected void editorContextMenuAboutToShow(IMenuManager menu) { - super.editorContextMenuAboutToShow(menu); - - ActionContext context = new ActionContext(getSelectionProvider().getSelection()); - refactoringGroup.setContext(context); - refactoringGroup.fillContextMenu(menu); - refactoringGroup.setContext(null); - - generatorsGroup.setContext(context); - generatorsGroup.fillContextMenu(menu); - generatorsGroup.setContext(null); - } - - @Override - protected void setKeyBindingScopes(String[] scopes) { - Set scopesSet = Sets.newHashSet(); - if (scopes != null) - scopesSet.addAll(Arrays.asList(scopes)); - if (!scopesSet.contains(CML_EDITOR_KEYBINDING_SCOPE)) - scopesSet.add(CML_EDITOR_KEYBINDING_SCOPE); - super.setKeyBindingScopes(scopesSet.toArray(new String[scopesSet.size()])); - } - -} diff --git a/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/editor/CMLQuickMenuCreator.java b/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/editor/CMLQuickMenuCreator.java deleted file mode 100644 index d8faf03f..00000000 --- a/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/editor/CMLQuickMenuCreator.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright 2020 The Context Mapper Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.contextmapper.dsl.ui.editor; - -import org.eclipse.core.commands.AbstractHandler; -import org.eclipse.core.commands.ExecutionEvent; -import org.eclipse.core.commands.ExecutionException; -import org.eclipse.core.commands.IHandler; -import org.eclipse.ui.actions.QuickMenuCreator; - -public abstract class CMLQuickMenuCreator extends QuickMenuCreator { - - public IHandler createHandler() { - return new AbstractHandler() { - @Override - public Object execute(ExecutionEvent event) throws ExecutionException { - createMenu(); - return null; - } - }; - } -} diff --git a/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/editor/XtextEditorHelper.java b/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/editor/XtextEditorHelper.java deleted file mode 100644 index d6440c62..00000000 --- a/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/editor/XtextEditorHelper.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Copyright 2020 The Context Mapper Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.contextmapper.dsl.ui.editor; - -import java.util.Set; - -import org.eclipse.emf.ecore.EObject; -import org.eclipse.jface.text.ITextSelection; -import org.eclipse.xtext.resource.EObjectAtOffsetHelper; -import org.eclipse.xtext.resource.XtextResource; -import org.eclipse.xtext.ui.editor.XtextEditor; -import org.eclipse.xtext.util.concurrent.IUnitOfWork; - -import com.google.common.collect.Sets; -import com.google.inject.Inject; - -public class XtextEditorHelper { - - @Inject - private EObjectAtOffsetHelper eObjectAtOffsetHelper; - - public EObject getFirstSelectedElement(XtextEditor editor) { - if (editor == null) - return null; - - final ITextSelection selection = (ITextSelection) editor.getSelectionProvider().getSelection(); - EObject selectedObject = editor.getDocument().priorityReadOnly(new IUnitOfWork() { - @Override - public EObject exec(XtextResource resource) throws Exception { - EObject selectedElement = eObjectAtOffsetHelper.resolveElementAt(resource, selection.getOffset()); - if (selectedElement != null) { - return selectedElement; - } - return null; - } - }); - return selectedObject; - } - - public Set getAllSelectedElements(XtextEditor editor) { - if (editor == null) - return Sets.newHashSet(); - - final ITextSelection selection = (ITextSelection) editor.getSelectionProvider().getSelection(); - Set selectedObjects = editor.getDocument().priorityReadOnly(new IUnitOfWork, XtextResource>() { - @Override - public Set exec(XtextResource resource) throws Exception { - Set objects = Sets.newHashSet(); - int offset = selection.getOffset(); - for (int i = selection.getLength(); i >= 0; i--) { - EObject selectedElement = eObjectAtOffsetHelper.resolveElementAt(resource, offset); - if (selectedElement != null) { - objects.add(selectedElement); - } - offset++; - } - return objects; - } - }); - return selectedObjects; - } -} diff --git a/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/AbstractGenerationHandler.java b/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/AbstractGenerationHandler.java deleted file mode 100644 index 43ec1263..00000000 --- a/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/AbstractGenerationHandler.java +++ /dev/null @@ -1,227 +0,0 @@ -/* - * Copyright 2018 The Context Mapper Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.contextmapper.dsl.ui.handler; - -import java.util.ArrayList; -import java.util.List; - -import org.contextmapper.dsl.exception.ContextMapperApplicationException; -import org.contextmapper.dsl.ui.internal.DslActivator; -import org.eclipse.core.commands.AbstractHandler; -import org.eclipse.core.commands.ExecutionEvent; -import org.eclipse.core.commands.ExecutionException; -import org.eclipse.core.commands.IHandler; -import org.eclipse.core.resources.IContainer; -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IFolder; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.resources.IWorkspaceRoot; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.MultiStatus; -import org.eclipse.core.runtime.NullProgressMonitor; -import org.eclipse.core.runtime.QualifiedName; -import org.eclipse.core.runtime.Status; -import org.eclipse.emf.common.util.URI; -import org.eclipse.emf.ecore.resource.Resource; -import org.eclipse.emf.ecore.resource.ResourceSet; -import org.eclipse.jface.dialogs.ErrorDialog; -import org.eclipse.jface.dialogs.MessageDialog; -import org.eclipse.jface.text.TextSelection; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.ui.IEditorInput; -import org.eclipse.ui.IFileEditorInput; -import org.eclipse.ui.handlers.HandlerUtil; -import org.eclipse.ui.statushandlers.StatusManager; -import org.eclipse.xtext.builder.EclipseResourceFileSystemAccess2; -import org.eclipse.xtext.generator.GeneratorContext; -import org.eclipse.xtext.generator.IFileSystemAccess2; -import org.eclipse.xtext.generator.IGenerator2; -import org.eclipse.xtext.resource.IResourceDescriptions; -import org.eclipse.xtext.ui.editor.XtextEditor; -import org.eclipse.xtext.ui.editor.utils.EditorUtils; -import org.eclipse.xtext.ui.resource.IResourceSetProvider; - -import com.google.inject.Inject; -import com.google.inject.Provider; - -public abstract class AbstractGenerationHandler extends AbstractHandler implements IHandler { - - @Inject - private Provider fileAccessProvider; - - @Inject - IResourceDescriptions resourceDescriptions; - - @Inject - IResourceSetProvider resourceSetProvider; - - protected abstract IGenerator2 getGenerator(); - - @Override - public Object execute(ExecutionEvent event) throws ExecutionException { - Resource resource = getResource(event); - IFile file = getSelectedFile(event); - if (resource != null && file != null) { - try { - final EclipseResourceFileSystemAccess2 fsa = fileAccessProvider.get(); - fsa.setProject(file.getProject()); - fsa.setOutputPath(getGenFolder(file).toString()); - fsa.setMonitor(new NullProgressMonitor()); - runGeneration(resource, event, fsa); - } catch (ContextMapperApplicationException e) { - MessageDialog.openInformation(HandlerUtil.getActiveShell(event), "Model Input", e.getMessage()); - } catch (Exception e) { - String message = e.getMessage() != null && !"".equals(e.getMessage()) ? e.getMessage() : e.getClass().getName() + " occurred in " + this.getClass().getName(); - Status status = new Status(IStatus.ERROR, DslActivator.PLUGIN_ID, message, e); - StatusManager.getManager().handle(status); - ErrorDialog.openError(HandlerUtil.getActiveShell(event), "Error", "Exception occured during execution of command!", createMultiStatus(e.getLocalizedMessage(), e)); - } - } - return null; - } - - protected void runGeneration(Resource resource, ExecutionEvent event, IFileSystemAccess2 fsa) { - try { - getGenerator().doGenerate(resource, fsa, new GeneratorContext()); - } catch (ContextMapperApplicationException e) { - MessageDialog.openInformation(HandlerUtil.getActiveShell(event), "Model Input", e.getMessage()); - } catch (Exception e) { - String message = e.getMessage() != null && !"".equals(e.getMessage()) ? e.getMessage() : e.getClass().getName() + " occurred in " + this.getClass().getName(); - Status status = new Status(IStatus.ERROR, DslActivator.PLUGIN_ID, message, e); - StatusManager.getManager().handle(status); - ErrorDialog.openError(HandlerUtil.getActiveShell(event), "Error", "Exception occured during execution of command!", createMultiStatus(e.getLocalizedMessage(), e)); - } - } - - private Resource getResource(ExecutionEvent event) { - ISelection selection = HandlerUtil.getCurrentSelection(event); - if (selection instanceof IStructuredSelection) { - IStructuredSelection structuredSelection = (IStructuredSelection) selection; - Object firstElement = structuredSelection.getFirstElement(); - if (firstElement instanceof IFile) { - return getResource((IFile) firstElement); - } - } else if (selection instanceof TextSelection && EditorUtils.getActiveXtextEditor() != null) { - XtextEditor xEditor = EditorUtils.getActiveXtextEditor(); - IResource xResource = xEditor.getResource(); - - URI uri = URI.createPlatformResourceURI(xResource.getFullPath().toString(), true); - - ResourceSet rs = resourceSetProvider.get(xResource.getProject()); - return rs.getResource(uri, true); - } - return null; - } - - protected IFile getSelectedFile(ExecutionEvent event) { - ISelection selection = HandlerUtil.getCurrentSelection(event); - if (selection instanceof IStructuredSelection) { - IStructuredSelection structuredSelection = (IStructuredSelection) selection; - Object firstElement = structuredSelection.getFirstElement(); - if (firstElement instanceof IFile) { - return (IFile) firstElement; - } - } else if (selection instanceof TextSelection && EditorUtils.getActiveXtextEditor() != null) { - XtextEditor xEditor = EditorUtils.getActiveXtextEditor(); - IEditorInput input = xEditor.getEditorInput(); - if (input instanceof IFileEditorInput) { - return ((IFileEditorInput) input).getFile(); - } - } - return null; - } - - protected Resource getResource(IFile file) { - URI uri = URI.createPlatformResourceURI(file.getFullPath().toString(), true); - ResourceSet rs = resourceSetProvider.get(file.getProject()); - return rs.getResource(uri, true); - } - - protected IPath getGenFolder(IFile file) { - IFolder srcGenFolder = file.getProject().getFolder("src-gen"); - if (!srcGenFolder.exists()) { - try { - srcGenFolder.create(true, true, new NullProgressMonitor()); - } catch (CoreException e) { - return null; - } - } - return srcGenFolder.getProjectRelativePath(); - } - - protected MultiStatus createMultiStatus(String msg, Throwable t) { - List childStatuses = new ArrayList<>(); - StackTraceElement[] stackTraces = Thread.currentThread().getStackTrace(); - for (StackTraceElement stackTrace : stackTraces) { - Status status = new Status(IStatus.ERROR, "org.contextmapper.dsl.ui", stackTrace.toString()); - childStatuses.add(status); - } - return new MultiStatus("org.contextmapper.dsl.ui", IStatus.ERROR, childStatuses.toArray(new Status[] {}), t.toString(), t); - } - - protected IFile findFileInContainer(IContainer container, String path) { - IResource resource = container.findMember(path); - if (resource != null && resource instanceof IFile) - return (IFile) resource; - return null; - } - - protected void persistWorkspaceProperty(ExecutionEvent event, String property, String value) { - IWorkspaceRoot workspaceRoot = getWorkspaceRoot(event); - try { - workspaceRoot.setPersistentProperty(getQualifiedName4File(workspaceRoot, property), value); - } catch (CoreException e) { - throw new ContextMapperApplicationException("Could not store workspace property.", e); - } - } - - protected String getWorkspaceProperty(ExecutionEvent event, String property) { - IWorkspaceRoot workspaceRoot = getWorkspaceRoot(event); - try { - return workspaceRoot.getPersistentProperty(getQualifiedName4File(workspaceRoot, property)); - } catch (CoreException e) { - throw new ContextMapperApplicationException("Could not read workspace property", e); - } - } - - protected boolean isWorkspacePropertySet(ExecutionEvent event, String property) { - IWorkspaceRoot workspaceRoot = getWorkspaceRoot(event); - try { - return workspaceRoot.getPersistentProperties().containsKey(getQualifiedName4File(workspaceRoot, property)); - } catch (CoreException e) { - throw new ContextMapperApplicationException("Cannot read workspace properties.", e); - } - } - - private IWorkspaceRoot getWorkspaceRoot(ExecutionEvent event) { - IProject project = getSelectedFile(event).getProject(); - return project.getWorkspace().getRoot(); - } - - private QualifiedName getQualifiedName4File(IResource resource, String property) { - return new QualifiedName(getGenerator().getClass().getName() + "." + property, resource.getLocation().toString()); - } - - @Override - public boolean isEnabled() { - return true; - } - -} diff --git a/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/AbstractRefactoringHandler.java b/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/AbstractRefactoringHandler.java deleted file mode 100644 index 5514bed0..00000000 --- a/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/AbstractRefactoringHandler.java +++ /dev/null @@ -1,173 +0,0 @@ -package org.contextmapper.dsl.ui.handler; - -import java.util.List; -import java.util.Set; - -import org.contextmapper.dsl.cml.CMLResource; -import org.contextmapper.dsl.contextMappingDSL.ContextMappingModel; -import org.contextmapper.dsl.contextMappingDSL.Import; -import org.contextmapper.dsl.exception.ContextMapperApplicationException; -import org.contextmapper.dsl.exception.RefactoringSerializationException; -import org.contextmapper.dsl.ui.editor.XtextEditorHelper; -import org.contextmapper.dsl.ui.internal.DslActivator; -import org.eclipse.core.commands.AbstractHandler; -import org.eclipse.core.commands.ExecutionEvent; -import org.eclipse.core.commands.ExecutionException; -import org.eclipse.core.commands.IHandler; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Status; -import org.eclipse.emf.common.util.URI; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.resource.Resource; -import org.eclipse.emf.ecore.resource.ResourceSet; -import org.eclipse.jface.dialogs.ErrorDialog; -import org.eclipse.jface.dialogs.MessageDialog; -import org.eclipse.ui.handlers.HandlerUtil; -import org.eclipse.ui.statushandlers.StatusManager; -import org.eclipse.xtext.resource.IResourceDescription; -import org.eclipse.xtext.resource.IResourceDescriptions; -import org.eclipse.xtext.resource.impl.ResourceDescriptionsProvider; -import org.eclipse.xtext.serializer.ISerializer; -import org.eclipse.xtext.ui.editor.XtextEditor; -import org.eclipse.xtext.ui.editor.utils.EditorUtils; -import org.eclipse.xtext.ui.resource.XtextLiveScopeResourceSetProvider; -import org.eclipse.xtext.xbase.lib.IteratorExtensions; - -import com.google.common.collect.Iterators; -import com.google.common.collect.Sets; -import com.google.inject.Inject; - -public abstract class AbstractRefactoringHandler extends AbstractHandler implements IHandler { - - @Inject - XtextLiveScopeResourceSetProvider resourceSetProvider; - - @Inject - private ResourceDescriptionsProvider resourceDescriptionsProvider; - - @Inject - private XtextEditorHelper xtextEditorHelper; - - @Inject - protected ISerializer serializer; - - protected Resource currentResource; - protected ResourceSet currentResourceSet; - - @Override - public Object execute(ExecutionEvent event) throws ExecutionException { - try { - XtextEditor xEditor = EditorUtils.getActiveXtextEditor(); - IResource xResource = xEditor.getResource(); - currentResourceSet = resourceSetProvider.get(xResource.getProject()); - currentResource = getCurrentResource(); - executeRefactoring(new CMLResource(currentResource), event); - } catch (RefactoringSerializationException e) { - String message = e.getMessage() != null && !"".equals(e.getMessage()) ? e.getMessage() - : e.getClass().getName() + " occurred in " + this.getClass().getName(); - Status status = new Status(IStatus.ERROR, DslActivator.PLUGIN_ID, message, e); - StatusManager.getManager().handle(status); - MessageDialog.openInformation(HandlerUtil.getActiveShell(event), "Model Input", e.getMessage()); - } catch (ContextMapperApplicationException e) { - MessageDialog.openInformation(HandlerUtil.getActiveShell(event), "Model Input", e.getMessage()); - } catch (Exception e) { - String message = e.getMessage() != null && !"".equals(e.getMessage()) ? e.getMessage() - : e.getClass().getName() + " occurred in " + this.getClass().getName(); - Status status = new Status(IStatus.ERROR, DslActivator.PLUGIN_ID, message, e); - StatusManager.getManager().handle(status); - ErrorDialog.openError(HandlerUtil.getActiveShell(event), "Error", - "Exception occured during execution of command!", status); - } - return null; - } - - protected Resource getCurrentResource() { - XtextEditor xEditor = EditorUtils.getActiveXtextEditor(); - IResource xResource = xEditor.getResource(); - - URI uri = URI.createPlatformResourceURI(xResource.getFullPath().toString(), true); - - return currentResourceSet.getResource(uri, true); - } - - protected ContextMappingModel getCurrentContextMappingModel() { - Resource resource = currentResource == null ? getCurrentResource() : currentResource; - - List contextMappingModels = IteratorExtensions.toList( - Iterators.filter(resource.getAllContents(), ContextMappingModel.class)); - - if (contextMappingModels.size() > 0) { - return contextMappingModels.get(0); - } - return null; - } - - protected ResourceSet getAllResources() { - IResourceDescriptions index = resourceDescriptionsProvider.createResourceDescriptions(); - for (IResourceDescription resDesc : index.getAllResourceDescriptions()) { - currentResourceSet.getResource(resDesc.getURI(), true); - } - return currentResourceSet; - } - - protected Set getReferencedContextMappingModels(ContextMappingModel rootModel) { - Set models = Sets.newHashSet(); - if (currentResource == null) - return models; - - for (Import cmlImport : rootModel.getImports()) { - ResourceSet rs = currentResource.getResourceSet(); - URI importURI = URI.createURI(cmlImport.getImportURI()); - Resource resource = rs.getResource(importURI.resolve(currentResource.getURI()), true); - if (resource != null) { - List contextMappingModels = IteratorExtensions.toList( - Iterators.filter(resource.getAllContents(), ContextMappingModel.class)); - models.addAll(contextMappingModels); - } - } - return models; - } - - /** - * Implement this method to initialize and execute the requested refactoring. - */ - protected abstract void executeRefactoring(CMLResource resource, ExecutionEvent event); - - /** - * Finds the selected element in the editor (where the user open the - * context-menu) - * - * @return EObject of current context (editor selection) - */ - protected EObject getSelectedElement() { - return xtextEditorHelper.getFirstSelectedElement(EditorUtils.getActiveXtextEditor()); - } - - /** - * Finds all selected objects in the editor. - * - * @return set with all EObject's of the current editor selection. - */ - protected Set getAllSelectedElements() { - return xtextEditorHelper.getAllSelectedElements(EditorUtils.getActiveXtextEditor()); - } - - protected boolean moreThenOneElementSelected() { - return getAllSelectedElements().size() > 1; - } - - private boolean editorHasChanges() { - final XtextEditor editor = EditorUtils.getActiveXtextEditor(); - if (editor != null) { - return editor.isDirty(); - } - return false; - } - - @Override - public boolean isEnabled() { - return !editorHasChanges(); - } - -} diff --git a/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/AbstractRefactoringWithUserInputHandler.java b/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/AbstractRefactoringWithUserInputHandler.java deleted file mode 100644 index ac8e4f74..00000000 --- a/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/AbstractRefactoringWithUserInputHandler.java +++ /dev/null @@ -1,41 +0,0 @@ -package org.contextmapper.dsl.ui.handler; - -import org.contextmapper.dsl.cml.CMLResource; -import org.contextmapper.dsl.exception.ContextMapperApplicationException; -import org.contextmapper.dsl.exception.RefactoringSerializationException; -import org.contextmapper.dsl.refactoring.SemanticCMLRefactoring; -import org.contextmapper.dsl.ui.internal.DslActivator; -import org.eclipse.core.commands.ExecutionEvent; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Status; -import org.eclipse.jface.dialogs.MessageDialog; -import org.eclipse.swt.widgets.Display; -import org.eclipse.ui.handlers.HandlerUtil; -import org.eclipse.ui.statushandlers.StatusManager; - -public abstract class AbstractRefactoringWithUserInputHandler extends AbstractRefactoringHandler { - - /** - * Use this method to finish refactoring after user input (on finish) - */ - protected boolean finishRefactoring(SemanticCMLRefactoring ar, CMLResource resource, ExecutionEvent event) { - Display.getDefault().asyncExec(new Runnable() { - @Override - public void run() { - try { - ar.refactor(resource, getAllResources()); - ar.persistChanges(serializer); - } catch (RefactoringSerializationException e) { - String message = e.getMessage() != null && !"".equals(e.getMessage()) ? e.getMessage() : e.getClass().getName() + " occurred in " + this.getClass().getName(); - Status status = new Status(IStatus.ERROR, DslActivator.PLUGIN_ID, message, e); - StatusManager.getManager().handle(status); - MessageDialog.openInformation(HandlerUtil.getActiveShell(event), "Model Input", e.getMessage()); - } catch (ContextMapperApplicationException e) { - MessageDialog.openInformation(HandlerUtil.getActiveShell(event), "Model Input", e.getMessage()); - } - } - }); - return true; - } - -} diff --git a/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/AddEthicalValueAssessmentToStoryHandler.java b/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/AddEthicalValueAssessmentToStoryHandler.java deleted file mode 100644 index ec8e0d5a..00000000 --- a/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/AddEthicalValueAssessmentToStoryHandler.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright 2024 The Context Mapper Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.contextmapper.dsl.ui.handler; - -import org.contextmapper.dsl.cml.CMLResource; -import org.contextmapper.dsl.contextMappingDSL.UserStory; -import org.contextmapper.dsl.refactoring.AddEthicalValueAssessmentToStory; -import org.contextmapper.dsl.refactoring.SemanticCMLRefactoring; -import org.eclipse.core.commands.ExecutionEvent; -import org.eclipse.emf.ecore.EObject; - -public class AddEthicalValueAssessmentToStoryHandler extends AbstractRefactoringHandler { - - @Override - protected void executeRefactoring(CMLResource resource, ExecutionEvent event) { - UserStory userStory = (UserStory) getSelectedElement(); - SemanticCMLRefactoring ar = new AddEthicalValueAssessmentToStory(userStory.getName()); - ar.refactor(resource, getAllResources()); - ar.persistChanges(serializer); - } - - @Override - public boolean isEnabled() { - EObject obj = getSelectedElement(); - - if (obj == null || !super.isEnabled()) - return false; - - if (!(obj instanceof UserStory)) - return false; - - UserStory story = (UserStory) obj; - - return story.getValuation() == null; - } - -} diff --git a/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/ContextMapGenerationHandler.java b/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/ContextMapGenerationHandler.java deleted file mode 100644 index 204d3a07..00000000 --- a/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/ContextMapGenerationHandler.java +++ /dev/null @@ -1,117 +0,0 @@ -/* - * Copyright 2019 The Context Mapper Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.contextmapper.dsl.ui.handler; - -import org.contextmapper.dsl.generator.ContextMapGenerator; -import org.contextmapper.dsl.generator.contextmap.ContextMapFormat; -import org.contextmapper.dsl.generator.exception.GeneratorInputException; -import org.contextmapper.dsl.ui.handler.wizard.GenerateContextMapContext; -import org.contextmapper.dsl.ui.handler.wizard.GenerateContextMapWizard; -import org.contextmapper.dsl.ui.internal.DslActivator; -import org.eclipse.core.commands.ExecutionEvent; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Status; -import org.eclipse.emf.ecore.resource.Resource; -import org.eclipse.jface.dialogs.MessageDialog; -import org.eclipse.jface.wizard.WizardDialog; -import org.eclipse.swt.widgets.Display; -import org.eclipse.ui.handlers.HandlerUtil; -import org.eclipse.ui.statushandlers.StatusManager; -import org.eclipse.xtext.builder.impl.SetWithProjectNames; -import org.eclipse.xtext.generator.GeneratorContext; -import org.eclipse.xtext.generator.IFileSystemAccess2; -import org.eclipse.xtext.generator.IGenerator2; - -import com.google.inject.Inject; - -public class ContextMapGenerationHandler extends AbstractGenerationHandler { - - @Inject - private ContextMapGenerator generator; - - @Override - protected IGenerator2 getGenerator() { - return generator; - } - - @Override - protected void runGeneration(Resource resource, ExecutionEvent event, IFileSystemAccess2 fsa) { - try { - if (!generator.isGraphvizInstalled()) { - MessageDialog.openInformation(HandlerUtil.getActiveShell(event), "Graphviz installation not found", - "Graphviz has not been found on your system. Ensure it is installed and the binaries are part of your PATH environment variable."); - return; - } - } catch (Exception e) { - String message = e.getMessage() != null && !"".equals(e.getMessage()) ? e.getMessage() : e.getClass().getName() + " occurred in " + this.getClass().getName(); - Status status = new Status(IStatus.ERROR, DslActivator.PLUGIN_ID, message, e); - StatusManager.getManager().handle(status); - MessageDialog.openInformation(HandlerUtil.getActiveShell(event), "Graphviz installation check", - "Your PATH variable could not be parsed to check if Graphviz is installed. The generator may not work if Graphviz is not available."); - } - - GenerateContextMapContext context = createContext(event); - new WizardDialog(HandlerUtil.getActiveShell(event), new GenerateContextMapWizard(context, executionContext -> { - persistContext(event, executionContext); - generator.setContextMapFormats(context.getFormats().toArray(new ContextMapFormat[context.getFormats().size()])); - generator.setLabelSpacingFactor(context.getLabelSpacingFactor()); - generator.clusterTeams(context.clusterTeams()); - if (context.isFixWidth()) - generator.setWidth(context.getWidth()); - else if (context.isFixHeight()) - generator.setHeight(context.getHeight()); - generator.printAdditionalLabels(context.generateAdditionalLabels()); - Display.getDefault().asyncExec(new Runnable() { - @Override - public void run() { - try { - getGenerator().doGenerate(resource, fsa, new GeneratorContext()); - } catch (GeneratorInputException e) { - MessageDialog.openInformation(HandlerUtil.getActiveShell(event), "Model Input", e.getMessage()); - } - } - }); - return true; - })).open(); - } - - private GenerateContextMapContext createContext(ExecutionEvent event) { - GenerateContextMapContext context = new GenerateContextMapContext(); - if (isWorkspacePropertySet(event, "fixHeight")) - context.setFixHeight(Boolean.valueOf(getWorkspaceProperty(event, "fixHeight"))); - if (isWorkspacePropertySet(event, "fixWidth")) - context.setFixHeight(Boolean.valueOf(getWorkspaceProperty(event, "fixWidth"))); - if (isWorkspacePropertySet(event, "generateAdditionalLabels")) - context.setGenerateAdditionalLabels(Boolean.valueOf(getWorkspaceProperty(event, "generateAdditionalLabels"))); - if (context.isFixWidth() && isWorkspacePropertySet(event, "width")) - context.setWidth(Integer.valueOf(getWorkspaceProperty(event, "width"))); - if (context.isFixHeight() && isWorkspacePropertySet(event, "height")) - context.setHeight(Integer.valueOf(getWorkspaceProperty(event, "height"))); - if (isWorkspacePropertySet(event, "labelSpacingFactor")) - context.setLabelSpacingFactor(Integer.valueOf(getWorkspaceProperty(event, "labelSpacingFactor"))); - return context; - } - - private void persistContext(ExecutionEvent event, GenerateContextMapContext context) { - persistWorkspaceProperty(event, "fixHeight", String.valueOf(context.isFixHeight())); - persistWorkspaceProperty(event, "fixWidth", String.valueOf(context.isFixWidth())); - persistWorkspaceProperty(event, "generateAdditionalLabels", String.valueOf(context.generateAdditionalLabels())); - persistWorkspaceProperty(event, "labelSpacingFactor", String.valueOf(context.getLabelSpacingFactor())); - persistWorkspaceProperty(event, "width", String.valueOf(context.getWidth())); - persistWorkspaceProperty(event, "height", String.valueOf(context.getHeight())); - } - -} diff --git a/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/ExtractAggregatesByCohesionRefactoringHandler.java b/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/ExtractAggregatesByCohesionRefactoringHandler.java deleted file mode 100644 index 9b6b7331..00000000 --- a/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/ExtractAggregatesByCohesionRefactoringHandler.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright 2018 The Context Mapper Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.contextmapper.dsl.ui.handler; - -import java.util.stream.Collectors; - -import org.contextmapper.dsl.cml.CMLResource; -import org.contextmapper.dsl.contextMappingDSL.BoundedContext; -import org.contextmapper.dsl.refactoring.ExtractAggregatesByCohesion; -import org.contextmapper.dsl.ui.handler.wizard.ExtractAggregatesByCohesionContext; -import org.contextmapper.dsl.ui.handler.wizard.ExtractAggregatesByCohesionRefactoringWizard; -import org.eclipse.core.commands.ExecutionEvent; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.jface.wizard.WizardDialog; -import org.eclipse.ui.handlers.HandlerUtil; - -public class ExtractAggregatesByCohesionRefactoringHandler extends AbstractRefactoringWithUserInputHandler { - - @Override - public boolean isEnabled() { - EObject obj = getSelectedElement(); - - if (obj == null || !super.isEnabled()) - return false; - - // only allowed on bounded contexts - if (!(obj instanceof BoundedContext)) - return false; - - BoundedContext bc = (BoundedContext) obj; - return bc.getAggregates().size() > 1; - } - - @Override - protected void executeRefactoring(CMLResource resource, ExecutionEvent event) { - BoundedContext bc = (BoundedContext) getSelectedElement(); - - ExtractAggregatesByCohesionContext refactoringContext = new ExtractAggregatesByCohesionContext("NewBoundedContext", - bc.getAggregates().stream().map(agg -> agg.getName()).collect(Collectors.toList())); - - new WizardDialog(HandlerUtil.getActiveShell(event), new ExtractAggregatesByCohesionRefactoringWizard(refactoringContext, executionContext -> { - return finishRefactoring(new ExtractAggregatesByCohesion(bc.getName(), executionContext.getNewBoundedContextName(), executionContext.getSelectedAggregates()), resource, - event); - })).open(); - } - -} diff --git a/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/ExtractAggregatesByVolatilityRefactoringHandler.java b/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/ExtractAggregatesByVolatilityRefactoringHandler.java deleted file mode 100644 index 196b042c..00000000 --- a/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/ExtractAggregatesByVolatilityRefactoringHandler.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright 2019 The Context Mapper Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.contextmapper.dsl.ui.handler; - -import java.util.List; -import java.util.stream.Collectors; - -import org.contextmapper.dsl.cml.CMLResource; -import org.contextmapper.dsl.contextMappingDSL.BoundedContext; -import org.contextmapper.dsl.contextMappingDSL.Volatility; -import org.contextmapper.dsl.refactoring.ExtractAggregatesByVolatility; -import org.contextmapper.dsl.ui.handler.wizard.ExtractAggregatesByVolatilityContext; -import org.contextmapper.dsl.ui.handler.wizard.ExtractAggregatesByVolatilityRefactoringWizard; -import org.eclipse.core.commands.ExecutionEvent; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.jface.wizard.WizardDialog; -import org.eclipse.ui.handlers.HandlerUtil; - -public class ExtractAggregatesByVolatilityRefactoringHandler extends AbstractRefactoringWithUserInputHandler { - - @Override - protected void executeRefactoring(CMLResource resource, ExecutionEvent event) { - BoundedContext bc = (BoundedContext) getSelectedElement(); - - ExtractAggregatesByVolatilityContext refactoringContext = new ExtractAggregatesByVolatilityContext( - bc.getAggregates().stream().map(agg -> agg.getLikelihoodForChange()).collect(Collectors.toList())); - - new WizardDialog(HandlerUtil.getActiveShell(event), new ExtractAggregatesByVolatilityRefactoringWizard(refactoringContext, executionContext -> { - ExtractAggregatesByVolatility ar = new ExtractAggregatesByVolatility(bc.getName(), executionContext.getVolatilityToExtract()); - return finishRefactoring(ar, resource, event); - })).open(); - } - - @Override - public boolean isEnabled() { - EObject obj = getSelectedElement(); - - if (obj == null || !super.isEnabled()) - return false; - - // only allowed on bounded contexts - if (!(obj instanceof BoundedContext)) - return false; - - BoundedContext bc = (BoundedContext) obj; - List likelihoods = bc.getAggregates().stream().map(agg -> agg.getLikelihoodForChange()).collect(Collectors.toList()); - return likelihoods.size() > 1; - } - -} diff --git a/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/ExtractSharedKernelRefactoringHandler.java b/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/ExtractSharedKernelRefactoringHandler.java deleted file mode 100644 index b620f195..00000000 --- a/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/ExtractSharedKernelRefactoringHandler.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright 2019 The Context Mapper Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.contextmapper.dsl.ui.handler; - -import org.contextmapper.dsl.cml.CMLResource; -import org.contextmapper.dsl.contextMappingDSL.SharedKernel; -import org.contextmapper.dsl.refactoring.ExtractSharedKernelRefactoring; -import org.contextmapper.dsl.refactoring.SemanticCMLRefactoring; -import org.eclipse.core.commands.ExecutionEvent; -import org.eclipse.emf.ecore.EObject; - -public class ExtractSharedKernelRefactoringHandler extends AbstractRefactoringHandler { - - @Override - protected void executeRefactoring(CMLResource resource, ExecutionEvent event) { - SharedKernel sk = (SharedKernel) getSelectedElement(); - SemanticCMLRefactoring ar = new ExtractSharedKernelRefactoring(sk.getParticipant1().getName(), sk.getParticipant2().getName()); - ar.refactor(resource); - ar.persistChanges(serializer); - } - - @Override - public boolean isEnabled() { - EObject obj = getSelectedElement(); - - if (obj == null || !super.isEnabled()) - return false; - - // only allowed on Shared Kernel relationship - if (!(obj instanceof SharedKernel)) - return false; - - return true; - } - -} diff --git a/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/GenerateBackendFrontendSystemsFromFeatureBCRefactoringHandler.java b/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/GenerateBackendFrontendSystemsFromFeatureBCRefactoringHandler.java deleted file mode 100644 index cd5fdb33..00000000 --- a/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/GenerateBackendFrontendSystemsFromFeatureBCRefactoringHandler.java +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Copyright 2020 The Context Mapper Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.contextmapper.dsl.ui.handler; - -import java.util.List; -import java.util.Set; -import java.util.stream.Collectors; - -import org.contextmapper.dsl.cml.CMLImportResolver; -import org.contextmapper.dsl.cml.CMLResource; -import org.contextmapper.dsl.contextMappingDSL.BoundedContext; -import org.contextmapper.dsl.contextMappingDSL.BoundedContextType; -import org.contextmapper.dsl.refactoring.DeriveFrontendAndBackendSystemsFromFeature; -import org.contextmapper.dsl.ui.handler.wizard.DeriveBackendFrontendFromFeatureContext; -import org.contextmapper.dsl.ui.handler.wizard.DeriveBackendFrontendSystemsFromFeatureWizard; -import org.eclipse.core.commands.ExecutionEvent; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.resource.Resource; -import org.eclipse.jface.wizard.WizardDialog; -import org.eclipse.ui.handlers.HandlerUtil; - -import com.google.common.collect.Lists; - -public class GenerateBackendFrontendSystemsFromFeatureBCRefactoringHandler extends AbstractRefactoringWithUserInputHandler { - - @Override - protected void executeRefactoring(CMLResource resource, ExecutionEvent event) { - BoundedContext selectedContext = (BoundedContext) getSelectedElement(); - Set allBCNames = collectAllBoundedContexts().stream().map(bc -> bc.getName()).collect(Collectors.toSet()); - - DeriveBackendFrontendFromFeatureContext refactoringContext = new DeriveBackendFrontendFromFeatureContext(selectedContext.getName(), allBCNames); - refactoringContext.setFrontendImplementationTechnology(selectedContext.getImplementationTechnology() != null ? selectedContext.getImplementationTechnology() : ""); - refactoringContext.setBackendImplementationTechnology(selectedContext.getImplementationTechnology() != null ? selectedContext.getImplementationTechnology() : ""); - refactoringContext.setRelationshipImplementationTechnology(""); - new WizardDialog(HandlerUtil.getActiveShell(event), new DeriveBackendFrontendSystemsFromFeatureWizard(refactoringContext, executionContext -> { - DeriveFrontendAndBackendSystemsFromFeature ar = new DeriveFrontendAndBackendSystemsFromFeature( - executionContext.getFeatureBoundedContextName(), executionContext.getRelationshipType()); - ar.deriveViewModelInFronted(executionContext.deriveViewModelInFrontend()); - ar.setBackendName(executionContext.getBackendName()); - ar.setFrontendName(executionContext.getFrontendName()); - ar.setBackendImplementationTechnology(executionContext.getBackendImplementationTechnology()); - ar.setFrontendImplementationTechnology(executionContext.getFrontendImplementationTechnology()); - ar.setRelationshipImplTechnology(executionContext.getRelationshipImplementationTechnology()); - return finishRefactoring(ar, resource, event); - })).open(); - } - - @Override - public boolean isEnabled() { - EObject obj = getSelectedElement(); - - if (!(obj instanceof BoundedContext)) - return false; - - BoundedContext selectedContext = (BoundedContext) obj; - if (selectedContext.getType() != BoundedContextType.FEATURE && selectedContext.getType() != BoundedContextType.APPLICATION) - return false; - - return super.isEnabled(); - } - - private List collectAllBoundedContexts() { - List bcList = Lists.newLinkedList(); - Resource currentResource = getCurrentResource(); - bcList.addAll(getCurrentContextMappingModel().getBoundedContexts()); - for (CMLResource cmlResource : new CMLImportResolver().resolveImportedResources(new CMLResource(currentResource))) { - bcList.addAll(cmlResource.getContextMappingModel().getBoundedContexts()); - } - return bcList; - } - -} diff --git a/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/GenerateBoundedContextFromSubdomainRefactoringHandler.java b/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/GenerateBoundedContextFromSubdomainRefactoringHandler.java deleted file mode 100644 index c05c155b..00000000 --- a/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/GenerateBoundedContextFromSubdomainRefactoringHandler.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright 2020 The Context Mapper Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.contextmapper.dsl.ui.handler; - -import java.util.Optional; -import java.util.Set; -import java.util.stream.Collectors; - -import org.contextmapper.dsl.cml.CMLResource; -import org.contextmapper.dsl.contextMappingDSL.Subdomain; -import org.contextmapper.dsl.refactoring.DeriveBoundedContextFromSubdomains; -import org.contextmapper.dsl.ui.handler.wizard.DeriveBoundedContextFromSubdomainsContext; -import org.contextmapper.dsl.ui.handler.wizard.DeriveBoundedContextFromSubdomainsWizard; -import org.eclipse.core.commands.ExecutionEvent; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.jface.wizard.WizardDialog; -import org.eclipse.ui.handlers.HandlerUtil; - -public class GenerateBoundedContextFromSubdomainRefactoringHandler extends AbstractRefactoringWithUserInputHandler { - - @Override - protected void executeRefactoring(CMLResource resource, ExecutionEvent event) { - Set subdomains = getAllSelectedElements().stream().filter(sd -> sd instanceof Subdomain).map(sd -> (Subdomain) sd).collect(Collectors.toSet()); - Set boundedContexts = resource.getContextMappingModel().getBoundedContexts().stream().map(bc -> bc.getName()).collect(Collectors.toSet()); - Set ids = subdomains.stream().map(sd -> sd.getName()).collect(Collectors.toSet()); - - DeriveBoundedContextFromSubdomainsContext refactoringContext = new DeriveBoundedContextFromSubdomainsContext("NewContextFromSubdomains", boundedContexts); - new WizardDialog(HandlerUtil.getActiveShell(event), new DeriveBoundedContextFromSubdomainsWizard(refactoringContext, executionContext -> { - return finishRefactoring(new DeriveBoundedContextFromSubdomains(executionContext.getBoundedContextName(), ids), resource, event); - })).open(); - } - - @Override - public boolean isEnabled() { - Set objs = getAllSelectedElements(); - - if (objs.isEmpty()) - return false; - - // selection must at least contain one subdomain - Optional optSubdomain = objs.stream().filter(o -> o instanceof Subdomain).map(o -> (Subdomain) o).findFirst(); - if (!optSubdomain.isPresent()) - return false; - - return super.isEnabled(); - } - -} diff --git a/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/GenerateSubdomainFromUserRequirementsRefactoringHandler.java b/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/GenerateSubdomainFromUserRequirementsRefactoringHandler.java deleted file mode 100644 index 034a3453..00000000 --- a/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/GenerateSubdomainFromUserRequirementsRefactoringHandler.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Copyright 2020 The Context Mapper Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.contextmapper.dsl.ui.handler; - -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.stream.Collectors; - -import org.contextmapper.dsl.cml.CMLResource; -import org.contextmapper.dsl.contextMappingDSL.ContextMappingModel; -import org.contextmapper.dsl.contextMappingDSL.Domain; -import org.contextmapper.dsl.contextMappingDSL.UserRequirement; -import org.contextmapper.dsl.refactoring.DeriveSubdomainFromUserRequirements; -import org.contextmapper.dsl.ui.handler.wizard.DeriveSubdomainsFromRequirementsContext; -import org.contextmapper.dsl.ui.handler.wizard.DeriveSubdomainsFromRequirementsWizard; -import org.eclipse.core.commands.ExecutionEvent; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.jface.wizard.WizardDialog; -import org.eclipse.ui.handlers.HandlerUtil; - -import com.google.common.collect.Maps; - -public class GenerateSubdomainFromUserRequirementsRefactoringHandler extends AbstractRefactoringWithUserInputHandler { - - @Override - public boolean isEnabled() { - Set objects = getAllSelectedElements(); - - if (objects == null || objects.isEmpty() || !super.isEnabled()) - return false; - - // selection must at least contain one user requirements (use case or user - // story) - return objects.stream().filter(o -> o instanceof UserRequirement).findFirst().isPresent() && super.isEnabled(); - } - - @Override - protected void executeRefactoring(CMLResource resource, ExecutionEvent event) { - Set userRequirements = getAllSelectedElements().stream().filter(o -> o instanceof UserRequirement).map(o -> (UserRequirement) o) - .collect(Collectors.toSet()); - - List allDomains = getCurrentContextMappingModel().getDomains().stream().map(d -> d.getName()).collect(Collectors.toList()); - String initialDomain = allDomains.isEmpty() ? "" : allDomains.iterator().next(); - - DeriveSubdomainsFromRequirementsContext refactoringContext = new DeriveSubdomainsFromRequirementsContext(initialDomain, - collectAllDomainsAndSubdomains(getCurrentContextMappingModel())); - new WizardDialog(HandlerUtil.getActiveShell(event), new DeriveSubdomainsFromRequirementsWizard(refactoringContext, executionContext -> { - return finishRefactoring(new DeriveSubdomainFromUserRequirements(executionContext.getDomainName(), executionContext.getSubdomainName(), - userRequirements.stream().map(ur -> ur.getName()).collect(Collectors.toSet())), resource, event); - })).open(); - } - - private Map> collectAllDomainsAndSubdomains(ContextMappingModel model) { - Map> allDomainsAndSubdomains = Maps.newHashMap(); - for (Domain domain : model.getDomains()) { - allDomainsAndSubdomains.put(domain.getName(), domain.getSubdomains().stream().map(sd -> sd.getName()).collect(Collectors.toSet())); - } - return allDomainsAndSubdomains; - } - -} diff --git a/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/GenericTextFileGenerationHandler.java b/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/GenericTextFileGenerationHandler.java deleted file mode 100644 index 125339d6..00000000 --- a/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/GenericTextFileGenerationHandler.java +++ /dev/null @@ -1,126 +0,0 @@ -/* - * Copyright 2019 The Context Mapper Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.contextmapper.dsl.ui.handler; - -import java.io.File; -import java.util.Map; - -import org.contextmapper.dsl.exception.ContextMapperApplicationException; -import org.contextmapper.dsl.generator.GenericContentGenerator; -import org.contextmapper.dsl.ui.handler.wizard.GenerateGenericTextFileContext; -import org.contextmapper.dsl.ui.handler.wizard.GenerateGenericTextFileWizard; -import org.contextmapper.dsl.ui.internal.DslActivator; -import org.eclipse.core.commands.ExecutionEvent; -import org.eclipse.core.resources.IFile; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Platform; -import org.eclipse.core.runtime.QualifiedName; -import org.eclipse.core.runtime.Status; -import org.eclipse.emf.ecore.resource.Resource; -import org.eclipse.jface.dialogs.MessageDialog; -import org.eclipse.jface.wizard.WizardDialog; -import org.eclipse.swt.widgets.Display; -import org.eclipse.ui.handlers.HandlerUtil; -import org.eclipse.ui.statushandlers.StatusManager; -import org.eclipse.xtext.generator.GeneratorContext; -import org.eclipse.xtext.generator.IFileSystemAccess2; -import org.eclipse.xtext.generator.IGenerator2; -import org.osgi.framework.Bundle; - -import com.google.inject.Inject; - -public class GenericTextFileGenerationHandler extends AbstractGenerationHandler { - - private static final String LAST_SELECTED_TEMPLATE_PROPERTY = "lastSelectedTemplate"; - private static final String LAST_TARGET_FILE_NAME_PROPERTY = "lastTargetFileName"; - - @Inject - private GenericContentGenerator generator; - - private IFile selectedCmlFile; - - @Override - protected IGenerator2 getGenerator() { - return generator; - } - - @Override - protected void runGeneration(Resource resource, ExecutionEvent event, IFileSystemAccess2 fsa) { - selectedCmlFile = getSelectedFile(event); - GenerateGenericTextFileContext context = getLastStoredContext(event, resource.getURI().lastSegment()); - registerCustomGenerationVariables(event); - new WizardDialog(HandlerUtil.getActiveShell(event), new GenerateGenericTextFileWizard(context, executionContext -> { - generator.setFreemarkerTemplateFile(new File(context.getFreemarkerTemplateFile().getLocationURI())); - generator.setTargetFileName(context.getTargetFileName()); - persistContext(context); - Display.getDefault().asyncExec(new Runnable() { - @Override - public void run() { - try { - getGenerator().doGenerate(resource, fsa, new GeneratorContext()); - } catch (ContextMapperApplicationException e) { - MessageDialog.openInformation(HandlerUtil.getActiveShell(event), "Model Input", e.getMessage()); - } - } - }); - return true; - })).open(); - } - - private void registerCustomGenerationVariables(ExecutionEvent event) { - String projectName = getSelectedFile(event).getProject().getName(); - generator.registerCustomModelProperty("projectname", projectName); // for backwards compatibility - generator.registerCustomModelProperty("projectName", projectName); - Bundle contextMapperBundle = Platform.getBundle("org.contextmapper.dsl.ui"); - if (contextMapperBundle != null) - generator.registerCustomModelProperty("contextMapperVersion", contextMapperBundle.getVersion().toString()); - } - - private GenerateGenericTextFileContext getLastStoredContext(ExecutionEvent event, String inputFileName) { - GenerateGenericTextFileContext context = new GenerateGenericTextFileContext(inputFileName); - try { - Map properties = selectedCmlFile.getPersistentProperties(); - if (!properties.containsKey(getQualifiedName4File(selectedCmlFile, LAST_SELECTED_TEMPLATE_PROPERTY))) - return context; - IFile templateFile = findFileInContainer(selectedCmlFile.getWorkspace().getRoot(), - properties.get(getQualifiedName4File(selectedCmlFile, LAST_SELECTED_TEMPLATE_PROPERTY))); - context.setFreemarkerTemplateFile(templateFile); - if (properties.containsKey(getQualifiedName4File(selectedCmlFile, LAST_TARGET_FILE_NAME_PROPERTY))) - context.setTargetFileName(properties.get(getQualifiedName4File(selectedCmlFile, LAST_TARGET_FILE_NAME_PROPERTY))); - } catch (CoreException e) { - StatusManager.getManager().handle(new Status(IStatus.ERROR, DslActivator.PLUGIN_ID, "Could not read persisted template file location.", e)); - } - return context; - } - - private void persistContext(GenerateGenericTextFileContext context) { - try { - IFile templateFile = context.getFreemarkerTemplateFile(); - selectedCmlFile.setPersistentProperty(getQualifiedName4File(selectedCmlFile, LAST_SELECTED_TEMPLATE_PROPERTY), - templateFile.getProject().getName() + IPath.SEPARATOR + templateFile.getProjectRelativePath().toString()); - selectedCmlFile.setPersistentProperty(getQualifiedName4File(selectedCmlFile, LAST_TARGET_FILE_NAME_PROPERTY), context.getTargetFileName()); - } catch (CoreException e) { - StatusManager.getManager().handle(new Status(IStatus.ERROR, DslActivator.PLUGIN_ID, "Could not persist template file location.", e)); - } - } - - private QualifiedName getQualifiedName4File(IFile file, String property) { - return new QualifiedName("org.contextmapper.genericGenerator." + property, file.getProjectRelativePath().toString()); - } - -} diff --git a/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/MDSLGenerationHandler.java b/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/MDSLGenerationHandler.java deleted file mode 100644 index def94e00..00000000 --- a/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/MDSLGenerationHandler.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright 2019 The Context Mapper Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.contextmapper.dsl.ui.handler; - -import org.contextmapper.dsl.generator.MDSLContractsGenerator; -import org.eclipse.xtext.generator.IGenerator2; - -import com.google.inject.Inject; - -public class MDSLGenerationHandler extends AbstractGenerationHandler { - - @Inject - private MDSLContractsGenerator generator; - - @Override - protected IGenerator2 getGenerator() { - return generator; - } - -} diff --git a/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/MergeAggregatesRefactoringHandler.java b/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/MergeAggregatesRefactoringHandler.java deleted file mode 100644 index 37b157de..00000000 --- a/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/MergeAggregatesRefactoringHandler.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Copyright 2019 The Context Mapper Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.contextmapper.dsl.ui.handler; - -import java.util.List; -import java.util.stream.Collectors; - -import org.contextmapper.dsl.cml.CMLResource; -import org.contextmapper.dsl.contextMappingDSL.Aggregate; -import org.contextmapper.dsl.contextMappingDSL.BoundedContext; -import org.contextmapper.dsl.contextMappingDSL.SculptorModule; -import org.contextmapper.dsl.refactoring.MergeAggregatesRefactoring; -import org.contextmapper.dsl.ui.handler.wizard.MergeAggregatesContext; -import org.contextmapper.dsl.ui.handler.wizard.MergeAggregatesRefactoringWizard; -import org.eclipse.core.commands.ExecutionEvent; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.jface.wizard.WizardDialog; -import org.eclipse.ui.handlers.HandlerUtil; - -public class MergeAggregatesRefactoringHandler extends AbstractRefactoringWithUserInputHandler { - - @Override - public boolean isEnabled() { - EObject obj = getSelectedElement(); - - if (obj == null || !super.isEnabled()) - return false; - - // only allowed on aggregates - if (!(obj instanceof Aggregate)) - return false; - - return true; - } - - @Override - protected void executeRefactoring(CMLResource resource, ExecutionEvent event) { - Aggregate aggregate = (Aggregate) getSelectedElement(); - BoundedContext parentBC = null; - if (aggregate.eContainer() instanceof BoundedContext) { - parentBC = (BoundedContext) aggregate.eContainer(); - } else if (aggregate.eContainer() instanceof SculptorModule) { - SculptorModule module = (SculptorModule) aggregate.eContainer(); - parentBC = (BoundedContext) module.eContainer(); - } else { - throw new RuntimeException("Unexpected change in model: Aggregate must be part of a Bounded Context or a Module!"); - } - - List allAggregates = parentBC.getAggregates().stream().map(agg -> agg.getName()).collect(Collectors.toList()); - for (SculptorModule module : parentBC.getModules()) { - allAggregates.addAll(module.getAggregates().stream().map(agg -> agg.getName()).collect(Collectors.toList())); - } - - MergeAggregatesContext refactoringContext = new MergeAggregatesContext(aggregate.getName(), allAggregates); - - new WizardDialog(HandlerUtil.getActiveShell(event), new MergeAggregatesRefactoringWizard(refactoringContext, executionContext -> { - return finishRefactoring(new MergeAggregatesRefactoring(executionContext.getSelectedAggregate1(), executionContext.getSelectedAggregate2(), - executionContext.takeAttributesFromSecondAggregate()), resource, event); - })).open(); - } - -} diff --git a/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/MergeBoundedContextsRefactoringHandler.java b/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/MergeBoundedContextsRefactoringHandler.java deleted file mode 100644 index f254b909..00000000 --- a/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/MergeBoundedContextsRefactoringHandler.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Copyright 2018 The Context Mapper Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.contextmapper.dsl.ui.handler; - -import java.util.Set; -import java.util.stream.Collectors; - -import org.contextmapper.dsl.cml.CMLResource; -import org.contextmapper.dsl.contextMappingDSL.BoundedContext; -import org.contextmapper.dsl.contextMappingDSL.ContextMappingModel; -import org.contextmapper.dsl.refactoring.MergeBoundedContextsRefactoring; -import org.contextmapper.dsl.ui.handler.wizard.MergeBoundedContextsContext; -import org.contextmapper.dsl.ui.handler.wizard.MergeBoundedContextsRefactoringWizard; -import org.eclipse.core.commands.ExecutionEvent; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.jface.wizard.WizardDialog; -import org.eclipse.ui.handlers.HandlerUtil; -import org.eclipse.xtext.EcoreUtil2; - -import com.google.common.collect.Sets; - -public class MergeBoundedContextsRefactoringHandler extends AbstractRefactoringWithUserInputHandler { - - @Override - public boolean isEnabled() { - EObject obj = getSelectedElement(); - - if (obj == null || !super.isEnabled()) - return false; - - // only allowed on bounded contexts - if (!(obj instanceof BoundedContext)) - return false; - - return true; - } - - @Override - protected void executeRefactoring(CMLResource resource, ExecutionEvent event) { - BoundedContext bc = (BoundedContext) getSelectedElement(); - - MergeBoundedContextsContext refactoringContext = new MergeBoundedContextsContext(bc.getName(), - collectAllBoundedContexts().stream().map(b -> b.getName()).collect(Collectors.toList())); - - new WizardDialog(HandlerUtil.getActiveShell(event), new MergeBoundedContextsRefactoringWizard(refactoringContext, executionContext -> { - return finishRefactoring(new MergeBoundedContextsRefactoring(executionContext.getSelectedBoundedContext1(), executionContext.getSelectedBoundedContext2(), - executionContext.takeAttributesFromSecondBoundedContext()), resource, event); - })).open(); - } - - private Set collectAllBoundedContexts() { - Set allBoundedContexts = Sets.newHashSet(); - ContextMappingModel rootModel = this.getCurrentContextMappingModel(); - allBoundedContexts.addAll(EcoreUtil2.getAllContentsOfType(rootModel, BoundedContext.class)); - Set referencedModels = this.getReferencedContextMappingModels(rootModel); - for (ContextMappingModel model : referencedModels) { - allBoundedContexts.addAll(EcoreUtil2.getAllContentsOfType(model, BoundedContext.class)); - } - return allBoundedContexts; - } - -} diff --git a/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/PlantUMLGenerationHandler.java b/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/PlantUMLGenerationHandler.java deleted file mode 100644 index c877ba41..00000000 --- a/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/PlantUMLGenerationHandler.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright 2018 The Context Mapper Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.contextmapper.dsl.ui.handler; - -import org.contextmapper.dsl.generator.PlantUMLGenerator; -import org.eclipse.xtext.generator.IGenerator2; - -import com.google.inject.Inject; - -public class PlantUMLGenerationHandler extends AbstractGenerationHandler { - - @Inject - private PlantUMLGenerator generator; - - @Override - protected IGenerator2 getGenerator() { - return generator; - } - -} diff --git a/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/SketchMinerGenerationHandler.java b/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/SketchMinerGenerationHandler.java deleted file mode 100644 index 4cd6d712..00000000 --- a/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/SketchMinerGenerationHandler.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright 2018 The Context Mapper Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.contextmapper.dsl.ui.handler; - -import org.contextmapper.dsl.generator.SketchMinerGenerator; -import org.eclipse.xtext.generator.IGenerator2; - -import com.google.inject.Inject; - -public class SketchMinerGenerationHandler extends AbstractGenerationHandler { - - @Inject - private SketchMinerGenerator generator; - - @Override - protected IGenerator2 getGenerator() { - return generator; - } - -} diff --git a/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/SplitAggregateByEntitiesRefactoringHandler.java b/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/SplitAggregateByEntitiesRefactoringHandler.java deleted file mode 100644 index 6cd26faa..00000000 --- a/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/SplitAggregateByEntitiesRefactoringHandler.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright 2018 The Context Mapper Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.contextmapper.dsl.ui.handler; - -import java.util.List; -import java.util.stream.Collectors; - -import org.contextmapper.dsl.cml.CMLResource; -import org.contextmapper.dsl.contextMappingDSL.Aggregate; -import org.contextmapper.dsl.refactoring.SemanticCMLRefactoring; -import org.contextmapper.dsl.refactoring.SplitAggregateByEntitiesRefactoring; -import org.contextmapper.tactic.dsl.tacticdsl.Entity; -import org.contextmapper.tactic.dsl.tacticdsl.SimpleDomainObject; -import org.eclipse.core.commands.ExecutionEvent; -import org.eclipse.emf.ecore.EObject; - -public class SplitAggregateByEntitiesRefactoringHandler extends AbstractRefactoringHandler { - - @Override - protected void executeRefactoring(CMLResource resource, ExecutionEvent event) { - Aggregate aggregate = (Aggregate) getSelectedElement(); - SemanticCMLRefactoring ar = new SplitAggregateByEntitiesRefactoring(aggregate.getName()); - ar.refactor(resource, getAllResources()); - ar.persistChanges(serializer); - } - - @Override - public boolean isEnabled() { - EObject obj = getSelectedElement(); - - if (obj == null || !super.isEnabled()) - return false; - - // only allowed on aggregates - if (!(obj instanceof Aggregate)) - return false; - - // aggregate should at least have two entities - Aggregate aggregate = (Aggregate) obj; - List entities = aggregate.getDomainObjects().stream().filter(so -> so instanceof Entity).collect(Collectors.toList()); - if (entities.size() < 2) - return false; - - return true; - } - -} diff --git a/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/SplitBoundedContextByOwnerRefactoringHandler.java b/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/SplitBoundedContextByOwnerRefactoringHandler.java deleted file mode 100644 index 0b6082bb..00000000 --- a/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/SplitBoundedContextByOwnerRefactoringHandler.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright 2018 The Context Mapper Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.contextmapper.dsl.ui.handler; - -import java.util.Set; -import java.util.stream.Collectors; - -import org.contextmapper.dsl.cml.CMLResource; -import org.contextmapper.dsl.contextMappingDSL.BoundedContext; -import org.contextmapper.dsl.refactoring.SemanticCMLRefactoring; -import org.contextmapper.dsl.refactoring.SplitBoundedContextByOwner; -import org.eclipse.core.commands.ExecutionEvent; -import org.eclipse.emf.ecore.EObject; - -public class SplitBoundedContextByOwnerRefactoringHandler extends AbstractRefactoringHandler { - - @Override - protected void executeRefactoring(CMLResource resource, ExecutionEvent event) { - BoundedContext bc = (BoundedContext) getSelectedElement(); - SemanticCMLRefactoring ar = new SplitBoundedContextByOwner(bc.getName()); - ar.refactor(resource, getAllResources()); - ar.persistChanges(serializer); - } - - @Override - public boolean isEnabled() { - EObject obj = getSelectedElement(); - - if (obj == null || !super.isEnabled()) - return false; - - // only allowed on aggregates - if (!(obj instanceof BoundedContext)) - return false; - - BoundedContext bc = (BoundedContext) obj; - Set owners = bc.getAggregates().stream().map(agg -> agg.getOwner() == null ? "" : agg.getOwner().getName()).collect(Collectors.toSet()); - return owners.size() > 1; - } - -} diff --git a/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/SplitBoundedContextByUseCasesRefactoringHandler.java b/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/SplitBoundedContextByUseCasesRefactoringHandler.java deleted file mode 100644 index 79074a21..00000000 --- a/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/SplitBoundedContextByUseCasesRefactoringHandler.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright 2018 The Context Mapper Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.contextmapper.dsl.ui.handler; - -import java.util.Set; -import java.util.stream.Collectors; - -import org.contextmapper.dsl.cml.CMLResource; -import org.contextmapper.dsl.contextMappingDSL.BoundedContext; -import org.contextmapper.dsl.refactoring.SemanticCMLRefactoring; -import org.contextmapper.dsl.refactoring.SplitBoundedContextByFeatures; -import org.eclipse.core.commands.ExecutionEvent; -import org.eclipse.emf.ecore.EObject; - -public class SplitBoundedContextByUseCasesRefactoringHandler extends AbstractRefactoringHandler { - - @Override - protected void executeRefactoring(CMLResource resource, ExecutionEvent event) { - BoundedContext bc = (BoundedContext) getSelectedElement(); - SemanticCMLRefactoring ar = new SplitBoundedContextByFeatures(bc.getName()); - ar.refactor(resource, getAllResources()); - ar.persistChanges(serializer); - } - - @Override - public boolean isEnabled() { - EObject obj = getSelectedElement(); - - if (obj == null || !super.isEnabled()) - return false; - - // only allowed on bounded contexts - if (!(obj instanceof BoundedContext)) - return false; - - BoundedContext bc = (BoundedContext) obj; - Set useCaseSets = bc.getAggregates().stream().map(agg -> agg.getUserRequirements().stream().map(uc -> uc.getName()).collect(Collectors.joining(", "))) - .collect(Collectors.toSet()); - - return useCaseSets.size() > 1; - } - -} diff --git a/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/SplitSystemIntoSubsystemsRefactoringHandler.java b/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/SplitSystemIntoSubsystemsRefactoringHandler.java deleted file mode 100644 index c7bc0b2d..00000000 --- a/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/SplitSystemIntoSubsystemsRefactoringHandler.java +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Copyright 2020 The Context Mapper Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.contextmapper.dsl.ui.handler; - -import java.util.List; -import java.util.Set; -import java.util.stream.Collectors; - -import org.contextmapper.dsl.cml.CMLImportResolver; -import org.contextmapper.dsl.cml.CMLResource; -import org.contextmapper.dsl.contextMappingDSL.BoundedContext; -import org.contextmapper.dsl.contextMappingDSL.BoundedContextType; -import org.contextmapper.dsl.refactoring.SplitSystemIntoSubsystems; -import org.contextmapper.dsl.ui.handler.wizard.SplitSystemIntoSubsystemsContext; -import org.contextmapper.dsl.ui.handler.wizard.SplitSystemIntoSubsystemsWizard; -import org.eclipse.core.commands.ExecutionEvent; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.resource.Resource; -import org.eclipse.jface.wizard.WizardDialog; -import org.eclipse.ui.handlers.HandlerUtil; - -import com.google.common.collect.Lists; - -public class SplitSystemIntoSubsystemsRefactoringHandler extends AbstractRefactoringWithUserInputHandler { - - @Override - protected void executeRefactoring(CMLResource resource, ExecutionEvent event) { - BoundedContext selectedContext = (BoundedContext) getSelectedElement(); - Set allBCNames = collectAllBoundedContexts().stream().map(bc -> bc.getName()).collect(Collectors.toSet()); - - SplitSystemIntoSubsystemsContext refactoringContext = new SplitSystemIntoSubsystemsContext(selectedContext.getName(), selectedContext.getName(), - selectedContext.getName() + "_New_Subsystem", allBCNames); - new WizardDialog(HandlerUtil.getActiveShell(event), new SplitSystemIntoSubsystemsWizard(refactoringContext, executionContext -> { - SplitSystemIntoSubsystems ar = new SplitSystemIntoSubsystems(executionContext.getOriginalSystemName(), executionContext.getExistingContextSubsystemName(), - executionContext.getNewSubsystemName()); - ar.setIntegrationType(executionContext.getIntegrationType()); - ar.setRelationshipType(executionContext.getRelationshipType()); - ar.setNewSubsystemImplementationTechnology(executionContext.getNewSubsystemImplementationTechnology()); - ar.setNewRelationshipImplementationTechnology(executionContext.getNewRelationshipImplementationTechnology()); - ar.copyDomainModel(executionContext.copyDomainModel()); - return finishRefactoring(ar, resource, event); - })).open(); - } - - @Override - public boolean isEnabled() { - EObject obj = getSelectedElement(); - - if (!(obj instanceof BoundedContext)) - return false; - - BoundedContext selectedContext = (BoundedContext) obj; - if (selectedContext.getType() != BoundedContextType.SYSTEM) - return false; - - return super.isEnabled(); - } - - private List collectAllBoundedContexts() { - List bcList = Lists.newLinkedList(); - Resource currentResource = getCurrentResource(); - bcList.addAll(getCurrentContextMappingModel().getBoundedContexts()); - for (CMLResource cmlResource : new CMLImportResolver().resolveImportedResources(new CMLResource(currentResource))) { - bcList.addAll(cmlResource.getContextMappingModel().getBoundedContexts()); - } - return bcList; - } - -} diff --git a/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/SuspendPartnershipRefactoringHandler.java b/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/SuspendPartnershipRefactoringHandler.java deleted file mode 100644 index 5c85fbfd..00000000 --- a/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/SuspendPartnershipRefactoringHandler.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Copyright 2019 The Context Mapper Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.contextmapper.dsl.ui.handler; - -import org.contextmapper.dsl.cml.CMLResource; -import org.contextmapper.dsl.contextMappingDSL.Partnership; -import org.contextmapper.dsl.refactoring.ChangePartnershipToUpstreamDownstreamRefactoring; -import org.contextmapper.dsl.refactoring.ExtractPartnershipRefactoring; -import org.contextmapper.dsl.refactoring.MergeBoundedContextsRefactoring; -import org.contextmapper.dsl.refactoring.SuspendPartnershipMode; -import org.contextmapper.dsl.ui.handler.wizard.SuspendPartnershipContext; -import org.contextmapper.dsl.ui.handler.wizard.SuspendPartnershipRefactoringWizard; -import org.eclipse.core.commands.ExecutionEvent; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.jface.wizard.WizardDialog; -import org.eclipse.ui.handlers.HandlerUtil; - -public class SuspendPartnershipRefactoringHandler extends AbstractRefactoringWithUserInputHandler { - - @Override - public boolean isEnabled() { - EObject obj = getSelectedElement(); - - if (obj == null || !super.isEnabled()) - return false; - - // only allowed on partnerships - if (!(obj instanceof Partnership)) - return false; - - return true; - } - - @Override - protected void executeRefactoring(CMLResource resource, ExecutionEvent event) { - Partnership partnership = (Partnership) getSelectedElement(); - - SuspendPartnershipContext refactoringContext = new SuspendPartnershipContext(partnership.getParticipant1().getName(), partnership.getParticipant2().getName()); - - new WizardDialog(HandlerUtil.getActiveShell(event), new SuspendPartnershipRefactoringWizard(refactoringContext, executionContext -> { - if (refactoringContext.getMode() == SuspendPartnershipMode.MERGE_BOUNDED_CONTEXTS) { - // just use the 'Merge Bounded Contexts' AR in this case ... - return finishRefactoring(new MergeBoundedContextsRefactoring(executionContext.getMergeModeSelectedBoundedContext1(), - executionContext.getMergeModeSelectedBoundedContext2(), executionContext.isMergeModeTakeAttributesFromSecondBoundedContext()), resource, event); - } else if (refactoringContext.getMode() == SuspendPartnershipMode.EXTRACT_NEW_BOUNDED_CONTEXT) { - return finishRefactoring(new ExtractPartnershipRefactoring(refactoringContext.getBoundedContext1(), refactoringContext.getBoundedContext2()), resource, event); - } else { - String upstream = refactoringContext.getBoundedContext1(); - String downstream = refactoringContext.getBoundedContext2(); - if (refactoringContext.getReplaceModeUpstreamBoundedContext().equals(refactoringContext.getBoundedContext2())) { - upstream = refactoringContext.getBoundedContext2(); - downstream = refactoringContext.getBoundedContext1(); - } - return finishRefactoring(new ChangePartnershipToUpstreamDownstreamRefactoring(upstream, downstream), resource, event); - } - })).open(); - } - -} diff --git a/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/SwitchFromPartnershipToSharedKernelRefactoringHandler.java b/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/SwitchFromPartnershipToSharedKernelRefactoringHandler.java deleted file mode 100644 index f75075a9..00000000 --- a/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/SwitchFromPartnershipToSharedKernelRefactoringHandler.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright 2019 The Context Mapper Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.contextmapper.dsl.ui.handler; - -import org.contextmapper.dsl.cml.CMLResource; -import org.contextmapper.dsl.contextMappingDSL.Partnership; -import org.contextmapper.dsl.refactoring.SemanticCMLRefactoring; -import org.contextmapper.dsl.refactoring.SwitchFromPartnershipToSharedKernelRefactoring; -import org.eclipse.core.commands.ExecutionEvent; -import org.eclipse.emf.ecore.EObject; - -public class SwitchFromPartnershipToSharedKernelRefactoringHandler extends AbstractRefactoringHandler { - - @Override - protected void executeRefactoring(CMLResource resource, ExecutionEvent event) { - Partnership partnership = (Partnership) getSelectedElement(); - SemanticCMLRefactoring ar = new SwitchFromPartnershipToSharedKernelRefactoring(partnership.getParticipant1().getName(), partnership.getParticipant2().getName()); - ar.refactor(resource); - ar.persistChanges(serializer); - } - - @Override - public boolean isEnabled() { - EObject obj = getSelectedElement(); - - if (obj == null || !super.isEnabled()) - return false; - - // only allowed on Partnership relationship - if (!(obj instanceof Partnership)) - return false; - - return true; - } - -} diff --git a/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/SwitchFromSharedKernelToPartnershipRefactoringHandler.java b/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/SwitchFromSharedKernelToPartnershipRefactoringHandler.java deleted file mode 100644 index 9e3effdb..00000000 --- a/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/SwitchFromSharedKernelToPartnershipRefactoringHandler.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright 2019 The Context Mapper Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.contextmapper.dsl.ui.handler; - -import org.contextmapper.dsl.cml.CMLResource; -import org.contextmapper.dsl.contextMappingDSL.SharedKernel; -import org.contextmapper.dsl.refactoring.SemanticCMLRefactoring; -import org.contextmapper.dsl.refactoring.SwitchFromSharedKernelToPartnershipRefactoring; -import org.eclipse.core.commands.ExecutionEvent; -import org.eclipse.emf.ecore.EObject; - -public class SwitchFromSharedKernelToPartnershipRefactoringHandler extends AbstractRefactoringHandler { - - @Override - protected void executeRefactoring(CMLResource resource, ExecutionEvent event) { - SharedKernel sk = (SharedKernel) getSelectedElement(); - SemanticCMLRefactoring ar = new SwitchFromSharedKernelToPartnershipRefactoring(sk.getParticipant1().getName(), sk.getParticipant2().getName()); - ar.refactor(resource); - ar.persistChanges(serializer); - } - - @Override - public boolean isEnabled() { - EObject obj = getSelectedElement(); - - if (obj == null || !super.isEnabled()) - return false; - - // only allowed on Shared Kernel relationship - if (!(obj instanceof SharedKernel)) - return false; - - return true; - } - -} diff --git a/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/XMIGenerationHandler.java b/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/XMIGenerationHandler.java deleted file mode 100644 index 56bd4c6d..00000000 --- a/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/XMIGenerationHandler.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright 2018 The Context Mapper Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.contextmapper.dsl.ui.handler; - -import org.contextmapper.dsl.generator.XMIGenerator; -import org.eclipse.xtext.generator.IGenerator2; - -import com.google.inject.Inject; - -public class XMIGenerationHandler extends AbstractGenerationHandler { - - @Inject - private XMIGenerator generator; - - @Override - protected IGenerator2 getGenerator() { - return generator; - } - -} diff --git a/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/stakeholders/CreateStakeholderForUserStoryRoleHandler.java b/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/stakeholders/CreateStakeholderForUserStoryRoleHandler.java deleted file mode 100644 index 2234f02e..00000000 --- a/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/stakeholders/CreateStakeholderForUserStoryRoleHandler.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright 2024 The Context Mapper Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.contextmapper.dsl.ui.handler.stakeholders; - -import org.contextmapper.dsl.cml.CMLResource; -import org.contextmapper.dsl.contextMappingDSL.UserStory; -import org.contextmapper.dsl.refactoring.SemanticCMLRefactoring; -import org.contextmapper.dsl.refactoring.stakeholders.CreateStakeholderForUserStoryRole; -import org.contextmapper.dsl.ui.handler.AbstractRefactoringHandler; -import org.eclipse.core.commands.ExecutionEvent; -import org.eclipse.emf.ecore.EObject; - -public class CreateStakeholderForUserStoryRoleHandler extends AbstractRefactoringHandler { - - @Override - protected void executeRefactoring(CMLResource resource, ExecutionEvent event) { - UserStory userStory = (UserStory) this.getSelectedElement(); - SemanticCMLRefactoring ar = new CreateStakeholderForUserStoryRole(userStory.getName()); - ar.refactor(resource, getAllResources()); - ar.persistChanges(serializer); - } - - @Override - public boolean isEnabled() { - if (moreThenOneElementSelected()) - return false; - - EObject obj = this.getSelectedElement(); - - if (obj == null || !super.isEnabled()) - return false; - - if (!(obj instanceof UserStory)) - return false; - - UserStory story = (UserStory) obj; - if (story.getRole() == null || story.getRole().equals("")) - return false; - - // check whether Stakeholder of this name already exists - return !(new CreateStakeholderForUserStoryRole(story.getName()).stakeholderForRoleAlreadyExists(story)); - } -} diff --git a/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/stakeholders/CreateValue4StakeholderHandler.java b/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/stakeholders/CreateValue4StakeholderHandler.java deleted file mode 100644 index 995fa84e..00000000 --- a/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/stakeholders/CreateValue4StakeholderHandler.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright 2024 The Context Mapper Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.contextmapper.dsl.ui.handler.stakeholders; - -import org.contextmapper.dsl.cml.CMLResource; -import org.contextmapper.dsl.contextMappingDSL.Stakeholder; -import org.contextmapper.dsl.refactoring.SemanticCMLRefactoring; -import org.contextmapper.dsl.refactoring.stakeholders.CreateValue4StakeholderRefactoring; -import org.contextmapper.dsl.ui.handler.AbstractRefactoringHandler; -import org.eclipse.core.commands.ExecutionEvent; -import org.eclipse.emf.ecore.EObject; - -public class CreateValue4StakeholderHandler extends AbstractRefactoringHandler { - - @Override - protected void executeRefactoring(CMLResource resource, ExecutionEvent event) { - Stakeholder stakeholder = (Stakeholder) getSelectedElement(); - SemanticCMLRefactoring ar = new CreateValue4StakeholderRefactoring(stakeholder.getName()); - ar.refactor(resource, getAllResources()); - ar.persistChanges(serializer); - } - - @Override - public boolean isEnabled() { - if (moreThenOneElementSelected()) - return false; - - EObject obj = getSelectedElement(); - - if (obj == null || !super.isEnabled()) - return false; - - return (obj instanceof Stakeholder); - } - -} diff --git a/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/stakeholders/MoveStakeholderToNewGroupHandler.java b/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/stakeholders/MoveStakeholderToNewGroupHandler.java deleted file mode 100644 index fa85af8b..00000000 --- a/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/stakeholders/MoveStakeholderToNewGroupHandler.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright 2024 The Context Mapper Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.contextmapper.dsl.ui.handler.stakeholders; - -import org.contextmapper.dsl.cml.CMLResource; -import org.contextmapper.dsl.contextMappingDSL.Stakeholder; -import org.contextmapper.dsl.refactoring.SemanticCMLRefactoring; -import org.contextmapper.dsl.refactoring.stakeholders.MoveStakeholderToNewStakeholderGroupRefactoring; -import org.contextmapper.dsl.ui.handler.AbstractRefactoringHandler; -import org.eclipse.core.commands.ExecutionEvent; -import org.eclipse.emf.ecore.EObject; - -public class MoveStakeholderToNewGroupHandler extends AbstractRefactoringHandler { - - @Override - protected void executeRefactoring(CMLResource resource, ExecutionEvent event) { - Stakeholder stakeholder = (Stakeholder) getSelectedElement(); - SemanticCMLRefactoring ar = new MoveStakeholderToNewStakeholderGroupRefactoring(stakeholder.getName()); - ar.refactor(resource, getAllResources()); - ar.persistChanges(serializer); - } - - @Override - public boolean isEnabled() { - if (moreThenOneElementSelected()) - return false; - - EObject obj = getSelectedElement(); - - if (obj == null || !super.isEnabled()) - return false; - - return (obj instanceof Stakeholder); - } - -} diff --git a/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/value_registers/CreateValueRegisterForBoundedContextHandler.java b/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/value_registers/CreateValueRegisterForBoundedContextHandler.java deleted file mode 100644 index 47d90d58..00000000 --- a/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/value_registers/CreateValueRegisterForBoundedContextHandler.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright 2024 The Context Mapper Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.contextmapper.dsl.ui.handler.value_registers; - -import org.contextmapper.dsl.cml.CMLModelObjectsResolvingHelper; -import org.contextmapper.dsl.cml.CMLResource; -import org.contextmapper.dsl.contextMappingDSL.BoundedContext; -import org.contextmapper.dsl.contextMappingDSL.ContextMappingModel; -import org.contextmapper.dsl.refactoring.SemanticCMLRefactoring; -import org.contextmapper.dsl.refactoring.value_registers.CreateValueRegisterForBoundedContext; -import org.contextmapper.dsl.ui.handler.AbstractRefactoringHandler; -import org.eclipse.core.commands.ExecutionEvent; -import org.eclipse.emf.ecore.EObject; - -public class CreateValueRegisterForBoundedContextHandler extends AbstractRefactoringHandler { - - @Override - protected void executeRefactoring(CMLResource resource, ExecutionEvent event) { - BoundedContext context = (BoundedContext) this.getSelectedElement(); - SemanticCMLRefactoring ar = new CreateValueRegisterForBoundedContext(context.getName()); - ar.refactor(resource, getAllResources()); - ar.persistChanges(serializer); - } - - @Override - public boolean isEnabled() { - if (moreThenOneElementSelected()) - return false; - - EObject obj = getSelectedElement(); - - if (obj == null || !super.isEnabled()) - return false; - - if (!(obj instanceof BoundedContext)) - return false; - - BoundedContext bc = (BoundedContext) obj; - return !(new CMLModelObjectsResolvingHelper((ContextMappingModel) bc.eContainer()) - .isReferencedInAValueRegister(bc)); - } - -} diff --git a/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/value_registers/WrapValueInClusterHandler.java b/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/value_registers/WrapValueInClusterHandler.java deleted file mode 100644 index 24c71eb4..00000000 --- a/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/value_registers/WrapValueInClusterHandler.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright 2024 The Context Mapper Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.contextmapper.dsl.ui.handler.value_registers; - -import org.contextmapper.dsl.cml.CMLResource; -import org.contextmapper.dsl.contextMappingDSL.Value; -import org.contextmapper.dsl.contextMappingDSL.ValueRegister; -import org.contextmapper.dsl.refactoring.SemanticCMLRefactoring; -import org.contextmapper.dsl.refactoring.value_registers.WrapValueInClusterRefactoring; -import org.contextmapper.dsl.ui.handler.AbstractRefactoringHandler; -import org.eclipse.core.commands.ExecutionEvent; -import org.eclipse.emf.ecore.EObject; - -public class WrapValueInClusterHandler extends AbstractRefactoringHandler { - - @Override - protected void executeRefactoring(CMLResource resource, ExecutionEvent event) { - Value value = (Value) getSelectedElement(); - SemanticCMLRefactoring ar = new WrapValueInClusterRefactoring(value.getName()); - ar.refactor(resource, getAllResources()); - ar.persistChanges(serializer); - } - - @Override - public boolean isEnabled() { - if (moreThenOneElementSelected()) - return false; - - EObject obj = getSelectedElement(); - - if (obj == null || !super.isEnabled()) - return false; - - if (!(obj instanceof Value)) - return false; - - Value value = (Value) obj; - return value.eContainer() instanceof ValueRegister; - } - -} diff --git a/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/wizard/ChooseName4NewBoundedContextContext.java b/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/wizard/ChooseName4NewBoundedContextContext.java deleted file mode 100644 index a8bcb137..00000000 --- a/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/wizard/ChooseName4NewBoundedContextContext.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright 2020 The Context Mapper Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.contextmapper.dsl.ui.handler.wizard; - -public class ChooseName4NewBoundedContextContext { - - private String newBoundedContextName; - - public ChooseName4NewBoundedContextContext(String newBoundedContextName) { - this.newBoundedContextName = newBoundedContextName; - } - - public String getNewBoundedContextName() { - return newBoundedContextName; - } - - public void setNewBoundedContextName(String newBoundedContextName) { - this.newBoundedContextName = newBoundedContextName; - } - -} diff --git a/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/wizard/ChooseName4NewBoundedContextWizard.java b/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/wizard/ChooseName4NewBoundedContextWizard.java deleted file mode 100644 index 3aa4e919..00000000 --- a/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/wizard/ChooseName4NewBoundedContextWizard.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright 2020 The Context Mapper Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.contextmapper.dsl.ui.handler.wizard; - -import java.util.function.Function; - -import org.contextmapper.dsl.ui.handler.wizard.pages.NewBoundedContextNameWizardPage; -import org.eclipse.jface.wizard.Wizard; - -public class ChooseName4NewBoundedContextWizard extends Wizard { - - private NewBoundedContextNameWizardPage page; - private Function finishFunction; - private ChooseName4NewBoundedContextContext context; - - public ChooseName4NewBoundedContextWizard(ChooseName4NewBoundedContextContext context, Function finishFunction) { - super(); - setNeedsProgressMonitor(true); - this.context = context; - this.finishFunction = finishFunction; - } - - @Override - public String getWindowTitle() { - return "Name for new Bounded Context"; - } - - @Override - public void addPages() { - page = new NewBoundedContextNameWizardPage(context.getNewBoundedContextName()); - addPage(page); - } - - @Override - public boolean performFinish() { - context.setNewBoundedContextName(page.getBoundedContextName()); - return finishFunction.apply(context); - } - -} diff --git a/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/wizard/DeriveBackendFrontendFromFeatureContext.java b/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/wizard/DeriveBackendFrontendFromFeatureContext.java deleted file mode 100644 index acef6f3a..00000000 --- a/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/wizard/DeriveBackendFrontendFromFeatureContext.java +++ /dev/null @@ -1,114 +0,0 @@ -/* - * Copyright 2020 The Context Mapper Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.contextmapper.dsl.ui.handler.wizard; - -import java.util.Set; - -import org.contextmapper.dsl.refactoring.ContextSplittingIntegrationType; - -public class DeriveBackendFrontendFromFeatureContext { - - private String frontendName; - private String backendName; - private Set allBoundedContextNames; - private String featureBoundedContextName; - private boolean deriveViewModelInFrontend = true; - private ContextSplittingIntegrationType relationshipType; - private String frontendImplementationTechnology; - private String backendImplementationTechnology; - private String relationshipImplementationTechnology; - - public DeriveBackendFrontendFromFeatureContext(String featureBoundedContextName, Set allBoundedContextNames) { - this.featureBoundedContextName = featureBoundedContextName; - this.allBoundedContextNames = allBoundedContextNames; - this.frontendName = featureBoundedContextName + "Frontend"; - this.backendName = featureBoundedContextName + "Backend"; - this.relationshipType = ContextSplittingIntegrationType.CONFORMIST; - } - - public String getFrontendName() { - return frontendName; - } - - public void setFrontendName(String frontendName) { - this.frontendName = frontendName; - } - - public String getBackendName() { - return backendName; - } - - public void setBackendName(String backendName) { - this.backendName = backendName; - } - - public Set getAllBoundedContextNames() { - return allBoundedContextNames; - } - - public void setAllBoundedContextNames(Set allBoundedContextNames) { - this.allBoundedContextNames = allBoundedContextNames; - } - - public String getFeatureBoundedContextName() { - return featureBoundedContextName; - } - - public void setFeatureBoundedContextName(String featureBoundedContextName) { - this.featureBoundedContextName = featureBoundedContextName; - } - - public ContextSplittingIntegrationType getRelationshipType() { - return relationshipType; - } - - public void setRelationshipType(ContextSplittingIntegrationType relationshipType) { - this.relationshipType = relationshipType; - } - - public boolean deriveViewModelInFrontend() { - return deriveViewModelInFrontend; - } - - public void deriveViewModelInFrontend(boolean deriveViewModelInFrontend) { - this.deriveViewModelInFrontend = deriveViewModelInFrontend; - } - - public String getFrontendImplementationTechnology() { - return frontendImplementationTechnology; - } - - public void setFrontendImplementationTechnology(String frontendImplementationTechnology) { - this.frontendImplementationTechnology = frontendImplementationTechnology; - } - - public String getBackendImplementationTechnology() { - return backendImplementationTechnology; - } - - public void setBackendImplementationTechnology(String backendImplementationTechnology) { - this.backendImplementationTechnology = backendImplementationTechnology; - } - - public String getRelationshipImplementationTechnology() { - return relationshipImplementationTechnology; - } - - public void setRelationshipImplementationTechnology(String relationshipImplementationTechnology) { - this.relationshipImplementationTechnology = relationshipImplementationTechnology; - } - -} diff --git a/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/wizard/DeriveBackendFrontendSystemsFromFeatureWizard.java b/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/wizard/DeriveBackendFrontendSystemsFromFeatureWizard.java deleted file mode 100644 index 04d63a48..00000000 --- a/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/wizard/DeriveBackendFrontendSystemsFromFeatureWizard.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright 2020 The Context Mapper Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.contextmapper.dsl.ui.handler.wizard; - -import java.util.function.Function; - -import org.contextmapper.dsl.ui.handler.wizard.pages.DeriveBackendFrontendSystemsFromFeatureWizardPage; -import org.eclipse.jface.wizard.Wizard; - -public class DeriveBackendFrontendSystemsFromFeatureWizard extends Wizard { - - private DeriveBackendFrontendSystemsFromFeatureWizardPage page; - private Function finishFunction; - private DeriveBackendFrontendFromFeatureContext context; - - public DeriveBackendFrontendSystemsFromFeatureWizard(DeriveBackendFrontendFromFeatureContext context, - Function finishFunction) { - super(); - setNeedsProgressMonitor(true); - this.context = context; - this.finishFunction = finishFunction; - } - - @Override - public String getWindowTitle() { - return "Derive Frontend/Backend Systems and Integration Relationship"; - } - - @Override - public void addPages() { - page = new DeriveBackendFrontendSystemsFromFeatureWizardPage(context); - addPage(page); - } - - @Override - public boolean performFinish() { - context.setFrontendName(page.getFrontendName()); - context.setBackendName(page.getBackendName()); - context.deriveViewModelInFrontend(page.deriveViewModelInFrontend()); - context.setRelationshipType(page.getRelationshipType()); - context.setFrontendImplementationTechnology(page.getFrontendImplementationTechnology()); - context.setBackendImplementationTechnology(page.getBackendImplementationTechnology()); - context.setRelationshipImplementationTechnology(page.getRelationshipImplementationTechnology()); - return finishFunction.apply(context); - } - -} diff --git a/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/wizard/DeriveBoundedContextFromSubdomainsContext.java b/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/wizard/DeriveBoundedContextFromSubdomainsContext.java deleted file mode 100644 index 6c0d6312..00000000 --- a/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/wizard/DeriveBoundedContextFromSubdomainsContext.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright 2020 The Context Mapper Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.contextmapper.dsl.ui.handler.wizard; - -import java.util.Set; - -public class DeriveBoundedContextFromSubdomainsContext { - - private String initialBoundedContextName; - private String boundedContextName; - private Set allBoundedContextNames; - - public DeriveBoundedContextFromSubdomainsContext(String initialBoundedContextName, Set allBoundedContextNames) { - super(); - this.initialBoundedContextName = initialBoundedContextName; - this.allBoundedContextNames = allBoundedContextNames; - } - - public String getInitialBoundedContextName() { - return initialBoundedContextName; - } - - public void setInitialBoundedContextName(String initialBoundedContextName) { - this.initialBoundedContextName = initialBoundedContextName; - } - - public String getBoundedContextName() { - return boundedContextName; - } - - public void setBoundedContextName(String boundedContextName) { - this.boundedContextName = boundedContextName; - } - - public Set getAllBoundedContextNames() { - return allBoundedContextNames; - } - - public void setAllBoundedContextNames(Set allBoundedContextNames) { - this.allBoundedContextNames = allBoundedContextNames; - } - -} diff --git a/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/wizard/DeriveBoundedContextFromSubdomainsWizard.java b/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/wizard/DeriveBoundedContextFromSubdomainsWizard.java deleted file mode 100644 index 4b33a639..00000000 --- a/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/wizard/DeriveBoundedContextFromSubdomainsWizard.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright 2020 The Context Mapper Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.contextmapper.dsl.ui.handler.wizard; - -import java.util.function.Function; - -import org.contextmapper.dsl.ui.handler.wizard.pages.DeriveBoundedContextFromSubdomainsWizardPage; -import org.eclipse.jface.wizard.Wizard; - -public class DeriveBoundedContextFromSubdomainsWizard extends Wizard { - - private DeriveBoundedContextFromSubdomainsWizardPage page; - private Function finishFunction; - private DeriveBoundedContextFromSubdomainsContext context; - - public DeriveBoundedContextFromSubdomainsWizard(DeriveBoundedContextFromSubdomainsContext context, - Function finishFunction) { - super(); - setNeedsProgressMonitor(true); - this.context = context; - this.finishFunction = finishFunction; - } - - @Override - public String getWindowTitle() { - return "Define Subdomain Name"; - } - - @Override - public void addPages() { - page = new DeriveBoundedContextFromSubdomainsWizardPage(context.getInitialBoundedContextName(), context.getAllBoundedContextNames()); - addPage(page); - } - - @Override - public boolean performFinish() { - context.setBoundedContextName(page.getBoundedContextName()); - return finishFunction.apply(context); - } - -} diff --git a/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/wizard/DeriveSubdomainsFromRequirementsContext.java b/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/wizard/DeriveSubdomainsFromRequirementsContext.java deleted file mode 100644 index ffc3a220..00000000 --- a/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/wizard/DeriveSubdomainsFromRequirementsContext.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright 2020 The Context Mapper Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.contextmapper.dsl.ui.handler.wizard; - -import java.util.Map; -import java.util.Set; - -public class DeriveSubdomainsFromRequirementsContext { - - private String initialDomain; - private String domainName; - private String subdomainName; - private Map> allDomainsAndSubdomains; - - public DeriveSubdomainsFromRequirementsContext(String initialDomain, Map> allDomainsAndSubdomains) { - this.initialDomain = initialDomain; - this.allDomainsAndSubdomains = allDomainsAndSubdomains; - } - - public String getInitialDomain() { - return initialDomain; - } - - public void setInitialDomain(String initialDomain) { - this.initialDomain = initialDomain; - } - - public String getDomainName() { - return domainName; - } - - public void setDomainName(String domainName) { - this.domainName = domainName; - } - - public String getSubdomainName() { - return subdomainName; - } - - public void setSubdomainName(String subdomainName) { - this.subdomainName = subdomainName; - } - - public Set getAllDomains() { - return allDomainsAndSubdomains.keySet(); - } - - public Map> getDomainSubdomainMapping() { - return allDomainsAndSubdomains; - } - -} diff --git a/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/wizard/DeriveSubdomainsFromRequirementsWizard.java b/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/wizard/DeriveSubdomainsFromRequirementsWizard.java deleted file mode 100644 index d4d80a15..00000000 --- a/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/wizard/DeriveSubdomainsFromRequirementsWizard.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright 2020 The Context Mapper Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.contextmapper.dsl.ui.handler.wizard; - -import java.util.function.Function; - -import org.contextmapper.dsl.ui.handler.wizard.pages.DeriveSubdomainFromRequirementsWizardPage; -import org.eclipse.jface.wizard.Wizard; - -public class DeriveSubdomainsFromRequirementsWizard extends Wizard { - - private DeriveSubdomainFromRequirementsWizardPage page; - private Function finishFunction; - private DeriveSubdomainsFromRequirementsContext context; - - public DeriveSubdomainsFromRequirementsWizard(DeriveSubdomainsFromRequirementsContext context, Function finishFunction) { - super(); - setNeedsProgressMonitor(true); - this.context = context; - this.finishFunction = finishFunction; - } - - @Override - public String getWindowTitle() { - return "Define Subdomain Name"; - } - - @Override - public void addPages() { - page = new DeriveSubdomainFromRequirementsWizardPage(context.getInitialDomain(), context.getDomainSubdomainMapping()); - addPage(page); - } - - @Override - public boolean performFinish() { - context.setDomainName(page.getDomain()); - context.setSubdomainName(page.getSubdomain()); - return finishFunction.apply(context); - } - -} diff --git a/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/wizard/ExtractAggregatesByCohesionContext.java b/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/wizard/ExtractAggregatesByCohesionContext.java deleted file mode 100644 index f3a181df..00000000 --- a/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/wizard/ExtractAggregatesByCohesionContext.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright 2018 The Context Mapper Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.contextmapper.dsl.ui.handler.wizard; - -import java.util.List; - -public class ExtractAggregatesByCohesionContext { - - private String newBoundedContextName; - private List allAggregates; - private List selectedAggregates; - - public ExtractAggregatesByCohesionContext(String newBoundedContextName, List allAggregates) { - this.newBoundedContextName = newBoundedContextName; - this.allAggregates = allAggregates; - } - - public String getNewBoundedContextName() { - return newBoundedContextName; - } - - public void setNewBoundedContextName(String newBoundedContextName) { - this.newBoundedContextName = newBoundedContextName; - } - - public List getAllAggregates() { - return allAggregates; - } - - public void setSelectedAggregates(List selectedAggregates) { - this.selectedAggregates = selectedAggregates; - } - - public List getSelectedAggregates() { - return selectedAggregates; - } - -} diff --git a/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/wizard/ExtractAggregatesByCohesionRefactoringWizard.java b/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/wizard/ExtractAggregatesByCohesionRefactoringWizard.java deleted file mode 100644 index 3aca464b..00000000 --- a/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/wizard/ExtractAggregatesByCohesionRefactoringWizard.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright 2018 The Context Mapper Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.contextmapper.dsl.ui.handler.wizard; - -import java.util.function.Function; - -import org.contextmapper.dsl.ui.handler.wizard.pages.AggregateSelectionWizardPage; -import org.eclipse.jface.wizard.Wizard; - -public class ExtractAggregatesByCohesionRefactoringWizard extends Wizard { - - private AggregateSelectionWizardPage page; - private Function finishFunction; - private ExtractAggregatesByCohesionContext context; - - public ExtractAggregatesByCohesionRefactoringWizard(ExtractAggregatesByCohesionContext context, Function finishFunction) { - super(); - setNeedsProgressMonitor(true); - this.context = context; - this.finishFunction = finishFunction; - } - - @Override - public String getWindowTitle() { - return "Extract Aggregates by Cohesion (Manual Selection)"; - } - - @Override - public void addPages() { - page = new AggregateSelectionWizardPage(context.getNewBoundedContextName(), context.getAllAggregates()); - addPage(page); - } - - @Override - public boolean performFinish() { - context.setNewBoundedContextName(page.getBoundedContextName()); - context.setSelectedAggregates(page.getSelectedAggregates()); - return finishFunction.apply(context); - } - -} diff --git a/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/wizard/ExtractAggregatesByVolatilityContext.java b/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/wizard/ExtractAggregatesByVolatilityContext.java deleted file mode 100644 index d4a74319..00000000 --- a/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/wizard/ExtractAggregatesByVolatilityContext.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright 2019 The Context Mapper Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.contextmapper.dsl.ui.handler.wizard; - -import java.util.List; - -import org.contextmapper.dsl.contextMappingDSL.Volatility; - -public class ExtractAggregatesByVolatilityContext { - - private Volatility volatilityToExtract; - private List availableLikelihoods; - - public ExtractAggregatesByVolatilityContext(List availableLikelihoods) { - this.availableLikelihoods = availableLikelihoods; - } - - public void setVolatilityToExtract(Volatility volatilityToExtract) { - this.volatilityToExtract = volatilityToExtract; - } - - public Volatility getVolatilityToExtract() { - return volatilityToExtract; - } - - public List getAvailableLikelihoods() { - return availableLikelihoods; - } - -} diff --git a/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/wizard/ExtractAggregatesByVolatilityRefactoringWizard.java b/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/wizard/ExtractAggregatesByVolatilityRefactoringWizard.java deleted file mode 100644 index f3eb7774..00000000 --- a/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/wizard/ExtractAggregatesByVolatilityRefactoringWizard.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright 2019 The Context Mapper Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.contextmapper.dsl.ui.handler.wizard; - -import java.util.function.Function; - -import org.contextmapper.dsl.ui.handler.wizard.pages.LikelihoodForChangeSelectionWizardPage; -import org.eclipse.jface.wizard.Wizard; - -public class ExtractAggregatesByVolatilityRefactoringWizard extends Wizard { - - private LikelihoodForChangeSelectionWizardPage page; - private Function finishFunction; - private ExtractAggregatesByVolatilityContext context; - - public ExtractAggregatesByVolatilityRefactoringWizard(ExtractAggregatesByVolatilityContext context, Function finishFunction) { - super(); - setNeedsProgressMonitor(true); - this.context = context; - this.finishFunction = finishFunction; - } - - @Override - public String getWindowTitle() { - return "Extract Aggregates by Volatility"; - } - - @Override - public void addPages() { - page = new LikelihoodForChangeSelectionWizardPage(this.context.getAvailableLikelihoods()); - addPage(page); - } - - @Override - public boolean performFinish() { - context.setVolatilityToExtract(page.getVolatility()); - return finishFunction.apply(context); - } - -} diff --git a/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/wizard/GenerateContextMapContext.java b/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/wizard/GenerateContextMapContext.java deleted file mode 100644 index 160e11ea..00000000 --- a/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/wizard/GenerateContextMapContext.java +++ /dev/null @@ -1,99 +0,0 @@ -/* - * Copyright 2019 The Context Mapper Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.contextmapper.dsl.ui.handler.wizard; - -import java.util.Set; - -import org.contextmapper.dsl.generator.contextmap.ContextMapFormat; - -import com.google.common.collect.Sets; - -public class GenerateContextMapContext { - - private Set formats = Sets.newHashSet(ContextMapFormat.values()); - private int labelSpacingFactor = 5; - private boolean fixWidth = false; - private boolean fixHeight = false; - private int width = 1500; - private int height = 1000; - private boolean generateAdditionalLabels = false; - private boolean clusterTeams = true; - - public void setFormats(Set formats) { - this.formats = formats; - } - - public Set getFormats() { - return formats; - } - - public void setLabelSpacingFactor(int labelSpacingFactor) { - this.labelSpacingFactor = labelSpacingFactor; - } - - public int getLabelSpacingFactor() { - return labelSpacingFactor; - } - - public boolean isFixWidth() { - return fixWidth; - } - - public boolean isFixHeight() { - return fixHeight; - } - - public void setFixWidth(boolean fixWidth) { - this.fixWidth = fixWidth; - } - - public void setFixHeight(boolean fixHeight) { - this.fixHeight = fixHeight; - } - - public int getWidth() { - return width; - } - - public void setWidth(int width) { - this.width = width; - } - - public int getHeight() { - return height; - } - - public void setHeight(int height) { - this.height = height; - } - - public void clusterTeams(boolean clusterTeams) { - this.clusterTeams = clusterTeams; - } - - public boolean clusterTeams() { - return this.clusterTeams; - } - - public void setGenerateAdditionalLabels(boolean generateAdditionalLabels) { - this.generateAdditionalLabels = generateAdditionalLabels; - } - - public boolean generateAdditionalLabels() { - return generateAdditionalLabels; - } - -} diff --git a/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/wizard/GenerateContextMapWizard.java b/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/wizard/GenerateContextMapWizard.java deleted file mode 100644 index 0d69e23e..00000000 --- a/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/wizard/GenerateContextMapWizard.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright 2019 The Context Mapper Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.contextmapper.dsl.ui.handler.wizard; - -import java.util.function.Function; - -import org.contextmapper.dsl.ui.handler.wizard.pages.GenerateContextMapWizardPage; -import org.eclipse.jface.wizard.Wizard; - -public class GenerateContextMapWizard extends Wizard { - - private GenerateContextMapWizardPage page; - private Function finishFunction; - private GenerateContextMapContext context; - - public GenerateContextMapWizard(GenerateContextMapContext context, Function finishFunction) { - super(); - setNeedsProgressMonitor(true); - this.context = context; - this.finishFunction = finishFunction; - } - - @Override - public String getWindowTitle() { - return "Generate Context Map"; - } - - @Override - public void addPages() { - page = new GenerateContextMapWizardPage(this.context); - addPage(page); - } - - @Override - public boolean performFinish() { - context.setFormats(page.getSelectedFormats()); - context.setLabelSpacingFactor(page.getLabelSpacingFactor()); - context.setFixHeight(page.takeHeight()); - context.setFixWidth(page.takeWidth()); - context.setHeight(page.getHeight()); - context.setWidth(page.getWidth()); - context.setGenerateAdditionalLabels(page.generateLabels()); - context.clusterTeams(page.clusterTeams()); - return finishFunction.apply(context); - } - -} diff --git a/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/wizard/GenerateGenericTextFileContext.java b/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/wizard/GenerateGenericTextFileContext.java deleted file mode 100644 index f1d8c05d..00000000 --- a/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/wizard/GenerateGenericTextFileContext.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright 2020 The Context Mapper Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.contextmapper.dsl.ui.handler.wizard; - -import org.eclipse.core.resources.IFile; - -public class GenerateGenericTextFileContext { - - private IFile freemarkerTemplateFile; - private String targetFileName; - - public GenerateGenericTextFileContext(String inputFileName) { - this.targetFileName = inputFileName.replace(".cml", ".tbd"); - } - - public void setFreemarkerTemplateFile(IFile freemarkerTemplateFile) { - this.freemarkerTemplateFile = freemarkerTemplateFile; - } - - public IFile getFreemarkerTemplateFile() { - return freemarkerTemplateFile; - } - - public void setTargetFileName(String targetFileName) { - this.targetFileName = targetFileName; - } - - public String getTargetFileName() { - return targetFileName; - } - -} diff --git a/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/wizard/GenerateGenericTextFileWizard.java b/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/wizard/GenerateGenericTextFileWizard.java deleted file mode 100644 index e181182f..00000000 --- a/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/wizard/GenerateGenericTextFileWizard.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright 2020 The Context Mapper Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.contextmapper.dsl.ui.handler.wizard; - -import java.util.function.Function; - -import org.contextmapper.dsl.ui.handler.wizard.pages.GenerateGenericTextFileWizardPage; -import org.eclipse.jface.wizard.Wizard; - -public class GenerateGenericTextFileWizard extends Wizard { - - private GenerateGenericTextFileWizardPage page; - private Function finishFunction; - private GenerateGenericTextFileContext context; - - public GenerateGenericTextFileWizard(GenerateGenericTextFileContext context, Function finishFunction) { - super(); - setNeedsProgressMonitor(true); - this.context = context; - this.finishFunction = finishFunction; - } - - @Override - public String getWindowTitle() { - return "Generate Generic Textual File with Freemarker Template"; - } - - @Override - public void addPages() { - page = new GenerateGenericTextFileWizardPage(); - page.setInitialTemplateFile(context.getFreemarkerTemplateFile()); - page.setInitialFilename(context.getTargetFileName()); - addPage(page); - } - - @Override - public boolean performFinish() { - context.setFreemarkerTemplateFile(page.getFile()); - context.setTargetFileName(page.getTargetFileName()); - return finishFunction.apply(context); - } - -} diff --git a/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/wizard/MergeAggregatesContext.java b/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/wizard/MergeAggregatesContext.java deleted file mode 100644 index 7b64cb6b..00000000 --- a/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/wizard/MergeAggregatesContext.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright 2019 The Context Mapper Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.contextmapper.dsl.ui.handler.wizard; - -import java.util.List; - -public class MergeAggregatesContext { - - private String initialAggregate1; - private String selectedAggregate1; - private String selectedAggregate2; - private boolean takeAttributesFromSecondAggregate; - private List allAggregates; - - public MergeAggregatesContext(String initialAggregate1, List allAggregates) { - this.initialAggregate1 = initialAggregate1; - this.allAggregates = allAggregates; - } - - public String getSelectedAggregate1() { - return selectedAggregate1; - } - - public String getSelectedAggregate2() { - return selectedAggregate2; - } - - public String getInitialAggregate1() { - return initialAggregate1; - } - - public void setSelectedAggregate1(String selectedAggregate1) { - this.selectedAggregate1 = selectedAggregate1; - } - - public void setSelectedAggregate2(String selectedAggregate2) { - this.selectedAggregate2 = selectedAggregate2; - } - - public List getAllAggregates() { - return allAggregates; - } - - public void setTakeAttributesFromSecondAggregate(boolean takeAttributesFromSecondAggregate) { - this.takeAttributesFromSecondAggregate = takeAttributesFromSecondAggregate; - } - - public boolean takeAttributesFromSecondAggregate() { - return takeAttributesFromSecondAggregate; - } - -} diff --git a/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/wizard/MergeAggregatesRefactoringWizard.java b/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/wizard/MergeAggregatesRefactoringWizard.java deleted file mode 100644 index 476ecf9b..00000000 --- a/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/wizard/MergeAggregatesRefactoringWizard.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright 2019 The Context Mapper Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.contextmapper.dsl.ui.handler.wizard; - -import java.util.function.Function; - -import org.contextmapper.dsl.ui.handler.wizard.pages.TwoAggregatesSelectionWizardPage; -import org.eclipse.jface.wizard.Wizard; - -public class MergeAggregatesRefactoringWizard extends Wizard { - - private TwoAggregatesSelectionWizardPage page; - private Function finishFunction; - private MergeAggregatesContext context; - - public MergeAggregatesRefactoringWizard(MergeAggregatesContext context, Function finishFunction) { - super(); - setNeedsProgressMonitor(true); - this.context = context; - this.finishFunction = finishFunction; - } - - @Override - public String getWindowTitle() { - return "Merge Aggregates"; - } - - @Override - public void addPages() { - page = new TwoAggregatesSelectionWizardPage(context.getInitialAggregate1(), context.getAllAggregates()); - addPage(page); - } - - @Override - public boolean performFinish() { - context.setSelectedAggregate1(page.getAggregate1()); - context.setSelectedAggregate2(page.getAggregate2()); - context.setTakeAttributesFromSecondAggregate(page.takeAttributesFromSecondAggregateCheckBox()); - return finishFunction.apply(context); - } - -} diff --git a/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/wizard/MergeBoundedContextsContext.java b/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/wizard/MergeBoundedContextsContext.java deleted file mode 100644 index 75ce292d..00000000 --- a/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/wizard/MergeBoundedContextsContext.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright 2019 The Context Mapper Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.contextmapper.dsl.ui.handler.wizard; - -import java.util.List; - -public class MergeBoundedContextsContext { - - private String initialBoundedContext1; - private String selectedBoundedContext1; - private String selectedBoundedContext2; - private boolean takeAttributesFromSecondBoundedContext; - private List allBoundedContexts; - - public MergeBoundedContextsContext(String initialBoundedContext1, List allBoundedContexts) { - this.initialBoundedContext1 = initialBoundedContext1; - this.allBoundedContexts = allBoundedContexts; - } - - public String getSelectedBoundedContext1() { - return selectedBoundedContext1; - } - - public String getSelectedBoundedContext2() { - return selectedBoundedContext2; - } - - public String getInitialBoundedContext1() { - return initialBoundedContext1; - } - - public void setSelectedBoundedContext1(String selectedBoundedContext1) { - this.selectedBoundedContext1 = selectedBoundedContext1; - } - - public void setSelectedBoundedContext2(String selectedBoundedContext2) { - this.selectedBoundedContext2 = selectedBoundedContext2; - } - - public void setTakeAttributesFromSecondBoundedContext(boolean takeAttributesFromSecondBoundedContext) { - this.takeAttributesFromSecondBoundedContext = takeAttributesFromSecondBoundedContext; - } - - public List getAllBoundedContexts() { - return allBoundedContexts; - } - - public boolean takeAttributesFromSecondBoundedContext() { - return takeAttributesFromSecondBoundedContext; - } - -} diff --git a/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/wizard/MergeBoundedContextsRefactoringWizard.java b/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/wizard/MergeBoundedContextsRefactoringWizard.java deleted file mode 100644 index 317c5cc5..00000000 --- a/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/wizard/MergeBoundedContextsRefactoringWizard.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright 2019 The Context Mapper Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.contextmapper.dsl.ui.handler.wizard; - -import java.util.function.Function; - -import org.contextmapper.dsl.ui.handler.wizard.pages.TwoBoundedContextSelectionWizardPage; -import org.eclipse.jface.wizard.Wizard; - -public class MergeBoundedContextsRefactoringWizard extends Wizard { - - private TwoBoundedContextSelectionWizardPage page; - private Function finishFunction; - private MergeBoundedContextsContext context; - - public MergeBoundedContextsRefactoringWizard(MergeBoundedContextsContext context, Function finishFunction) { - super(); - setNeedsProgressMonitor(true); - this.context = context; - this.finishFunction = finishFunction; - } - - @Override - public String getWindowTitle() { - return "Merge Bounded Contexts"; - } - - @Override - public void addPages() { - page = new TwoBoundedContextSelectionWizardPage(context.getInitialBoundedContext1(), context.getAllBoundedContexts()); - addPage(page); - } - - @Override - public boolean performFinish() { - context.setSelectedBoundedContext1(page.getBoundedContext1()); - context.setSelectedBoundedContext2(page.getBoundedContext2()); - context.setTakeAttributesFromSecondBoundedContext(page.takeAttributesFromSecondBoundedContext()); - return finishFunction.apply(context); - } - -} diff --git a/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/wizard/SplitSystemIntoSubsystemsContext.java b/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/wizard/SplitSystemIntoSubsystemsContext.java deleted file mode 100644 index b5e413e8..00000000 --- a/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/wizard/SplitSystemIntoSubsystemsContext.java +++ /dev/null @@ -1,106 +0,0 @@ -/* - * Copyright 2020 The Context Mapper Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.contextmapper.dsl.ui.handler.wizard; - -import java.util.Set; - -import org.contextmapper.dsl.refactoring.ContextSplittingIntegrationType; -import org.contextmapper.dsl.refactoring.SplitSystemIntoSubsystems.SplitBoundedContextRelationshipType; - -public class SplitSystemIntoSubsystemsContext { - - private String originalSystemName; - private String existingContextSubsystemName; - private String newSubsystemName; - private SplitBoundedContextRelationshipType relationshipType = SplitBoundedContextRelationshipType.NEW_CONTEXT_BECOMES_UPSTREAM; - private ContextSplittingIntegrationType integrationType = ContextSplittingIntegrationType.CONFORMIST; - private boolean copyDomainModel = false; - private String newSubsystemImplementationTechnology = ""; - private String newRelationshipImplementationTechnology = ""; - private Set existingBoundedContexts; - - public SplitSystemIntoSubsystemsContext(String originalSystemName, String existingContextSubsystemName, String newSubsystemName, Set existingBoundedContexts) { - this.originalSystemName = originalSystemName; - this.existingContextSubsystemName = existingContextSubsystemName; - this.newSubsystemName = newSubsystemName; - this.existingBoundedContexts = existingBoundedContexts; - } - - public String getOriginalSystemName() { - return originalSystemName; - } - - public String getExistingContextSubsystemName() { - return existingContextSubsystemName; - } - - public void setExistingContextSubsystemName(String existingContextSubsystemName) { - this.existingContextSubsystemName = existingContextSubsystemName; - } - - public String getNewSubsystemName() { - return newSubsystemName; - } - - public void setNewSubsystemName(String newSubsystemName) { - this.newSubsystemName = newSubsystemName; - } - - public SplitBoundedContextRelationshipType getRelationshipType() { - return relationshipType; - } - - public void setRelationshipType(SplitBoundedContextRelationshipType relationshipType) { - this.relationshipType = relationshipType; - } - - public ContextSplittingIntegrationType getIntegrationType() { - return integrationType; - } - - public void setIntegrationType(ContextSplittingIntegrationType integrationType) { - this.integrationType = integrationType; - } - - public boolean copyDomainModel() { - return copyDomainModel; - } - - public void copyDomainModel(boolean copyDomainModel) { - this.copyDomainModel = copyDomainModel; - } - - public String getNewSubsystemImplementationTechnology() { - return newSubsystemImplementationTechnology; - } - - public void setNewSubsystemImplementationTechnology(String newSubsystemImplementationTechnology) { - this.newSubsystemImplementationTechnology = newSubsystemImplementationTechnology; - } - - public String getNewRelationshipImplementationTechnology() { - return newRelationshipImplementationTechnology; - } - - public void setNewRelationshipImplementationTechnology(String newRelationshipImplementationTechnology) { - this.newRelationshipImplementationTechnology = newRelationshipImplementationTechnology; - } - - public Set getExistingBoundedContexts() { - return existingBoundedContexts; - } - -} diff --git a/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/wizard/SplitSystemIntoSubsystemsWizard.java b/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/wizard/SplitSystemIntoSubsystemsWizard.java deleted file mode 100644 index 8f57a1cf..00000000 --- a/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/wizard/SplitSystemIntoSubsystemsWizard.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright 2020 The Context Mapper Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.contextmapper.dsl.ui.handler.wizard; - -import java.util.function.Function; - -import org.contextmapper.dsl.ui.handler.wizard.pages.SplitSystemIntoSubsystemsWizardPage; -import org.eclipse.jface.wizard.Wizard; - -public class SplitSystemIntoSubsystemsWizard extends Wizard { - - private SplitSystemIntoSubsystemsWizardPage page; - private Function finishFunction; - private SplitSystemIntoSubsystemsContext context; - - public SplitSystemIntoSubsystemsWizard(SplitSystemIntoSubsystemsContext context, Function finishFunction) { - super(); - setNeedsProgressMonitor(true); - this.context = context; - this.finishFunction = finishFunction; - } - - @Override - public String getWindowTitle() { - return "Split System Context Into Two Subsystems"; - } - - @Override - public void addPages() { - page = new SplitSystemIntoSubsystemsWizardPage(context); - addPage(page); - } - - @Override - public boolean performFinish() { - context.setExistingContextSubsystemName(page.getExistingSubsystemName()); - context.setNewSubsystemName(page.getNewSubsystemName()); - context.copyDomainModel(page.copyDomainModel()); - context.setRelationshipType(page.getRelationshipType()); - context.setIntegrationType(page.getIntegrationType()); - context.setNewSubsystemImplementationTechnology(page.getNewSubsystemImplementationTechnology()); - context.setNewRelationshipImplementationTechnology(page.getNewRelationshipImplementationTechnology()); - return finishFunction.apply(context); - } - -} diff --git a/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/wizard/SuspendPartnershipContext.java b/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/wizard/SuspendPartnershipContext.java deleted file mode 100644 index 56c03a6a..00000000 --- a/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/wizard/SuspendPartnershipContext.java +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Copyright 2019 The Context Mapper Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.contextmapper.dsl.ui.handler.wizard; - -import org.contextmapper.dsl.refactoring.SuspendPartnershipMode; - -public class SuspendPartnershipContext { - - private String boundedContext1; - private String boundedContext2; - private SuspendPartnershipMode mode; - private String replaceModeUpstreamBoundedContext; - private String mergeModeSelectedBoundedContext1; - private String mergeModeSelectedBoundedContext2; - private boolean mergeModeTakeAttributesFromSecondBoundedContext; - - public SuspendPartnershipContext(String boundedContext1, String boundedContext2) { - this.boundedContext1 = boundedContext1; - this.boundedContext2 = boundedContext2; - } - - public String getBoundedContext1() { - return boundedContext1; - } - - public String getBoundedContext2() { - return boundedContext2; - } - - public void setMode(SuspendPartnershipMode mode) { - this.mode = mode; - } - - public SuspendPartnershipMode getMode() { - return mode; - } - - public void setReplaceModeUpstreamBoundedContext(String replaceModeUpstreamBoundedContext) { - this.replaceModeUpstreamBoundedContext = replaceModeUpstreamBoundedContext; - } - - public String getReplaceModeUpstreamBoundedContext() { - return replaceModeUpstreamBoundedContext; - } - - public String getMergeModeSelectedBoundedContext1() { - return mergeModeSelectedBoundedContext1; - } - - public void setMergeModeSelectedBoundedContext1(String mergeModeSelectedBoundedContext1) { - this.mergeModeSelectedBoundedContext1 = mergeModeSelectedBoundedContext1; - } - - public String getMergeModeSelectedBoundedContext2() { - return mergeModeSelectedBoundedContext2; - } - - public void setMergeModeSelectedBoundedContext2(String mergeModeSelectedBoundedContext2) { - this.mergeModeSelectedBoundedContext2 = mergeModeSelectedBoundedContext2; - } - - public void setMergeModeTakeAttributesFromSecondBoundedContext(boolean mergeModeTakeAttributesFromSecondBoundedContext) { - this.mergeModeTakeAttributesFromSecondBoundedContext = mergeModeTakeAttributesFromSecondBoundedContext; - } - - public boolean isMergeModeTakeAttributesFromSecondBoundedContext() { - return mergeModeTakeAttributesFromSecondBoundedContext; - } -} diff --git a/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/wizard/SuspendPartnershipRefactoringWizard.java b/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/wizard/SuspendPartnershipRefactoringWizard.java deleted file mode 100644 index 0541d713..00000000 --- a/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/wizard/SuspendPartnershipRefactoringWizard.java +++ /dev/null @@ -1,87 +0,0 @@ -/* - * Copyright 2019 The Context Mapper Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.contextmapper.dsl.ui.handler.wizard; - -import java.util.Arrays; -import java.util.function.Function; - -import org.contextmapper.dsl.refactoring.SuspendPartnershipMode; -import org.contextmapper.dsl.ui.handler.wizard.pages.SuspendPartnershipWizardPage; -import org.contextmapper.dsl.ui.handler.wizard.pages.TwoBoundedContextSelectionWizardPage; -import org.eclipse.jface.wizard.IWizardPage; -import org.eclipse.jface.wizard.Wizard; - -public class SuspendPartnershipRefactoringWizard extends Wizard { - - private SuspendPartnershipWizardPage suspendPartnershipPage; - private TwoBoundedContextSelectionWizardPage mergeBoundedContextsPage; - private Function finishFunction; - private SuspendPartnershipContext context; - - public SuspendPartnershipRefactoringWizard(SuspendPartnershipContext context, Function finishFunction) { - super(); - setNeedsProgressMonitor(true); - this.context = context; - this.finishFunction = finishFunction; - setForcePreviousAndNextButtons(true); - } - - @Override - public String getWindowTitle() { - return "Suspend Partnership Relationship"; - } - - @Override - public void addPages() { - suspendPartnershipPage = new SuspendPartnershipWizardPage(context.getBoundedContext1(), context.getBoundedContext2()); - mergeBoundedContextsPage = new TwoBoundedContextSelectionWizardPage(context.getBoundedContext1(), - Arrays.asList(new String[] { context.getBoundedContext1(), context.getBoundedContext2() })); - mergeBoundedContextsPage.setInitialBoundedContext2(context.getBoundedContext2()); - mergeBoundedContextsPage.disableTextFields(); - addPage(suspendPartnershipPage); - addPage(mergeBoundedContextsPage); - } - - @Override - public IWizardPage getNextPage(IWizardPage page) { - if (page instanceof SuspendPartnershipWizardPage && suspendPartnershipPage.getSuspendMode() == SuspendPartnershipMode.MERGE_BOUNDED_CONTEXTS) { - addPage(mergeBoundedContextsPage); - return mergeBoundedContextsPage; - } else { - return null; - } - } - - @Override - public boolean canFinish() { - if (suspendPartnershipPage.getSuspendMode() == SuspendPartnershipMode.MERGE_BOUNDED_CONTEXTS) { - return suspendPartnershipPage.isPageComplete() && mergeBoundedContextsPage.isPageComplete(); - } else { - return suspendPartnershipPage.isPageComplete(); - } - } - - @Override - public boolean performFinish() { - context.setMode(suspendPartnershipPage.getSuspendMode()); - context.setReplaceModeUpstreamBoundedContext(suspendPartnershipPage.getReplaceModeUpstreamBoundedContext()); - context.setMergeModeSelectedBoundedContext1(mergeBoundedContextsPage.getBoundedContext1()); - context.setMergeModeSelectedBoundedContext2(mergeBoundedContextsPage.getBoundedContext2()); - context.setMergeModeTakeAttributesFromSecondBoundedContext(mergeBoundedContextsPage.takeAttributesFromSecondBoundedContext()); - return finishFunction.apply(context); - } - -} diff --git a/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/wizard/pages/AggregateSelectionWizardPage.java b/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/wizard/pages/AggregateSelectionWizardPage.java deleted file mode 100644 index f571c17a..00000000 --- a/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/wizard/pages/AggregateSelectionWizardPage.java +++ /dev/null @@ -1,145 +0,0 @@ -/* - * Copyright 2018 The Context Mapper Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.contextmapper.dsl.ui.handler.wizard.pages; - -import java.util.Arrays; -import java.util.List; -import java.util.stream.Collectors; - -import org.eclipse.swt.SWT; -import org.eclipse.swt.events.KeyAdapter; -import org.eclipse.swt.events.KeyEvent; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.program.Program; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Event; -import org.eclipse.swt.widgets.Label; -import org.eclipse.swt.widgets.Listener; -import org.eclipse.swt.widgets.Table; -import org.eclipse.swt.widgets.TableItem; -import org.eclipse.swt.widgets.Text; - -public class AggregateSelectionWizardPage extends ContextMapperWizardPage { - - private String initialBoundedContextName; - private List allAggregates; - - private Text boundedContextName; - private Composite container; - private Table selectionTable; - - public AggregateSelectionWizardPage(String initialBoundedContextName, List allAggregates) { - super("Aggregate Selection Page"); - this.initialBoundedContextName = initialBoundedContextName; - this.allAggregates = allAggregates; - } - - @Override - public String getTitle() { - return "Aggregate Selection"; - } - - @Override - public String getDescription() { - return "Select Aggregates to Extract"; - } - - @Override - public void createControl(Composite parent) { - container = new Composite(parent, SWT.NONE); - GridLayout layout = new GridLayout(); - container.setLayout(layout); - layout.numColumns = 2; - - // name label - Label boundedContextNameLabel = new Label(container, SWT.NONE); - boundedContextNameLabel.setText("Name for new Bounded Context:"); - - // name text field - boundedContextName = new Text(container, SWT.BORDER | SWT.SINGLE); - boundedContextName.setText(initialBoundedContextName); - boundedContextName.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); - boundedContextName.addKeyListener(new KeyAdapter() { - @Override - public void keyReleased(KeyEvent e) { - setPageComplete(isPageComplete()); - } - }); - - // create a horizontal separator - Label separator = new Label(container, SWT.HORIZONTAL | SWT.SEPARATOR); - GridData separatorGridData = new GridData(GridData.FILL_HORIZONTAL); - separatorGridData.horizontalSpan = 2; - separator.setLayoutData(separatorGridData); - - // selection label - Label selectionLabel = new Label(container, SWT.NONE); - selectionLabel.setText("Extracted Aggregates:"); - GridData selectionLabelGridData = new GridData(); - selectionLabelGridData.horizontalSpan = 2; - selectionLabel.setLayoutData(selectionLabelGridData); - - // selection table - selectionTable = new Table(container, SWT.CHECK | SWT.BORDER | SWT.V_SCROLL); - for (String aggregate : allAggregates) { - TableItem item = new TableItem(selectionTable, SWT.NONE); - item.setText(aggregate); - } - GridData tableGridData = new GridData(GridData.FILL_HORIZONTAL); - tableGridData.horizontalSpan = 2; - tableGridData.heightHint = 200; - selectionTable.setLayoutData(tableGridData); - selectionTable.addListener(SWT.Selection, new Listener() { - public void handleEvent(Event event) { - if (event.detail == SWT.CHECK) { - setPageComplete(isPageComplete()); - updateWarningMessage(); - } - } - }); - - setControl(container); - setPageComplete(false); - } - - private void updateWarningMessage() { - setMessage(null); - if (getSelectedAggregates().size() == this.allAggregates.size()) { - setMessage("Note that extracting all aggregates leads to the current Bounded Context being empty. Maybe just rename the current Bounded Context instead.", - WARNING); - } - } - - public String getBoundedContextName() { - return boundedContextName.getText(); - } - - public List getSelectedAggregates() { - List selectedItems = Arrays.asList(selectionTable.getItems()).stream().filter(item -> item.getChecked()).collect(Collectors.toList()); - return selectedItems.stream().map(item -> item.getText()).collect(Collectors.toList()); - } - - @Override - public boolean isPageComplete() { - return boundedContextName.getText() != null && !"".equals(boundedContextName.getText()) && getSelectedAggregates().size() >= 1; - } - - @Override - public void performHelp() { - Program.launch("https://contextmapper.org/docs/ar-extract-aggregates-by-nfr/"); - } -} diff --git a/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/wizard/pages/ContextMapperWizardPage.java b/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/wizard/pages/ContextMapperWizardPage.java deleted file mode 100644 index fde63a6d..00000000 --- a/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/wizard/pages/ContextMapperWizardPage.java +++ /dev/null @@ -1,24 +0,0 @@ -package org.contextmapper.dsl.ui.handler.wizard.pages; - -import org.contextmapper.dsl.ui.internal.DslActivator; -import org.eclipse.jface.wizard.WizardPage; -import org.eclipse.swt.graphics.Image; -import org.eclipse.swt.program.Program; - -public abstract class ContextMapperWizardPage extends WizardPage { - - public ContextMapperWizardPage(String title) { - super(title); - } - - @Override - public Image getImage() { - return DslActivator.imageDescriptorFromPlugin(DslActivator.PLUGIN_ID, "icons/cml-dialog-image.png").createImage(); - } - - @Override - public void performHelp() { - Program.launch("https://contextmapper.org/docs/architectural-refactorings/"); - } - -} diff --git a/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/wizard/pages/DeriveBackendFrontendSystemsFromFeatureWizardPage.java b/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/wizard/pages/DeriveBackendFrontendSystemsFromFeatureWizardPage.java deleted file mode 100644 index 01f3a091..00000000 --- a/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/wizard/pages/DeriveBackendFrontendSystemsFromFeatureWizardPage.java +++ /dev/null @@ -1,249 +0,0 @@ -/* - * Copyright 2020 The Context Mapper Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.contextmapper.dsl.ui.handler.wizard.pages; - -import java.util.Arrays; -import java.util.List; -import java.util.stream.Collectors; - -import org.contextmapper.dsl.refactoring.ContextSplittingIntegrationType; -import org.contextmapper.dsl.ui.handler.wizard.DeriveBackendFrontendFromFeatureContext; -import org.contextmapper.dsl.validation.AbstractCMLValidator; -import org.eclipse.swt.SWT; -import org.eclipse.swt.events.KeyAdapter; -import org.eclipse.swt.events.KeyEvent; -import org.eclipse.swt.events.SelectionAdapter; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.program.Program; -import org.eclipse.swt.widgets.Button; -import org.eclipse.swt.widgets.Combo; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Label; -import org.eclipse.swt.widgets.Text; - -public class DeriveBackendFrontendSystemsFromFeatureWizardPage extends ContextMapperWizardPage { - - private DeriveBackendFrontendFromFeatureContext context; - - private Composite container; - private Text frontendNameText; - private Text backendNameText; - private Text frontendImplementationTechnology; - private Text backendImplementationTechnology; - private Text relationshipImplementationTechnology; - private Combo typeSelectionCombo; - private Button deriveViewModelCheckbox; - private boolean hasError = true; - - public DeriveBackendFrontendSystemsFromFeatureWizardPage(DeriveBackendFrontendFromFeatureContext context) { - super("Derive Frontend/Backend Systems And Integration Relationship"); - this.context = context; - } - - @Override - public String getTitle() { - return "Derive Frontend/Backend Systems and Integration Relationship"; - } - - @Override - public String getDescription() { - return "Configure the derived Bounded Contexts and integration relationship:"; - } - - @Override - public void createControl(Composite parent) { - container = new Composite(parent, SWT.NONE); - GridLayout layout = new GridLayout(); - container.setLayout(layout); - layout.numColumns = 2; - - Label frontendNameLabel = new Label(container, SWT.NONE); - frontendNameLabel.setText("Frontend System Name:"); - frontendNameText = new Text(container, SWT.BORDER | SWT.SINGLE); - frontendNameText.setText(context.getFrontendName()); - frontendNameText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); - frontendNameText.addKeyListener(new KeyAdapter() { - @Override - public void keyReleased(KeyEvent e) { - validate(); - setPageComplete(isPageComplete()); - } - }); - - Label backendNameLabel = new Label(container, SWT.NONE); - backendNameLabel.setText("Backend System Name:"); - backendNameText = new Text(container, SWT.BORDER | SWT.SINGLE); - backendNameText.setText(context.getBackendName()); - backendNameText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); - backendNameText.addKeyListener(new KeyAdapter() { - @Override - public void keyReleased(KeyEvent e) { - validate(); - setPageComplete(isPageComplete()); - } - }); - - Label frontendImplTechnologyLabel = new Label(container, SWT.NONE); - frontendImplTechnologyLabel.setText("Frontend Implementation Technology:"); - frontendImplementationTechnology = new Text(container, SWT.BORDER | SWT.SINGLE); - frontendImplementationTechnology.setText(context.getFrontendImplementationTechnology()); - frontendImplementationTechnology.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); - frontendImplementationTechnology.addKeyListener(new KeyAdapter() { - @Override - public void keyReleased(KeyEvent e) { - validate(); - setPageComplete(isPageComplete()); - } - }); - - Label backendImplTechnologyLabel = new Label(container, SWT.NONE); - backendImplTechnologyLabel.setText("Backend Implementation Technology:"); - backendImplementationTechnology = new Text(container, SWT.BORDER | SWT.SINGLE); - backendImplementationTechnology.setText(context.getBackendImplementationTechnology()); - backendImplementationTechnology.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); - backendImplementationTechnology.addKeyListener(new KeyAdapter() { - @Override - public void keyReleased(KeyEvent e) { - validate(); - setPageComplete(isPageComplete()); - } - }); - - Label typeSelectionLabel = new Label(container, SWT.NONE); - typeSelectionLabel.setText("Frontend Integration Type:"); - - typeSelectionCombo = new Combo(container, SWT.DROP_DOWN | SWT.READ_ONLY); - typeSelectionCombo.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); - List selectionStrings = Arrays.asList(ContextSplittingIntegrationType.values()).stream().map(l -> l.toString()).collect(Collectors.toList()); - typeSelectionCombo.setItems(selectionStrings.toArray(new String[selectionStrings.size()])); - typeSelectionCombo.select(selectionStrings.indexOf(ContextSplittingIntegrationType.CONFORMIST.toString())); - typeSelectionCombo.addSelectionListener(new SelectionAdapter() { - @Override - public void widgetSelected(SelectionEvent e) { - validate(); - setPageComplete(isPageComplete()); - } - }); - typeSelectionCombo.addKeyListener(new KeyAdapter() { - @Override - public void keyReleased(KeyEvent e) { - validate(); - setPageComplete(isPageComplete()); - } - }); - - new Label(container, SWT.NONE); - Label hintLabel1 = new Label(container, SWT.NONE); - hintLabel1.setText("Hint: With the CONFORMIST integration type, the frontend system conforms to"); - new Label(container, SWT.NONE); - Label hintLabel2 = new Label(container, SWT.NONE); - hintLabel2.setText("the domain model of the backend."); - - new Label(container, SWT.NONE); - Label hintLabel3 = new Label(container, SWT.NONE); - hintLabel3.setText("Hint: With the ACL integration type, the frontend system domain model differs"); - new Label(container, SWT.NONE); - Label hintLabel4 = new Label(container, SWT.NONE); - hintLabel4.setText("from the backend one, and the frontend needs a translation/anticorruption layer."); - - Label relationshipImplTechnologyLabel = new Label(container, SWT.NONE); - relationshipImplTechnologyLabel.setText("Relationship Impl. Technology:"); - relationshipImplementationTechnology = new Text(container, SWT.BORDER | SWT.SINGLE); - relationshipImplementationTechnology.setText(context.getRelationshipImplementationTechnology()); - relationshipImplementationTechnology.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); - relationshipImplementationTechnology.addKeyListener(new KeyAdapter() { - @Override - public void keyReleased(KeyEvent e) { - validate(); - setPageComplete(isPageComplete()); - } - }); - - new Label(container, SWT.NONE); - deriveViewModelCheckbox = new Button(container, SWT.CHECK); - deriveViewModelCheckbox.setSelection(context.deriveViewModelInFrontend()); - deriveViewModelCheckbox.setText("Derive ViewModel in frontend system (initially just a copy of existing model)."); - - setControl(container); - validate(); - setPageComplete(false); - } - - @Override - public void setVisible(boolean visible) { - super.setVisible(visible); - this.frontendNameText.forceFocus(); - } - - public String getFrontendName() { - return frontendNameText.getText(); - } - - public String getBackendName() { - return backendNameText.getText(); - } - - public String getFrontendImplementationTechnology() { - return frontendImplementationTechnology.getText(); - } - - public String getRelationshipImplementationTechnology() { - return relationshipImplementationTechnology.getText(); - } - - public String getBackendImplementationTechnology() { - return backendImplementationTechnology.getText(); - } - - public ContextSplittingIntegrationType getRelationshipType() { - return ContextSplittingIntegrationType.valueOf(this.typeSelectionCombo.getText()); - } - - public boolean deriveViewModelInFrontend() { - return deriveViewModelCheckbox.getSelection(); - } - - private void validate() { - setErrorMessage(null); - hasError = false; - - if (!backendNameText.getText().matches(AbstractCMLValidator.ID_VALIDATION_PATTERN)) { - setError("The Bounded Context name '" + backendNameText.getText() + "' is not valid. Allowed characters are: a-z, A-Z, 0-9, _"); - return; - } - if (!frontendNameText.getText().matches(AbstractCMLValidator.ID_VALIDATION_PATTERN)) { - setError("The Bounded Context name '" + frontendNameText.getText() + "' is not valid. Allowed characters are: a-z, A-Z, 0-9, _"); - return; - } - } - - private void setError(String message) { - hasError = true; - setErrorMessage(message); - } - - @Override - public boolean isPageComplete() { - return !hasError && !"".equals(backendNameText.getText()) && !"".equals(frontendNameText.getText()) && getRelationshipType() != null; - } - - @Override - public void performHelp() { - Program.launch("https://contextmapper.org/docs/rapid-ooad/"); - } -} diff --git a/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/wizard/pages/DeriveBoundedContextFromSubdomainsWizardPage.java b/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/wizard/pages/DeriveBoundedContextFromSubdomainsWizardPage.java deleted file mode 100644 index c115aece..00000000 --- a/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/wizard/pages/DeriveBoundedContextFromSubdomainsWizardPage.java +++ /dev/null @@ -1,131 +0,0 @@ -/* - * Copyright 2020 The Context Mapper Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.contextmapper.dsl.ui.handler.wizard.pages; - -import java.util.Set; - -import org.contextmapper.dsl.validation.AbstractCMLValidator; -import org.eclipse.jface.fieldassist.AutoCompleteField; -import org.eclipse.jface.fieldassist.ComboContentAdapter; -import org.eclipse.swt.SWT; -import org.eclipse.swt.events.KeyAdapter; -import org.eclipse.swt.events.KeyEvent; -import org.eclipse.swt.events.SelectionAdapter; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.program.Program; -import org.eclipse.swt.widgets.Combo; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Label; - -public class DeriveBoundedContextFromSubdomainsWizardPage extends ContextMapperWizardPage { - - private String initialBoundedContextName; - private Set existingBoundedContexts; - - private Combo comboBCs; - private Composite container; - - private boolean hasError = true; - - public DeriveBoundedContextFromSubdomainsWizardPage(String initialBoundedContextName, Set existingBoundedContexts) { - super("Bounded Context Definition Page"); - this.initialBoundedContextName = initialBoundedContextName; - this.existingBoundedContexts = existingBoundedContexts; - } - - @Override - public String getTitle() { - return "Bounded Context Name"; - } - - @Override - public String getDescription() { - return "Choose the name of the Bounded Context to be created/updated:"; - } - - @Override - public void createControl(Composite parent) { - container = new Composite(parent, SWT.NONE); - GridLayout layout = new GridLayout(); - container.setLayout(layout); - layout.numColumns = 2; - - Label boundedContextLabel = new Label(container, SWT.NONE); - boundedContextLabel.setText("Bounded Context:"); - - // BC selection field - comboBCs = new Combo(container, SWT.DROP_DOWN); - comboBCs.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); - comboBCs.setItems(this.existingBoundedContexts.toArray(new String[this.existingBoundedContexts.size()])); - comboBCs.setText(initialBoundedContextName); - comboBCs.addSelectionListener(new SelectionAdapter() { - @Override - public void widgetSelected(SelectionEvent e) { - validate(); - setPageComplete(isPageComplete()); - } - }); - comboBCs.addKeyListener(new KeyAdapter() { - @Override - public void keyReleased(KeyEvent e) { - validate(); - setPageComplete(isPageComplete()); - } - }); - new AutoCompleteField(comboBCs, new ComboContentAdapter(), this.existingBoundedContexts.toArray(new String[existingBoundedContexts.size()])); - - setControl(container); - validate(); - setPageComplete(false); - } - - private void validate() { - setErrorMessage(null); - hasError = false; - - if (!comboBCs.getText().matches(AbstractCMLValidator.ID_VALIDATION_PATTERN)) { - setError("The domain name '" + comboBCs.getText() + "' is not valid. Allowed characters are: a-z, A-Z, 0-9, _"); - return; - } - } - - private void setError(String message) { - hasError = true; - setErrorMessage(message); - } - - @Override - public void setVisible(boolean visible) { - super.setVisible(visible); - this.comboBCs.forceFocus(); - } - - public String getBoundedContextName() { - return comboBCs.getText(); - } - - @Override - public boolean isPageComplete() { - return !hasError && comboBCs.getText() != null && !"".equals(comboBCs.getText()); - } - - @Override - public void performHelp() { - Program.launch("https://contextmapper.org/docs/rapid-ooad/"); - } -} diff --git a/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/wizard/pages/DeriveSubdomainFromRequirementsWizardPage.java b/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/wizard/pages/DeriveSubdomainFromRequirementsWizardPage.java deleted file mode 100644 index b78629a5..00000000 --- a/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/wizard/pages/DeriveSubdomainFromRequirementsWizardPage.java +++ /dev/null @@ -1,200 +0,0 @@ -/* - * Copyright 2020 The Context Mapper Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.contextmapper.dsl.ui.handler.wizard.pages; - -import java.util.ArrayList; -import java.util.Map; -import java.util.Set; - -import org.contextmapper.dsl.validation.AbstractCMLValidator; -import org.eclipse.jface.fieldassist.AutoCompleteField; -import org.eclipse.jface.fieldassist.ComboContentAdapter; -import org.eclipse.swt.SWT; -import org.eclipse.swt.events.KeyAdapter; -import org.eclipse.swt.events.KeyEvent; -import org.eclipse.swt.events.SelectionAdapter; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.program.Program; -import org.eclipse.swt.widgets.Combo; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Label; - -import com.google.common.collect.Sets; - -public class DeriveSubdomainFromRequirementsWizardPage extends ContextMapperWizardPage { - - private String initialDomain; - private Map> domainSubdomainMapping; - - private Combo comboDomains; - private Combo comboSubdomain; - private AutoCompleteField subdomainAutoCompleteField; - private Composite container; - - private boolean hasError = true; - - public DeriveSubdomainFromRequirementsWizardPage(String initialDomain, - Map> domainSubdomainMapping) { - super("Subdomain Definition Page"); - this.initialDomain = initialDomain; - this.domainSubdomainMapping = domainSubdomainMapping; - } - - @Override - public String getTitle() { - return "Domain and Subdomain Definition"; - } - - @Override - public String getDescription() { - return "Choose the name of the Domain and Subdomain to be created/updated:"; - } - - @Override - public void createControl(Composite parent) { - container = new Composite(parent, SWT.NONE); - GridLayout layout = new GridLayout(); - container.setLayout(layout); - layout.numColumns = 2; - - Label domainNameLabel = new Label(container, SWT.NONE); - domainNameLabel.setText("Domain:"); - - // domain selection field - comboDomains = new Combo(container, SWT.DROP_DOWN); - comboDomains.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); - comboDomains - .setItems(this.domainSubdomainMapping.keySet().toArray(new String[this.domainSubdomainMapping.size()])); - comboDomains.select(new ArrayList(this.domainSubdomainMapping.keySet()).indexOf(this.initialDomain)); - comboDomains.addSelectionListener(new SelectionAdapter() { - @Override - public void widgetSelected(SelectionEvent e) { - updateSubdomainCombo(domainSubdomainMapping.get(comboDomains.getText())); - validate(); - setPageComplete(isPageComplete()); - } - }); - comboDomains.addKeyListener(new KeyAdapter() { - @Override - public void keyReleased(KeyEvent e) { - validate(); - setPageComplete(isPageComplete()); - } - }); - new AutoCompleteField(comboDomains, new ComboContentAdapter(), - this.domainSubdomainMapping.keySet().toArray(new String[domainSubdomainMapping.size()])); - - Label subdomainNameLabel = new Label(container, SWT.NONE); - subdomainNameLabel.setText("Subdomain name:"); - - Set initialSubdomains = domainSubdomainMapping.get(initialDomain); - if (initialSubdomains == null) - initialSubdomains = Sets.newHashSet(); - comboSubdomain = new Combo(container, SWT.DROP_DOWN); - comboSubdomain.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); - comboSubdomain.addSelectionListener(new SelectionAdapter() { - @Override - public void widgetSelected(SelectionEvent e) { - validate(); - setPageComplete(isPageComplete()); - } - }); - comboSubdomain.addKeyListener(new KeyAdapter() { - @Override - public void keyReleased(KeyEvent e) { - validate(); - setPageComplete(isPageComplete()); - } - }); - this.subdomainAutoCompleteField = new AutoCompleteField(comboSubdomain, new ComboContentAdapter(), - initialSubdomains.toArray(new String[initialSubdomains.size()])); - updateSubdomainCombo(initialSubdomains); - - setControl(container); - validate(); - setPageComplete(false); - } - - private void validate() { - setErrorMessage(null); - hasError = false; - - if (comboDomains.getText() == null || "".equals(comboDomains.getText())) { - setError("Please provide a name for the domain."); - return; - } - if (!comboDomains.getText().matches(AbstractCMLValidator.ID_VALIDATION_PATTERN)) { - setError("The domain name \"" + comboDomains.getText() - + "\" is not valid. Allowed characters are: a-z, A-Z, 0-9, _"); - return; - } - if (comboSubdomain.getText() == null || "".equals(comboSubdomain.getText())) { - setError("Please provide a name for the subdomain."); - return; - } - if (!comboSubdomain.getText().matches(AbstractCMLValidator.ID_VALIDATION_PATTERN)) { - setError("The subdomain name \"" + comboSubdomain.getText() - + "\" is not valid. Allowed characters are: a-z, A-Z, 0-9, _"); - return; - } - } - - private void setError(String message) { - hasError = true; - setErrorMessage(message); - } - - private void updateSubdomainCombo(Set subdomains) { - if (subdomains == null) { - comboSubdomain.setItems(new String[0]); - subdomainAutoCompleteField.setProposals(new String[0]); - } - - String[] items = subdomains.toArray(new String[subdomains.size()]); - comboSubdomain.setItems(items); - subdomainAutoCompleteField.setProposals(items); - } - - @Override - public void setVisible(boolean visible) { - super.setVisible(visible); - if (this.initialDomain != null && !"".equals(this.initialDomain)) - this.comboSubdomain.forceFocus(); - else - this.comboDomains.forceFocus(); - } - - public String getDomain() { - return comboDomains.getText(); - } - - public String getSubdomain() { - return comboSubdomain.getText(); - } - - @Override - public boolean isPageComplete() { - return !hasError && comboDomains.getText() != null && !"".equals(comboDomains.getText()) - && comboSubdomain.getText() != null && !"".equals(comboSubdomain.getText()); - } - - @Override - public void performHelp() { - Program.launch("https://contextmapper.org/docs/rapid-ooad/"); - } -} diff --git a/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/wizard/pages/GenerateContextMapWizardPage.java b/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/wizard/pages/GenerateContextMapWizardPage.java deleted file mode 100644 index 2811d9d0..00000000 --- a/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/wizard/pages/GenerateContextMapWizardPage.java +++ /dev/null @@ -1,252 +0,0 @@ -/* - * Copyright 2019 The Context Mapper Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.contextmapper.dsl.ui.handler.wizard.pages; - -import java.util.HashSet; -import java.util.Set; - -import org.contextmapper.dsl.generator.contextmap.ContextMapFormat; -import org.contextmapper.dsl.ui.handler.wizard.GenerateContextMapContext; -import org.eclipse.swt.SWT; -import org.eclipse.swt.events.SelectionAdapter; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.events.SelectionListener; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.program.Program; -import org.eclipse.swt.widgets.Button; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Event; -import org.eclipse.swt.widgets.Group; -import org.eclipse.swt.widgets.Label; -import org.eclipse.swt.widgets.Listener; -import org.eclipse.swt.widgets.Scale; -import org.eclipse.swt.widgets.Spinner; - -public class GenerateContextMapWizardPage extends ContextMapperWizardPage { - - private Composite container; - private Button widthCheckBox; - private Spinner widthSpinner; - private Button heightCheckBox; - private Spinner heightSpinner; - private Button generateLabelsCheckBox; - private Button clusterTeamsCheckBox; - - private GenerateContextMapContext context; - private Set selectedFormats; - private int labelSpacingFactor; - private int width; - private int height; - - public GenerateContextMapWizardPage(GenerateContextMapContext context) { - super("Generate Context Map Configuration Page"); - this.context = context; - this.selectedFormats = new HashSet<>(); - this.selectedFormats.addAll(context.getFormats()); - this.labelSpacingFactor = context.getLabelSpacingFactor(); - this.width = context.getWidth(); - this.height = context.getHeight(); - } - - @Override - public String getTitle() { - return "Context Map Generation"; - } - - @Override - public String getDescription() { - return "Configure how to generate your Context Map"; - } - - @Override - public void createControl(Composite parent) { - container = new Composite(parent, SWT.NONE); - GridLayout layout = new GridLayout(); - layout.numColumns = 2; - layout.verticalSpacing = 10; - container.setLayout(layout); - - // name label - Label formatSelectionLabel = new Label(container, SWT.NONE); - formatSelectionLabel.setText("Generated formats:"); - - // format selection checkboxes - Group formatSelectionGroup = new Group(container, SWT.NONE); - GridLayout gridLayout = new GridLayout(); - gridLayout.numColumns = 3; - formatSelectionGroup.setLayout(gridLayout); - formatSelectionGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); - - SelectionListener formatSelectionListener = new SelectionAdapter() { - public void widgetSelected(SelectionEvent event) { - Button button = ((Button) event.widget); - ContextMapFormat format = ContextMapFormat.valueOf(button.getText()); - if (button.getSelection()) - selectedFormats.add(format); - else if (selectedFormats.contains(format)) - selectedFormats.remove(format); - setPageComplete(isPageComplete()); - }; - }; - - for (ContextMapFormat format : ContextMapFormat.values()) { - Button button = new Button(formatSelectionGroup, SWT.CHECK); - button.setText(format.toString()); - button.setSelection(true); - button.addSelectionListener(formatSelectionListener); - } - - // fix width to custom value - widthCheckBox = new Button(container, SWT.CHECK); - widthCheckBox.setText("Fix image width: "); - widthCheckBox.setSelection(context.isFixWidth()); - widthCheckBox.addListener(SWT.Selection, new Listener() { - public void handleEvent(Event event) { - widthSpinner.setEnabled(widthCheckBox.getSelection()); - if (widthCheckBox.getSelection()) { - heightCheckBox.setSelection(false); - heightSpinner.setEnabled(false); - } - } - }); - widthSpinner = new Spinner(container, SWT.NONE); - widthSpinner.setMinimum(1); - widthSpinner.setMaximum(20000); - widthSpinner.setSelection(width); - widthSpinner.setIncrement(100); - widthSpinner.setEnabled(context.isFixWidth()); - widthSpinner.addListener(SWT.Selection, new Listener() { - public void handleEvent(Event event) { - width = widthSpinner.getSelection(); - } - }); - - // fix height to custom value - heightCheckBox = new Button(container, SWT.CHECK); - heightCheckBox.setText("Fix image height:"); - heightCheckBox.setSelection(context.isFixHeight()); - heightCheckBox.addListener(SWT.Selection, new Listener() { - public void handleEvent(Event event) { - heightSpinner.setEnabled(heightCheckBox.getSelection()); - if (heightCheckBox.getSelection()) { - widthCheckBox.setSelection(false); - widthSpinner.setEnabled(false); - } - } - }); - heightSpinner = new Spinner(container, SWT.NONE); - heightSpinner.setMinimum(1); - heightSpinner.setMaximum(20000); - heightSpinner.setSelection(height); - heightSpinner.setIncrement(100); - heightSpinner.setEnabled(context.isFixHeight()); - heightSpinner.addListener(SWT.Selection, new Listener() { - public void handleEvent(Event event) { - height = heightSpinner.getSelection(); - } - }); - - // generate labels checkbox - Label generateLabelsLabel = new Label(container, SWT.NONE); - generateLabelsLabel.setText("Generate labels:"); - generateLabelsCheckBox = new Button(container, SWT.CHECK); - generateLabelsCheckBox.setText("Labels for relationship names and implementation technologies"); - generateLabelsCheckBox.setSelection(context.generateAdditionalLabels()); - - // cluster teams checkbox - Label clusterTeamsLabel = new Label(container, SWT.NONE); - clusterTeamsLabel.setText("Cluster team contexts:"); - clusterTeamsCheckBox = new Button(container, SWT.CHECK); - clusterTeamsCheckBox.setText("Separate team/generic Bounded Contexts into clusters (team maps only)"); - clusterTeamsCheckBox.setSelection(context.clusterTeams()); - - // spacing factor label - Label labelSpacingFactorLabel = new Label(container, SWT.NONE); - labelSpacingFactorLabel.setText("Spacing factor:"); - - // spacing factor selection - Scale scale = new Scale(container, SWT.HORIZONTAL); - scale.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); - scale.setSelection(labelSpacingFactor); - scale.setMinimum(1); - scale.setMaximum(20); - scale.setIncrement(1); - scale.addListener(SWT.Selection, new Listener() { - public void handleEvent(Event event) { - labelSpacingFactor = scale.getSelection(); - } - }); - - // spacing factor hint - new Label(container, SWT.NONE); - Label spacingHintLabel1 = new Label(container, SWT.NONE); - spacingHintLabel1.setText(" Hint: Increasing the spacing factor may improve the generated"); - new Label(container, SWT.NONE); - Label spacingHintLabel2 = new Label(container, SWT.NONE); - spacingHintLabel2.setText(" image in case it contains overlapping labels."); - - setControl(container); - setPageComplete(false); - } - - @Override - public void setVisible(boolean visible) { - super.setVisible(visible); - } - - public Set getSelectedFormats() { - return new HashSet<>(selectedFormats); - } - - public int getLabelSpacingFactor() { - return labelSpacingFactor; - } - - public boolean takeWidth() { - return widthCheckBox.getSelection(); - } - - public int getWidth() { - return width; - } - - public boolean takeHeight() { - return heightCheckBox.getSelection(); - } - - public int getHeight() { - return height; - } - - public boolean generateLabels() { - return generateLabelsCheckBox.getSelection(); - } - - public boolean clusterTeams() { - return clusterTeamsCheckBox.getSelection(); - } - - @Override - public boolean isPageComplete() { - return this.selectedFormats.size() > 0; - } - - @Override - public void performHelp() { - Program.launch("https://contextmapper.org/docs/context-map-generator/"); - } -} diff --git a/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/wizard/pages/GenerateGenericTextFileWizardPage.java b/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/wizard/pages/GenerateGenericTextFileWizardPage.java deleted file mode 100644 index ed66017b..00000000 --- a/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/wizard/pages/GenerateGenericTextFileWizardPage.java +++ /dev/null @@ -1,115 +0,0 @@ -/* - * Copyright 2020 The Context Mapper Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.contextmapper.dsl.ui.handler.wizard.pages; - -import org.contextmapper.dsl.ui.handler.wizard.pages.components.FreemarkerFileChooser; -import org.eclipse.core.resources.IFile; -import org.eclipse.swt.SWT; -import org.eclipse.swt.events.KeyAdapter; -import org.eclipse.swt.events.KeyEvent; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.program.Program; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Label; -import org.eclipse.swt.widgets.Text; - -public class GenerateGenericTextFileWizardPage extends ContextMapperWizardPage { - - private Composite container; - private FreemarkerFileChooser fileChooser; - private Text targetFileNameTextBox; - private IFile selectedFile; - private String initialFilename; - - public GenerateGenericTextFileWizardPage() { - super("Generate Arbitrary Textual File with Freemarker"); - } - - @Override - public String getTitle() { - return "Generic Text File Generator (Freemarker)"; - } - - @Override - public String getDescription() { - return "Generate Arbitrary Textual File with Freemarker"; - } - - @Override - public void createControl(Composite parent) { - container = new Composite(parent, SWT.NONE); - GridLayout layout = new GridLayout(); - layout.numColumns = 2; - layout.horizontalSpacing = 0; - layout.verticalSpacing = 10; - container.setLayout(layout); - - // Freemarker template selection - Label fileSelectionLabel = new Label(container, SWT.NONE); - fileSelectionLabel.setText("Freemarker template: "); - fileChooser = new FreemarkerFileChooser(container); - if (selectedFile != null) - fileChooser.setFile(selectedFile); - fileChooser.setFileSelectedFunction(f -> { - selectedFile = f; - setPageComplete(isPageComplete()); - }); - - // target filename - Label targetFileNameLabel = new Label(container, SWT.NONE); - targetFileNameLabel.setText("Target file name: "); - targetFileNameTextBox = new Text(container, SWT.BORDER | SWT.SINGLE); - targetFileNameTextBox.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); - targetFileNameTextBox.addKeyListener(new KeyAdapter() { - @Override - public void keyReleased(KeyEvent e) { - setPageComplete(isPageComplete()); - } - }); - if(initialFilename != null) - targetFileNameTextBox.setText(initialFilename); - - setControl(container); - setPageComplete(false); - } - - public IFile getFile() { - return selectedFile; - } - - public String getTargetFileName() { - return targetFileNameTextBox.getText(); - } - - public void setInitialTemplateFile(IFile initialTemplateFile) { - this.selectedFile = initialTemplateFile; - } - - public void setInitialFilename(String initialFilename) { - this.initialFilename = initialFilename; - } - - @Override - public boolean isPageComplete() { - return selectedFile != null && fileChooser.getFile().exists() && !"".equals(targetFileNameTextBox.getText()); - } - - @Override - public void performHelp() { - Program.launch("https://contextmapper.org/docs/generic-template-based-generator/"); - } -} diff --git a/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/wizard/pages/LikelihoodForChangeSelectionWizardPage.java b/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/wizard/pages/LikelihoodForChangeSelectionWizardPage.java deleted file mode 100644 index 419fa593..00000000 --- a/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/wizard/pages/LikelihoodForChangeSelectionWizardPage.java +++ /dev/null @@ -1,118 +0,0 @@ -/* - * Copyright 2019 The Context Mapper Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.contextmapper.dsl.ui.handler.wizard.pages; - -import java.util.Arrays; -import java.util.List; -import java.util.stream.Collectors; - -import org.contextmapper.dsl.contextMappingDSL.Volatility; -import org.eclipse.swt.SWT; -import org.eclipse.swt.events.KeyAdapter; -import org.eclipse.swt.events.KeyEvent; -import org.eclipse.swt.events.SelectionAdapter; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.program.Program; -import org.eclipse.swt.widgets.Combo; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Label; - -public class LikelihoodForChangeSelectionWizardPage extends ContextMapperWizardPage { - - private Combo selectionCombo; - private Composite container; - private List availableLikelihoodsForChange; - - public LikelihoodForChangeSelectionWizardPage(List availableLikelihoodsForChange) { - super("Volatility Selection Page"); - this.availableLikelihoodsForChange = availableLikelihoodsForChange; - } - - @Override - public String getTitle() { - return "Volatility Selection"; - } - - @Override - public String getDescription() { - return "Select volatility by which you want to extract"; - } - - @Override - public void createControl(Composite parent) { - container = new Composite(parent, SWT.NONE); - GridLayout layout = new GridLayout(); - container.setLayout(layout); - layout.numColumns = 2; - - // name label - Label boundedContextNameLabel1 = new Label(container, SWT.NONE); - boundedContextNameLabel1.setText("Volatility (Likelihood for Change):"); - - // selection field - selectionCombo = new Combo(container, SWT.DROP_DOWN); - selectionCombo.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); - List selectionStrings = Arrays.asList(Volatility.values()).stream().map(l -> l.getName()).collect(Collectors.toList()); - selectionCombo.setItems(selectionStrings.toArray(new String[selectionStrings.size()])); - selectionCombo.select(selectionStrings.indexOf(Volatility.OFTEN.getName())); - selectionCombo.addSelectionListener(new SelectionAdapter() { - @Override - public void widgetSelected(SelectionEvent e) { - setPageComplete(isPageComplete()); - updateValidationMessage(); - } - }); - selectionCombo.addKeyListener(new KeyAdapter() { - @Override - public void keyReleased(KeyEvent e) { - setPageComplete(isPageComplete()); - updateValidationMessage(); - } - }); - - setControl(container); - setPageComplete(false); - } - - private void updateValidationMessage() { - setErrorMessage(null); - if (Volatility.get(selectionCombo.getText()) != null && !this.availableLikelihoodsForChange.contains(Volatility.valueOf(selectionCombo.getText()))) { - setErrorMessage("Your Bounded Context does not contain any Aggregates with a 'likelihood for change' of '" + selectionCombo.getText() + "'."); - } - } - - @Override - public void setVisible(boolean visible) { - super.setVisible(visible); - this.selectionCombo.forceFocus(); - } - - public Volatility getVolatility() { - return Volatility.valueOf(this.selectionCombo.getText()); - } - - @Override - public boolean isPageComplete() { - return this.selectionCombo.getText() != null && !"".equals(this.selectionCombo.getText()) && this.availableLikelihoodsForChange.contains(Volatility.valueOf(this.selectionCombo.getText())); - } - - @Override - public void performHelp() { - Program.launch("https://contextmapper.org/docs/ar-extract-aggregates-by-volatility/"); - } -} diff --git a/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/wizard/pages/NewBoundedContextNameWizardPage.java b/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/wizard/pages/NewBoundedContextNameWizardPage.java deleted file mode 100644 index 4d6fd0fd..00000000 --- a/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/wizard/pages/NewBoundedContextNameWizardPage.java +++ /dev/null @@ -1,89 +0,0 @@ -/* - * Copyright 2020 The Context Mapper Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.contextmapper.dsl.ui.handler.wizard.pages; - -import org.eclipse.swt.SWT; -import org.eclipse.swt.events.KeyAdapter; -import org.eclipse.swt.events.KeyEvent; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.program.Program; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Label; -import org.eclipse.swt.widgets.Text; - -public class NewBoundedContextNameWizardPage extends ContextMapperWizardPage { - - private String initialBoundedContextName; - - private Text boundedContextName; - private Composite container; - - public NewBoundedContextNameWizardPage(String initialBoundedContextName) { - super("Bounded Context Name"); - this.initialBoundedContextName = initialBoundedContextName; - } - - @Override - public String getTitle() { - return "New Bounded Context Name"; - } - - @Override - public String getDescription() { - return "Please define a name for the new Bounded Context."; - } - - @Override - public void createControl(Composite parent) { - container = new Composite(parent, SWT.NONE); - GridLayout layout = new GridLayout(); - container.setLayout(layout); - layout.numColumns = 2; - - // name label - Label boundedContextNameLabel = new Label(container, SWT.NONE); - boundedContextNameLabel.setText("Name for new Bounded Context:"); - - // name text field - boundedContextName = new Text(container, SWT.BORDER | SWT.SINGLE); - boundedContextName.setText(initialBoundedContextName); - boundedContextName.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); - boundedContextName.addKeyListener(new KeyAdapter() { - @Override - public void keyReleased(KeyEvent e) { - setPageComplete(isPageComplete()); - } - }); - - setControl(container); - setPageComplete(false); - } - - public String getBoundedContextName() { - return boundedContextName.getText(); - } - - @Override - public boolean isPageComplete() { - return boundedContextName.getText() != null && !"".equals(boundedContextName.getText()); - } - - @Override - public void performHelp() { - Program.launch("https://contextmapper.org/docs/systematic-service-decomposition/"); - } -} diff --git a/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/wizard/pages/SplitSystemIntoSubsystemsWizardPage.java b/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/wizard/pages/SplitSystemIntoSubsystemsWizardPage.java deleted file mode 100644 index 2459bfb9..00000000 --- a/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/wizard/pages/SplitSystemIntoSubsystemsWizardPage.java +++ /dev/null @@ -1,263 +0,0 @@ -/* - * Copyright 2020 The Context Mapper Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.contextmapper.dsl.ui.handler.wizard.pages; - -import java.util.Arrays; -import java.util.List; -import java.util.stream.Collectors; - -import org.contextmapper.dsl.refactoring.ContextSplittingIntegrationType; -import org.contextmapper.dsl.refactoring.SplitSystemIntoSubsystems.SplitBoundedContextRelationshipType; -import org.contextmapper.dsl.ui.handler.wizard.SplitSystemIntoSubsystemsContext; -import org.contextmapper.dsl.validation.AbstractCMLValidator; -import org.eclipse.swt.SWT; -import org.eclipse.swt.events.KeyAdapter; -import org.eclipse.swt.events.KeyEvent; -import org.eclipse.swt.events.SelectionAdapter; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.program.Program; -import org.eclipse.swt.widgets.Button; -import org.eclipse.swt.widgets.Combo; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Label; -import org.eclipse.swt.widgets.Text; - -public class SplitSystemIntoSubsystemsWizardPage extends ContextMapperWizardPage { - - private SplitSystemIntoSubsystemsContext context; - - private Composite container; - private Text existingSubsystemNameText; - private Text newSubsystemNameText; - private Combo relationshipTypeSelectionCombo; - private Combo integrationTypeSelectionCombo; - private Text newSubsystemImplementationTechnology; - private Text newRelationshipImplementationTechnology; - private Button copyDomainModelCheckbox; - private boolean hasError = true; - - public SplitSystemIntoSubsystemsWizardPage(SplitSystemIntoSubsystemsContext context) { - super("Split System Context Into Two Subsystems"); - this.context = context; - } - - @Override - public String getTitle() { - return "Split System Context Into Two Subsystems"; - } - - @Override - public String getDescription() { - return "Configure the two subsystems:"; - } - - @Override - public void createControl(Composite parent) { - container = new Composite(parent, SWT.NONE); - GridLayout layout = new GridLayout(); - container.setLayout(layout); - layout.numColumns = 2; - - Label existingSubsystemNameLabel = new Label(container, SWT.NONE); - existingSubsystemNameLabel.setText("Existing Subsystem:"); - existingSubsystemNameText = new Text(container, SWT.BORDER | SWT.SINGLE); - existingSubsystemNameText.setText(context.getExistingContextSubsystemName()); - existingSubsystemNameText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); - existingSubsystemNameText.addKeyListener(new KeyAdapter() { - @Override - public void keyReleased(KeyEvent e) { - validate(); - setPageComplete(isPageComplete()); - } - }); - - Label newSubsystemNameLabel = new Label(container, SWT.NONE); - newSubsystemNameLabel.setText("New Subsystem:"); - newSubsystemNameText = new Text(container, SWT.BORDER | SWT.SINGLE); - newSubsystemNameText.setText(context.getNewSubsystemName()); - newSubsystemNameText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); - newSubsystemNameText.addKeyListener(new KeyAdapter() { - @Override - public void keyReleased(KeyEvent e) { - validate(); - setPageComplete(isPageComplete()); - } - }); - - Label newSubsystemImplTechnologyLabel = new Label(container, SWT.NONE); - newSubsystemImplTechnologyLabel.setText("New Subsystems Impl. Technology:"); - newSubsystemImplementationTechnology = new Text(container, SWT.BORDER | SWT.SINGLE); - newSubsystemImplementationTechnology.setText(context.getNewSubsystemImplementationTechnology()); - newSubsystemImplementationTechnology.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); - newSubsystemImplementationTechnology.addKeyListener(new KeyAdapter() { - @Override - public void keyReleased(KeyEvent e) { - validate(); - setPageComplete(isPageComplete()); - } - }); - - Label relationshipTypeLabel = new Label(container, SWT.NONE); - relationshipTypeLabel.setText("New Subsystems Relationship Role:"); - - relationshipTypeSelectionCombo = new Combo(container, SWT.DROP_DOWN | SWT.READ_ONLY); - relationshipTypeSelectionCombo.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); - List selectionStrings = Arrays.asList(SplitBoundedContextRelationshipType.values()).stream().map(l -> l.getLabel()).collect(Collectors.toList()); - relationshipTypeSelectionCombo.setItems(selectionStrings.toArray(new String[selectionStrings.size()])); - relationshipTypeSelectionCombo.select(selectionStrings.indexOf(context.getRelationshipType().getLabel())); - relationshipTypeSelectionCombo.addSelectionListener(new SelectionAdapter() { - @Override - public void widgetSelected(SelectionEvent e) { - validate(); - setPageComplete(isPageComplete()); - } - }); - relationshipTypeSelectionCombo.addKeyListener(new KeyAdapter() { - @Override - public void keyReleased(KeyEvent e) { - validate(); - setPageComplete(isPageComplete()); - } - }); - - Label integrationTypeLabel = new Label(container, SWT.NONE); - integrationTypeLabel.setText("Downstream Integration Type:"); - - integrationTypeSelectionCombo = new Combo(container, SWT.DROP_DOWN | SWT.READ_ONLY); - integrationTypeSelectionCombo.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); - List integrationSelectionStrings = Arrays.asList(ContextSplittingIntegrationType.values()).stream().map(l -> l.toString()).collect(Collectors.toList()); - integrationTypeSelectionCombo.setItems(integrationSelectionStrings.toArray(new String[integrationSelectionStrings.size()])); - integrationTypeSelectionCombo.select(integrationSelectionStrings.indexOf(context.getIntegrationType().toString())); - integrationTypeSelectionCombo.addSelectionListener(new SelectionAdapter() { - @Override - public void widgetSelected(SelectionEvent e) { - validate(); - setPageComplete(isPageComplete()); - } - }); - integrationTypeSelectionCombo.addKeyListener(new KeyAdapter() { - @Override - public void keyReleased(KeyEvent e) { - validate(); - setPageComplete(isPageComplete()); - } - }); - - new Label(container, SWT.NONE); - Label hintLabel1 = new Label(container, SWT.NONE); - hintLabel1.setText("Hint: With the CONFORMIST integration type, the downstream subsystem conforms to"); - new Label(container, SWT.NONE); - Label hintLabel2 = new Label(container, SWT.NONE); - hintLabel2.setText("the domain model of the upstream subsystem."); - - new Label(container, SWT.NONE); - Label hintLabel3 = new Label(container, SWT.NONE); - hintLabel3.setText("Hint: With the ACL integration type, the downstream subsystem domain model differs"); - new Label(container, SWT.NONE); - Label hintLabel4 = new Label(container, SWT.NONE); - hintLabel4.setText("from the upstream domain model, and the downstream needs a translation/anti-"); - new Label(container, SWT.NONE); - Label hintLabel5 = new Label(container, SWT.NONE); - hintLabel5.setText("corruption layer."); - - Label relationshipImplTechnologyLabel = new Label(container, SWT.NONE); - relationshipImplTechnologyLabel.setText("Relationship Impl. Technology:"); - newRelationshipImplementationTechnology = new Text(container, SWT.BORDER | SWT.SINGLE); - newRelationshipImplementationTechnology.setText(context.getNewRelationshipImplementationTechnology()); - newRelationshipImplementationTechnology.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); - newRelationshipImplementationTechnology.addKeyListener(new KeyAdapter() { - @Override - public void keyReleased(KeyEvent e) { - validate(); - setPageComplete(isPageComplete()); - } - }); - - new Label(container, SWT.NONE); - copyDomainModelCheckbox = new Button(container, SWT.CHECK); - copyDomainModelCheckbox.setSelection(context.copyDomainModel()); - copyDomainModelCheckbox.setText("Copy domain model from existing subsystem to new subsystem."); - - setControl(container); - validate(); - setPageComplete(false); - } - - @Override - public void setVisible(boolean visible) { - super.setVisible(visible); - this.newSubsystemNameText.forceFocus(); - } - - public String getExistingSubsystemName() { - return this.existingSubsystemNameText.getText(); - } - - public String getNewSubsystemName() { - return this.newSubsystemNameText.getText(); - } - - public ContextSplittingIntegrationType getIntegrationType() { - return ContextSplittingIntegrationType.valueOf(this.integrationTypeSelectionCombo.getText()); - } - - public SplitBoundedContextRelationshipType getRelationshipType() { - return SplitBoundedContextRelationshipType.byLabel(this.relationshipTypeSelectionCombo.getText()); - } - - public String getNewSubsystemImplementationTechnology() { - return this.newSubsystemImplementationTechnology.getText(); - } - - public String getNewRelationshipImplementationTechnology() { - return this.newRelationshipImplementationTechnology.getText(); - } - - public boolean copyDomainModel() { - return this.copyDomainModelCheckbox.getSelection(); - } - - private void validate() { - setErrorMessage(null); - hasError = false; - - if (!existingSubsystemNameText.getText().matches(AbstractCMLValidator.ID_VALIDATION_PATTERN)) { - setError("The Bounded Context name '" + existingSubsystemNameText.getText() + "' is not valid. Allowed characters are: a-z, A-Z, 0-9, _"); - return; - } - if (!newSubsystemNameText.getText().matches(AbstractCMLValidator.ID_VALIDATION_PATTERN)) { - setError("The Bounded Context name '" + newSubsystemNameText.getText() + "' is not valid. Allowed characters are: a-z, A-Z, 0-9, _"); - return; - } - } - - private void setError(String message) { - hasError = true; - setErrorMessage(message); - } - - @Override - public boolean isPageComplete() { - return !hasError && !"".equals(existingSubsystemNameText.getText()) && !"".equals(newSubsystemNameText.getText()); - } - - @Override - public void performHelp() { - Program.launch("https://contextmapper.org/docs/rapid-ooad/"); - } -} diff --git a/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/wizard/pages/SuspendPartnershipWizardPage.java b/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/wizard/pages/SuspendPartnershipWizardPage.java deleted file mode 100644 index 312a7433..00000000 --- a/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/wizard/pages/SuspendPartnershipWizardPage.java +++ /dev/null @@ -1,183 +0,0 @@ -/* - * Copyright 2019 The Context Mapper Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.contextmapper.dsl.ui.handler.wizard.pages; - -import static org.contextmapper.dsl.refactoring.SuspendPartnershipMode.EXTRACT_NEW_BOUNDED_CONTEXT; -import static org.contextmapper.dsl.refactoring.SuspendPartnershipMode.MERGE_BOUNDED_CONTEXTS; -import static org.contextmapper.dsl.refactoring.SuspendPartnershipMode.REPLACE_RELATIONSHIP_WITH_UPSTREAM_DOWNSTREAM; - -import org.contextmapper.dsl.refactoring.SuspendPartnershipMode; -import org.eclipse.jface.fieldassist.AutoCompleteField; -import org.eclipse.jface.fieldassist.ComboContentAdapter; -import org.eclipse.swt.SWT; -import org.eclipse.swt.events.KeyAdapter; -import org.eclipse.swt.events.KeyEvent; -import org.eclipse.swt.events.SelectionAdapter; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.layout.RowLayout; -import org.eclipse.swt.program.Program; -import org.eclipse.swt.widgets.Button; -import org.eclipse.swt.widgets.Combo; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Group; -import org.eclipse.swt.widgets.Label; - -public class SuspendPartnershipWizardPage extends ContextMapperWizardPage { - - private String boundedContext1; - private String boundedContext2; - - private SuspendPartnershipMode suspendMode; - - private Composite container; - private Group radioGroup; - private Button mergeButton; - private Button extractBCButton; - private Button createUpstreamDownstreamButton; - private Combo replaceModeUpstreamCombo; - private Label replaceModeUpstreamLabel; - - public SuspendPartnershipWizardPage(String boundedContext1, String boundedContext2) { - super("Suspend Partnership Page"); - this.boundedContext1 = boundedContext1; - this.boundedContext2 = boundedContext2; - this.suspendMode = MERGE_BOUNDED_CONTEXTS; - } - - @Override - public String getTitle() { - return "Suspend Partnership"; - } - - @Override - public String getDescription() { - return "Choose how you want to suspend the partnership between '" + boundedContext1 + "' and\n'" + boundedContext2 + "'."; - } - - @Override - public void createControl(Composite parent) { - container = new Composite(parent, SWT.NONE); - GridLayout layout = new GridLayout(); - container.setLayout(layout); - layout.numColumns = 2; - - radioGroup = new Group(container, SWT.NONE); - radioGroup.setLayout(new RowLayout(SWT.VERTICAL)); - radioGroup.setText("Partnership Suspending Mode"); - GridData radioGroupLayoutData = new GridData(GridData.FILL_HORIZONTAL); - radioGroupLayoutData.horizontalSpan = 2; - radioGroup.setLayoutData(radioGroupLayoutData); - - mergeButton = new Button(radioGroup, SWT.RADIO); - mergeButton.setText("Merge Bounded Contexts '" + boundedContext1 + "' and '" + boundedContext2 + "'."); - mergeButton.setSelection(true); - mergeButton.addSelectionListener(new SelectionAdapter() { - @Override - public void widgetSelected(SelectionEvent e) { - suspendMode = MERGE_BOUNDED_CONTEXTS; - updateComboVisibility(); - setPageComplete(isPageComplete()); - } - }); - new Label(radioGroup, NONE).setText(""); - - extractBCButton = new Button(radioGroup, SWT.RADIO); - extractBCButton.setText("Extract new Bounded Context."); - extractBCButton.addSelectionListener(new SelectionAdapter() { - @Override - public void widgetSelected(SelectionEvent e) { - suspendMode = EXTRACT_NEW_BOUNDED_CONTEXT; - updateComboVisibility(); - setPageComplete(isPageComplete()); - } - }); - new Label(radioGroup, SWT.NONE).setText(" Hint: Creates a new Bounded Context for common model parts and establishes upstream-downstream"); - new Label(radioGroup, SWT.NONE).setText(" relationships between the new and the existing two Bounded Contexts."); - new Label(radioGroup, NONE).setText(""); - - createUpstreamDownstreamButton = new Button(radioGroup, SWT.RADIO); - createUpstreamDownstreamButton.setText("Replace Partnership with Upstream-Downstream relationship."); - createUpstreamDownstreamButton.addSelectionListener(new SelectionAdapter() { - @Override - public void widgetSelected(SelectionEvent e) { - suspendMode = REPLACE_RELATIONSHIP_WITH_UPSTREAM_DOWNSTREAM; - updateComboVisibility(); - setPageComplete(isPageComplete()); - } - }); - new Label(radioGroup, SWT.NONE).setText(" Hint: Simply replaces the Partnership relationship with an upstream-downstream relationship."); - new Label(radioGroup, SWT.NONE).setText(" In this case you must specify which Bounded Context becomes upstream."); - new Label(radioGroup, NONE).setText(""); - - replaceModeUpstreamLabel = new Label(container, NONE); - replaceModeUpstreamLabel.setText("Upstream Bounded Context: "); - replaceModeUpstreamLabel.setVisible(false); - replaceModeUpstreamCombo = new Combo(container, SWT.DROP_DOWN); - replaceModeUpstreamCombo.setVisible(false); - replaceModeUpstreamCombo.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); - replaceModeUpstreamCombo.setItems(new String[] { boundedContext1, boundedContext2 }); - replaceModeUpstreamCombo.addSelectionListener(new SelectionAdapter() { - @Override - public void widgetSelected(SelectionEvent e) { - setPageComplete(isPageComplete()); - } - }); - replaceModeUpstreamCombo.addKeyListener(new KeyAdapter() { - @Override - public void keyReleased(KeyEvent e) { - setPageComplete(isPageComplete()); - } - }); - new AutoCompleteField(replaceModeUpstreamCombo, new ComboContentAdapter(), new String[] { boundedContext1, boundedContext2 }); - - setControl(container); - setPageComplete(false); - } - - public SuspendPartnershipMode getSuspendMode() { - return suspendMode; - } - - public String getReplaceModeUpstreamBoundedContext() { - return replaceModeUpstreamCombo.getText(); - } - - private void updateComboVisibility() { - replaceModeUpstreamCombo.setVisible(suspendMode == REPLACE_RELATIONSHIP_WITH_UPSTREAM_DOWNSTREAM); - replaceModeUpstreamLabel.setVisible(suspendMode == REPLACE_RELATIONSHIP_WITH_UPSTREAM_DOWNSTREAM); - } - - @Override - public void setVisible(boolean visible) { - super.setVisible(visible); - this.mergeButton.forceFocus(); - } - - @Override - public boolean isPageComplete() { - if (suspendMode == REPLACE_RELATIONSHIP_WITH_UPSTREAM_DOWNSTREAM) - return replaceModeUpstreamCombo.getText() != null && !"".equals(replaceModeUpstreamCombo.getText()) - && (boundedContext1.equals(replaceModeUpstreamCombo.getText()) || boundedContext2.equals(replaceModeUpstreamCombo.getText())); - return suspendMode != null; - } - - @Override - public void performHelp() { - Program.launch("https://contextmapper.org/docs/ar-suspend-partnership/"); - } -} diff --git a/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/wizard/pages/TwoAggregatesSelectionWizardPage.java b/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/wizard/pages/TwoAggregatesSelectionWizardPage.java deleted file mode 100644 index cc486f0c..00000000 --- a/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/wizard/pages/TwoAggregatesSelectionWizardPage.java +++ /dev/null @@ -1,158 +0,0 @@ -/* - * Copyright 2019 The Context Mapper Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.contextmapper.dsl.ui.handler.wizard.pages; - -import java.util.List; - -import org.eclipse.jface.fieldassist.AutoCompleteField; -import org.eclipse.jface.fieldassist.ComboContentAdapter; -import org.eclipse.swt.SWT; -import org.eclipse.swt.events.KeyAdapter; -import org.eclipse.swt.events.KeyEvent; -import org.eclipse.swt.events.SelectionAdapter; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.program.Program; -import org.eclipse.swt.widgets.Button; -import org.eclipse.swt.widgets.Combo; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Label; - -public class TwoAggregatesSelectionWizardPage extends ContextMapperWizardPage { - - private String initialAggregate1; - private List allAggregates; - - private Combo comboAgg1; - private Combo comboAgg2; - private Button takeAttributesFromSecondAggregateCheckBox; - private Composite container; - - public TwoAggregatesSelectionWizardPage(String initialAggregate1, List allAggregates) { - super("Bounded Context Selection Page"); - this.initialAggregate1 = initialAggregate1; - this.allAggregates = allAggregates; - } - - @Override - public String getTitle() { - return "Aggregate Selection"; - } - - @Override - public String getDescription() { - return "Select Aggregates to Merge"; - } - - @Override - public void createControl(Composite parent) { - container = new Composite(parent, SWT.NONE); - GridLayout layout = new GridLayout(); - container.setLayout(layout); - layout.numColumns = 2; - - // name label - Label aggregateNameLabel1 = new Label(container, SWT.NONE); - aggregateNameLabel1.setText("First Aggregate:"); - - // aggregate 1 selection field - comboAgg1 = new Combo(container, SWT.DROP_DOWN); - comboAgg1.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); - comboAgg1.setItems(this.allAggregates.toArray(new String[this.allAggregates.size()])); - comboAgg1.select(this.allAggregates.indexOf(this.initialAggregate1)); - comboAgg1.addSelectionListener(new SelectionAdapter() { - @Override - public void widgetSelected(SelectionEvent e) { - setPageComplete(isPageComplete()); - } - }); - comboAgg1.addKeyListener(new KeyAdapter() { - @Override - public void keyReleased(KeyEvent e) { - setPageComplete(isPageComplete()); - } - }); - new AutoCompleteField(comboAgg1, new ComboContentAdapter(), this.allAggregates.toArray(new String[allAggregates.size()])); - - // name label - Label aggregateNameLabel2 = new Label(container, SWT.NONE); - aggregateNameLabel2.setText("Second Aggregate:"); - - // aggregate 2 selection field - comboAgg2 = new Combo(container, SWT.DROP_DOWN); - comboAgg2.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); - comboAgg2.setItems(this.allAggregates.toArray(new String[this.allAggregates.size()])); - comboAgg2.addSelectionListener(new SelectionAdapter() { - @Override - public void widgetSelected(SelectionEvent e) { - setPageComplete(isPageComplete()); - } - }); - comboAgg2.addKeyListener(new KeyAdapter() { - @Override - public void keyReleased(KeyEvent e) { - setPageComplete(isPageComplete()); - } - }); - new AutoCompleteField(comboAgg2, new ComboContentAdapter(), this.allAggregates.toArray(new String[allAggregates.size()])); - - // checkbox to inverse merging - takeAttributesFromSecondAggregateCheckBox = new Button(container, SWT.CHECK); - takeAttributesFromSecondAggregateCheckBox.setText("Take attributes which cannot be merged (incl. Aggregate name) from second Aggregate."); - GridData buttonGroupGridData = new GridData(GridData.FILL_HORIZONTAL); - buttonGroupGridData.horizontalSpan = 2; - takeAttributesFromSecondAggregateCheckBox.setLayoutData(buttonGroupGridData); - - // label to explain checkbox - Label checkboxExplanationLabel = new Label(container, SWT.NONE); - checkboxExplanationLabel.setText("(By default we take attributes which cannot be merged from the first Aggregate)"); - GridData checkboxExplanationLabelGridData = new GridData(GridData.FILL_HORIZONTAL); - checkboxExplanationLabelGridData.horizontalSpan = 2; - checkboxExplanationLabel.setLayoutData(checkboxExplanationLabelGridData); - - setControl(container); - setPageComplete(false); - } - - @Override - public void setVisible(boolean visible) { - super.setVisible(visible); - this.comboAgg2.forceFocus(); - } - - public String getAggregate1() { - return comboAgg1.getText(); - } - - public String getAggregate2() { - return comboAgg2.getText(); - } - - public boolean takeAttributesFromSecondAggregateCheckBox() { - return takeAttributesFromSecondAggregateCheckBox.getSelection(); - } - - @Override - public boolean isPageComplete() { - return this.allAggregates.contains(comboAgg1.getText()) && this.allAggregates.contains(comboAgg2.getText()) && !comboAgg1.getText().equals(comboAgg2.getText()); - } - - @Override - public void performHelp() { - Program.launch("https://contextmapper.org/docs/ar-merge-aggregates/"); - } -} diff --git a/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/wizard/pages/TwoBoundedContextSelectionWizardPage.java b/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/wizard/pages/TwoBoundedContextSelectionWizardPage.java deleted file mode 100644 index 1c63f3f5..00000000 --- a/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/wizard/pages/TwoBoundedContextSelectionWizardPage.java +++ /dev/null @@ -1,180 +0,0 @@ -/* - * Copyright 2018 The Context Mapper Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.contextmapper.dsl.ui.handler.wizard.pages; - -import java.util.List; - -import org.eclipse.jface.fieldassist.AutoCompleteField; -import org.eclipse.jface.fieldassist.ComboContentAdapter; -import org.eclipse.swt.SWT; -import org.eclipse.swt.events.KeyAdapter; -import org.eclipse.swt.events.KeyEvent; -import org.eclipse.swt.events.SelectionAdapter; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.program.Program; -import org.eclipse.swt.widgets.Button; -import org.eclipse.swt.widgets.Combo; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Label; - -public class TwoBoundedContextSelectionWizardPage extends ContextMapperWizardPage { - - private String initialBoundedContext1; - private String initialBoundedContext2; - private List allBoundedContexts; - private boolean textFieldsDisabled = false; - - private Combo comboBC1; - private Combo comboBC2; - private Button takeAttributesFromSecondBoundedContextCheckBox; - private Composite container; - - public TwoBoundedContextSelectionWizardPage(String initialBoundedContext1, List allBoundedContexts) { - super("Bounded Context Selection Page"); - this.initialBoundedContext1 = initialBoundedContext1; - this.allBoundedContexts = allBoundedContexts; - } - - @Override - public String getTitle() { - return "Bounded Context Selection"; - } - - @Override - public String getDescription() { - return "Select Bounded Contexts to Merge"; - } - - @Override - public void createControl(Composite parent) { - container = new Composite(parent, SWT.NONE); - GridLayout layout = new GridLayout(); - container.setLayout(layout); - layout.numColumns = 2; - - // name label - Label boundedContextNameLabel1 = new Label(container, SWT.NONE); - boundedContextNameLabel1.setText("First Bounded Context:"); - - // bounded context 1 selection field - comboBC1 = new Combo(container, SWT.DROP_DOWN); - comboBC1.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); - comboBC1.setItems(this.allBoundedContexts.toArray(new String[this.allBoundedContexts.size()])); - comboBC1.select(this.allBoundedContexts.indexOf(this.initialBoundedContext1)); - if (textFieldsDisabled) - comboBC1.setEnabled(false); - comboBC1.addSelectionListener(new SelectionAdapter() { - @Override - public void widgetSelected(SelectionEvent e) { - setPageComplete(isPageComplete()); - } - }); - comboBC1.addKeyListener(new KeyAdapter() { - @Override - public void keyReleased(KeyEvent e) { - setPageComplete(isPageComplete()); - } - }); - new AutoCompleteField(comboBC1, new ComboContentAdapter(), this.allBoundedContexts.toArray(new String[allBoundedContexts.size()])); - - // name label - Label boundedContextNameLabel2 = new Label(container, SWT.NONE); - boundedContextNameLabel2.setText("Second Bounded Context:"); - - // bounded context 2 selection field - comboBC2 = new Combo(container, SWT.DROP_DOWN); - comboBC2.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); - comboBC2.setItems(this.allBoundedContexts.toArray(new String[this.allBoundedContexts.size()])); - if (this.initialBoundedContext2 != null) - comboBC2.select(this.allBoundedContexts.indexOf(this.initialBoundedContext2)); - if (textFieldsDisabled) - comboBC2.setEnabled(false); - comboBC2.addSelectionListener(new SelectionAdapter() { - @Override - public void widgetSelected(SelectionEvent e) { - setPageComplete(isPageComplete()); - } - }); - comboBC2.addKeyListener(new KeyAdapter() { - @Override - public void keyReleased(KeyEvent e) { - setPageComplete(isPageComplete()); - } - }); - new AutoCompleteField(comboBC2, new ComboContentAdapter(), this.allBoundedContexts.toArray(new String[allBoundedContexts.size()])); - - // create a horizontal separator - Label separator = new Label(container, SWT.HORIZONTAL | SWT.SEPARATOR); - GridData separatorGridData = new GridData(GridData.FILL_HORIZONTAL); - separatorGridData.horizontalSpan = 2; - separator.setLayoutData(separatorGridData); - - // checkbox to inverse merging - takeAttributesFromSecondBoundedContextCheckBox = new Button(container, SWT.CHECK); - takeAttributesFromSecondBoundedContextCheckBox.setText("Take attributes which cannot be merged (incl. Bounded Context name) from second Bounded Context."); - GridData buttonGroupGridData = new GridData(GridData.FILL_HORIZONTAL); - buttonGroupGridData.horizontalSpan = 2; - takeAttributesFromSecondBoundedContextCheckBox.setLayoutData(buttonGroupGridData); - - // label to explain checkbox - Label checkboxExplanationLabel = new Label(container, SWT.NONE); - checkboxExplanationLabel.setText("(By default we take attributes which cannot be merged from the first Bounded Context)"); - GridData checkboxExplanationLabelGridData = new GridData(GridData.FILL_HORIZONTAL); - checkboxExplanationLabelGridData.horizontalSpan = 2; - checkboxExplanationLabel.setLayoutData(checkboxExplanationLabelGridData); - - setControl(container); - setPageComplete(false); - } - - @Override - public void setVisible(boolean visible) { - super.setVisible(visible); - this.comboBC2.forceFocus(); - } - - public String getBoundedContext1() { - return comboBC1.getText(); - } - - public String getBoundedContext2() { - return comboBC2.getText(); - } - - public void setInitialBoundedContext2(String boundedContext2) { - this.initialBoundedContext2 = boundedContext2; - } - - public void disableTextFields() { - this.textFieldsDisabled = true; - } - - public boolean takeAttributesFromSecondBoundedContext() { - return takeAttributesFromSecondBoundedContextCheckBox.getSelection(); - } - - @Override - public boolean isPageComplete() { - return this.allBoundedContexts.contains(comboBC1.getText()) && this.allBoundedContexts.contains(comboBC2.getText()) && !comboBC1.getText().equals(comboBC2.getText()); - } - - @Override - public void performHelp() { - Program.launch("https://contextmapper.org/docs/ar-merge-bounded-contexts/"); - } -} diff --git a/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/wizard/pages/components/FileByExtensionChooser.java b/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/wizard/pages/components/FileByExtensionChooser.java deleted file mode 100644 index eafded6d..00000000 --- a/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/wizard/pages/components/FileByExtensionChooser.java +++ /dev/null @@ -1,182 +0,0 @@ -/* - * Copyright 2019 The Context Mapper Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.contextmapper.dsl.ui.handler.wizard.pages.components; - -import java.util.List; -import java.util.function.Consumer; - -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.resources.IResourceVisitor; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.jface.viewers.ArrayContentProvider; -import org.eclipse.jface.viewers.ILabelProvider; -import org.eclipse.jface.window.Window; -import org.eclipse.swt.SWT; -import org.eclipse.swt.events.SelectionAdapter; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.graphics.Image; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Button; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Text; -import org.eclipse.ui.dialogs.ListDialog; -import org.eclipse.ui.model.WorkbenchLabelProvider; - -import com.google.common.collect.Lists; - -/** - * Component to choose files with a given file extension (all files in - * workspace). - * - * @author Stefan Kapferer - */ -public class FileByExtensionChooser extends Composite { - - private Text fileText; - private Button chooseButton; - private IFile file; - private String fileExtension; - private Consumer fileSelectedFunction; - - public FileByExtensionChooser(Composite parent, String fileExtension) { - super(parent, SWT.NONE); - this.fileExtension = fileExtension; - createContent(); - } - - private void createContent() { - GridLayout layout = new GridLayout(2, false); - layout.marginWidth = 0; - layout.marginHeight = 0; - setLayout(layout); - - GridData gridData = new GridData(GridData.FILL_HORIZONTAL); - gridData.grabExcessHorizontalSpace = true; - gridData.horizontalAlignment = GridData.FILL; - - setLayoutData(gridData); - - fileText = new Text(this, SWT.SINGLE | SWT.BORDER); - fileText.setLayoutData(gridData); - fileText.setEditable(false); - fileText.setEnabled(false); - updateText(); - - chooseButton = new Button(this, SWT.NONE); - chooseButton.setText("..."); - chooseButton.addSelectionListener(new SelectionAdapter() { - public void widgetSelected(SelectionEvent e) { - IFile newFile = open(); - if (newFile != null) - file = newFile; - if (fileSelectedFunction != null) - fileSelectedFunction.accept(newFile); - updateText(); - } - }); - } - - private void updateText() { - if (this.file == null) - this.fileText.setText("no file selected"); - else - this.fileText.setText(new WorkbenchLabelProvider().getText(file)); - } - - public IFile open() { - final List sclResources = findResources(); - ListDialog listDialog = new ListDialog(getShell()); - listDialog.setContentProvider(ArrayContentProvider.getInstance()); - listDialog.setLabelProvider(new LabelProvider()); - listDialog.setTitle(getDialogTitle()); - listDialog.setMessage(getDialogMessage()); - listDialog.setInput(sclResources); - - int result = listDialog.open(); - if (result == Window.OK) { - Object[] selection = listDialog.getResult(); - if (selection != null && selection.length == 1 && selection[0] instanceof IFile) { - return (IFile) selection[0]; - } - } - return null; - } - - private List findResources() { - final List filteredResources = Lists.newArrayList(); - try { - ResourcesPlugin.getWorkspace().getRoot().accept(new IResourceVisitor() { - @Override - public boolean visit(IResource resource) throws CoreException { - if (resource instanceof IFile) { - String resourceExtension = ((IFile) resource).getFileExtension(); - if (fileExtension.equals(resourceExtension)) { - filteredResources.add(resource); - } - } - return true; - } - }); - } catch (CoreException e) { - throw new RuntimeException("Could not find " + fileExtension.toUpperCase() + " files.", e); - } - return filteredResources; - } - - private class LabelProvider extends org.eclipse.jface.viewers.LabelProvider { - - private ILabelProvider delegate = new WorkbenchLabelProvider(); - - @Override - public String getText(Object object) { - if (object instanceof IFile) { - IFile file = (IFile) object; - return delegate.getText(file) + " - " + file.getParent().getFullPath(); - } - return delegate.getText(object); - } - - @Override - public Image getImage(Object element) { - return delegate.getImage(element); - } - } - - public IFile getFile() { - return file; - } - - public void setFile(IFile file) { - this.file = file; - updateText(); - } - - protected String getDialogTitle() { - return "Choose " + fileExtension.toUpperCase() + " file"; - } - - protected String getDialogMessage() { - return "Select a *." + fileExtension + " file:"; - } - - public void setFileSelectedFunction(Consumer fileSelectedFunction) { - this.fileSelectedFunction = fileSelectedFunction; - } - -} diff --git a/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/wizard/pages/components/FreemarkerFileChooser.java b/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/wizard/pages/components/FreemarkerFileChooser.java deleted file mode 100644 index 900994f2..00000000 --- a/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/wizard/pages/components/FreemarkerFileChooser.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright 2019 The Context Mapper Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.contextmapper.dsl.ui.handler.wizard.pages.components; - -import org.eclipse.swt.widgets.Composite; - -/** - * Component to choose a Freemarker template file. - * - * @author Stefan Kapferer - */ -public class FreemarkerFileChooser extends FileByExtensionChooser { - - public FreemarkerFileChooser(Composite parent) { - super(parent, "ftl"); - } - - @Override - protected String getDialogTitle() { - return "Choose Freemarker (*.ftl) file"; - } - - @Override - protected String getDialogMessage() { - return "Select the *.ftl file you want to use for generation:"; - } - -} diff --git a/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/wizard/pages/components/SCLFileChooser.java b/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/wizard/pages/components/SCLFileChooser.java deleted file mode 100644 index 9ba3093a..00000000 --- a/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/handler/wizard/pages/components/SCLFileChooser.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright 2019 The Context Mapper Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.contextmapper.dsl.ui.handler.wizard.pages.components; - -import org.eclipse.swt.widgets.Composite; - -/** - * Component to choose an SCL (Service Cutter user representations) file. - * - * @author Stefan Kapferer - */ -public class SCLFileChooser extends FileByExtensionChooser { - - public SCLFileChooser(Composite parent) { - super(parent, "scl"); - } - - @Override - protected String getDialogTitle() { - return "Choose SCL file"; - } - - @Override - protected String getDialogMessage() { - return "Select the SCL file with your user representations:"; - } -} diff --git a/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/hover/CMLHoverProvider.java b/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/hover/CMLHoverProvider.java deleted file mode 100644 index 2979961d..00000000 --- a/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/hover/CMLHoverProvider.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright 2019 The Context Mapper Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.contextmapper.dsl.ui.hover; - -import org.contextmapper.dsl.hover.CMLHoverTextProvider; -import org.contextmapper.dsl.hover.impl.HTMLHoverTextProvider4CML; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.jface.internal.text.html.HTMLPrinter; -import org.eclipse.jface.text.IRegion; -import org.eclipse.xtext.Keyword; -import org.eclipse.xtext.ui.editor.hover.html.DefaultEObjectHoverProvider; -import org.eclipse.xtext.ui.editor.hover.html.XtextBrowserInformationControlInput; - -public class CMLHoverProvider extends DefaultEObjectHoverProvider { - - private CMLHoverTextProvider hoverTextProvider; - - public CMLHoverProvider() { - super(); - this.hoverTextProvider = new HTMLHoverTextProvider4CML(); - } - - @Override - protected XtextBrowserInformationControlInput getHoverInfo(EObject obj, IRegion region, XtextBrowserInformationControlInput prev) { - if (obj instanceof Keyword) { - String html = getHoverInfoAsHtml(obj); - if (html != null && !"".equals(html)) { - StringBuffer buffer = new StringBuffer(html); - HTMLPrinter.insertPageProlog(buffer, 0, getStyleSheet()); - HTMLPrinter.addPageEpilog(buffer); - return new XtextBrowserInformationControlInput(prev, obj, buffer.toString(), getLabelProvider()); - } - } - return super.getHoverInfo(obj, region, prev); - } - - @Override - protected String getHoverInfoAsHtml(EObject o) { - if (o instanceof Keyword) - return hoverTextProvider.getHoverText(((Keyword) o).getValue()); - return super.getHoverInfoAsHtml(o); - } -} diff --git a/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/hover/CMLKeywordAtOffsetHelper.java b/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/hover/CMLKeywordAtOffsetHelper.java deleted file mode 100644 index cb0fbde4..00000000 --- a/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/hover/CMLKeywordAtOffsetHelper.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright 2019 The Context Mapper Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.contextmapper.dsl.ui.hover; - -import org.eclipse.emf.ecore.EObject; -import org.eclipse.jface.text.IRegion; -import org.eclipse.jface.text.Region; -import org.eclipse.xtext.EnumLiteralDeclaration; -import org.eclipse.xtext.Keyword; -import org.eclipse.xtext.nodemodel.ILeafNode; -import org.eclipse.xtext.nodemodel.util.NodeModelUtils; -import org.eclipse.xtext.parser.IParseResult; -import org.eclipse.xtext.resource.XtextResource; -import org.eclipse.xtext.util.Pair; -import org.eclipse.xtext.util.Tuples; - -public class CMLKeywordAtOffsetHelper { - public Pair resolveKeywordAt(XtextResource resource, int offset) { - IParseResult parseResult = resource.getParseResult(); - if (parseResult != null) { - ILeafNode leaf = NodeModelUtils.findLeafNodeAtOffset(parseResult.getRootNode(), offset); - if (leaf != null && leaf.isHidden() && leaf.getOffset() == offset) { - leaf = NodeModelUtils.findLeafNodeAtOffset(parseResult.getRootNode(), offset - 1); - } - if (leaf != null && leaf.getGrammarElement() instanceof Keyword) { - Keyword keyword = (Keyword) leaf.getGrammarElement(); - return Tuples.create((EObject) keyword, (IRegion) new Region(leaf.getOffset(), leaf.getLength())); - } - if (leaf != null && leaf.getGrammarElement() instanceof EnumLiteralDeclaration) { - EnumLiteralDeclaration enumLiteral = (EnumLiteralDeclaration) leaf.getGrammarElement(); - return Tuples.create((EObject) enumLiteral, (IRegion) new Region(leaf.getOffset(), leaf.getLength())); - } - } - return null; - } -} diff --git a/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/hover/CMLXbaseDispatchingEObjectTextHover.java b/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/hover/CMLXbaseDispatchingEObjectTextHover.java deleted file mode 100644 index 610d6fb6..00000000 --- a/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/hover/CMLXbaseDispatchingEObjectTextHover.java +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Copyright 2019 The Context Mapper Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.contextmapper.dsl.ui.hover; - -import org.contextmapper.dsl.hover.CMLHoverTextProvider; -import org.contextmapper.dsl.hover.impl.HTMLHoverTextProvider4CML; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.jface.text.IInformationControlCreator; -import org.eclipse.jface.text.IRegion; -import org.eclipse.jface.text.ITextViewer; -import org.eclipse.xtext.EnumLiteralDeclaration; -import org.eclipse.xtext.Keyword; -import org.eclipse.xtext.resource.XtextResource; -import org.eclipse.xtext.ui.editor.hover.IEObjectHoverProvider; -import org.eclipse.xtext.ui.editor.hover.IEObjectHoverProvider.IInformationControlCreatorProvider; -import org.eclipse.xtext.util.Pair; -import org.eclipse.xtext.xbase.ui.hover.XbaseDispatchingEObjectTextHover; - -import com.google.inject.Inject; - -public class CMLXbaseDispatchingEObjectTextHover extends XbaseDispatchingEObjectTextHover { - - @Inject - CMLKeywordAtOffsetHelper keywordAtOffsetHelper; - - @Inject - IEObjectHoverProvider hoverProvider; - - CMLHoverTextProvider hoverTextProvider; - - IInformationControlCreatorProvider lastCreatorProvider = null; - - public CMLXbaseDispatchingEObjectTextHover() { - super(); - this.hoverTextProvider = new HTMLHoverTextProvider4CML(); - } - - @Override - public Object getHoverInfo(EObject first, ITextViewer textViewer, IRegion hoverRegion) { - if (first instanceof EnumLiteralDeclaration) { - EnumLiteralDeclaration enumLiteral = (EnumLiteralDeclaration) first; - first = enumLiteral.getLiteral(); - } - if (first instanceof Keyword && hoverTextProvider.isKeywordRegistered(((Keyword) first).getValue())) { - lastCreatorProvider = hoverProvider.getHoverInfo(first, textViewer, hoverRegion); - return lastCreatorProvider == null ? null : lastCreatorProvider.getInfo(); - } - lastCreatorProvider = null; - return super.getHoverInfo(first, textViewer, hoverRegion); - } - - @Override - public IInformationControlCreator getHoverControlCreator() { - return this.lastCreatorProvider == null ? super.getHoverControlCreator() : lastCreatorProvider.getHoverControlCreator(); - } - - @Override - protected Pair getXtextElementAt(XtextResource resource, final int offset) { - Pair result = super.getXtextElementAt(resource, offset); - if (result == null) { - result = keywordAtOffsetHelper.resolveKeywordAt(resource, offset); - } - return result; - } -} diff --git a/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/images/CMLImageDescriptionFactory.java b/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/images/CMLImageDescriptionFactory.java deleted file mode 100644 index 8f50a7e1..00000000 --- a/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/images/CMLImageDescriptionFactory.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright 2020 The Context Mapper Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.contextmapper.dsl.ui.images; - -import java.net.URL; - -import org.contextmapper.dsl.ui.internal.DslActivator; -import org.eclipse.core.runtime.Platform; -import org.eclipse.jface.resource.ImageDescriptor; -import org.osgi.framework.Bundle; - -/** - * Factory method to create Context Mapper Logo as ImageDescriptor. - * - * @author Stefan Kapferer - * - */ -public class CMLImageDescriptionFactory { - - public static ImageDescriptor createContextMapperLogoDescriptor() { - return ImageDescriptor.createFromURL(getIconURL("cml.png")); - } - - public static ImageDescriptor createContextMapperLogo4DialogDescriptor() { - return ImageDescriptor.createFromURL(getIconURL("cml-dialog-image.png")); - } - - private static URL getIconURL(String icon) { - Bundle bundle = Platform.getBundle(DslActivator.PLUGIN_ID); - return bundle.getEntry("icons/" + icon); - } - -} diff --git a/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/labeling/ContextMappingDSLDescriptionLabelProvider.xtend b/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/labeling/ContextMappingDSLDescriptionLabelProvider.xtend deleted file mode 100644 index 8620322e..00000000 --- a/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/labeling/ContextMappingDSLDescriptionLabelProvider.xtend +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright 2018 The Context Mapper Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.contextmapper.dsl.ui.labeling - -import org.eclipse.xtext.ui.label.DefaultDescriptionLabelProvider - -/** - * Provides labels for IEObjectDescriptions and IResourceDescriptions. - * - * See https://www.eclipse.org/Xtext/documentation/304_ide_concepts.html#label-provider - */ -class ContextMappingDSLDescriptionLabelProvider extends DefaultDescriptionLabelProvider { - - // Labels and icons can be computed like this: - -// override text(IEObjectDescription ele) { -// ele.name.toString -// } -// -// override image(IEObjectDescription ele) { -// ele.EClass.name + '.gif' -// } -} diff --git a/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/labeling/ContextMappingDSLLabelProvider.xtend b/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/labeling/ContextMappingDSLLabelProvider.xtend deleted file mode 100644 index 596b3d33..00000000 --- a/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/labeling/ContextMappingDSLLabelProvider.xtend +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright 2018 The Context Mapper Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.contextmapper.dsl.ui.labeling - -import com.google.inject.Inject -import org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider -import org.eclipse.xtext.ui.label.DefaultEObjectLabelProvider - -/** - * Provides labels for EObjects. - * - * See https://www.eclipse.org/Xtext/documentation/304_ide_concepts.html#label-provider - */ -class ContextMappingDSLLabelProvider extends DefaultEObjectLabelProvider { - - @Inject - new(AdapterFactoryLabelProvider delegate) { - super(delegate); - } - - // Labels and icons can be computed like this: - -// def text(Greeting ele) { -// 'A greeting to ' + ele.name -// } -// -// def image(Greeting ele) { -// 'Greeting.gif' -// } -} diff --git a/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/outline/ContextMappingDSLOutlineTreeProvider.xtend b/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/outline/ContextMappingDSLOutlineTreeProvider.xtend deleted file mode 100644 index c3641cfe..00000000 --- a/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/outline/ContextMappingDSLOutlineTreeProvider.xtend +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright 2018 The Context Mapper Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.contextmapper.dsl.ui.outline - -import org.eclipse.xtext.ui.editor.outline.impl.DefaultOutlineTreeProvider - -/** - * Customization of the default outline structure. - * - * See https://www.eclipse.org/Xtext/documentation/310_eclipse_support.html#outline - */ -class ContextMappingDSLOutlineTreeProvider extends DefaultOutlineTreeProvider { - -} diff --git a/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/quickfix/CMLTextEditComposer.java b/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/quickfix/CMLTextEditComposer.java deleted file mode 100644 index 9ef89c26..00000000 --- a/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/quickfix/CMLTextEditComposer.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright 2020 The Context Mapper Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.contextmapper.dsl.ui.quickfix; - -import org.eclipse.xtext.resource.SaveOptions; -import org.eclipse.xtext.ui.editor.model.edit.DefaultTextEditComposer; - -/** - * Ensures that CML is formatted after applying quick fixes. - * - * @author Stefan Kapferer - * - */ -public class CMLTextEditComposer extends DefaultTextEditComposer { - - @Override - protected SaveOptions getSaveOptions() { - return SaveOptions.newBuilder().format().getOptions(); - } - -} diff --git a/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/quickfix/ContextMappingDSLQuickfixProvider.xtend b/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/quickfix/ContextMappingDSLQuickfixProvider.xtend deleted file mode 100644 index 61bd1de7..00000000 --- a/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/quickfix/ContextMappingDSLQuickfixProvider.xtend +++ /dev/null @@ -1,116 +0,0 @@ -/* - * Copyright 2020 The Context Mapper Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.contextmapper.dsl.ui.quickfix - -import java.util.regex.Pattern -import org.contextmapper.dsl.generator.sketchminer.SketchMinerLinkCreator -import org.contextmapper.dsl.quickfixes.CMLQuickFix -import org.contextmapper.dsl.quickfixes.CreateMissingBoundedContextQuickFix -import org.contextmapper.dsl.quickfixes.SplitStoryByVerb -import org.contextmapper.dsl.quickfixes.tactic.ExtractIDValueObjectQuickFix -import org.contextmapper.dsl.ui.quickfix.context.SelectStoryVerbsContextCreator -import org.contextmapper.dsl.validation.ApplicationFlowSemanticsValidator -import org.contextmapper.dsl.validation.DomainObjectValidator -import org.contextmapper.dsl.validation.UserRequirementsValidator -import org.eclipse.emf.ecore.EObject -import org.eclipse.jface.text.source.ISourceViewer -import org.eclipse.jface.text.source.SourceViewer -import org.eclipse.swt.program.Program -import org.eclipse.xtext.diagnostics.Diagnostic -import org.eclipse.xtext.ui.editor.model.edit.IModificationContext -import org.eclipse.xtext.ui.editor.quickfix.DefaultQuickfixProvider -import org.eclipse.xtext.ui.editor.quickfix.Fix -import org.eclipse.xtext.ui.editor.quickfix.IssueResolutionAcceptor -import org.eclipse.xtext.ui.editor.utils.EditorUtils -import org.eclipse.xtext.validation.Issue - -import static org.contextmapper.dsl.quickfixes.CreateMissingBoundedContextQuickFix.LINK_DIAGNOSTIC_MESSAGE_PATTERN -import org.contextmapper.dsl.validation.ApplicationCoordinationSemanticsValidator - -/** - * Custom quickfix registry. - */ -class ContextMappingDSLQuickfixProvider extends DefaultQuickfixProvider { - - @Fix(DomainObjectValidator.ID_IS_PRIMITIVE_CODE) - def extractValueObject(Issue issue, IssueResolutionAcceptor acceptor) { - applyCMLQuickfix(issue, acceptor, new ExtractIDValueObjectQuickFix()); - } - - @Fix(UserRequirementsValidator.ID_SPLIT_FEATURE_BY_VERB_SUGGESTION) - def splitStoryByVerb(Issue issue, IssueResolutionAcceptor acceptor) { - val quickfix = new SplitStoryByVerb; - acceptor.accept(issue, quickfix.name, quickfix.description, - null, [ EObject element, IModificationContext context | - val quickFixContext = new SelectStoryVerbsContextCreator().context; - quickfix.verbs = quickFixContext.selectedVerbs - if (quickFixContext.finishedWizard) - quickfix.applyQuickfix2EObject(element); - ]); - format(); - } - - @Fix(Diagnostic.LINKING_DIAGNOSTIC) - def provideQuickFix4WrongReference(Issue issue, IssueResolutionAcceptor acceptor) { - if (isValidationMessageLinkingProblem("BoundedContext", issue.message)) { - applyCMLQuickfix(issue, acceptor, - new CreateMissingBoundedContextQuickFix(getLinkingErrorObjectId("BoundedContext", issue.message))); - } - } - - @Fix(ApplicationFlowSemanticsValidator.SKETCH_MINER_INFO_ID) - def openSketchMiner(Issue issue, IssueResolutionAcceptor acceptor) { - acceptor.accept(issue, "Open flow in BPMN Sketch Miner", "Open this flow in BPMN Sketch Miner", - null, [ EObject element, IModificationContext context | - Program.launch(new SketchMinerLinkCreator().createSketchMinerLink(element)); - ]); - } - - @Fix(ApplicationCoordinationSemanticsValidator.SKETCH_MINER_INFO_ID) - def openSketchMinerForCoordination(Issue issue, IssueResolutionAcceptor acceptor) { - acceptor.accept(issue, "Open coordination in BPMN Sketch Miner", "Open this coordination in BPMN Sketch Miner", - null, [ EObject element, IModificationContext context | - Program.launch(new SketchMinerLinkCreator().createSketchMinerLink(element)); - ]); - } - - def applyCMLQuickfix(Issue issue, IssueResolutionAcceptor acceptor, CMLQuickFix quickfix) { - acceptor.accept(issue, quickfix.name, quickfix.description, - null, [ EObject element, IModificationContext context | - quickfix.applyQuickfix2EObject(element) - ]); - format(); - } - - def format() { - val xEditor = EditorUtils.getActiveXtextEditor(); - if (xEditor !== null) { - (xEditor.internalSourceViewer as SourceViewer).doOperation(ISourceViewer.FORMAT); - } - } - - def boolean isValidationMessageLinkingProblem(String type, String message) { - return message.matches(String.format(LINK_DIAGNOSTIC_MESSAGE_PATTERN, type)); - } - - def String getLinkingErrorObjectId(String type, String message) { - var pattern = Pattern.compile(String.format(LINK_DIAGNOSTIC_MESSAGE_PATTERN, type)); - var matcher = pattern.matcher(message); - if (matcher.find()) - return matcher.group(1); - return ""; - } -} diff --git a/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/quickfix/context/SelectStoryVerbsContext.java b/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/quickfix/context/SelectStoryVerbsContext.java deleted file mode 100644 index 1761f25b..00000000 --- a/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/quickfix/context/SelectStoryVerbsContext.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright 2020 The Context Mapper Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.contextmapper.dsl.ui.quickfix.context; - -import java.util.Set; - -import com.google.common.collect.Sets; - -public class SelectStoryVerbsContext { - - private Set defaultVerbs; - private Set selectedVerbs; - private boolean finishedWizard = false; - - public SelectStoryVerbsContext() { - this.defaultVerbs = Sets.newHashSet(); - this.selectedVerbs = Sets.newHashSet(); - this.defaultVerbs.add("create"); - this.defaultVerbs.add("read"); - this.defaultVerbs.add("update"); - this.defaultVerbs.add("delete"); - this.defaultVerbs.add("search"); - } - - public Set getDefaultVerbs() { - return defaultVerbs; - } - - public void setSelectedVerbs(Set selectedVerbs) { - this.selectedVerbs = Sets.newHashSet(selectedVerbs); - } - - public Set getSelectedVerbs() { - return Sets.newHashSet(selectedVerbs); - } - - public void setFinishedWizard(boolean finishedWizard) { - this.finishedWizard = finishedWizard; - } - - public boolean isFinishedWizard() { - return finishedWizard; - } - -} diff --git a/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/quickfix/context/SelectStoryVerbsContextCreator.java b/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/quickfix/context/SelectStoryVerbsContextCreator.java deleted file mode 100644 index 528a429c..00000000 --- a/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/quickfix/context/SelectStoryVerbsContextCreator.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright 2020 The Context Mapper Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.contextmapper.dsl.ui.quickfix.context; - -import org.contextmapper.dsl.ui.quickfix.wizard.SelectStoryVerbsWizard; -import org.eclipse.jface.window.Window; -import org.eclipse.jface.wizard.WizardDialog; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.ui.PlatformUI; - -public class SelectStoryVerbsContextCreator { - - public SelectStoryVerbsContext getContext() { - Shell activeShell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(); - SelectStoryVerbsContext context = new SelectStoryVerbsContext(); - WizardDialog wizard = new WizardDialog(activeShell, new SelectStoryVerbsWizard(context)); - wizard.setBlockOnOpen(true); - int returnCode = wizard.open(); - context.setFinishedWizard(returnCode == Window.OK); - return context; - } - -} diff --git a/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/quickfix/wizard/SelectStoryVerbsWizard.java b/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/quickfix/wizard/SelectStoryVerbsWizard.java deleted file mode 100644 index d6784eca..00000000 --- a/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/quickfix/wizard/SelectStoryVerbsWizard.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright 2020 The Context Mapper Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.contextmapper.dsl.ui.quickfix.wizard; - -import org.contextmapper.dsl.ui.quickfix.context.SelectStoryVerbsContext; -import org.contextmapper.dsl.ui.quickfix.wizard.page.SelectUserStoryVerbsWizardPage; -import org.eclipse.jface.wizard.Wizard; - -public class SelectStoryVerbsWizard extends Wizard { - - private SelectUserStoryVerbsWizardPage page; - private SelectStoryVerbsContext context; - - public SelectStoryVerbsWizard(SelectStoryVerbsContext context) { - super(); - setNeedsProgressMonitor(true); - this.context = context; - } - - @Override - public String getWindowTitle() { - return "Verbs for Story Split"; - } - - @Override - public void addPages() { - page = new SelectUserStoryVerbsWizardPage(context.getDefaultVerbs()); - addPage(page); - } - - @Override - public boolean performFinish() { - context.setSelectedVerbs(page.getSelectedItems()); - return true; - } - -} diff --git a/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/quickfix/wizard/page/SelectUserStoryVerbsWizardPage.java b/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/quickfix/wizard/page/SelectUserStoryVerbsWizardPage.java deleted file mode 100644 index a3679a2d..00000000 --- a/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/quickfix/wizard/page/SelectUserStoryVerbsWizardPage.java +++ /dev/null @@ -1,124 +0,0 @@ -/* - * Copyright 2020 The Context Mapper Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.contextmapper.dsl.ui.quickfix.wizard.page; - -import java.util.Arrays; -import java.util.Set; - -import org.contextmapper.dsl.ui.handler.wizard.pages.ContextMapperWizardPage; -import org.eclipse.swt.SWT; -import org.eclipse.swt.events.SelectionAdapter; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.events.SelectionListener; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.program.Program; -import org.eclipse.swt.widgets.Button; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Event; -import org.eclipse.swt.widgets.List; -import org.eclipse.swt.widgets.Listener; -import org.eclipse.swt.widgets.Text; - -import com.google.common.collect.Sets; - -public class SelectUserStoryVerbsWizardPage extends ContextMapperWizardPage { - - private Composite container; - private List list; - private Set initialVerbs; - - public SelectUserStoryVerbsWizardPage(Set initialVerbs) { - super("Story Verb / Operation Selection Page"); - this.initialVerbs = initialVerbs; - } - - @Override - public String getTitle() { - return "Verb / Operation Selection"; - } - - @Override - public String getDescription() { - return "Select and / or add the verbs for the story split:"; - } - - @Override - public void createControl(Composite parent) { - container = new Composite(parent, SWT.NONE); - GridLayout layout = new GridLayout(); - container.setLayout(layout); - layout.numColumns = 2; - - // selection list - list = new List(container, SWT.BORDER | SWT.MULTI | SWT.V_SCROLL); - for (String verb : initialVerbs) - list.add(verb); - GridData tableGridData = new GridData(GridData.FILL_HORIZONTAL); - tableGridData.horizontalSpan = 2; - tableGridData.grabExcessVerticalSpace = false; - tableGridData.heightHint = 200; - list.setLayoutData(tableGridData); - list.addSelectionListener(new SelectionAdapter() { - @Override - public void widgetSelected(SelectionEvent e) { - setPageComplete(isPageComplete()); - } - }); - - // adding new verb - Text newVerbNameTextField = new Text(container, SWT.BORDER | SWT.SINGLE); - GridData textGridData = new GridData(GridData.FILL_HORIZONTAL); - newVerbNameTextField.setLayoutData(textGridData); - Button addNewVerbButton = new Button(container, SWT.NONE); - addNewVerbButton.setText("Add new verb ..."); - addNewVerbButton.addListener(SWT.Selection, new Listener() { - public void handleEvent(Event e) { - if (newVerbNameTextField.getText() != null && !"".equals(newVerbNameTextField.getText().trim())) { - String verb = formatVerb(newVerbNameTextField.getText()); - Set existingVerbs = Sets.newHashSet(Arrays.asList(list.getItems())); - if (!existingVerbs.contains(verb)) - list.add(verb); - } - } - }); - - setControl(container); - setPageComplete(false); - } - - private String formatVerb(String verb) { - String s = verb.replace(" ", "_"); - if (s.substring(0, 1).matches("^[0-9]")) - s = "_" + s; - s = s.replaceAll("[^A-Za-z0-9_]", ""); - return s.length() > 1 ? s.substring(0, 1).toLowerCase() + s.substring(1) : s.toLowerCase(); - } - - public Set getSelectedItems() { - return Sets.newHashSet(Arrays.asList(list.getSelection())); - } - - @Override - public boolean isPageComplete() { - return !Arrays.asList(list.getSelection()).isEmpty(); - } - - @Override - public void performHelp() { - Program.launch("https://contextmapper.org/docs/"); - } -} diff --git a/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/wizard/NewCMLFileWizard.java b/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/wizard/NewCMLFileWizard.java deleted file mode 100644 index b555687d..00000000 --- a/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/wizard/NewCMLFileWizard.java +++ /dev/null @@ -1,90 +0,0 @@ -/* - * Copyright 2020 The Context Mapper Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.contextmapper.dsl.ui.wizard; - -import org.contextmapper.dsl.exception.ContextMapperApplicationException; -import org.contextmapper.dsl.ui.images.CMLImageDescriptionFactory; -import org.contextmapper.dsl.ui.wizard.page.WizardNewCMLFileCreationPage; -import org.eclipse.core.resources.IFile; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.ui.IWorkbench; -import org.eclipse.ui.IWorkbenchPage; -import org.eclipse.ui.IWorkbenchWindow; -import org.eclipse.ui.PartInitException; -import org.eclipse.ui.ide.IDE; -import org.eclipse.ui.internal.ide.DialogUtil; -import org.eclipse.ui.internal.wizards.newresource.ResourceMessages; -import org.eclipse.ui.wizards.newresource.BasicNewResourceWizard; - -/** - * - * Wizard to create new Context Mapper DSL (CML) file. - * - * @author Stefan Kapferer - * - */ -public class NewCMLFileWizard extends BasicNewResourceWizard { - - private WizardNewCMLFileCreationPage mainPage; - - @Override - public void addPages() { - mainPage = new WizardNewCMLFileCreationPage("New CML File Page", getSelection()); - mainPage.setAllowExistingResources(false); - mainPage.setFileExtension("cml"); - mainPage.setFileName("model.cml"); - mainPage.setDescription("Create a new Context Mapper DSL (CML) file"); - mainPage.setTitle("New CML File"); - addPage(mainPage); - } - - @Override - public void init(IWorkbench workbench, IStructuredSelection currentSelection) { - super.init(workbench, currentSelection); - setWindowTitle("New CML File Wizard"); - setNeedsProgressMonitor(true); - } - - @Override - protected void initializeDefaultPageImageDescriptor() { - setDefaultPageImageDescriptor(CMLImageDescriptionFactory.createContextMapperLogo4DialogDescriptor()); - } - - @Override - public boolean performFinish() { - IFile file = mainPage.createNewFile(); - if (file == null) { - return false; - } - - selectAndReveal(file); - - // Open editor on new file. - IWorkbenchWindow dw = getWorkbench().getActiveWorkbenchWindow(); - try { - if (dw != null) { - IWorkbenchPage page = dw.getActivePage(); - if (page != null) { - IDE.openEditor(page, file, true); - } - } - } catch (PartInitException e) { - throw new ContextMapperApplicationException(e.getMessage(), e); - } - return true; - } - -} diff --git a/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/wizard/page/WizardNewCMLFileCreationPage.java b/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/wizard/page/WizardNewCMLFileCreationPage.java deleted file mode 100644 index 7eddb2fb..00000000 --- a/org.contextmapper.dsl.ui/src/org/contextmapper/dsl/ui/wizard/page/WizardNewCMLFileCreationPage.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright 2020 The Context Mapper Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.contextmapper.dsl.ui.wizard.page; - -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.ui.dialogs.WizardNewFileCreationPage; - -public class WizardNewCMLFileCreationPage extends WizardNewFileCreationPage { - - public WizardNewCMLFileCreationPage(String pageName, IStructuredSelection selection) { - super(pageName, selection); - } - -} diff --git a/org.contextmapper.dsl.ui/src/org/contextmapper/servicecutter/dsl/ui/ServiceCutterConfigurationDSLUiModule.xtend b/org.contextmapper.dsl.ui/src/org/contextmapper/servicecutter/dsl/ui/ServiceCutterConfigurationDSLUiModule.xtend deleted file mode 100644 index d4fffbc2..00000000 --- a/org.contextmapper.dsl.ui/src/org/contextmapper/servicecutter/dsl/ui/ServiceCutterConfigurationDSLUiModule.xtend +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright 2018 The Context Mapper Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.contextmapper.servicecutter.dsl.ui - -import org.eclipse.xtend.lib.annotations.FinalFieldsConstructor - -/** - * Use this class to register components to be used within the Eclipse IDE. - */ -@FinalFieldsConstructor -class ServiceCutterConfigurationDSLUiModule extends AbstractServiceCutterConfigurationDSLUiModule { -} diff --git a/org.contextmapper.dsl.ui/src/org/contextmapper/servicecutter/dsl/ui/actions/GeneratorsActionGroup.java b/org.contextmapper.dsl.ui/src/org/contextmapper/servicecutter/dsl/ui/actions/GeneratorsActionGroup.java deleted file mode 100644 index 63acd78d..00000000 --- a/org.contextmapper.dsl.ui/src/org/contextmapper/servicecutter/dsl/ui/actions/GeneratorsActionGroup.java +++ /dev/null @@ -1,117 +0,0 @@ -/* - * Copyright 2020 The Context Mapper Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.contextmapper.servicecutter.dsl.ui.actions; - -import java.util.List; -import java.util.Optional; - -import org.contextmapper.dsl.exception.ContextMapperApplicationException; -import org.contextmapper.dsl.ui.editor.CMLQuickMenuCreator; -import org.contextmapper.dsl.ui.images.CMLImageDescriptionFactory; -import org.eclipse.core.commands.Command; -import org.eclipse.core.commands.IHandler; -import org.eclipse.core.commands.common.NotDefinedException; -import org.eclipse.jface.action.Action; -import org.eclipse.jface.action.IMenuManager; -import org.eclipse.jface.action.MenuManager; -import org.eclipse.ui.actions.ActionGroup; -import org.eclipse.ui.commands.ICommandService; -import org.eclipse.ui.handlers.IHandlerService; -import org.eclipse.xtext.ui.editor.XtextEditor; - -import com.google.common.collect.Lists; - -public class GeneratorsActionGroup extends ActionGroup { - - private static final String QUICK_MENU_ID = "org.contextmapper.servicecutter.dsl.ui.edit.scl.generator.quickMenu"; - - private IHandlerService handlerService; - private ICommandService commandService; - private List allCommands; - - public GeneratorsActionGroup(XtextEditor editor) { - this.handlerService = editor.getEditorSite().getService(IHandlerService.class); - this.commandService = editor.getEditorSite().getService(ICommandService.class); - allCommands = Lists.newArrayList(commandService.getDefinedCommands()); - installQuickAccessAction(); - } - - @Override - public void fillContextMenu(IMenuManager menu) { - super.fillContextMenu(menu); - addGeneratorSubmenu(menu); - } - - private void installQuickAccessAction() { - if (handlerService != null) { - IHandler handler = new CMLQuickMenuCreator() { - @Override - protected void fillMenu(IMenuManager menu) { - fillRefactorMenu(menu); - } - }.createHandler(); - handlerService.activateHandler(QUICK_MENU_ID, handler); - } - } - - private int fillRefactorMenu(IMenuManager generatorSubmenu) { - int added = 0; - added += addAction(generatorSubmenu, createAction("org.contextmapper.servicecutter.dsl.ui.handler.ServiceCutterUserRepresentationsJSONGenerationCommand")); - return added; - } - - private Action createAction(String commandId) { - Optional optCommand = allCommands.stream().filter(c -> c.getId().equals(commandId)).findFirst(); - if (!optCommand.isPresent()) - return null; - - Command command = optCommand.get(); - Action action = new Action() { - public void run() { - try { - handlerService.executeCommand(command.getId(), null); - } catch (Exception e) { - throw new ContextMapperApplicationException("Could not execute command with id '" + command.getId() + "'.", e); - } - }; - }; - try { - action.setActionDefinitionId(command.getId()); - action.setText(command.getName()); - action.setEnabled(command.isEnabled()); - } catch (NotDefinedException e) { - throw new ContextMapperApplicationException("The command with the id '" + command.getId() + "' is not properly defined!", e); - } - return action; - } - - private void addGeneratorSubmenu(IMenuManager menu) { - MenuManager contextMenu = new MenuManager("Context Mapper", "org.contextmapper.servicecutter.dsl.ui.generator.menu"); - contextMenu.setActionDefinitionId(QUICK_MENU_ID); - contextMenu.setImageDescriptor(CMLImageDescriptionFactory.createContextMapperLogoDescriptor()); - if (fillRefactorMenu(contextMenu) > 0) - menu.insertAfter("additions", contextMenu); - } - - private int addAction(IMenuManager menu, Action action) { - if (action != null && action.isEnabled()) { - menu.add(action); - return 1; - } - return 0; - } - -} diff --git a/org.contextmapper.dsl.ui/src/org/contextmapper/servicecutter/dsl/ui/contentassist/ServiceCutterConfigurationDSLProposalProvider.xtend b/org.contextmapper.dsl.ui/src/org/contextmapper/servicecutter/dsl/ui/contentassist/ServiceCutterConfigurationDSLProposalProvider.xtend deleted file mode 100644 index 964cd7f1..00000000 --- a/org.contextmapper.dsl.ui/src/org/contextmapper/servicecutter/dsl/ui/contentassist/ServiceCutterConfigurationDSLProposalProvider.xtend +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright 2018 The Context Mapper Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.contextmapper.servicecutter.dsl.ui.contentassist - - -/** - * See https://www.eclipse.org/Xtext/documentation/304_ide_concepts.html#content-assist - * on how to customize the content assistant. - */ -class ServiceCutterConfigurationDSLProposalProvider extends AbstractServiceCutterConfigurationDSLProposalProvider { -} diff --git a/org.contextmapper.dsl.ui/src/org/contextmapper/servicecutter/dsl/ui/editor/SCLEditor.java b/org.contextmapper.dsl.ui/src/org/contextmapper/servicecutter/dsl/ui/editor/SCLEditor.java deleted file mode 100644 index a2db2f06..00000000 --- a/org.contextmapper.dsl.ui/src/org/contextmapper/servicecutter/dsl/ui/editor/SCLEditor.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright 2020 The Context Mapper Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.contextmapper.servicecutter.dsl.ui.editor; - -import java.util.Arrays; -import java.util.Set; - -import org.contextmapper.servicecutter.dsl.ui.actions.GeneratorsActionGroup; -import org.eclipse.jface.action.IMenuManager; -import org.eclipse.ui.actions.ActionContext; -import org.eclipse.ui.actions.ActionGroup; -import org.eclipse.xtext.ui.editor.XtextEditor; - -import com.google.common.collect.Sets; - -public class SCLEditor extends XtextEditor { - - private ActionGroup generatorsGroup; - - private static final String SCL_EDITOR_KEYBINDING_SCOPE = "org.contextmapper.ui.scl.editor.SCLEditorScope"; - - @Override - protected void createActions() { - super.createActions(); - - generatorsGroup = new GeneratorsActionGroup(this); - } - - @Override - protected void editorContextMenuAboutToShow(IMenuManager menu) { - super.editorContextMenuAboutToShow(menu); - - ActionContext context = new ActionContext(getSelectionProvider().getSelection()); - generatorsGroup.setContext(context); - generatorsGroup.fillContextMenu(menu); - generatorsGroup.setContext(null); - } - - @Override - protected void setKeyBindingScopes(String[] scopes) { - Set scopesSet = Sets.newHashSet(); - if (scopes != null) - scopesSet.addAll(Arrays.asList(scopes)); - if (!scopesSet.contains(SCL_EDITOR_KEYBINDING_SCOPE)) - scopesSet.add(SCL_EDITOR_KEYBINDING_SCOPE); - super.setKeyBindingScopes(scopesSet.toArray(new String[scopesSet.size()])); - } - -} diff --git a/org.contextmapper.dsl.ui/src/org/contextmapper/servicecutter/dsl/ui/labeling/ServiceCutterConfigurationDSLDescriptionLabelProvider.xtend b/org.contextmapper.dsl.ui/src/org/contextmapper/servicecutter/dsl/ui/labeling/ServiceCutterConfigurationDSLDescriptionLabelProvider.xtend deleted file mode 100644 index 1a7690ef..00000000 --- a/org.contextmapper.dsl.ui/src/org/contextmapper/servicecutter/dsl/ui/labeling/ServiceCutterConfigurationDSLDescriptionLabelProvider.xtend +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright 2018 The Context Mapper Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.contextmapper.servicecutter.dsl.ui.labeling - -import org.eclipse.xtext.ui.label.DefaultDescriptionLabelProvider - -/** - * Provides labels for IEObjectDescriptions and IResourceDescriptions. - * - * See https://www.eclipse.org/Xtext/documentation/304_ide_concepts.html#label-provider - */ -class ServiceCutterConfigurationDSLDescriptionLabelProvider extends DefaultDescriptionLabelProvider { - - // Labels and icons can be computed like this: - -// override text(IEObjectDescription ele) { -// ele.name.toString -// } -// -// override image(IEObjectDescription ele) { -// ele.EClass.name + '.gif' -// } -} diff --git a/org.contextmapper.dsl.ui/src/org/contextmapper/servicecutter/dsl/ui/labeling/ServiceCutterConfigurationDSLLabelProvider.xtend b/org.contextmapper.dsl.ui/src/org/contextmapper/servicecutter/dsl/ui/labeling/ServiceCutterConfigurationDSLLabelProvider.xtend deleted file mode 100644 index 038b5b5d..00000000 --- a/org.contextmapper.dsl.ui/src/org/contextmapper/servicecutter/dsl/ui/labeling/ServiceCutterConfigurationDSLLabelProvider.xtend +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright 2018 The Context Mapper Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.contextmapper.servicecutter.dsl.ui.labeling - -import com.google.inject.Inject -import org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider -import org.eclipse.xtext.ui.label.DefaultEObjectLabelProvider - -/** - * Provides labels for EObjects. - * - * See https://www.eclipse.org/Xtext/documentation/304_ide_concepts.html#label-provider - */ -class ServiceCutterConfigurationDSLLabelProvider extends DefaultEObjectLabelProvider { - - @Inject - new(AdapterFactoryLabelProvider delegate) { - super(delegate); - } - - // Labels and icons can be computed like this: - -// def text(Greeting ele) { -// 'A greeting to ' + ele.name -// } -// -// def image(Greeting ele) { -// 'Greeting.gif' -// } -} diff --git a/org.contextmapper.dsl.ui/src/org/contextmapper/servicecutter/dsl/ui/outline/ServiceCutterConfigurationDSLOutlineTreeProvider.xtend b/org.contextmapper.dsl.ui/src/org/contextmapper/servicecutter/dsl/ui/outline/ServiceCutterConfigurationDSLOutlineTreeProvider.xtend deleted file mode 100644 index 8e0dce39..00000000 --- a/org.contextmapper.dsl.ui/src/org/contextmapper/servicecutter/dsl/ui/outline/ServiceCutterConfigurationDSLOutlineTreeProvider.xtend +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright 2018 The Context Mapper Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.contextmapper.servicecutter.dsl.ui.outline - -import org.eclipse.xtext.ui.editor.outline.impl.DefaultOutlineTreeProvider - -/** - * Customization of the default outline structure. - * - * See https://www.eclipse.org/Xtext/documentation/310_eclipse_support.html#outline - */ -class ServiceCutterConfigurationDSLOutlineTreeProvider extends DefaultOutlineTreeProvider { - -} diff --git a/org.contextmapper.dsl.ui/src/org/contextmapper/servicecutter/dsl/ui/quickfix/ServiceCutterConfigurationDSLQuickfixProvider.xtend b/org.contextmapper.dsl.ui/src/org/contextmapper/servicecutter/dsl/ui/quickfix/ServiceCutterConfigurationDSLQuickfixProvider.xtend deleted file mode 100644 index 7ad3625b..00000000 --- a/org.contextmapper.dsl.ui/src/org/contextmapper/servicecutter/dsl/ui/quickfix/ServiceCutterConfigurationDSLQuickfixProvider.xtend +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright 2018 The Context Mapper Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.contextmapper.servicecutter.dsl.ui.quickfix - -import org.contextmapper.tactic.dsl.ui.quickfix.TacticDDDLanguageQuickfixProvider - -/** - * Custom quickfixes. - * - * See https://www.eclipse.org/Xtext/documentation/310_eclipse_support.html#quick-fixes - */ -class ServiceCutterConfigurationDSLQuickfixProvider extends TacticDDDLanguageQuickfixProvider { - -// @Fix(ServiceCutterConfigurationDSLValidator.INVALID_NAME) -// def capitalizeName(Issue issue, IssueResolutionAcceptor acceptor) { -// acceptor.accept(issue, 'Capitalize name', 'Capitalize the name.', 'upcase.png') [ -// context | -// val xtextDocument = context.xtextDocument -// val firstLetter = xtextDocument.get(issue.offset, 1) -// xtextDocument.replace(issue.offset, 1, firstLetter.toUpperCase) -// ] -// } -} diff --git a/org.contextmapper.dsl.ui/src/org/contextmapper/tactic/dsl/ui/TacticDDDLanguageUiModule.xtend b/org.contextmapper.dsl.ui/src/org/contextmapper/tactic/dsl/ui/TacticDDDLanguageUiModule.xtend deleted file mode 100644 index ffeb5410..00000000 --- a/org.contextmapper.dsl.ui/src/org/contextmapper/tactic/dsl/ui/TacticDDDLanguageUiModule.xtend +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright 2018 The Context Mapper Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.contextmapper.tactic.dsl.ui - -import org.eclipse.xtend.lib.annotations.FinalFieldsConstructor - -/** - * Use this class to register components to be used within the Eclipse IDE. - */ -@FinalFieldsConstructor -class TacticDDDLanguageUiModule extends AbstractTacticDDDLanguageUiModule { -} diff --git a/org.contextmapper.dsl.ui/src/org/contextmapper/tactic/dsl/ui/contentassist/TacticDDDLanguageProposalProvider.xtend b/org.contextmapper.dsl.ui/src/org/contextmapper/tactic/dsl/ui/contentassist/TacticDDDLanguageProposalProvider.xtend deleted file mode 100644 index f574199d..00000000 --- a/org.contextmapper.dsl.ui/src/org/contextmapper/tactic/dsl/ui/contentassist/TacticDDDLanguageProposalProvider.xtend +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright 2018 The Context Mapper Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.contextmapper.tactic.dsl.ui.contentassist - - -/** - * See https://www.eclipse.org/Xtext/documentation/304_ide_concepts.html#content-assist - * on how to customize the content assistant. - */ -class TacticDDDLanguageProposalProvider extends AbstractTacticDDDLanguageProposalProvider { -} diff --git a/org.contextmapper.dsl.ui/src/org/contextmapper/tactic/dsl/ui/labeling/TacticDDDLanguageDescriptionLabelProvider.xtend b/org.contextmapper.dsl.ui/src/org/contextmapper/tactic/dsl/ui/labeling/TacticDDDLanguageDescriptionLabelProvider.xtend deleted file mode 100644 index be5b248c..00000000 --- a/org.contextmapper.dsl.ui/src/org/contextmapper/tactic/dsl/ui/labeling/TacticDDDLanguageDescriptionLabelProvider.xtend +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright 2018 The Context Mapper Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.contextmapper.tactic.dsl.ui.labeling - -import org.eclipse.xtext.ui.label.DefaultDescriptionLabelProvider - -/** - * Provides labels for IEObjectDescriptions and IResourceDescriptions. - * - * See https://www.eclipse.org/Xtext/documentation/304_ide_concepts.html#label-provider - */ -class TacticDDDLanguageDescriptionLabelProvider extends DefaultDescriptionLabelProvider { - - // Labels and icons can be computed like this: - -// override text(IEObjectDescription ele) { -// ele.name.toString -// } -// -// override image(IEObjectDescription ele) { -// ele.EClass.name + '.gif' -// } -} diff --git a/org.contextmapper.dsl.ui/src/org/contextmapper/tactic/dsl/ui/labeling/TacticDDDLanguageLabelProvider.xtend b/org.contextmapper.dsl.ui/src/org/contextmapper/tactic/dsl/ui/labeling/TacticDDDLanguageLabelProvider.xtend deleted file mode 100644 index 66676d83..00000000 --- a/org.contextmapper.dsl.ui/src/org/contextmapper/tactic/dsl/ui/labeling/TacticDDDLanguageLabelProvider.xtend +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright 2018 The Context Mapper Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.contextmapper.tactic.dsl.ui.labeling - -import com.google.inject.Inject -import org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider -import org.eclipse.xtext.ui.label.DefaultEObjectLabelProvider - -/** - * Provides labels for EObjects. - * - * See https://www.eclipse.org/Xtext/documentation/304_ide_concepts.html#label-provider - */ -class TacticDDDLanguageLabelProvider extends DefaultEObjectLabelProvider { - - @Inject - new(AdapterFactoryLabelProvider delegate) { - super(delegate); - } - - // Labels and icons can be computed like this: - -// def text(Greeting ele) { -// 'A greeting to ' + ele.name -// } -// -// def image(Greeting ele) { -// 'Greeting.gif' -// } -} diff --git a/org.contextmapper.dsl.ui/src/org/contextmapper/tactic/dsl/ui/outline/TacticDDDLanguageOutlineTreeProvider.xtend b/org.contextmapper.dsl.ui/src/org/contextmapper/tactic/dsl/ui/outline/TacticDDDLanguageOutlineTreeProvider.xtend deleted file mode 100644 index 99599a70..00000000 --- a/org.contextmapper.dsl.ui/src/org/contextmapper/tactic/dsl/ui/outline/TacticDDDLanguageOutlineTreeProvider.xtend +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright 2018 The Context Mapper Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.contextmapper.tactic.dsl.ui.outline - -import org.eclipse.xtext.ui.editor.outline.impl.DefaultOutlineTreeProvider - -/** - * Customization of the default outline structure. - * - * See https://www.eclipse.org/Xtext/documentation/310_eclipse_support.html#outline - */ -class TacticDDDLanguageOutlineTreeProvider extends DefaultOutlineTreeProvider { - -} diff --git a/org.contextmapper.dsl.ui/src/org/contextmapper/tactic/dsl/ui/quickfix/TacticDDDLanguageQuickfixProvider.xtend b/org.contextmapper.dsl.ui/src/org/contextmapper/tactic/dsl/ui/quickfix/TacticDDDLanguageQuickfixProvider.xtend deleted file mode 100644 index 3e6f9821..00000000 --- a/org.contextmapper.dsl.ui/src/org/contextmapper/tactic/dsl/ui/quickfix/TacticDDDLanguageQuickfixProvider.xtend +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright 2018 The Context Mapper Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.contextmapper.tactic.dsl.ui.quickfix - -import org.eclipse.xtext.ui.editor.quickfix.DefaultQuickfixProvider - -/** - * Custom quickfixes. - * - * See https://www.eclipse.org/Xtext/documentation/310_eclipse_support.html#quick-fixes - */ -class TacticDDDLanguageQuickfixProvider extends DefaultQuickfixProvider { - -// @Fix(TacticDDDLanguageValidator.INVALID_NAME) -// def capitalizeName(Issue issue, IssueResolutionAcceptor acceptor) { -// acceptor.accept(issue, 'Capitalize name', 'Capitalize the name.', 'upcase.png') [ -// context | -// val xtextDocument = context.xtextDocument -// val firstLetter = xtextDocument.get(issue.offset, 1) -// xtextDocument.replace(issue.offset, 1, firstLetter.toUpperCase) -// ] -// } -} From 188653ba86ac1069fd5e420f657a5efbd65e3592 Mon Sep 17 00:00:00 2001 From: Stefan Kapferer Date: Wed, 21 Oct 2026 23:04:26 +0200 Subject: [PATCH 3/7] Remove the Maven/Tycho build Gradle is the only build now. The version moved from the parent pom.xml to gradle.properties. The root .project was the m2e (Maven) project of the parent pom. .java-version: 17 (minimum since Xtext 2.42). --- .github/workflows/settings.xml | 13 - .java-version | 2 +- .mvn/wrapper/MavenWrapperDownloader.java | 110 ------- .mvn/wrapper/maven-wrapper.properties | 1 - .project | 17 - build.gradle | 3 - gradle.properties | 2 + mvnw | 286 ---------------- mvnw.cmd | 162 --------- org.contextmapper.dsl.ide.tests/pom.xml | 35 -- org.contextmapper.dsl.ide/build.gradle | 2 +- org.contextmapper.dsl.ide/pom.xml | 146 --------- org.contextmapper.dsl.tests/pom.xml | 20 -- org.contextmapper.dsl/build.gradle | 2 +- org.contextmapper.dsl/pom.xml | 128 -------- pom.xml | 400 ----------------------- 16 files changed, 5 insertions(+), 1324 deletions(-) delete mode 100644 .github/workflows/settings.xml delete mode 100755 .mvn/wrapper/MavenWrapperDownloader.java delete mode 100755 .mvn/wrapper/maven-wrapper.properties delete mode 100644 .project delete mode 100755 mvnw delete mode 100755 mvnw.cmd delete mode 100644 org.contextmapper.dsl.ide.tests/pom.xml delete mode 100644 org.contextmapper.dsl.ide/pom.xml delete mode 100644 org.contextmapper.dsl.tests/pom.xml delete mode 100644 org.contextmapper.dsl/pom.xml delete mode 100644 pom.xml diff --git a/.github/workflows/settings.xml b/.github/workflows/settings.xml deleted file mode 100644 index 7aa91fb5..00000000 --- a/.github/workflows/settings.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - false - - - github - ${env.GH_CI_USERNAME} - ${env.GH_CI_TOKEN} - - - diff --git a/.java-version b/.java-version index 2dbc24b3..98d9bcb7 100644 --- a/.java-version +++ b/.java-version @@ -1 +1 @@ -11.0 +17 diff --git a/.mvn/wrapper/MavenWrapperDownloader.java b/.mvn/wrapper/MavenWrapperDownloader.java deleted file mode 100755 index fa4f7b49..00000000 --- a/.mvn/wrapper/MavenWrapperDownloader.java +++ /dev/null @@ -1,110 +0,0 @@ -/* -Licensed to the Apache Software Foundation (ASF) under one -or more contributor license agreements. See the NOTICE file -distributed with this work for additional information -regarding copyright ownership. The ASF licenses this file -to you under the Apache License, Version 2.0 (the -"License"); you may not use this file except in compliance -with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, -software distributed under the License is distributed on an -"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, either express or implied. See the License for the -specific language governing permissions and limitations -under the License. -*/ - -import java.net.*; -import java.io.*; -import java.nio.channels.*; -import java.util.Properties; - -public class MavenWrapperDownloader { - - /** - * Default URL to download the maven-wrapper.jar from, if no 'downloadUrl' is provided. - */ - private static final String DEFAULT_DOWNLOAD_URL = - "https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.4.2/maven-wrapper-0.4.2.jar"; - - /** - * Path to the maven-wrapper.properties file, which might contain a downloadUrl property to - * use instead of the default one. - */ - private static final String MAVEN_WRAPPER_PROPERTIES_PATH = - ".mvn/wrapper/maven-wrapper.properties"; - - /** - * Path where the maven-wrapper.jar will be saved to. - */ - private static final String MAVEN_WRAPPER_JAR_PATH = - ".mvn/wrapper/maven-wrapper.jar"; - - /** - * Name of the property which should be used to override the default download url for the wrapper. - */ - private static final String PROPERTY_NAME_WRAPPER_URL = "wrapperUrl"; - - public static void main(String args[]) { - System.out.println("- Downloader started"); - File baseDirectory = new File(args[0]); - System.out.println("- Using base directory: " + baseDirectory.getAbsolutePath()); - - // If the maven-wrapper.properties exists, read it and check if it contains a custom - // wrapperUrl parameter. - File mavenWrapperPropertyFile = new File(baseDirectory, MAVEN_WRAPPER_PROPERTIES_PATH); - String url = DEFAULT_DOWNLOAD_URL; - if(mavenWrapperPropertyFile.exists()) { - FileInputStream mavenWrapperPropertyFileInputStream = null; - try { - mavenWrapperPropertyFileInputStream = new FileInputStream(mavenWrapperPropertyFile); - Properties mavenWrapperProperties = new Properties(); - mavenWrapperProperties.load(mavenWrapperPropertyFileInputStream); - url = mavenWrapperProperties.getProperty(PROPERTY_NAME_WRAPPER_URL, url); - } catch (IOException e) { - System.out.println("- ERROR loading '" + MAVEN_WRAPPER_PROPERTIES_PATH + "'"); - } finally { - try { - if(mavenWrapperPropertyFileInputStream != null) { - mavenWrapperPropertyFileInputStream.close(); - } - } catch (IOException e) { - // Ignore ... - } - } - } - System.out.println("- Downloading from: : " + url); - - File outputFile = new File(baseDirectory.getAbsolutePath(), MAVEN_WRAPPER_JAR_PATH); - if(!outputFile.getParentFile().exists()) { - if(!outputFile.getParentFile().mkdirs()) { - System.out.println( - "- ERROR creating output direcrory '" + outputFile.getParentFile().getAbsolutePath() + "'"); - } - } - System.out.println("- Downloading to: " + outputFile.getAbsolutePath()); - try { - downloadFileFromURL(url, outputFile); - System.out.println("Done"); - System.exit(0); - } catch (Throwable e) { - System.out.println("- Error downloading"); - e.printStackTrace(); - System.exit(1); - } - } - - private static void downloadFileFromURL(String urlString, File destination) throws Exception { - URL website = new URL(urlString); - ReadableByteChannel rbc; - rbc = Channels.newChannel(website.openStream()); - FileOutputStream fos = new FileOutputStream(destination); - fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE); - fos.close(); - rbc.close(); - } - -} diff --git a/.mvn/wrapper/maven-wrapper.properties b/.mvn/wrapper/maven-wrapper.properties deleted file mode 100755 index 78b60c17..00000000 --- a/.mvn/wrapper/maven-wrapper.properties +++ /dev/null @@ -1 +0,0 @@ -distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.16/apache-maven-3.9.16-bin.zip diff --git a/.project b/.project deleted file mode 100644 index 2177785b..00000000 --- a/.project +++ /dev/null @@ -1,17 +0,0 @@ - - - org.contextmapper.dsl.parent - - - - - - org.eclipse.m2e.core.maven2Builder - - - - - - org.eclipse.m2e.core.maven2Nature - - diff --git a/build.gradle b/build.gradle index 6fd4b1eb..e6514c34 100644 --- a/build.gradle +++ b/build.gradle @@ -8,8 +8,6 @@ buildscript { } } -def pomXml = new groovy.xml.XmlSlurper().parse('pom.xml') - subprojects { ext.xtextVersion = '2.42.0' repositories { @@ -28,7 +26,6 @@ subprojects { apply plugin: 'jacoco' group = 'org.contextmapper' - version = pomXml.version java { sourceCompatibility = JavaVersion.VERSION_17 diff --git a/gradle.properties b/gradle.properties index 6b69b68e..e67ea550 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,3 +1,5 @@ +version=6.12.1-SNAPSHOT + centralSnapshotRepository=https://central.sonatype.com/repository/maven-snapshots/ centralReleaseStagingRepository=https://ossrh-staging-api.central.sonatype.com/service/local/staging/deploy/maven2/ diff --git a/mvnw b/mvnw deleted file mode 100755 index 5551fde8..00000000 --- a/mvnw +++ /dev/null @@ -1,286 +0,0 @@ -#!/bin/sh -# ---------------------------------------------------------------------------- -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -# ---------------------------------------------------------------------------- - -# ---------------------------------------------------------------------------- -# Maven2 Start Up Batch script -# -# Required ENV vars: -# ------------------ -# JAVA_HOME - location of a JDK home dir -# -# Optional ENV vars -# ----------------- -# M2_HOME - location of maven2's installed home dir -# MAVEN_OPTS - parameters passed to the Java VM when running Maven -# e.g. to debug Maven itself, use -# set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 -# MAVEN_SKIP_RC - flag to disable loading of mavenrc files -# ---------------------------------------------------------------------------- - -if [ -z "$MAVEN_SKIP_RC" ] ; then - - if [ -f /etc/mavenrc ] ; then - . /etc/mavenrc - fi - - if [ -f "$HOME/.mavenrc" ] ; then - . "$HOME/.mavenrc" - fi - -fi - -# OS specific support. $var _must_ be set to either true or false. -cygwin=false; -darwin=false; -mingw=false -case "`uname`" in - CYGWIN*) cygwin=true ;; - MINGW*) mingw=true;; - Darwin*) darwin=true - # Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home - # See https://developer.apple.com/library/mac/qa/qa1170/_index.html - if [ -z "$JAVA_HOME" ]; then - if [ -x "/usr/libexec/java_home" ]; then - export JAVA_HOME="`/usr/libexec/java_home`" - else - export JAVA_HOME="/Library/Java/Home" - fi - fi - ;; -esac - -if [ -z "$JAVA_HOME" ] ; then - if [ -r /etc/gentoo-release ] ; then - JAVA_HOME=`java-config --jre-home` - fi -fi - -if [ -z "$M2_HOME" ] ; then - ## resolve links - $0 may be a link to maven's home - PRG="$0" - - # need this for relative symlinks - while [ -h "$PRG" ] ; do - ls=`ls -ld "$PRG"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - PRG="$link" - else - PRG="`dirname "$PRG"`/$link" - fi - done - - saveddir=`pwd` - - M2_HOME=`dirname "$PRG"`/.. - - # make it fully qualified - M2_HOME=`cd "$M2_HOME" && pwd` - - cd "$saveddir" - # echo Using m2 at $M2_HOME -fi - -# For Cygwin, ensure paths are in UNIX format before anything is touched -if $cygwin ; then - [ -n "$M2_HOME" ] && - M2_HOME=`cygpath --unix "$M2_HOME"` - [ -n "$JAVA_HOME" ] && - JAVA_HOME=`cygpath --unix "$JAVA_HOME"` - [ -n "$CLASSPATH" ] && - CLASSPATH=`cygpath --path --unix "$CLASSPATH"` -fi - -# For Mingw, ensure paths are in UNIX format before anything is touched -if $mingw ; then - [ -n "$M2_HOME" ] && - M2_HOME="`(cd "$M2_HOME"; pwd)`" - [ -n "$JAVA_HOME" ] && - JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`" - # TODO classpath? -fi - -if [ -z "$JAVA_HOME" ]; then - javaExecutable="`which javac`" - if [ -n "$javaExecutable" ] && ! [ "`expr \"$javaExecutable\" : '\([^ ]*\)'`" = "no" ]; then - # readlink(1) is not available as standard on Solaris 10. - readLink=`which readlink` - if [ ! `expr "$readLink" : '\([^ ]*\)'` = "no" ]; then - if $darwin ; then - javaHome="`dirname \"$javaExecutable\"`" - javaExecutable="`cd \"$javaHome\" && pwd -P`/javac" - else - javaExecutable="`readlink -f \"$javaExecutable\"`" - fi - javaHome="`dirname \"$javaExecutable\"`" - javaHome=`expr "$javaHome" : '\(.*\)/bin'` - JAVA_HOME="$javaHome" - export JAVA_HOME - fi - fi -fi - -if [ -z "$JAVACMD" ] ; then - if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD="$JAVA_HOME/jre/sh/java" - else - JAVACMD="$JAVA_HOME/bin/java" - fi - else - JAVACMD="`which java`" - fi -fi - -if [ ! -x "$JAVACMD" ] ; then - echo "Error: JAVA_HOME is not defined correctly." >&2 - echo " We cannot execute $JAVACMD" >&2 - exit 1 -fi - -if [ -z "$JAVA_HOME" ] ; then - echo "Warning: JAVA_HOME environment variable is not set." -fi - -CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher - -# traverses directory structure from process work directory to filesystem root -# first directory with .mvn subdirectory is considered project base directory -find_maven_basedir() { - - if [ -z "$1" ] - then - echo "Path not specified to find_maven_basedir" - return 1 - fi - - basedir="$1" - wdir="$1" - while [ "$wdir" != '/' ] ; do - if [ -d "$wdir"/.mvn ] ; then - basedir=$wdir - break - fi - # workaround for JBEAP-8937 (on Solaris 10/Sparc) - if [ -d "${wdir}" ]; then - wdir=`cd "$wdir/.."; pwd` - fi - # end of workaround - done - echo "${basedir}" -} - -# concatenates all lines of a file -concat_lines() { - if [ -f "$1" ]; then - echo "$(tr -s '\n' ' ' < "$1")" - fi -} - -BASE_DIR=`find_maven_basedir "$(pwd)"` -if [ -z "$BASE_DIR" ]; then - exit 1; -fi - -########################################################################################## -# Extension to allow automatically downloading the maven-wrapper.jar from Maven-central -# This allows using the maven wrapper in projects that prohibit checking in binary data. -########################################################################################## -if [ -r "$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" ]; then - if [ "$MVNW_VERBOSE" = true ]; then - echo "Found .mvn/wrapper/maven-wrapper.jar" - fi -else - if [ "$MVNW_VERBOSE" = true ]; then - echo "Couldn't find .mvn/wrapper/maven-wrapper.jar, downloading it ..." - fi - jarUrl="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.4.2/maven-wrapper-0.4.2.jar" - while IFS="=" read key value; do - case "$key" in (wrapperUrl) jarUrl="$value"; break ;; - esac - done < "$BASE_DIR/.mvn/wrapper/maven-wrapper.properties" - if [ "$MVNW_VERBOSE" = true ]; then - echo "Downloading from: $jarUrl" - fi - wrapperJarPath="$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" - - if command -v wget > /dev/null; then - if [ "$MVNW_VERBOSE" = true ]; then - echo "Found wget ... using wget" - fi - wget "$jarUrl" -O "$wrapperJarPath" - elif command -v curl > /dev/null; then - if [ "$MVNW_VERBOSE" = true ]; then - echo "Found curl ... using curl" - fi - curl -o "$wrapperJarPath" "$jarUrl" - else - if [ "$MVNW_VERBOSE" = true ]; then - echo "Falling back to using Java to download" - fi - javaClass="$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.java" - if [ -e "$javaClass" ]; then - if [ ! -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then - if [ "$MVNW_VERBOSE" = true ]; then - echo " - Compiling MavenWrapperDownloader.java ..." - fi - # Compiling the Java class - ("$JAVA_HOME/bin/javac" "$javaClass") - fi - if [ -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then - # Running the downloader - if [ "$MVNW_VERBOSE" = true ]; then - echo " - Running MavenWrapperDownloader.java ..." - fi - ("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$MAVEN_PROJECTBASEDIR") - fi - fi - fi -fi -########################################################################################## -# End of extension -########################################################################################## - -export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"} -if [ "$MVNW_VERBOSE" = true ]; then - echo $MAVEN_PROJECTBASEDIR -fi -MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS" - -# For Cygwin, switch paths to Windows format before running java -if $cygwin; then - [ -n "$M2_HOME" ] && - M2_HOME=`cygpath --path --windows "$M2_HOME"` - [ -n "$JAVA_HOME" ] && - JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"` - [ -n "$CLASSPATH" ] && - CLASSPATH=`cygpath --path --windows "$CLASSPATH"` - [ -n "$MAVEN_PROJECTBASEDIR" ] && - MAVEN_PROJECTBASEDIR=`cygpath --path --windows "$MAVEN_PROJECTBASEDIR"` -fi - -WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain - -exec "$JAVACMD" \ - $MAVEN_OPTS \ - -classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \ - "-Dmaven.home=${M2_HOME}" "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \ - ${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@" diff --git a/mvnw.cmd b/mvnw.cmd deleted file mode 100755 index f707b01d..00000000 --- a/mvnw.cmd +++ /dev/null @@ -1,162 +0,0 @@ -@REM ---------------------------------------------------------------------------- -@REM Licensed to the Apache Software Foundation (ASF) under one -@REM or more contributor license agreements. See the NOTICE file -@REM distributed with this work for additional information -@REM regarding copyright ownership. The ASF licenses this file -@REM to you under the Apache License, Version 2.0 (the -@REM "License"); you may not use this file except in compliance -@REM with the License. You may obtain a copy of the License at -@REM -@REM http://www.apache.org/licenses/LICENSE-2.0 -@REM -@REM Unless required by applicable law or agreed to in writing, -@REM software distributed under the License is distributed on an -@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -@REM KIND, either express or implied. See the License for the -@REM specific language governing permissions and limitations -@REM under the License. -@REM ---------------------------------------------------------------------------- - -@REM ---------------------------------------------------------------------------- -@REM Maven2 Start Up Batch script -@REM -@REM Required ENV vars: -@REM JAVA_HOME - location of a JDK home dir -@REM -@REM Optional ENV vars -@REM M2_HOME - location of maven2's installed home dir -@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands -@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a key stroke before ending -@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven -@REM e.g. to debug Maven itself, use -@REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 -@REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files -@REM ---------------------------------------------------------------------------- - -@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on' -@echo off -@REM set title of command window -title %0 -@REM enable echoing my setting MAVEN_BATCH_ECHO to 'on' -@if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO% - -@REM set %HOME% to equivalent of $HOME - -if not defined HOME (set HOME=%HOMEDRIVE%%HOMEPATH%) - -@REM Execute a user defined script before this one -if defined MAVEN_SKIP_RC goto skipRcPre -@REM check for pre script, once with legacy .bat ending and once with .cmd ending -if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat" -if exist "%HOME%\mavenrc_pre.cmd" call "%HOME%\mavenrc_pre.cmd" - -:skipRcPre -@setlocal - -set ERROR_CODE=0 - -@REM To isolate internal variables from possible post scripts, we use another setlocal -@setlocal - -@REM ==== START VALIDATION ==== -if defined JAVA_HOME goto OkJHome - -echo. -echo Error: JAVA_HOME not found in your environment. >&2 -echo Please set the JAVA_HOME variable in your environment to match the >&2 -echo location of your Java installation. >&2 -echo. -goto error - -:OkJHome -if exist "%JAVA_HOME%\bin\java.exe" goto init - -echo. -echo Error: JAVA_HOME is set to an invalid directory. >&2 -echo JAVA_HOME = "%JAVA_HOME%" >&2 -echo Please set the JAVA_HOME variable in your environment to match the >&2 -echo location of your Java installation. >&2 -echo. -goto error - -@REM ==== END VALIDATION ==== - -:init - -@REM Find the project base dir, i.e. the directory that contains the folder ".mvn". -@REM Fallback to current working directory if not found. - -set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR% -IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir - -set EXEC_DIR=%CD% -set WDIR=%EXEC_DIR% -:findBaseDir -IF EXIST "%WDIR%"\.mvn goto baseDirFound -cd .. -IF "%WDIR%"=="%CD%" goto baseDirNotFound -set WDIR=%CD% -goto findBaseDir - -:baseDirFound -set MAVEN_PROJECTBASEDIR=%WDIR% -cd "%EXEC_DIR%" -goto endDetectBaseDir - -:baseDirNotFound -set MAVEN_PROJECTBASEDIR=%EXEC_DIR% -cd "%EXEC_DIR%" - -:endDetectBaseDir - -IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig - -@setlocal EnableExtensions EnableDelayedExpansion -for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a -@endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS% - -:endReadAdditionalConfig - -SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe" -set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar" -set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain - -set DOWNLOAD_URL="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.4.2/maven-wrapper-0.4.2.jar" -FOR /F "tokens=1,2 delims==" %%A IN (%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties) DO ( - IF "%%A"=="wrapperUrl" SET DOWNLOAD_URL=%%B -) - -@REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central -@REM This allows using the maven wrapper in projects that prohibit checking in binary data. -if exist %WRAPPER_JAR% ( - echo Found %WRAPPER_JAR% -) else ( - echo Couldn't find %WRAPPER_JAR%, downloading it ... - echo Downloading from: %DOWNLOAD_URL% - powershell -Command "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; (New-Object Net.WebClient).DownloadFile('%DOWNLOAD_URL%', '%WRAPPER_JAR%')" - echo Finished downloading %WRAPPER_JAR% -) -@REM End of extension - -%MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %* -if ERRORLEVEL 1 goto error -goto end - -:error -set ERROR_CODE=1 - -:end -@endlocal & set ERROR_CODE=%ERROR_CODE% - -if not "%MAVEN_SKIP_RC%" == "" goto skipRcPost -@REM check for post script, once with legacy .bat ending and once with .cmd ending -if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat" -if exist "%HOME%\mavenrc_post.cmd" call "%HOME%\mavenrc_post.cmd" -:skipRcPost - -@REM pause the script if MAVEN_BATCH_PAUSE is set to 'on' -if "%MAVEN_BATCH_PAUSE%" == "on" pause - -if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE% - -exit /B %ERROR_CODE% diff --git a/org.contextmapper.dsl.ide.tests/pom.xml b/org.contextmapper.dsl.ide.tests/pom.xml deleted file mode 100644 index 4ca5f484..00000000 --- a/org.contextmapper.dsl.ide.tests/pom.xml +++ /dev/null @@ -1,35 +0,0 @@ - - 4.0.0 - - org.contextmapper.dsl - org.contextmapper.dsl.parent - 6.12.1-SNAPSHOT - - org.contextmapper.dsl.ide.tests - eclipse-test-plugin - - - - - org.eclipse.xtext - xtend-maven-plugin - - - org.eclipse.tycho - tycho-surefire-plugin - - - true - - - - - - diff --git a/org.contextmapper.dsl.ide/build.gradle b/org.contextmapper.dsl.ide/build.gradle index c8bac8e9..df648fcf 100644 --- a/org.contextmapper.dsl.ide/build.gradle +++ b/org.contextmapper.dsl.ide/build.gradle @@ -52,7 +52,7 @@ publishing { maven { def releasesRepoUrl = "${centralReleaseStagingRepository}" def snapshotsRepoUrl = "${centralSnapshotRepository}" - url = project.version.text().endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl + url = project.version.toString().endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl credentials { username = System.getenv('CENTRAL_USERNAME') diff --git a/org.contextmapper.dsl.ide/pom.xml b/org.contextmapper.dsl.ide/pom.xml deleted file mode 100644 index d86827c6..00000000 --- a/org.contextmapper.dsl.ide/pom.xml +++ /dev/null @@ -1,146 +0,0 @@ - - 4.0.0 - - org.contextmapper.dsl - org.contextmapper.dsl.parent - 6.12.1-SNAPSHOT - - org.contextmapper.dsl.ide - eclipse-plugin - - - - ch.qos.reload4j - reload4j - - - org.eclipse.lsp4j - org.eclipse.lsp4j - - - org.ow2.asm - asm - - - - - - org.eclipse.xtext - xtend-maven-plugin - - - org.eclipse.tycho - target-platform-configuration - - consider - - - - org.apache.maven.plugins - maven-dependency-plugin - 3.5.0 - - - copy-dependencies - package - - copy-dependencies - - - ${project.build.directory}/libs - false - false - true - true - - com.ibm.icu, - org.apache.ant, - org.apache.commons.lang, - org.apache.commons.logging, - org.eclipse.core.commands, - org.eclipse.core.contenttype, - org.eclipse.core.expressions, - org.eclipse.core.filesystem, - org.eclipse.core.jobs, - org.eclipse.core.resources, - org.eclipse.core.runtime, - org.eclipse.core.variables, - org.eclipse.debug.core, - org.eclipse.emf.codegen.ecore, - org.eclipse.emf.codegen, - org.eclipse.emf.mwe.core, - org.eclipse.emf.mwe.utils, - org.eclipse.emf.mwe2.lib, - org.eclipse.emf.mwe2.runtime, - org.eclipse.equinox.app, - org.eclipse.equinox.preferences, - org.eclipse.equinox.registry, - org.eclipse.jdt.core, - org.eclipse.jdt.debug, - org.eclipse.jdt.launching, - org.eclipse.text, - org.eclipse.xtend.typesystem.emf, - org.eclipse.xtend, - - - - - - - com.googlecode.addjars-maven-plugin - addjars-maven-plugin - 1.0.5 - - - package - - add-jars - - - - - ${project.build.directory}/libs - - - - - - - - org.codehaus.mojo - appassembler-maven-plugin - 1.10 - - - package - - assemble - - - ${project.build.directory}/languageserver - flat - true - - - - cml-ls - org.eclipse.xtext.ide.server.ServerLauncher - - - - - - - - - - - diff --git a/org.contextmapper.dsl.tests/pom.xml b/org.contextmapper.dsl.tests/pom.xml deleted file mode 100644 index b044fd3d..00000000 --- a/org.contextmapper.dsl.tests/pom.xml +++ /dev/null @@ -1,20 +0,0 @@ - - 4.0.0 - - org.contextmapper.dsl - org.contextmapper.dsl.parent - 6.12.1-SNAPSHOT - - org.contextmapper.dsl.tests - eclipse-test-plugin - - - - - org.eclipse.xtext - xtend-maven-plugin - - - - - diff --git a/org.contextmapper.dsl/build.gradle b/org.contextmapper.dsl/build.gradle index 22a8981d..d3407206 100644 --- a/org.contextmapper.dsl/build.gradle +++ b/org.contextmapper.dsl/build.gradle @@ -94,7 +94,7 @@ publishing { maven { def releasesRepoUrl = "${centralReleaseStagingRepository}" def snapshotsRepoUrl = "${centralSnapshotRepository}" - url = project.version.text().endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl + url = project.version.toString().endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl credentials { username = System.getenv('CENTRAL_USERNAME') diff --git a/org.contextmapper.dsl/pom.xml b/org.contextmapper.dsl/pom.xml deleted file mode 100644 index d2e9f472..00000000 --- a/org.contextmapper.dsl/pom.xml +++ /dev/null @@ -1,128 +0,0 @@ - - 4.0.0 - - org.contextmapper.dsl - org.contextmapper.dsl.parent - 6.12.1-SNAPSHOT - - org.contextmapper.dsl - eclipse-plugin - - - - - org.codehaus.mojo - exec-maven-plugin - 3.0.0 - - - mwe2Launcher - generate-sources - - java - - - - - org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher - - /${project.basedir}/src/org/contextmapper/dsl/GenerateContextMappingDSL.mwe2 - -p - rootPath=/${project.basedir}/.. - - compile - true - false - - - - org.eclipse.xtext - xtext-antlr-generator - 2.1.1 - - - - - org.eclipse.xtext - xtend-maven-plugin - - - - org.apache.maven.plugins - maven-clean-plugin - - - - ${basedir}/../org.contextmapper.dsl/src-gen/ - - **/* - - - - ${basedir}/../org.contextmapper.dsl.tests/src-gen/ - - **/* - - - - ${basedir}/../org.contextmapper.dsl.ide/src-gen/ - - **/* - - - - ${basedir}/../org.contextmapper.dsl.ui/src-gen/ - - **/* - - - - ${basedir}/../org.contextmapper.dsl.ui.tests/src-gen/ - - **/* - - - - ${basedir}/model/generated/ - - - - - - - - - org.eclipse.m2e - lifecycle-mapping - 1.0.0 - - - - - - - org.codehaus.mojo - - - exec-maven-plugin - - - [1.2.1,) - - - java - - - - - - - - - - - - - - - diff --git a/pom.xml b/pom.xml deleted file mode 100644 index 4e1af9b2..00000000 --- a/pom.xml +++ /dev/null @@ -1,400 +0,0 @@ - - 4.0.0 - org.contextmapper.dsl - 6.12.1-SNAPSHOT - org.contextmapper.dsl.parent - pom - - - 2.42.0 - 2.25.0 - UTF-8 - 17 - 17 - - 5.0.4 - - - - - - 3.1.0 - - - org.contextmapper.dsl - org.contextmapper.dsl.ide - org.contextmapper.dsl.ui - org.contextmapper.dsl.target - org.contextmapper.dsl.feature - org.contextmapper.dsl.repository - org.contextmapper.dsl.tests - org.contextmapper.dsl.ide.tests - org.contextmapper.dsl.ui.tests - - - - scm:git:https://${env.GH_CI_USERNAME}:${env.GH_CI_TOKEN}@github.com/ContextMapper/context-mapper-dsl.git - scm:git:https://${env.GH_CI_USERNAME}:${env.GH_CI_TOKEN}@github.com/ContextMapper/context-mapper-dsl.git - HEAD - - - - - - org.eclipse.xtext - xtext-dev-bom - ${xtextVersion} - pom - import - - - - - - - org.apache.maven.plugins - maven-release-plugin - 2.5.3 - - true - v@{project.version} - org.eclipse.tycho:tycho-versions-plugin:${tycho-version}:update-eclipse-metadata org.apache.maven.plugins:maven-scm-plugin:1.9.5:add org.apache.maven.plugins:maven-scm-plugin:1.9.5:checkin - org.eclipse.tycho:tycho-versions-plugin:${tycho-version}:update-eclipse-metadata org.apache.maven.plugins:maven-scm-plugin:1.9.5:add org.apache.maven.plugins:maven-scm-plugin:1.9.5:checkin - - - - org.apache.maven.plugins - maven-scm-plugin - 1.11.1 - - - default-cli - - add - checkin - - - **/META-INF/MANIFEST.MF,**/feature.xml,**/*.product,**/category.xml - **/target/** - [Tycho] Prepare for release: v${project.version} - - - - - - org.eclipse.tycho - tycho-maven-plugin - ${tycho-version} - true - - - org.eclipse.tycho - tycho-source-plugin - ${tycho-version} - - - plugin-source - - plugin-source - - - - feature-source - - feature-source - - - - - - org.eclipse.tycho - tycho-p2-plugin - ${tycho-version} - - - attach-p2-metadata - package - - p2-metadata - - - - - - org.eclipse.tycho - target-platform-configuration - ${tycho-version} - - - - org.contextmapper.dsl - org.contextmapper.dsl.target - ${project.version} - - - - false - - - macosx - cocoa - x86_64 - - - win32 - win32 - x86_64 - - - linux - gtk - x86_64 - - - - - - eclipse-plugin - org.eclipse.xtext.logging - 1.2.24 - - - - eclipse-feature - org.eclipse.rcp - 0.0.0 - - - - - - - - - - org.eclipse.xtext - xtend-maven-plugin - ${xtextVersion} - - - - compile - xtend-install-debug-info - testCompile - xtend-test-install-debug-info - - - - - ${basedir}/xtend-gen - ${basedir}/xtend-gen - - - - org.apache.maven.plugins - maven-clean-plugin - 3.2.0 - - - - ${basedir}/xtend-gen - - **/* - - - - - - - org.eclipse.m2e - lifecycle-mapping - 1.0.0 - - - - - - - org.codehaus.mojo - - - build-helper-maven-plugin - - - [1.9.1,) - - - add-resource - add-source - add-test-resource - add-test-source - - - - - - - - - - - - - org.eclipse.tycho - tycho-compiler-plugin - ${tycho-version} - - -err:-forbidden - false - - - - - org.eclipse.tycho - tycho-surefire-plugin - ${tycho-version} - - - ${platformSystemProperties} ${systemProperties} ${moduleProperties} ${additionalTestArguments} - false - false - - - - - - - - codehaus-snapshots - disable dead 'Codehaus Snapshots' repository, see https://bugs.eclipse.org/bugs/show_bug.cgi?id=481478 - http://nexus.codehaus.org/snapshots/ - - false - - - false - - - - - ossrh-snapshots - ossrh-snapshots - - false - - - false - - http://oss.sonatype.org/content/repositories/snapshots - - - - sonatype-nexus-snapshots - Sonatype Nexus Snapshots - https://oss.sonatype.org/content/repositories/snapshots - - false - - - false - - - - - - codehaus-snapshots - disable dead 'Codehaus Snapshots' repository, see https://bugs.eclipse.org/bugs/show_bug.cgi?id=481478 - http://nexus.codehaus.org/snapshots/ - - false - - - false - - - - ossrh-snapshots - ossrh-snapshots - - false - - - false - - http://oss.sonatype.org/content/repositories/snapshots - - - sonatype-nexus-snapshots - Sonatype Nexus Snapshots - https://oss.sonatype.org/content/repositories/snapshots - - false - - - false - - - - - - macos - - - mac - - - - - -XstartOnFirstThread - - - - jdk9-or-newer - - [9,) - - - --add-modules=ALL-SYSTEM - - - - release-composite - - false - - - - - - maven-install-plugin - - - default-install - none - - - - - maven-deploy-plugin - - true - - - - - - - - - - From 9f2addfbdec97cb206b8e3cf646e81db1849a599 Mon Sep 17 00:00:00 2001 From: Stefan Kapferer Date: Wed, 21 Oct 2026 23:11:41 +0200 Subject: [PATCH 4/7] Generate only runtime and LSP infrastructure with Xtext - MWE2: no Eclipse plugin, Eclipse plugin tests and Eclipse metadata anymore, Eclipse UI fragments removed. The generated runtime, LSP and test code is identical to before. - Remove OSGi/Eclipse plugin metadata (MANIFEST.MF, build.properties, plugin.xml) and the Eclipse launch configurations - Remove the versioned .project/.classpath files; they are generated by Gradle (Buildship) when importing the project into Eclipse, and the Gradle eclipse plugin no longer has to be disabled for them --- .gitignore | 4 + org.contextmapper.dsl.ide.tests/.classpath | 21 ----- org.contextmapper.dsl.ide.tests/.project | 40 --------- .../META-INF/MANIFEST.MF | 28 ------- org.contextmapper.dsl.ide.tests/build.gradle | 4 - .../build.properties | 5 -- org.contextmapper.dsl.ide/.classpath | 9 -- org.contextmapper.dsl.ide/.project | 40 --------- .../META-INF/MANIFEST.MF | 26 ------ org.contextmapper.dsl.ide/build.gradle | 4 - org.contextmapper.dsl.ide/build.properties | 6 -- org.contextmapper.dsl.tests/.classpath | 21 ----- org.contextmapper.dsl.tests/.project | 40 --------- .../META-INF/MANIFEST.MF | 29 ------- org.contextmapper.dsl.tests/build.gradle | 4 - org.contextmapper.dsl.tests/build.properties | 6 -- org.contextmapper.dsl/.classpath | 9 -- ...rateContextMappingDSLInfrastructure.launch | 20 ----- .../.launch/LaunchRuntimeEclipse.launch | 40 --------- org.contextmapper.dsl/.project | 40 --------- org.contextmapper.dsl/META-INF/MANIFEST.MF | 82 ------------------- org.contextmapper.dsl/build.gradle | 4 - org.contextmapper.dsl/build.properties | 20 ----- org.contextmapper.dsl/plugin.xml | 22 ----- .../dsl/GenerateContextMappingDSL.mwe2 | 23 ------ 25 files changed, 4 insertions(+), 543 deletions(-) delete mode 100644 org.contextmapper.dsl.ide.tests/.classpath delete mode 100644 org.contextmapper.dsl.ide.tests/.project delete mode 100644 org.contextmapper.dsl.ide.tests/META-INF/MANIFEST.MF delete mode 100644 org.contextmapper.dsl.ide.tests/build.properties delete mode 100644 org.contextmapper.dsl.ide/.classpath delete mode 100644 org.contextmapper.dsl.ide/.project delete mode 100644 org.contextmapper.dsl.ide/META-INF/MANIFEST.MF delete mode 100644 org.contextmapper.dsl.ide/build.properties delete mode 100644 org.contextmapper.dsl.tests/.classpath delete mode 100644 org.contextmapper.dsl.tests/.project delete mode 100644 org.contextmapper.dsl.tests/META-INF/MANIFEST.MF delete mode 100644 org.contextmapper.dsl.tests/build.properties delete mode 100644 org.contextmapper.dsl/.classpath delete mode 100644 org.contextmapper.dsl/.launch/GenerateContextMappingDSLInfrastructure.launch delete mode 100644 org.contextmapper.dsl/.launch/LaunchRuntimeEclipse.launch delete mode 100644 org.contextmapper.dsl/.project delete mode 100644 org.contextmapper.dsl/META-INF/MANIFEST.MF delete mode 100644 org.contextmapper.dsl/build.properties delete mode 100644 org.contextmapper.dsl/plugin.xml diff --git a/.gitignore b/.gitignore index 2fb3aa58..ac76a62f 100644 --- a/.gitignore +++ b/.gitignore @@ -44,3 +44,7 @@ build/ # MacOS .DS_Store + +# Eclipse project files (generated by Gradle/Buildship on import) +.project +.classpath diff --git a/org.contextmapper.dsl.ide.tests/.classpath b/org.contextmapper.dsl.ide.tests/.classpath deleted file mode 100644 index 9684cf42..00000000 --- a/org.contextmapper.dsl.ide.tests/.classpath +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - diff --git a/org.contextmapper.dsl.ide.tests/.project b/org.contextmapper.dsl.ide.tests/.project deleted file mode 100644 index c70efe56..00000000 --- a/org.contextmapper.dsl.ide.tests/.project +++ /dev/null @@ -1,40 +0,0 @@ - - - org.contextmapper.dsl.ide.tests - - - - - - org.eclipse.xtext.ui.shared.xtextBuilder - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.pde.ManifestBuilder - - - - - org.eclipse.pde.SchemaBuilder - - - - - org.eclipse.m2e.core.maven2Builder - - - - - - org.eclipse.m2e.core.maven2Nature - org.eclipse.xtext.ui.shared.xtextNature - org.eclipse.jdt.core.javanature - org.eclipse.pde.PluginNature - - diff --git a/org.contextmapper.dsl.ide.tests/META-INF/MANIFEST.MF b/org.contextmapper.dsl.ide.tests/META-INF/MANIFEST.MF deleted file mode 100644 index 5a4dc981..00000000 --- a/org.contextmapper.dsl.ide.tests/META-INF/MANIFEST.MF +++ /dev/null @@ -1,28 +0,0 @@ -Manifest-Version: 1.0 -Automatic-Module-Name: org.contextmapper.dsl.ide.tests -Bundle-ManifestVersion: 2 -Bundle-Name: org.contextmapper.dsl.ide.tests -Bundle-Vendor: Context Mapper -Bundle-Version: 6.12.1.qualifier -Bundle-SymbolicName: org.contextmapper.dsl.ide.tests; singleton:=true -Bundle-ActivationPolicy: lazy -Require-Bundle: org.contextmapper.dsl, - org.contextmapper.dsl.ide, - org.eclipse.xtext.testing, - org.eclipse.xtext.xbase.testing, - org.eclipse.xtext.xbase.lib;bundle-version="2.14.0", - org.apache.commons.io;bundle-version="2.2.0", - org.contextmapper.contextmap.generator;bundle-version="1.2.1", - org.eclipse.lsp4j, - org.eclipse.lsp4j.jsonrpc, - com.google.gson;bundle-version="2.8.9", - org.eclipse.osgi, - junit-jupiter-api, - junit-jupiter-params, - org.aopalliance;bundle-version="1.0.0", - org.eclipse.emf.ecore.change;bundle-version="2.14.0" -Bundle-RequiredExecutionEnvironment: JavaSE-17 -Export-Package: org.contextmapper.dsl.ide.tests;x-internal=true -Import-Package: org.eclipse.xtext.generator, - org.junit.jupiter.api;version="[5.1.0,6.0.0)", - org.junit.jupiter.api.extension;version="[5.1.0,6.0.0)" diff --git a/org.contextmapper.dsl.ide.tests/build.gradle b/org.contextmapper.dsl.ide.tests/build.gradle index 7a9ff0ef..bd8126be 100644 --- a/org.contextmapper.dsl.ide.tests/build.gradle +++ b/org.contextmapper.dsl.ide.tests/build.gradle @@ -12,10 +12,6 @@ dependencies { test { useJUnitPlatform() } -//this is an eclipse plugin project -eclipseClasspath.enabled=false -cleanEclipseClasspath.enabled=false - jacocoTestReport { sourceSets project(':context-mapper-lsp').sourceSets.main diff --git a/org.contextmapper.dsl.ide.tests/build.properties b/org.contextmapper.dsl.ide.tests/build.properties deleted file mode 100644 index bc00e7d3..00000000 --- a/org.contextmapper.dsl.ide.tests/build.properties +++ /dev/null @@ -1,5 +0,0 @@ -source.. = src/,\ - xtend-gen/ -bin.includes = .,\ - META-INF/ -bin.excludes = **/*.xtend diff --git a/org.contextmapper.dsl.ide/.classpath b/org.contextmapper.dsl.ide/.classpath deleted file mode 100644 index 277a6027..00000000 --- a/org.contextmapper.dsl.ide/.classpath +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/org.contextmapper.dsl.ide/.project b/org.contextmapper.dsl.ide/.project deleted file mode 100644 index 9db5448e..00000000 --- a/org.contextmapper.dsl.ide/.project +++ /dev/null @@ -1,40 +0,0 @@ - - - org.contextmapper.dsl.ide - - - - - - org.eclipse.xtext.ui.shared.xtextBuilder - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.pde.ManifestBuilder - - - - - org.eclipse.pde.SchemaBuilder - - - - - org.eclipse.m2e.core.maven2Builder - - - - - - org.eclipse.m2e.core.maven2Nature - org.eclipse.xtext.ui.shared.xtextNature - org.eclipse.jdt.core.javanature - org.eclipse.pde.PluginNature - - diff --git a/org.contextmapper.dsl.ide/META-INF/MANIFEST.MF b/org.contextmapper.dsl.ide/META-INF/MANIFEST.MF deleted file mode 100644 index 588df813..00000000 --- a/org.contextmapper.dsl.ide/META-INF/MANIFEST.MF +++ /dev/null @@ -1,26 +0,0 @@ -Manifest-Version: 1.0 -Automatic-Module-Name: org.contextmapper.dsl.ide -Bundle-ManifestVersion: 2 -Bundle-Name: org.contextmapper.dsl.ide -Bundle-Vendor: Context Mapper -Bundle-Version: 6.12.1.qualifier -Bundle-SymbolicName: org.contextmapper.dsl.ide; singleton:=true -Bundle-ActivationPolicy: lazy -Require-Bundle: org.contextmapper.dsl, - org.eclipse.xtext.ide, - org.eclipse.xtext.xbase.ide, - org.antlr.runtime;bundle-version="[3.2.0,3.2.1)", - org.eclipse.lsp4j, - org.eclipse.lsp4j.jsonrpc, - org.apache.log4j;bundle-version="1.2.15", - com.google.gson, - org.apache.commons.lang3;bundle-version="3.9.0" -Bundle-RequiredExecutionEnvironment: JavaSE-17 -Export-Package: org.contextmapper.dsl.ide.commands, - org.contextmapper.dsl.ide.contentassist.antlr, - org.contextmapper.dsl.ide.contentassist.antlr.internal, - org.contextmapper.dsl.ide.quickfix.impl, - org.contextmapper.servicecutter.dsl.ide.contentassist.antlr, - org.contextmapper.servicecutter.dsl.ide.contentassist.antlr.internal, - org.contextmapper.tactic.dsl.ide.contentassist.antlr, - org.contextmapper.tactic.dsl.ide.contentassist.antlr.internal diff --git a/org.contextmapper.dsl.ide/build.gradle b/org.contextmapper.dsl.ide/build.gradle index df648fcf..008cbf1e 100644 --- a/org.contextmapper.dsl.ide/build.gradle +++ b/org.contextmapper.dsl.ide/build.gradle @@ -11,10 +11,6 @@ application { mainClass = "org.eclipse.xtext.ide.server.ServerLauncher" } -//this is an eclipse plugin project -eclipseClasspath.enabled=false -cleanEclipseClasspath.enabled=false - task sourcesJar(type: Jar) { dependsOn generateXtext from sourceSets.main.allJava diff --git a/org.contextmapper.dsl.ide/build.properties b/org.contextmapper.dsl.ide/build.properties deleted file mode 100644 index 5c6bbf99..00000000 --- a/org.contextmapper.dsl.ide/build.properties +++ /dev/null @@ -1,6 +0,0 @@ -source.. = src/,\ - src-gen/,\ - xtend-gen/ -bin.includes = .,\ - META-INF/ -bin.excludes = **/*.xtend diff --git a/org.contextmapper.dsl.tests/.classpath b/org.contextmapper.dsl.tests/.classpath deleted file mode 100644 index 39e241d2..00000000 --- a/org.contextmapper.dsl.tests/.classpath +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - diff --git a/org.contextmapper.dsl.tests/.project b/org.contextmapper.dsl.tests/.project deleted file mode 100644 index 66d058b6..00000000 --- a/org.contextmapper.dsl.tests/.project +++ /dev/null @@ -1,40 +0,0 @@ - - - org.contextmapper.dsl.tests - - - - - - org.eclipse.xtext.ui.shared.xtextBuilder - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.pde.ManifestBuilder - - - - - org.eclipse.pde.SchemaBuilder - - - - - org.eclipse.m2e.core.maven2Builder - - - - - - org.eclipse.m2e.core.maven2Nature - org.eclipse.xtext.ui.shared.xtextNature - org.eclipse.jdt.core.javanature - org.eclipse.pde.PluginNature - - diff --git a/org.contextmapper.dsl.tests/META-INF/MANIFEST.MF b/org.contextmapper.dsl.tests/META-INF/MANIFEST.MF deleted file mode 100644 index 5892a6f3..00000000 --- a/org.contextmapper.dsl.tests/META-INF/MANIFEST.MF +++ /dev/null @@ -1,29 +0,0 @@ -Manifest-Version: 1.0 -Automatic-Module-Name: org.contextmapper.dsl.tests -Bundle-ManifestVersion: 2 -Bundle-Name: org.contextmapper.dsl.tests -Bundle-Vendor: Context Mapper -Bundle-Version: 6.12.1.qualifier -Bundle-SymbolicName: org.contextmapper.dsl.tests; singleton:=true -Bundle-ActivationPolicy: lazy -Require-Bundle: org.contextmapper.dsl, - org.contextmapper.dsl.ide, - org.eclipse.xtext.testing, - org.eclipse.xtext.xbase.testing, - org.eclipse.xtext.xbase.lib;bundle-version="2.14.0", - org.apache.commons.io;bundle-version="2.2.0", - org.contextmapper.contextmap.generator;bundle-version="1.2.1", - org.eclipse.lsp4j, - org.eclipse.lsp4j.jsonrpc, - com.google.gson, - org.eclipse.osgi, - org.freemarker.freemarker;bundle-version="2.3.30", - junit-jupiter-api, - junit-jupiter-params -Bundle-RequiredExecutionEnvironment: JavaSE-17 -Export-Package: org.contextmapper.dsl.tests;x-internal=true, - org.contextmapper.tactic.dsl.tests;x-internal=true, - org.contextmapper.servicecutter.dsl.tests;x-internal=true -Import-Package: org.eclipse.xtext.generator, - org.junit.jupiter.api;version="[5.1.0,6.0.0)", - org.junit.jupiter.api.extension;version="[5.1.0,6.0.0)" diff --git a/org.contextmapper.dsl.tests/build.gradle b/org.contextmapper.dsl.tests/build.gradle index 3a0a74ea..fbd19c31 100644 --- a/org.contextmapper.dsl.tests/build.gradle +++ b/org.contextmapper.dsl.tests/build.gradle @@ -14,10 +14,6 @@ dependencies { test { useJUnitPlatform() } -//this is an eclipse plugin project -eclipseClasspath.enabled=false -cleanEclipseClasspath.enabled=false - jacocoTestReport { sourceSets project(':context-mapper-dsl').sourceSets.main diff --git a/org.contextmapper.dsl.tests/build.properties b/org.contextmapper.dsl.tests/build.properties deleted file mode 100644 index 5c6bbf99..00000000 --- a/org.contextmapper.dsl.tests/build.properties +++ /dev/null @@ -1,6 +0,0 @@ -source.. = src/,\ - src-gen/,\ - xtend-gen/ -bin.includes = .,\ - META-INF/ -bin.excludes = **/*.xtend diff --git a/org.contextmapper.dsl/.classpath b/org.contextmapper.dsl/.classpath deleted file mode 100644 index e9522a4a..00000000 --- a/org.contextmapper.dsl/.classpath +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/org.contextmapper.dsl/.launch/GenerateContextMappingDSLInfrastructure.launch b/org.contextmapper.dsl/.launch/GenerateContextMappingDSLInfrastructure.launch deleted file mode 100644 index 079f3be9..00000000 --- a/org.contextmapper.dsl/.launch/GenerateContextMappingDSLInfrastructure.launch +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - - - - - - - - - - - - - diff --git a/org.contextmapper.dsl/.launch/LaunchRuntimeEclipse.launch b/org.contextmapper.dsl/.launch/LaunchRuntimeEclipse.launch deleted file mode 100644 index 82195fdf..00000000 --- a/org.contextmapper.dsl/.launch/LaunchRuntimeEclipse.launch +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/org.contextmapper.dsl/.project b/org.contextmapper.dsl/.project deleted file mode 100644 index 6d3de55f..00000000 --- a/org.contextmapper.dsl/.project +++ /dev/null @@ -1,40 +0,0 @@ - - - org.contextmapper.dsl - - - - - - org.eclipse.xtext.ui.shared.xtextBuilder - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.pde.ManifestBuilder - - - - - org.eclipse.pde.SchemaBuilder - - - - - org.eclipse.m2e.core.maven2Builder - - - - - - org.eclipse.m2e.core.maven2Nature - org.eclipse.xtext.ui.shared.xtextNature - org.eclipse.jdt.core.javanature - org.eclipse.pde.PluginNature - - diff --git a/org.contextmapper.dsl/META-INF/MANIFEST.MF b/org.contextmapper.dsl/META-INF/MANIFEST.MF deleted file mode 100644 index 1f533921..00000000 --- a/org.contextmapper.dsl/META-INF/MANIFEST.MF +++ /dev/null @@ -1,82 +0,0 @@ -Manifest-Version: 1.0 -Automatic-Module-Name: org.contextmapper.dsl -Bundle-ManifestVersion: 2 -Bundle-Name: org.contextmapper.dsl -Bundle-Vendor: Context Mapper -Bundle-Version: 6.12.1.qualifier -Bundle-SymbolicName: org.contextmapper.dsl; singleton:=true -Bundle-ActivationPolicy: lazy -Require-Bundle: org.eclipse.xtext, - org.eclipse.xtext.xbase, - org.eclipse.equinox.common;bundle-version="3.16.0", - org.eclipse.emf.ecore, - org.eclipse.xtext.xbase.lib;bundle-version="2.14.0", - org.eclipse.xtext.util, - org.eclipse.emf.common, - org.eclipse.xtend.lib;bundle-version="2.14.0", - org.antlr.runtime;bundle-version="[3.2.0,3.2.1)", - org.apache.commons.io;bundle-version="2.2.0", - org.contextmapper.contextmap.generator;bundle-version="1.2.1", - org.apache.commons.lang3;bundle-version="3.9.0", - org.apache.commons.exec;bundle-version="1.3.0", - guru.nidi.com.kitfox.svgSalamander;bundle-version="1.1.2", - org.freemarker.freemarker;bundle-version="2.3.30" -Bundle-RequiredExecutionEnvironment: JavaSE-17 -Export-Package: org.contextmapper.dsl, - org.contextmapper.dsl.cml, - org.contextmapper.dsl.cml.exception, - org.contextmapper.dsl.contextMappingDSL, - org.contextmapper.dsl.contextMappingDSL.impl, - org.contextmapper.dsl.contextMappingDSL.util, - org.contextmapper.dsl.exception, - org.contextmapper.dsl.formatting2, - org.contextmapper.dsl.generator, - org.contextmapper.dsl.generator.contextmap, - org.contextmapper.dsl.generator.exception, - org.contextmapper.dsl.generator.mdsl, - org.contextmapper.dsl.generator.mdsl.model, - org.contextmapper.dsl.generator.plantuml, - org.contextmapper.dsl.generator.plantuml.value_impact_mapping.model, - org.contextmapper.dsl.generator.sketchminer, - org.contextmapper.dsl.generator.sketchminer.model, - org.contextmapper.dsl.hover, - org.contextmapper.dsl.hover.impl, - org.contextmapper.dsl.parser.antlr, - org.contextmapper.dsl.parser.antlr.internal, - org.contextmapper.dsl.quickfixes, - org.contextmapper.dsl.quickfixes.tactic, - org.contextmapper.dsl.refactoring, - org.contextmapper.dsl.refactoring.exception, - org.contextmapper.dsl.refactoring.stakeholders, - org.contextmapper.dsl.refactoring.value_registers, - org.contextmapper.dsl.scoping, - org.contextmapper.dsl.serializer, - org.contextmapper.dsl.services, - org.contextmapper.dsl.standalone, - org.contextmapper.dsl.validation, - org.contextmapper.servicecutter.dsl, - org.contextmapper.servicecutter.dsl.formatting2, - org.contextmapper.servicecutter.dsl.parser.antlr, - org.contextmapper.servicecutter.dsl.parser.antlr.internal, - org.contextmapper.servicecutter.dsl.scl, - org.contextmapper.servicecutter.dsl.scl.exception, - org.contextmapper.servicecutter.dsl.scoping, - org.contextmapper.servicecutter.dsl.serializer, - org.contextmapper.servicecutter.dsl.serviceCutterConfigurationDSL, - org.contextmapper.servicecutter.dsl.serviceCutterConfigurationDSL.impl, - org.contextmapper.servicecutter.dsl.serviceCutterConfigurationDSL.util, - org.contextmapper.servicecutter.dsl.services, - org.contextmapper.servicecutter.dsl.validation, - org.contextmapper.tactic.dsl, - org.contextmapper.tactic.dsl.formatting2, - org.contextmapper.tactic.dsl.parser.antlr, - org.contextmapper.tactic.dsl.parser.antlr.internal, - org.contextmapper.tactic.dsl.scoping, - org.contextmapper.tactic.dsl.serializer, - org.contextmapper.tactic.dsl.services, - org.contextmapper.tactic.dsl.tacticdsl, - org.contextmapper.tactic.dsl.tacticdsl.impl, - org.contextmapper.tactic.dsl.tacticdsl.util, - org.contextmapper.tactic.dsl.validation -Import-Package: org.apache.log4j, - org.eclipse.core.resources diff --git a/org.contextmapper.dsl/build.gradle b/org.contextmapper.dsl/build.gradle index d3407206..cd26f8bc 100644 --- a/org.contextmapper.dsl/build.gradle +++ b/org.contextmapper.dsl/build.gradle @@ -41,10 +41,6 @@ processResources.dependsOn(generateXtextLanguage) generateXtext.dependsOn(generateXtextLanguage) clean.dependsOn(cleanGenerateXtextLanguage) eclipse.classpath.plusConfigurations += [configurations.mwe2] -//this is an eclipse plugin project -eclipseClasspath.enabled=false -cleanEclipseClasspath.enabled=false - clean { delete 'xtend-gen' delete 'model' diff --git a/org.contextmapper.dsl/build.properties b/org.contextmapper.dsl/build.properties deleted file mode 100644 index 18d540bf..00000000 --- a/org.contextmapper.dsl/build.properties +++ /dev/null @@ -1,20 +0,0 @@ -source.. = src/,\ - src-gen/,\ - xtend-gen/ -bin.includes = model/generated/,\ - .,\ - META-INF/,\ - plugin.xml -bin.excludes = **/*.mwe2,\ - **/*.xtend -additional.bundles = org.eclipse.xtext.xbase,\ - org.eclipse.xtext.common.types,\ - org.eclipse.xtext.xtext.generator,\ - org.eclipse.emf.codegen.ecore,\ - org.eclipse.emf.mwe.utils,\ - org.eclipse.emf.mwe2.launch,\ - org.eclipse.emf.mwe2.lib,\ - org.objectweb.asm,\ - org.apache.commons.logging,\ - org.apache.log4j,\ - com.ibm.icu diff --git a/org.contextmapper.dsl/plugin.xml b/org.contextmapper.dsl/plugin.xml deleted file mode 100644 index ec110ef5..00000000 --- a/org.contextmapper.dsl/plugin.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - - - - - - diff --git a/org.contextmapper.dsl/src/org/contextmapper/dsl/GenerateContextMappingDSL.mwe2 b/org.contextmapper.dsl/src/org/contextmapper/dsl/GenerateContextMappingDSL.mwe2 index 2181faab..74a35cc5 100644 --- a/org.contextmapper.dsl/src/org/contextmapper/dsl/GenerateContextMappingDSL.mwe2 +++ b/org.contextmapper.dsl/src/org/contextmapper/dsl/GenerateContextMappingDSL.mwe2 @@ -30,13 +30,6 @@ Workflow { runtimeTest = { enabled = true } - eclipsePlugin = { - enabled = true - } - eclipsePluginTest = { - enabled = true - } - createEclipseMetaData = true genericIde = { enabled = true } @@ -53,14 +46,6 @@ Workflow { fragment = exporting.SimpleNamesFragment2 {} fragment = builder.BuilderIntegrationFragment2 {} - fragment = ui.labeling.LabelProviderFragment2 {} - fragment = ui.outline.QuickOutlineFragment2 {} - fragment = ui.outline.OutlineTreeProviderFragment2 {} - fragment = ui.quickfix.QuickfixProviderFragment2 {} - fragment = ui.contentAssist.ContentAssistFragment2 {} - fragment = ui.refactoring.RefactorElementNameFragment2 {} - fragment = ui.templates.CodetemplatesGeneratorFragment2 {} - fragment = ui.compare.CompareFragment2 {} serializer = { generateStub = false @@ -117,14 +102,6 @@ Workflow { fragment = exporting.SimpleNamesFragment2 {} fragment = builder.BuilderIntegrationFragment2 {} - fragment = ui.labeling.LabelProviderFragment2 {} - fragment = ui.outline.QuickOutlineFragment2 {} - fragment = ui.outline.OutlineTreeProviderFragment2 {} - fragment = ui.quickfix.QuickfixProviderFragment2 {} - fragment = ui.contentAssist.ContentAssistFragment2 {} - fragment = ui.refactoring.RefactorElementNameFragment2 {} - fragment = ui.templates.CodetemplatesGeneratorFragment2 {} - fragment = ui.compare.CompareFragment2 {} serializer = { generateStub = false From 69f9ef9b96745e139b9dedfb9adeb9450dbd44ad Mon Sep 17 00:00:00 2001 From: Stefan Kapferer Date: Wed, 21 Oct 2026 23:12:49 +0200 Subject: [PATCH 5/7] Build and release with Gradle only - Remove the Eclipse plugin jobs (build, p2 snapshot and release update sites) from all workflows - Release trigger without the maven-release-plugin: sets the release version in gradle.properties, builds, commits and tags vX.Y.Z, sets the next development version and pushes both (same commit/tag scheme and CI token as before). Release and next version can be given as inputs. - Current versions of the GitHub actions - Bug report template: ask for VS Code / standalone library instead of Eclipse --- .github/ISSUE_TEMPLATE/bug_report.md | 8 +-- .github/workflows/build_master.yml | 83 ++++----------------------- .github/workflows/build_standard.yml | 36 ++---------- .github/workflows/release-trigger.yml | 76 ++++++++++++++++++------ .github/workflows/release.yml | 73 +++-------------------- 5 files changed, 85 insertions(+), 191 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index 9abd0b46..c8228983 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -19,14 +19,14 @@ A clear and concise description of what you expected to happen. **Screenshots / Exceptions** If applicable, add screenshots to help explain your problem. -Provide error messages and exceptions you may got in the eclipse plugin (see error log view). +Provide error messages and exceptions you may got in VS Code (Output view, channel "CML Language Server") or in your application (standalone library). **Input files to reproduce** If possible, provide input files which allow reproducing the problem (CML or SCL files). -**IDE and Plugin (please complete the following information):** - - Eclipse version - - ContextMapper plugin version +**Environment (please complete the following information):** + - VS Code version and Context Mapper extension version, or version of the standalone library + - Java version **Additional context** Add any other context about the problem here. diff --git a/.github/workflows/build_master.yml b/.github/workflows/build_master.yml index 144785b2..2096f9e8 100644 --- a/.github/workflows/build_master.yml +++ b/.github/workflows/build_master.yml @@ -10,20 +10,21 @@ on: jobs: build_standalone: name: Build Standalone Libraries (DSL, LSP) - if: startsWith(github.event.head_commit.message, '[Tycho]') == false && startsWith(github.event.head_commit.message, '[maven-release-plugin] prepare release v') == false + # release commits are built and published by the release workflow (tag) + if: startsWith(github.event.head_commit.message, 'Release v') == false runs-on: ubuntu-latest - + steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v7 - name: Set up JDK 17 - uses: actions/setup-java@v4 + uses: actions/setup-java@v6 with: distribution: 'temurin' java-version: 17 - name: Install Graphviz run: sudo apt-get -y install graphviz - - name: Gradle caches - uses: actions/cache@v4 + - name: Gradle caches + uses: actions/cache@v6 with: path: | ~/.gradle/caches @@ -40,52 +41,24 @@ jobs: with: token: ${{ secrets.CODECOV_TOKEN }} - build_eclipse: - name: Build Eclipse Plugin - if: startsWith(github.event.head_commit.message, '[Tycho]') == false && startsWith(github.event.head_commit.message, '[maven-release-plugin] prepare release v') == false - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v4 - - name: Set up JDK 21 - uses: actions/setup-java@v4 - with: - distribution: 'temurin' - java-version: 21 - - name: Install Graphviz - run: sudo apt-get -y install graphviz - - name: Cache local Maven repository - uses: actions/cache@v4 - with: - path: ~/.m2/repository - key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} - restore-keys: | - ${{ runner.os }}-maven- - - name: Grant execute permission for mvnw - run: chmod +x mvnw - - name: Build with Maven - run: ./mvnw clean verify - publish_standalone_lib: name: Publish Snapshots of Libraries (DSL Standalone Lib, LSP) - if: startsWith(github.event.head_commit.message, '[Tycho]') == false && startsWith(github.event.head_commit.message, '[maven-release-plugin] prepare release v') == false runs-on: ubuntu-latest needs: - - build_eclipse - build_standalone steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v7 - name: Set up JDK 17 - uses: actions/setup-java@v4 + uses: actions/setup-java@v6 with: distribution: 'temurin' java-version: 17 - name: Install Graphviz run: sudo apt-get -y install graphviz - - name: Gradle caches - uses: actions/cache@v4 + - name: Gradle caches + uses: actions/cache@v6 with: path: | ~/.gradle/caches @@ -109,37 +82,3 @@ jobs: GPG_KEY_PASSPHRASE: ${{ secrets.GPG_KEY_PASSPHRASE }} CENTRAL_USERNAME: ${{ secrets.CENTRAL_USERNAME }} CENTRAL_PASSWORD: ${{ secrets.CENTRAL_PASSWORD }} - - publish_eclipse_snapshot: - name: Publish Snapshot of Eclipse Plugin (P2 repo) - if: startsWith(github.event.head_commit.message, '[Tycho]') == false && startsWith(github.event.head_commit.message, '[maven-release-plugin] prepare release v') == false - runs-on: ubuntu-latest - - needs: - - build_eclipse - - build_standalone - - steps: - - uses: actions/checkout@v4 - - name: Set up JDK 21 - uses: actions/setup-java@v4 - with: - distribution: 'temurin' - java-version: 21 - - name: Install Graphviz - run: sudo apt-get -y install graphviz - - name: Cache local Maven repository - uses: actions/cache@v4 - with: - path: ~/.m2/repository - key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} - restore-keys: | - ${{ runner.os }}-maven- - - name: Grant execute permission for mvnw - run: chmod +x mvnw - - name: Configure Git user - run: | - git config --global user.email "contextmapper-ci@kapferer.ch" - git config --global user.name "Context Mapper CI" - - name: Publish Eclipse plugin to Snapshot Repo - run: ./mvnw --settings ./.github/workflows/settings.xml clean deploy -Prelease-composite -Prelease-snapshot-version -Dgithub-update-repo=https://${{ secrets.GH_CI_USERNAME }}:${{ secrets.GH_CI_TOKEN }}@github.com/ContextMapper/eclipse-update-site-snapshots diff --git a/.github/workflows/build_standard.yml b/.github/workflows/build_standard.yml index 7a8fcbb3..9d982fc1 100644 --- a/.github/workflows/build_standard.yml +++ b/.github/workflows/build_standard.yml @@ -10,18 +10,18 @@ jobs: build_standalone: name: Build Standalone Libraries (DSL, LSP) runs-on: ubuntu-latest - + steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v7 - name: Set up JDK 17 - uses: actions/setup-java@v4 + uses: actions/setup-java@v6 with: distribution: 'temurin' java-version: 17 - name: Install Graphviz run: sudo apt-get -y install graphviz - - name: Gradle caches - uses: actions/cache@v4 + - name: Gradle caches + uses: actions/cache@v6 with: path: | ~/.gradle/caches @@ -37,29 +37,3 @@ jobs: uses: codecov/codecov-action@v5 with: token: ${{ secrets.CODECOV_TOKEN }} - - build_eclipse: - name: Build Eclipse Plugin - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v4 - - name: Set up JDK 21 - uses: actions/setup-java@v4 - with: - distribution: 'temurin' - java-version: 21 - - name: Install Graphviz - run: sudo apt-get -y install graphviz - - name: Cache local Maven repository - uses: actions/cache@v4 - with: - path: ~/.m2/repository - key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} - restore-keys: | - ${{ runner.os }}-maven- - - name: Grant execute permission for mvnw - run: chmod +x mvnw - - name: Build with Maven - run: ./mvnw clean verify - diff --git a/.github/workflows/release-trigger.yml b/.github/workflows/release-trigger.yml index 80f09495..828a3c1e 100644 --- a/.github/workflows/release-trigger.yml +++ b/.github/workflows/release-trigger.yml @@ -2,40 +2,80 @@ name: Trigger Release (manual) on: workflow_dispatch: + inputs: + release-version: + description: 'Release version (x.y.z); default: the current version without -SNAPSHOT' + required: false + next-version: + description: 'Next development version (x.y.z-SNAPSHOT); default: next patch version' + required: false jobs: prepare_release: name: Prepare Release + if: github.ref == 'refs/heads/master' runs-on: ubuntu-latest - + steps: - - uses: actions/checkout@v4 + # the CI token is needed (instead of the default GITHUB_TOKEN) so that pushing the tag triggers the release workflow + - uses: actions/checkout@v7 with: fetch-depth: 0 - persist-credentials: false - - name: Set up JDK 21 - uses: actions/setup-java@v4 + token: ${{ secrets.GH_CI_TOKEN }} + - name: Set up JDK 17 + uses: actions/setup-java@v6 with: distribution: 'temurin' - java-version: 21 + java-version: 17 - name: Configure Git user run: | git config user.email "contextmapper-ci@kapferer.ch" git config user.name "Context Mapper CI" - name: Install Graphviz run: sudo apt-get -y install graphviz - - name: Cache local Maven repository - uses: actions/cache@v4 + - name: Gradle caches + uses: actions/cache@v6 with: - path: ~/.m2/repository - key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} + path: | + ~/.gradle/caches + ~/.gradle/wrapper + key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} restore-keys: | - ${{ runner.os }}-maven- - - name: Grant execute permission for mvnw - run: chmod +x mvnw - - name: Prepare Release - run: ./mvnw --settings ./.github/workflows/settings.xml clean release:prepare -B + ${{ runner.os }}-gradle- + - name: Determine versions + run: | + CURRENT=$(sed -n 's/^version=//p' gradle.properties) + RELEASE="${RELEASE_INPUT:-${CURRENT%-SNAPSHOT}}" + if ! [[ "$RELEASE" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then + echo "Invalid release version: $RELEASE"; exit 1 + fi + if [ -z "$NEXT_INPUT" ]; then + IFS=. read -r MAJOR MINOR PATCH <<< "$RELEASE" + NEXT="$MAJOR.$MINOR.$((PATCH + 1))-SNAPSHOT" + else + NEXT="$NEXT_INPUT" + fi + if ! [[ "$NEXT" =~ ^[0-9]+\.[0-9]+\.[0-9]+-SNAPSHOT$ ]]; then + echo "Invalid next development version: $NEXT"; exit 1 + fi + if git rev-parse -q --verify "refs/tags/v$RELEASE" > /dev/null; then + echo "Tag v$RELEASE already exists"; exit 1 + fi + echo "Releasing $RELEASE (current: $CURRENT, next: $NEXT)" + echo "RELEASE=$RELEASE" >> $GITHUB_ENV + echo "NEXT=$NEXT" >> $GITHUB_ENV env: - GH_CI_USERNAME: ${{ secrets.GH_CI_USERNAME }} - GH_CI_TOKEN: ${{ secrets.GH_CI_TOKEN }} - + RELEASE_INPUT: ${{ inputs.release-version }} + NEXT_INPUT: ${{ inputs.next-version }} + - name: Build release version + run: | + sed -i "s/^version=.*/version=$RELEASE/" gradle.properties + chmod +x gradlew + ./gradlew clean build + - name: Commit and tag release, prepare next development iteration + run: | + git commit -am "Release v$RELEASE" + git tag "v$RELEASE" + sed -i "s/^version=.*/version=$NEXT/" gradle.properties + git commit -am "Prepare next development iteration ($NEXT)" + git push --atomic origin HEAD:master "v$RELEASE" diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 8882d1f3..05297129 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -11,16 +11,16 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v7 - name: Set up JDK 17 - uses: actions/setup-java@v4 + uses: actions/setup-java@v6 with: distribution: 'temurin' java-version: 17 - name: Install Graphviz run: sudo apt-get -y install graphviz - name: Gradle caches - uses: actions/cache@v4 + uses: actions/cache@v6 with: path: | ~/.gradle/caches @@ -33,54 +33,28 @@ jobs: - name: Build with Gradle run: ./gradlew clean build - name: Upload coverage to Codecov - uses: codecov/codecov-action@v4 + uses: codecov/codecov-action@v5 with: token: ${{ secrets.CODECOV_TOKEN }} - build_eclipse: - name: Build Eclipse Plugin - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v4 - - name: Set up JDK 21 - uses: actions/setup-java@v4 - with: - distribution: 'temurin' - java-version: 21 - - name: Install Graphviz - run: sudo apt-get -y install graphviz - - name: Cache local Maven repository - uses: actions/cache@v4 - with: - path: ~/.m2/repository - key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} - restore-keys: | - ${{ runner.os }}-maven- - - name: Grant execute permission for mvnw - run: chmod +x mvnw - - name: Build with Maven - run: ./mvnw clean verify - publish_standalone_lib: name: Publish Libraries to Maven Central (DSL Standalone Lib, LSP) runs-on: ubuntu-latest needs: - - build_eclipse - build_standalone steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v7 - name: Set up JDK 17 - uses: actions/setup-java@v4 + uses: actions/setup-java@v6 with: distribution: 'temurin' java-version: 17 - name: Install Graphviz run: sudo apt-get -y install graphviz - name: Gradle caches - uses: actions/cache@v4 + uses: actions/cache@v6 with: path: | ~/.gradle/caches @@ -114,36 +88,3 @@ jobs: env: CENTRAL_USERNAME: ${{ secrets.CENTRAL_USERNAME }} CENTRAL_PASSWORD: ${{ secrets.CENTRAL_PASSWORD }} - - publish_eclipse: - name: Publish Eclipse Plugin (P2 repo) - runs-on: ubuntu-latest - - needs: - - build_eclipse - - build_standalone - - steps: - - uses: actions/checkout@v4 - - name: Set up JDK 21 - uses: actions/setup-java@v4 - with: - distribution: 'temurin' - java-version: 21 - - name: Install Graphviz - run: sudo apt-get -y install graphviz - - name: Cache local Maven repository - uses: actions/cache@v4 - with: - path: ~/.m2/repository - key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} - restore-keys: | - ${{ runner.os }}-maven- - - name: Grant execute permission for mvnw - run: chmod +x mvnw - - name: Configure Git user - run: | - git config --global user.email "contextmapper-ci@kapferer.ch" - git config --global user.name "Context Mapper CI" - - name: Publish Eclipse plugin with Maven - run: ./mvnw --settings ./.github/workflows/settings.xml clean deploy -Prelease-composite -Prelease-final-version -Dgithub-update-repo=https://${{ secrets.GH_CI_USERNAME }}:${{ secrets.GH_CI_TOKEN }}@github.com/ContextMapper/eclipse-update-site From 6c88071877ad9eaecc7f8fc4a3c5730b197131d7 Mon Sep 17 00:00:00 2001 From: Stefan Kapferer Date: Wed, 21 Oct 2026 23:14:49 +0200 Subject: [PATCH 6/7] Update README for the language server only setup and add ADR - Installation via VS Code Marketplace / Open VSX; note that 6.12.0 is the last version of the Eclipse plugin - Development: Gradle build only, IDE import as Gradle project, release workflow - Fix the build badge (the referenced workflow name did not exist) - ADR 0003: discontinue the Eclipse plugin (status: proposed) --- README.md | 66 +++++++------------- docs/madr/0003-discontinue-eclipse-plugin.md | 31 +++++++++ 2 files changed, 55 insertions(+), 42 deletions(-) create mode 100644 docs/madr/0003-discontinue-eclipse-plugin.md diff --git a/README.md b/README.md index 99fdaf72..f8078fa1 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ ![Context Mapper](https://raw.githubusercontent.com/wiki/ContextMapper/context-mapper-dsl/logo/cm-logo-github-small.png) # Context Mapper DSL (CML) -[![Build (master)](https://github.com/ContextMapper/context-mapper-dsl/workflows/Build%20(master)/badge.svg)](https://github.com/ContextMapper/context-mapper-dsl/actions) [![codecov](https://codecov.io/gh/ContextMapper/context-mapper-dsl/branch/master/graph/badge.svg)](https://codecov.io/gh/ContextMapper/context-mapper-dsl) [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0) [![Maven Central](https://img.shields.io/maven-central/v/org.contextmapper/context-mapper-dsl.svg?label=Maven%20Central)](https://search.maven.org/search?q=g:%22org.contextmapper%22%20AND%20a:%22context-mapper-dsl%22) +[![Build (master)](https://github.com/ContextMapper/context-mapper-dsl/actions/workflows/build_master.yml/badge.svg)](https://github.com/ContextMapper/context-mapper-dsl/actions/workflows/build_master.yml) [![codecov](https://codecov.io/gh/ContextMapper/context-mapper-dsl/branch/master/graph/badge.svg)](https://codecov.io/gh/ContextMapper/context-mapper-dsl) [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0) [![Maven Central](https://img.shields.io/maven-central/v/org.contextmapper/context-mapper-dsl.svg?label=Maven%20Central)](https://search.maven.org/search?q=g:%22org.contextmapper%22%20AND%20a:%22context-mapper-dsl%22) ContextMapper is an open source tool providing a Domain-specific Language based on Domain-Driven Design (DDD) patterns for context mapping and service decomposition. @@ -10,12 +10,10 @@ Checkout our website [https://contextmapper.org/](https://contextmapper.org/) to The Context Mapper project has originally been developed as part of research projects at [OST (former HSR)](https://www.ost.ch). You can find the project reports and further background information [here](https://contextmapper.org/background-and-publications/). * **Installation links:** - Context Mapper is available for Visual Studio Code and Eclipse: - * VS Code: - * [VS Code Marketplace](https://marketplace.visualstudio.com/items?itemName=contextmapper.context-mapper-vscode-extension) - * Eclipse: - * [Eclipse Marketplace](https://marketplace.eclipse.org/content/context-mapper) - * Update Site: [https://contextmapper.org/eclipse-update-site/](https://contextmapper.org/eclipse-update-site/) + Context Mapper is available for Visual Studio Code (and other editors supporting VS Code extensions): + * [VS Code Marketplace](https://marketplace.visualstudio.com/items?itemName=contextmapper.context-mapper-vscode-extension) + * [Open VSX Registry](https://open-vsx.org/extension/contextmapper/context-mapper-vscode-extension) + * **Eclipse:** The Eclipse plugin is discontinued. Version 6.12.0 is the last version available for Eclipse ([Eclipse Marketplace](https://marketplace.eclipse.org/content/context-mapper), update site: [https://contextmapper.org/eclipse-update-site/](https://contextmapper.org/eclipse-update-site/)). This repository provides the language server (LSP) for the VS Code extension and the standalone library. * [Release notes for latest releases](https://contextmapper.org/allnews) ## Features @@ -37,21 +35,17 @@ The Context Mapper project has originally been developed as part of research pro To use the ContextMapper DSL (CML) you need the following tools: * [Java JDK](https://adoptium.net/) (JDK 17 or newer) -* [Eclipse](https://www.eclipse.org/downloads/packages/) or [Visual Studio Code](https://code.visualstudio.com/) +* [Visual Studio Code](https://code.visualstudio.com/) * If you want to use our [Context Map generator](https://contextmapper.org/docs/context-map-generator/) you need to have [Graphviz](https://www.graphviz.org/) installed on your system. * Ensure that the binaries are part of the _PATH_ environment variable and can be called from the terminal. * Especially on Windows this is not the case after the installation of [Graphviz](https://www.graphviz.org/). The default installation path is `C:\Program Files (x86)\GraphvizX.XX`, which means you have to add `C:\Program Files (x86)\GraphvizX.XX\bin` to your _PATH_ variable. -* You may want to install one of the following two plugins to display the plantUML diagrams directly in Eclipse: - * [Asciidoctor Editor](https://marketplace.eclipse.org/content/asciidoctor-editor) (Update site: [https://dl.bintray.com/de-jcup/asciidoctoreditor](https://dl.bintray.com/de-jcup/asciidoctoreditor)) - * [PlantUML Eclipse Plugin](https://github.com/hallvard/plantuml) (Update site: [http://hallvard.github.io/plantuml/](http://hallvard.github.io/plantuml/)) - * **Note:** Both plugins require [Graphviz](http://www.graphviz.org/) to be installed on your machine! +* You may want to install a [PlantUML](https://plantuml.com/) extension to display the generated PlantUML diagrams directly in VS Code (for example [PlantUML](https://marketplace.visualstudio.com/items?itemName=jebbs.plantuml)). * Alternatively you can use the [plantUML online server](http://www.plantuml.com/plantuml/uml). ## Getting Started -If you want to use our Context Mapper tool, install the plugin in Eclipse or the extension in VS Code: +If you want to use our Context Mapper tool, install the extension in VS Code: 1. Installation of Context Mapper: - * [Eclipse Marketplace](https://marketplace.eclipse.org/content/context-mapper) * [VS Code Marketplace](https://marketplace.visualstudio.com/items?itemName=contextmapper.context-mapper-vscode-extension) 2. Find a detailed manual how to create your first CML project [here](https://contextmapper.org/docs/getting-started-create-project/). 3. Examples which introduce the language (CML) capabilities can be found here: [https://github.com/ContextMapper/context-mapper-examples](https://github.com/ContextMapper/context-mapper-examples) @@ -76,49 +70,37 @@ implementation 'org.contextmapper:context-mapper-dsl:6.12.0' In our [context-mapper-standalone-example](https://github.com/ContextMapper/context-mapper-standalone-example) repository you find an example project showing how to include the library within your project. It further contains code examples illustrating how to use the CML models and the generator tools (PlantUML, MDSL, etc.). ## Development -If you want to contribute and setup the IDE for this project on your local system follow the following instructions. [Here](./wiki/Development) you get the instructions in more details. - -### Building the Project -The project currently has two builds since we have to use Maven for building the Eclipse plugin but prefer Gradle in the standalone case. -With Gradle you can only build the DSL and the IDE (LSP) project. It is further used to deploy these standalone JARs to the Maven central. - -#### Complete Build with Eclipse Plugin (Maven) -The project uses the [Maven Wrapper](https://github.com/takari/maven-wrapper). - -After cloning the project it can be built with the following command within the root directory of the project: - -`./mvnw clean install` +If you want to contribute and setup the IDE for this project on your local system follow the following instructions. -**Note:** This is an Xtext project and the tests which are evaluating the correctness of the language grammar need an additional maven goal besides _test_ to be executed. Use this command if you want to execute the tests: +### Project Structure + * `org.contextmapper.dsl`: the CML language (Xtext grammars), validators, generators and refactorings; published as standalone library `context-mapper-dsl` + * `org.contextmapper.dsl.ide`: the language server (LSP) used by the [VS Code extension](https://github.com/ContextMapper/vscode-extension); published as `context-mapper-lsp` + * `org.contextmapper.dsl.tests` and `org.contextmapper.dsl.ide.tests`: the corresponding tests + * `samples/freemarker`: sample templates for the [generic Freemarker generator](https://contextmapper.org/docs/generic-freemarker-generator/) -`./mvnw clean integration-test` - -Of course they are also executed with a _clean install_. - -#### Standalone Build Only (Gradle) -To build the standalone projects only, you can use the Gradle Wrapper: +### Building the Project +The project is built with the Gradle Wrapper (JDK 17 or newer): `./gradlew clean build` +This generates the Xtext language infrastructure (parser, EMF model, etc.) from the grammars first (task `generateXtextLanguage`), then compiles the project and runs all tests. The language server distribution (as used by the VS Code extension) can be found in `org.contextmapper.dsl.ide/build/distributions` afterwards. + **Note:** If you want to deploy the libraries into your local Maven repository, you need a GPG key to sign the artifacts: `./gradlew clean publishToMavenLocal -Psigning.keyId= -Psigning.password= -Psigning.secretKeyRingFile=` -### Setup Eclipse IDE -Since this is an Xtext project you need an Eclipse IDE to work on it. Download the **Eclipse IDE for Java and DSL Developers** from [here](https://www.eclipse.org/downloads/packages/). The latest version of Eclipse we worked with is [2019-12](https://www.eclipse.org/downloads/packages/release/2019-12/r/eclipse-ide-java-and-dsl-developers). - -#### Importing the project -You can import the project with as an existing maven project (_Import -> Existing Maven Project_). +### Setup the IDE +Import the project as Gradle project into your IDE (IntelliJ IDEA, Eclipse with Buildship, VS Code with the Java extensions). Run `./gradlew build` once before (or after) importing, so that the generated sources (`src-gen` and `xtend-gen` folders) exist. Whenever you change one of the grammars (`*.xtext` files), run the build again to regenerate the language infrastructure. -#### Build in Eclipse -After importing the project you will have lots of build errors. This is because you have to generate some Xtext sources first. There exists an eclipse launch configuration called 'GenerateContextMappingDSLInfrastructure' delivered with the project. Run this launch configuration (yes, even if there exist build errors). As soon this has completed, execute a clean build with _Project -> Clean... -> Clean all projects_. +**Note:** Syntax highlighting and validation for the Xtext grammar and the Xtend files (some of the tests are written in [Xtend](https://eclipse.dev/Xtext/xtend/)) are only available in an Eclipse IDE with the Xtext SDK installed ("Eclipse IDE for Java and DSL Developers"). -That's it. You should have a clean workspace now without build errors. +### Releasing +Releases are triggered manually with the GitHub workflow "Trigger Release (manual)" on the master branch. It sets the release version, tags the release (`vX.Y.Z`) and sets the next development version. The tag triggers the release workflow, which publishes the libraries to Maven Central (the deployment has to be published manually in the [Central Portal](https://central.sonatype.com/publishing/deployments)). ## Contributing Contribution is always welcome! Here are some ways how you can contribute: * Create GitHub issues if you find bugs or just want to give suggestions for improvements. - * This is an open source project: if you want to code, [create pull requests](https://help.github.com/articles/creating-a-pull-request/) from [forks of this repository](https://help.github.com/articles/fork-a-repo/). Please refer to a Github issue if you contribute this way. In our [wiki](https://github.com/ContextMapper/context-mapper-dsl/wiki/IDE-Setup) you can find out how to build the project and setup the development environment locally. + * This is an open source project: if you want to code, [create pull requests](https://help.github.com/articles/creating-a-pull-request/) from [forks of this repository](https://help.github.com/articles/fork-a-repo/). Please refer to a Github issue if you contribute this way. The [Development](#development) section above explains how to build the project and setup the development environment locally. * If you want to contribute to our documentation and user guides on our website [https://contextmapper.org/](https://contextmapper.org/), create pull requests from forks of the corresponding page repo [https://github.com/ContextMapper/contextmapper.github.io](https://github.com/ContextMapper/contextmapper.github.io) or create issues [there](https://github.com/ContextMapper/contextmapper.github.io/issues). ## Licence diff --git a/docs/madr/0003-discontinue-eclipse-plugin.md b/docs/madr/0003-discontinue-eclipse-plugin.md new file mode 100644 index 00000000..9b60b03a --- /dev/null +++ b/docs/madr/0003-discontinue-eclipse-plugin.md @@ -0,0 +1,31 @@ +--- +status: "proposed" +date: "2026-10-21" +deciders: "stefan-ka" +--- +# Discontinue the Eclipse Plugin (Language Server and Standalone Library only) + +## Context and Problem Statement + +Context Mapper has been provided as Eclipse plugin, as VS Code extension (based on our language server) and as standalone library. The Eclipse plugin requires a second build (Maven/Tycho with an Eclipse target platform, p2 update sites) besides the Gradle build of the standalone library and the language server. Keeping this stack up to date has become expensive: every Xtext update requires updating the Eclipse target platform (the current one, Eclipse 2026-03, needs Java 21 for the build), Orbit renamed bundles (for example `org.apache.commons.io`, which broke the installation of the 6.12.1 snapshot), and the Eclipse UI code (handlers, wizards, quick fixes) duplicates the functionality the language server offers to VS Code. + +## Considered Options + +* Keep the Eclipse plugin and the Maven/Tycho build +* Discontinue the Eclipse plugin; provide the language server (for the VS Code extension) and the standalone library only + +## Decision Outcome + +Chosen option: "Discontinue the Eclipse plugin", because the VS Code extension offers (almost) the same functionality via the language server, and a single Gradle build (as generated by the Xtext project wizard for language-server-only projects) is much easier to maintain. + +Version 6.12.0 is the last version of the Eclipse plugin; its update site and marketplace entry stay available. + +### Consequences + +* Good, because there is only one build (Gradle) and no Eclipse target platform, Tycho, p2 update sites, OSGi manifests and Eclipse UI code to maintain anymore. +* Good, because Xtext updates only depend on the Xtext Maven artifacts. +* Bad, because Eclipse users do not get new versions anymore. +* Bad, because the following features were only available in Eclipse: + * the XMI generator as IDE command (the generator itself is still part of the standalone library: `XMIGenerator`) + * the "New CML File" wizard and the Freemarker template examples wizard (the templates moved to `samples/freemarker`) + * Eclipse-specific editor features: quick outline, structure compare editor, preference pages to configure validation severities, the "Generators" and "Refactor" quick menus From 1d5176e452d5bde3023418b294c401be4234aebe Mon Sep 17 00:00:00 2001 From: Stefan Kapferer Date: Wed, 21 Oct 2026 23:19:36 +0200 Subject: [PATCH 7/7] Remove the HTML hover texts of the Eclipse editor Only the Eclipse editor used HTMLHoverTextProvider4CML; the language server uses the Markdown variant with the same keywords. --- .../dsl/hover/CMLHoverTextProviderTest.java | 18 +-- .../ContextMapperApplicationException.java | 2 +- .../impl/HTMLHoverTextProvider4CML.xtend | 124 ------------------ 3 files changed, 3 insertions(+), 141 deletions(-) delete mode 100644 org.contextmapper.dsl/src/org/contextmapper/dsl/hover/impl/HTMLHoverTextProvider4CML.xtend diff --git a/org.contextmapper.dsl.tests/src/org/contextmapper/dsl/hover/CMLHoverTextProviderTest.java b/org.contextmapper.dsl.tests/src/org/contextmapper/dsl/hover/CMLHoverTextProviderTest.java index 089f1a75..22c6a295 100644 --- a/org.contextmapper.dsl.tests/src/org/contextmapper/dsl/hover/CMLHoverTextProviderTest.java +++ b/org.contextmapper.dsl.tests/src/org/contextmapper/dsl/hover/CMLHoverTextProviderTest.java @@ -19,25 +19,11 @@ import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertTrue; -import org.contextmapper.dsl.hover.impl.HTMLHoverTextProvider4CML; import org.contextmapper.dsl.hover.impl.MarkdownHoverTextProvider4CML; import org.junit.jupiter.api.Test; public class CMLHoverTextProviderTest { - @Test - public void canProvideHoverTextsAsHTML() { - // given - CMLHoverTextProvider textProvider = new HTMLHoverTextProvider4CML(); - - // when - String sampleHoverText = textProvider.getHoverText("ContextMap"); - - // then - assertNotNull(sampleHoverText); - assertFalse("".equals(sampleHoverText)); - } - @Test public void canProvideHoverTextsAsMarkdown() { // given @@ -54,7 +40,7 @@ public void canProvideHoverTextsAsMarkdown() { @Test public void canReturnEmptyString4NonExistentKeyword() { // given - CMLHoverTextProvider textProvider = new HTMLHoverTextProvider4CML(); + CMLHoverTextProvider textProvider = new MarkdownHoverTextProvider4CML(); // when String sampleHoverText = textProvider.getHoverText("ThisKeywordDoesNotExist"); @@ -67,7 +53,7 @@ public void canReturnEmptyString4NonExistentKeyword() { @Test public void canTellIfKeywordExists() { // given - CMLHoverTextProvider textProvider = new HTMLHoverTextProvider4CML(); + CMLHoverTextProvider textProvider = new MarkdownHoverTextProvider4CML(); // when boolean existing = textProvider.isKeywordRegistered("ContextMap"); diff --git a/org.contextmapper.dsl/src/org/contextmapper/dsl/exception/ContextMapperApplicationException.java b/org.contextmapper.dsl/src/org/contextmapper/dsl/exception/ContextMapperApplicationException.java index d0910a1e..7e6cd275 100644 --- a/org.contextmapper.dsl/src/org/contextmapper/dsl/exception/ContextMapperApplicationException.java +++ b/org.contextmapper.dsl/src/org/contextmapper/dsl/exception/ContextMapperApplicationException.java @@ -16,7 +16,7 @@ package org.contextmapper.dsl.exception; /** - * Exception that is catched in Eclipse UI project to show message box. + * Exception with a message that is shown to the user (for example by the language server). * * @author Stefan Kapferer * diff --git a/org.contextmapper.dsl/src/org/contextmapper/dsl/hover/impl/HTMLHoverTextProvider4CML.xtend b/org.contextmapper.dsl/src/org/contextmapper/dsl/hover/impl/HTMLHoverTextProvider4CML.xtend deleted file mode 100644 index f9add083..00000000 --- a/org.contextmapper.dsl/src/org/contextmapper/dsl/hover/impl/HTMLHoverTextProvider4CML.xtend +++ /dev/null @@ -1,124 +0,0 @@ -/* - * Copyright 2020 The Context Mapper Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.contextmapper.dsl.hover.impl - -import org.contextmapper.dsl.hover.impl.AbstractCMLHoverTextProvider -import org.contextmapper.dsl.hover.CMLHoverTextProvider - -class HTMLHoverTextProvider4CML extends AbstractCMLHoverTextProvider implements CMLHoverTextProvider { - - override protected registerHoverTexts() { - registerHoverText("BoundedContext", ''' - Bounded Context: A description of a boundary (typically a subsystem, or the work - of a particular team) within which a particular model is defined and applicable. -

- Find all DDD pattern descriptions in the DDD reference under - http://domainlanguage.com/ddd/reference/'''); - - registerHoverText("ContextMap", '''Context Map: A model describing bounded contexts - and especially their relationships. Brandolini provides a very good introduction into context mapping here: - https://www.infoq.com/articles/ddd-contextmapping/ -

Find all DDD pattern descriptions in the DDD reference under - http://domainlanguage.com/ddd/reference/'''); - - registerHoverText("U", '''Upstream in the upstream-downstream relationship. -

upstream-downstream:
A relationship between two bounded contexts - in which the “upstream” contexts’s actions affect project success of the “downstream” context, but - the actions of the downstream do not significantly affect projects upstream. (e.g. If two cities - are along the same river, the upstream city’s pollution primarily affects the downstream city.) - The upstream team may succeed independently of the fate of the downstream team.

- Find all DDD pattern descriptions in the DDD reference under - http://domainlanguage.com/ddd/reference/'''); - - registerHoverText("D", '''Downstream in the upstream-downstream relationship. -

upstream-downstream:
A relationship between two bounded contexts - in which the “upstream” contexts’s actions affect project success of the “downstream” context, but - the actions of the downstream do not significantly affect projects upstream. (e.g. If two cities - are along the same river, the upstream city’s pollution primarily affects the downstream city.) - The upstream team may succeed independently of the fate of the downstream team.

- Find all DDD pattern descriptions in the DDD reference under - http://domainlanguage.com/ddd/reference/'''); - - registerHoverText("S", '''Supplier in the customer-supplier relationship. -

customer-supplier:
Describes an upstream-downstream relationship - where one bounded context is customer and the other supplier which work closely together. - The supplier prioritizes the implementation with respect to the customers requirements. -

Find all DDD pattern descriptions in the DDD reference under - http://domainlanguage.com/ddd/reference/'''); - - registerHoverText("C", '''Customer in the customer-supplier relationship. -

customer-supplier:
Describes an upstream-downstream relationship - where one bounded context is customer and the other supplier which work closely together. - The supplier prioritizes the implementation with respect to the customers requirements. -

Find all DDD pattern descriptions in the DDD reference under - http://domainlanguage.com/ddd/reference/'''); - - registerHoverText("OHS", '''Open Host Service (OHS): Describes a role of a - bounded context which is providing certain functionality needed by many other contexts. - Because of the broad usage, a public API is provided. -

Find all DDD pattern descriptions in the DDD reference under - http://domainlanguage.com/ddd/reference/'''); - - registerHoverText("PL", '''Published Language (PL): The published language describes - the shared knowledge two bounded contexts need for their interaction. Typically defined by the - upstream providing an Open Host Service. -

Find all DDD pattern descriptions in the DDD reference under - http://domainlanguage.com/ddd/reference/'''); - - registerHoverText("ACL", '''Anticorruption Layer (ACL): Describes a mechanism used - by downstreams in order to protect themselves from changes of the upstream. -

Find all DDD pattern descriptions in the DDD reference under - http://domainlanguage.com/ddd/reference/'''); - - registerHoverText("CF", '''Conformist (CF): Describes a role of a bounded context in - an upstream-downstream relationship. Since there is no influence on the upstream, the downstream - team has to deal with what they get and "conform" to it. -

Find all DDD pattern descriptions in the DDD reference under - http://domainlanguage.com/ddd/reference/'''); - - registerHoverText("Aggregate", '''Aggregate: An Aggregate is a cluster of domain - objects (such as Entities, Value Objects, etc.) which is kept consistent with respect to specific - invariants and typically also represents a boundary regarding transactions. -

Find all DDD pattern descriptions in the DDD reference under - http://domainlanguage.com/ddd/reference/'''); - - registerHoverText("Domain", '''Domain: The domain describes the world within your - organization is working. This is not a pattern in the original DDD book of Evans, but still a very - important term related to the patterns Subdomain and Bounded Context as described by - Vernon -

Find all DDD pattern descriptions in the DDD reference under - http://domainlanguage.com/ddd/reference/'''); - - registerHoverText("Subdomain", '''Subdomain (Core, Supporting, Generic): A subdomain - is a part of the domain. Regarding subdomains we differentiate between Core Domains, Supporting - Subdomains and Generic Subdomains. A bounded context implements parts of one or multiple subdomains. -

Find all DDD pattern descriptions in the DDD reference under - http://domainlanguage.com/ddd/reference/'''); - - registerHoverText("P", '''Partnership (P): The partnership pattern describes an - intimate relationship between two bounded contexts. Their domain models somehow relate and have - to be evolved together. -

Find all DDD pattern descriptions in the DDD reference under - http://domainlanguage.com/ddd/reference/'''); - - registerHoverText("SK", '''Shared Kernel (SK): Desribes an intimate relationship - between two bounded contexts which share a common part of the domain model and manage it as a - common library. -

Find all DDD pattern descriptions in the DDD reference under - http://domainlanguage.com/ddd/reference/'''); - } - -}