From b92f54b13e6f30afd299c766e148e58664f5a071 Mon Sep 17 00:00:00 2001 From: Stefano Puri <stefano.puri@intecs.it> Date: Mon, 19 Feb 2018 10:49:41 +0100 Subject: [PATCH] the plugin has been moved under the plugins foldewr --- org.polarsys.chess.smvExport/.classpath | 7 - org.polarsys.chess.smvExport/.gitignore | 1 - org.polarsys.chess.smvExport/.project | 28 --- .../.settings/org.eclipse.jdt.core.prefs | 7 - .../META-INF/MANIFEST.MF | 19 -- org.polarsys.chess.smvExport/build.properties | 5 - org.polarsys.chess.smvExport/plugin.xml | 41 ---- .../ExportNominalSMsToSmvFilesCommand.java | 48 ---- ...rtSelectedNominalSMsToSmvFilesCommand.java | 49 ---- .../smvExport/model/UMLStateMachineModel.java | 216 ------------------ .../smvExport/services/SmvExportService.java | 97 -------- 11 files changed, 518 deletions(-) delete mode 100644 org.polarsys.chess.smvExport/.classpath delete mode 100644 org.polarsys.chess.smvExport/.gitignore delete mode 100644 org.polarsys.chess.smvExport/.project delete mode 100644 org.polarsys.chess.smvExport/.settings/org.eclipse.jdt.core.prefs delete mode 100644 org.polarsys.chess.smvExport/META-INF/MANIFEST.MF delete mode 100644 org.polarsys.chess.smvExport/build.properties delete mode 100644 org.polarsys.chess.smvExport/plugin.xml delete mode 100644 org.polarsys.chess.smvExport/src/org/polarsys/chess/smvExport/commands/ExportNominalSMsToSmvFilesCommand.java delete mode 100644 org.polarsys.chess.smvExport/src/org/polarsys/chess/smvExport/commands/ExportSelectedNominalSMsToSmvFilesCommand.java delete mode 100644 org.polarsys.chess.smvExport/src/org/polarsys/chess/smvExport/model/UMLStateMachineModel.java delete mode 100644 org.polarsys.chess.smvExport/src/org/polarsys/chess/smvExport/services/SmvExportService.java diff --git a/org.polarsys.chess.smvExport/.classpath b/org.polarsys.chess.smvExport/.classpath deleted file mode 100644 index b862a296d..000000000 --- a/org.polarsys.chess.smvExport/.classpath +++ /dev/null @@ -1,7 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<classpath> - <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/> - <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> - <classpathentry kind="src" path="src"/> - <classpathentry kind="output" path="bin"/> -</classpath> diff --git a/org.polarsys.chess.smvExport/.gitignore b/org.polarsys.chess.smvExport/.gitignore deleted file mode 100644 index ae3c17260..000000000 --- a/org.polarsys.chess.smvExport/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/bin/ diff --git a/org.polarsys.chess.smvExport/.project b/org.polarsys.chess.smvExport/.project deleted file mode 100644 index 1a3d40d0d..000000000 --- a/org.polarsys.chess.smvExport/.project +++ /dev/null @@ -1,28 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<projectDescription> - <name>org.polarsys.chess.smvExport</name> - <comment></comment> - <projects> - </projects> - <buildSpec> - <buildCommand> - <name>org.eclipse.jdt.core.javabuilder</name> - <arguments> - </arguments> - </buildCommand> - <buildCommand> - <name>org.eclipse.pde.ManifestBuilder</name> - <arguments> - </arguments> - </buildCommand> - <buildCommand> - <name>org.eclipse.pde.SchemaBuilder</name> - <arguments> - </arguments> - </buildCommand> - </buildSpec> - <natures> - <nature>org.eclipse.pde.PluginNature</nature> - <nature>org.eclipse.jdt.core.javanature</nature> - </natures> -</projectDescription> diff --git a/org.polarsys.chess.smvExport/.settings/org.eclipse.jdt.core.prefs b/org.polarsys.chess.smvExport/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index 295926d96..000000000 --- a/org.polarsys.chess.smvExport/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,7 +0,0 @@ -eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 -org.eclipse.jdt.core.compiler.compliance=1.8 -org.eclipse.jdt.core.compiler.problem.assertIdentifier=error -org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.source=1.8 diff --git a/org.polarsys.chess.smvExport/META-INF/MANIFEST.MF b/org.polarsys.chess.smvExport/META-INF/MANIFEST.MF deleted file mode 100644 index cf4887323..000000000 --- a/org.polarsys.chess.smvExport/META-INF/MANIFEST.MF +++ /dev/null @@ -1,19 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Bundle-Name: SmvExport -Bundle-SymbolicName: org.polarsys.chess.smvExport;singleton:=true -Bundle-Version: 1.0.0.qualifier -Bundle-RequiredExecutionEnvironment: JavaSE-1.8 -Bundle-Vendor: Fondazione Bruno Kessler -Require-Bundle: org.eclipse.papyrus.infra.gmfdiag.common, - eu.fbk.eclipse.standardtools.utils, - org.polarsys.chess.service, - org.eclipse.uml2.uml, - org.polarsys.chess.contracts.profile;bundle-version="0.9.0", - eu.fbk.eclipse.standardtools.StateMachineTranslatorToSmv;bundle-version="1.0.0", - org.eclipse.papyrus.uml.tools, - org.eclipse.core.resources, - org.polarsys.chess.core, - org.eclipse.papyrus.cdo.core -Import-Package: org.apache.log4j -Export-Package: org.polarsys.chess.smvExport.services diff --git a/org.polarsys.chess.smvExport/build.properties b/org.polarsys.chess.smvExport/build.properties deleted file mode 100644 index 6f20375d6..000000000 --- a/org.polarsys.chess.smvExport/build.properties +++ /dev/null @@ -1,5 +0,0 @@ -source.. = src/ -output.. = bin/ -bin.includes = META-INF/,\ - .,\ - plugin.xml diff --git a/org.polarsys.chess.smvExport/plugin.xml b/org.polarsys.chess.smvExport/plugin.xml deleted file mode 100644 index 8891cbcf1..000000000 --- a/org.polarsys.chess.smvExport/plugin.xml +++ /dev/null @@ -1,41 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<?eclipse version="3.4"?> -<plugin> - <extension - point="org.eclipse.ui.commands"> - <command - defaultHandler="org.polarsys.chess.smvExport.commands.ExportNominalSMsToSmvFilesCommand" - id="org.polarsys.chess.smvExport.commands.ExportNominalSMsToSmvFilesCommand" - name="Export state machines as .smv files"> - </command> - <command - defaultHandler="org.polarsys.chess.smvExport.commands.ExportSelectedNominalSMsToSmvFilesCommand" - id="org.polarsys.chess.smvExport.commands.ExportSelectedNominalSMsToSmvFilesCommand" - name="Export state machines of Selected Component as .smv files"> - </command> - </extension> - <extension - point="org.eclipse.ui.menus"> - <menuContribution - allPopups="false" - locationURI="menu:org.eclipse.ui.main.menu.CHESS.basicOperation"> - <command - commandId="org.polarsys.chess.smvExport.commands.ExportNominalSMsToSmvFilesCommand" - style="push"> - </command> - </menuContribution> - <menuContribution - allPopups="false" - locationURI="popup:org.polarsys.chess.modelexplorerpopupmenu.id"> - <menu - id="org.eclipse.ui.main.diagramEditorMenu.CHESS.basicOperations" - label="Basic Operations"> - <command - commandId="org.polarsys.chess.smvExport.commands.ExportSelectedNominalSMsToSmvFilesCommand" - style="push"> - </command> - </menu> - </menuContribution> - </extension> - -</plugin> diff --git a/org.polarsys.chess.smvExport/src/org/polarsys/chess/smvExport/commands/ExportNominalSMsToSmvFilesCommand.java b/org.polarsys.chess.smvExport/src/org/polarsys/chess/smvExport/commands/ExportNominalSMsToSmvFilesCommand.java deleted file mode 100644 index b1331f458..000000000 --- a/org.polarsys.chess.smvExport/src/org/polarsys/chess/smvExport/commands/ExportNominalSMsToSmvFilesCommand.java +++ /dev/null @@ -1,48 +0,0 @@ -/******************************************************************************* - * Copyright (C) 2017 Fondazione Bruno Kessler. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Alberto Debiasi - initial API and implementation - ******************************************************************************/ -package org.polarsys.chess.smvExport.commands; - -import org.eclipse.core.commands.ExecutionEvent; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.papyrus.uml.tools.model.UmlModel; -import org.eclipse.papyrus.uml.tools.model.UmlUtils; -import org.polarsys.chess.service.utils.DialogUtils; -import org.polarsys.chess.smvExport.services.SmvExportService; -import eu.fbk.eclipse.standardtools.commands.AbstractJobCommand; - -public class ExportNominalSMsToSmvFilesCommand extends AbstractJobCommand { - - private DialogUtils exportDialogUtils = DialogUtils.getInstance(); - private SmvExportService smvExportService = SmvExportService.getInstance(); - - public ExportNominalSMsToSmvFilesCommand() { - super("Export Nominal State Machines To .smv Files"); - } - - private String outputDirectoryName; - private boolean showPopups; - private UmlModel umlModel; - - @Override - public void execPreJobOperations(ExecutionEvent event, IProgressMonitor monitor) throws Exception { - - outputDirectoryName = exportDialogUtils.getDirectoryNameFromDialog(); - showPopups = true; - umlModel = UmlUtils.getUmlModel(); - } - - @Override - public void execJobCommand(ExecutionEvent event, IProgressMonitor monitor) throws Exception { - smvExportService.exportAllNominalStateMachinesOfTheModel(umlModel, outputDirectoryName, showPopups, monitor); - - } - -} diff --git a/org.polarsys.chess.smvExport/src/org/polarsys/chess/smvExport/commands/ExportSelectedNominalSMsToSmvFilesCommand.java b/org.polarsys.chess.smvExport/src/org/polarsys/chess/smvExport/commands/ExportSelectedNominalSMsToSmvFilesCommand.java deleted file mode 100644 index 85697b492..000000000 --- a/org.polarsys.chess.smvExport/src/org/polarsys/chess/smvExport/commands/ExportSelectedNominalSMsToSmvFilesCommand.java +++ /dev/null @@ -1,49 +0,0 @@ -/******************************************************************************* - * Copyright (C) 2017 Fondazione Bruno Kessler. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Alberto Debiasi - initial API and implementation - ******************************************************************************/ -package org.polarsys.chess.smvExport.commands; - -import org.eclipse.core.commands.ExecutionEvent; -import org.eclipse.core.runtime.IProgressMonitor; -import org.polarsys.chess.service.utils.DialogUtils; -import org.polarsys.chess.service.utils.SelectionUtil; -import org.polarsys.chess.smvExport.services.SmvExportService; -import eu.fbk.eclipse.standardtools.commands.AbstractJobCommand; -import org.eclipse.uml2.uml.Class; - -public class ExportSelectedNominalSMsToSmvFilesCommand extends AbstractJobCommand { - - private SelectionUtil selectionUtil = SelectionUtil.getInstance(); - private DialogUtils dialogUtils = DialogUtils.getInstance(); - private SmvExportService smvExportService = SmvExportService.getInstance(); - - public ExportSelectedNominalSMsToSmvFilesCommand() { - super("Export Nominal State Machines To .smv Files"); - } - - private Class umlSelectedComponent; - private String outputDirectoryName; - private boolean showPopups; - - @Override - public void execPreJobOperations(ExecutionEvent event, IProgressMonitor monitor) throws Exception { - - umlSelectedComponent = selectionUtil.getUmlComponentFromSelectedObject(event); - outputDirectoryName = dialogUtils.getDirectoryNameFromDialog(); - showPopups = true; - - } - - @Override - public void execJobCommand(ExecutionEvent event, IProgressMonitor monitor) throws Exception { - smvExportService.exportNominalStateMachines(umlSelectedComponent, outputDirectoryName, showPopups, monitor); - } - -} diff --git a/org.polarsys.chess.smvExport/src/org/polarsys/chess/smvExport/model/UMLStateMachineModel.java b/org.polarsys.chess.smvExport/src/org/polarsys/chess/smvExport/model/UMLStateMachineModel.java deleted file mode 100644 index a22a3894d..000000000 --- a/org.polarsys.chess.smvExport/src/org/polarsys/chess/smvExport/model/UMLStateMachineModel.java +++ /dev/null @@ -1,216 +0,0 @@ -/******************************************************************************* - * Copyright (C) 2017 Fondazione Bruno Kessler. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Alberto Debiasi - initial API and implementation - ******************************************************************************/ -package org.polarsys.chess.smvExport.model; - -import java.util.Set; - -import org.eclipse.emf.common.util.BasicEList; -import org.eclipse.emf.common.util.EList; -import org.eclipse.papyrus.sysml.portandflows.FlowDirection; -import org.eclipse.papyrus.uml.tools.model.UmlModel; -import org.eclipse.uml2.uml.Constraint; -import org.eclipse.uml2.uml.Element; -import org.eclipse.uml2.uml.Port; -import org.eclipse.uml2.uml.Property; -import org.eclipse.uml2.uml.StateMachine; -import org.eclipse.uml2.uml.Transition; -import org.eclipse.uml2.uml.Type; -import org.eclipse.uml2.uml.Vertex; -import org.polarsys.chess.contracts.profile.chesscontract.util.EntityUtil; - -import eu.fbk.eclipse.standardtools.StateMachineTranslatorToSmv.stateMachineModel.AbstractStateMachineModel; - -public class UMLStateMachineModel implements AbstractStateMachineModel { - - private static UMLStateMachineModel umlStateMachineModel; - private EntityUtil entityUtil = EntityUtil.getInstance(); - - public static UMLStateMachineModel getInstance() { - if (umlStateMachineModel == null) { - umlStateMachineModel = new UMLStateMachineModel(); - } - return umlStateMachineModel; - } - - @Override - public EList<Port> getOwnerInputPortsExceptEvents(Object stateMachine) { - Element owner = ((StateMachine) stateMachine).getOwner(); - return new BasicEList<Port>(entityUtil.getUmlPortsExceptEvents(owner, FlowDirection.IN_VALUE)); - } - - @Override - public EList<Port> getOwnerOutputPortsExceptEvents(Object stateMachine) { - Element owner = ((StateMachine) stateMachine).getOwner(); - return new BasicEList<Port>(entityUtil.getUmlPortsExceptEvents(owner, FlowDirection.OUT_VALUE)); - } - - @Override - public EList<Element> getOwnerAttributes(Object stateMachine) { - Element owner = ((StateMachine) stateMachine).getOwner(); - return new BasicEList<Element>(entityUtil.getAttributesExceptPorts(owner)); - } - - @Override - public EList<String> getTransitionsNameList(Object stateMachine) throws Exception { - return entityUtil.getTransitionNameList(entityUtil.getTranstitions((StateMachine) stateMachine)); - } - - @Override - public EList<String> getEventsNameList(Object stateMachine) { - EList<Port> events = entityUtil.getEventPorts(((StateMachine) stateMachine).getOwner()); - - return (entityUtil.getPortsName(events)); - } - - @Override - public String getStateMachineName(Object stateMachine) { - return (entityUtil.getStateMachineName((StateMachine) stateMachine)); - } - - @Override - public EList<Transition> getStartTransitions(Object stateMachine) throws Exception { - return entityUtil.getInitialTransitions((StateMachine) stateMachine); - } - - @Override - public EList<Transition> getNonStartTransitions(Object stateMachine) { - return entityUtil.getNonInitialTransitions((StateMachine) stateMachine); - } - - @Override - public EList<String> getIntermediateStatesNameList(Object stateMachine) { - EList<Vertex> states = entityUtil.getIntermediateStates((StateMachine) stateMachine); - return entityUtil.getStatesNameList(states); - } - - @Override - public String getTransitionName(Object transition) { - return entityUtil.getTransitionName((Transition) transition); - } - - @Override - public String getTransitionNextStateName(Object transition) { - Vertex nextState = entityUtil.getTransitionNextState((Transition) transition); - return entityUtil.getStateName(nextState); - } - - @Override - public String getTransitionStartStateName(Object transition) { - Vertex sourceState = entityUtil.getTransitionSourceState((Transition) transition); - return entityUtil.getStateName(sourceState); - } - - @Override - public EList<String> getTransitionEventsName(Object transition) { - EList<Port> events = entityUtil.getTransitionEvents((Transition) transition); - if (events != null) { - return entityUtil.getPortsName(events); - } - return null; - } - - @Override - public String getTransitionGuardCondition(Object transition) { - Constraint condition = entityUtil.getTransitionGuard((Transition) transition); - if (condition != null) { - return entityUtil.getConditionExpression(condition); - } - return null; - } - - @Override - public boolean isFinalTransition(Object transition) { - return entityUtil.isFinalTransition((Transition) transition); - - } - - @Override - public boolean isTransitionWithNoEvent(Object transition) { - return entityUtil.isTransitionWithNoEvent((Transition) transition); - } - - @Override - public String getVariableName(Object variable) { - return ((Property) variable).getName(); - } - - @Override - public Object getVariableType(Object variable) { - return entityUtil.getUmlType((Property) variable); - } - - @Override - public boolean isBooleanType(Object type) { - return entityUtil.isBooleanType((Type) type); - } - - @Override - public boolean isIntegerType(Object type) { - return entityUtil.isIntegerType((Type) type); - } - - @Override - public boolean isRealType(Object type) { - return entityUtil.isRealType((Type) type); - } - - @Override - public boolean isIntervalType(Object type) { - return entityUtil.isRangeType((Type) type); - } - - @Override - public String[] getLowHighIntervalType(Object type) { - return entityUtil.getLowerUpperBoundsForRangeType((Type) type); - } - - @Override - public EList<String> getEnumValues(Object type) { - return new BasicEList<String>(entityUtil.getListValuesForEnumeratorType((Type) type)); - } - - @Override - public boolean isEnumType(Object type) { - return entityUtil.isEnumerationType((Type) type); - } - - @Override - public String getStateMachineOwnerName(Object stateMachine) { - return ((org.eclipse.uml2.uml.Class) entityUtil.getOwner((StateMachine) stateMachine)).getName(); - } - - @Override - public String getTransitionEffectText(Object transition) { - return entityUtil.getTransitionEffectText((Transition) transition); - } - - @Override - public Set<StateMachine> getNominalStateMachinesIncludingFromSubComponents(Object umlSelectedComponent) { - return entityUtil.getNominalStateMachines((org.eclipse.uml2.uml.Class) umlSelectedComponent, true); - } - - @Override - public Set<StateMachine> getAllStateMachinesFromModel(Object model) { - return entityUtil.getNominalStateMachines((UmlModel) model); - } - - @Override - public Object getFirstNominalStateMachine(Object umlSelectedComponent) { - return entityUtil.getFirstNominalStateMachine((org.eclipse.uml2.uml.Class) umlSelectedComponent); - } - - @Override - public Object getStateMachineOwner(Object stateMachine) { - return entityUtil.getOwner((StateMachine) stateMachine); - - } - -} diff --git a/org.polarsys.chess.smvExport/src/org/polarsys/chess/smvExport/services/SmvExportService.java b/org.polarsys.chess.smvExport/src/org/polarsys/chess/smvExport/services/SmvExportService.java deleted file mode 100644 index 2af1d7690..000000000 --- a/org.polarsys.chess.smvExport/src/org/polarsys/chess/smvExport/services/SmvExportService.java +++ /dev/null @@ -1,97 +0,0 @@ -/******************************************************************************* - * Copyright (C) 2017 Fondazione Bruno Kessler. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Alberto Debiasi - initial API and implementation - ******************************************************************************/ -package org.polarsys.chess.smvExport.services; - -import java.io.File; -import java.util.HashMap; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.emf.common.util.EList; -import org.eclipse.papyrus.uml.tools.model.UmlModel; -import org.eclipse.uml2.uml.Class; -import org.eclipse.uml2.uml.Property; -import org.polarsys.chess.service.internal.model.ChessSystemModel; -import org.polarsys.chess.smvExport.model.UMLStateMachineModel; -import eu.fbk.eclipse.standardtools.StateMachineTranslatorToSmv.services.SMVTranslatorService; -import eu.fbk.eclipse.standardtools.utils.DialogUtil; - -public class SmvExportService { - - private static SmvExportService instance; -private ChessSystemModel chessSystemModel = ChessSystemModel.getInstance(); - - private SMVTranslatorService smvTranslatorService = SMVTranslatorService.getInstance(chessSystemModel, - UMLStateMachineModel.getInstance()); - private DialogUtil dialogUtil = DialogUtil.getInstance(); - - public static SmvExportService getInstance() { - if (instance == null) { - instance = new SmvExportService(); - } - return instance; - } - - public void exportAllNominalStateMachinesOfTheModel(UmlModel umlModel, String selectedDirectory, boolean showPopups, - IProgressMonitor monitor) throws Exception { - - System.out.println("umlModel: " + umlModel); - smvTranslatorService.exportAllNominalStateMachinesOfTheModel(umlModel, selectedDirectory, null, monitor); - - if (showPopups) { - dialogUtil.showMessage_ExportNominalStateMachinesDone(selectedDirectory); - } - - } - - public void exportNominalStateMachines(Class umlSelectedComponent, String selectedDirectory, boolean showPopups, - IProgressMonitor monitor) throws Exception { - - smvTranslatorService.exportNominalStateMachines(umlSelectedComponent, selectedDirectory, null, monitor); - - if (showPopups) { - dialogUtil.showMessage_ExportNominalStateMachinesDone(selectedDirectory); - } - - } - - public String exportSingleSmv(Class umlSelectedComponent, boolean showPopups, String selectedDirectory, - IProgressMonitor monitor) throws Exception { - - File smvFile = smvTranslatorService.exportSingleSmv(umlSelectedComponent, showPopups, selectedDirectory, - monitor); - - if (showPopups) { - dialogUtil.showMessage_ExportBehaviourDone(smvFile.getAbsolutePath()); - } - - return smvFile.getPath(); - - } - - public HashMap<String, String> exportSmv(Class umlSelectedComponent, boolean showPopups, String selectedDirectory, - IProgressMonitor monitor) throws Exception { - - HashMap<String, String> mapSmvFile_ComponentName = smvTranslatorService.exportSmv(umlSelectedComponent, - selectedDirectory, monitor); - - if (showPopups) { - dialogUtil.showMessage_ExportBehaviourDone(selectedDirectory); - } - - return mapSmvFile_ComponentName; - - } - - public boolean isLeafComponent(Class umlSelectedComponent){ - EList<Property> subComponents = chessSystemModel.getSubComponentsInstances(umlSelectedComponent); - return ((subComponents==null)||(subComponents.size()==0)); - } - -} -- GitLab