-
-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
First transformation on stakeholders (PoC)
- Loading branch information
Showing
6 changed files
with
316 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
...i/src/org/contextmapper/dsl/ui/handler/stakeholders/MoveStakeholderToNewGroupHandler.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/* | ||
* 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() { | ||
EObject obj = getSelectedElement(); | ||
|
||
if (obj == null || !super.isEnabled()) | ||
return false; | ||
|
||
return (obj instanceof Stakeholder); | ||
} | ||
|
||
} |
68 changes: 37 additions & 31 deletions
68
org.contextmapper.dsl/.launch/LaunchRuntimeEclipse.launch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,40 @@ | ||
<?xml version="1.0" encoding="UTF-8" standalone="no"?> | ||
<launchConfiguration type="org.eclipse.pde.ui.RuntimeWorkbench"> | ||
<booleanAttribute key="append.args" value="true"/> | ||
<booleanAttribute key="askclear" value="true"/> | ||
<booleanAttribute key="automaticAdd" value="true"/> | ||
<booleanAttribute key="automaticValidate" value="false"/> | ||
<stringAttribute key="bad_container_name" value="/org.contextmapper.dsl/.launch/"/> | ||
<stringAttribute key="bootstrap" value=""/> | ||
<stringAttribute key="checked" value="[NONE]"/> | ||
<booleanAttribute key="clearConfig" value="false"/> | ||
<booleanAttribute key="clearws" value="false"/> | ||
<booleanAttribute key="clearwslog" value="false"/> | ||
<stringAttribute key="configLocation" value="${workspace_loc}/.metadata/.plugins/org.eclipse.pde.core/Launch Runtime Eclipse"/> | ||
<booleanAttribute key="default" value="true"/> | ||
<booleanAttribute key="includeOptional" value="true"/> | ||
<stringAttribute key="location" value="${workspace_loc}/../runtime-EclipseXtext"/> | ||
<listAttribute key="org.eclipse.debug.ui.favoriteGroups"> | ||
<listEntry value="org.eclipse.debug.ui.launchGroup.debug"/> | ||
<listEntry value="org.eclipse.debug.ui.launchGroup.run"/> | ||
</listAttribute> | ||
<stringAttribute key="org.eclipse.jdt.launching.JRE_CONTAINER" value="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-11"/> | ||
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-os ${target.os} -ws ${target.ws} -arch ${target.arch} -nl ${target.nl}"/> | ||
<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.pde.ui.workbenchClasspathProvider"/> | ||
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Xms40m -Xmx512m"/> | ||
<stringAttribute key="pde.version" value="3.3"/> | ||
<stringAttribute key="product" value="org.eclipse.platform.ide"/> | ||
<booleanAttribute key="show_selected_only" value="false"/> | ||
<stringAttribute key="templateConfig" value="${target_home}/configuration/config.ini"/> | ||
<booleanAttribute key="tracing" value="false"/> | ||
<booleanAttribute key="useDefaultConfig" value="true"/> | ||
<booleanAttribute key="useDefaultConfigArea" value="true"/> | ||
<booleanAttribute key="useProduct" value="true"/> | ||
<booleanAttribute key="usefeatures" value="false"/> | ||
<booleanAttribute key="append.args" value="true"/> | ||
<booleanAttribute key="askclear" value="true"/> | ||
<booleanAttribute key="automaticAdd" value="true"/> | ||
<booleanAttribute key="automaticValidate" value="false"/> | ||
<stringAttribute key="bad_container_name" value="/org.contextmapper.dsl/.launch/"/> | ||
<stringAttribute key="bootstrap" value=""/> | ||
<stringAttribute key="checked" value="[NONE]"/> | ||
<booleanAttribute key="clearConfig" value="false"/> | ||
<booleanAttribute key="clearws" value="false"/> | ||
<booleanAttribute key="clearwslog" value="false"/> | ||
<stringAttribute key="configLocation" value="${workspace_loc}/.metadata/.plugins/org.eclipse.pde.core/LaunchRuntimeEclipse"/> | ||
<booleanAttribute key="default" value="true"/> | ||
<booleanAttribute key="includeOptional" value="true"/> | ||
<stringAttribute key="location" value="${workspace_loc}/../runtime-EclipseXtext"/> | ||
<booleanAttribute key="org.eclipse.debug.core.ATTR_FORCE_SYSTEM_CONSOLE_ENCODING" value="false"/> | ||
<mapAttribute key="org.eclipse.debug.core.environmentVariables"> | ||
<mapEntry key="WEBKIT_DISABLE_DMABUF_RENDERER" value="1"/> | ||
</mapAttribute> | ||
<listAttribute key="org.eclipse.debug.ui.favoriteGroups"> | ||
<listEntry value="org.eclipse.debug.ui.launchGroup.debug"/> | ||
<listEntry value="org.eclipse.debug.ui.launchGroup.run"/> | ||
</listAttribute> | ||
<booleanAttribute key="org.eclipse.jdt.launching.ATTR_ATTR_USE_ARGFILE" value="false"/> | ||
<stringAttribute key="org.eclipse.jdt.launching.JRE_CONTAINER" value="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-11"/> | ||
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-os ${target.os} -ws ${target.ws} -arch ${target.arch} -nl ${target.nl}"/> | ||
<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.pde.ui.workbenchClasspathProvider"/> | ||
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Xms40m -Xmx512m"/> | ||
<stringAttribute key="pde.version" value="3.3"/> | ||
<stringAttribute key="product" value="org.eclipse.platform.ide"/> | ||
<booleanAttribute key="show_selected_only" value="false"/> | ||
<stringAttribute key="templateConfig" value="${target_home}/configuration/config.ini"/> | ||
<booleanAttribute key="tracing" value="false"/> | ||
<booleanAttribute key="useCustomFeatures" value="false"/> | ||
<booleanAttribute key="useDefaultConfig" value="true"/> | ||
<booleanAttribute key="useDefaultConfigArea" value="true"/> | ||
<booleanAttribute key="useProduct" value="true"/> | ||
<booleanAttribute key="usefeatures" value="false"/> | ||
</launchConfiguration> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.