Search in sources :

Example 1 with ChooseName4NewBoundedContextContext

use of org.contextmapper.dsl.ui.handler.wizard.ChooseName4NewBoundedContextContext in project context-mapper-dsl by ContextMapper.

the class ExtractSuggestedServiceRefactoringHandler method executeRefactoring.

@Override
protected void executeRefactoring(CMLResource resource, ExecutionEvent event) {
    BoundedContext bc = (BoundedContext) getSelectedElement();
    ChooseName4NewBoundedContextContext refactoringContext = new ChooseName4NewBoundedContextContext("NewBoundedContext");
    originalCMLResource = getAllResources().getResource(new ExtractSuggestedService(bc, "TempBC").constructOriginalModelUri(), false);
    if (originalCMLResource == null)
        throw new ContextMapperApplicationException("We were not able to find the original CML model. Please do not rename the models after generating service cut suggestions.");
    new WizardDialog(HandlerUtil.getActiveShell(event), new ChooseName4NewBoundedContextWizard(refactoringContext, executionContext -> {
        return finishRefactoring(new ExtractSuggestedService(bc, executionContext.getNewBoundedContextName()), new CMLResource(originalCMLResource), event);
    })).open();
}
Also used : ExtractSuggestedService(org.contextmapper.dsl.refactoring.ExtractSuggestedService) ContextMapperApplicationException(org.contextmapper.dsl.exception.ContextMapperApplicationException) ChooseName4NewBoundedContextContext(org.contextmapper.dsl.ui.handler.wizard.ChooseName4NewBoundedContextContext) ChooseName4NewBoundedContextWizard(org.contextmapper.dsl.ui.handler.wizard.ChooseName4NewBoundedContextWizard) CMLResource(org.contextmapper.dsl.cml.CMLResource) BoundedContext(org.contextmapper.dsl.contextMappingDSL.BoundedContext) WizardDialog(org.eclipse.jface.wizard.WizardDialog)

Aggregations

CMLResource (org.contextmapper.dsl.cml.CMLResource)1 BoundedContext (org.contextmapper.dsl.contextMappingDSL.BoundedContext)1 ContextMapperApplicationException (org.contextmapper.dsl.exception.ContextMapperApplicationException)1 ExtractSuggestedService (org.contextmapper.dsl.refactoring.ExtractSuggestedService)1 ChooseName4NewBoundedContextContext (org.contextmapper.dsl.ui.handler.wizard.ChooseName4NewBoundedContextContext)1 ChooseName4NewBoundedContextWizard (org.contextmapper.dsl.ui.handler.wizard.ChooseName4NewBoundedContextWizard)1 WizardDialog (org.eclipse.jface.wizard.WizardDialog)1