Commit 22dcbe7b authored by Filip Reaboi's avatar Filip Reaboi
Browse files

Removed all the code concerned with Use Case.

From the SimpleTrafficLightsExample and STLC Beagle Java Deployment examples
were removed the Use Cases requirements.  
refs 3120
parent 96cf27e0
......@@ -41,42 +41,18 @@
modelElementClass="org.fortiss.af3.mira.model.Requirement">
</modelElementClass>
</modelElementHandler>
<modelElementHandler
handler="org.fortiss.af3.mira.ui.handler.UseCaseHandler">
<modelElementClass
modelElementClass="org.fortiss.af3.mira.model.usecase.UseCase">
</modelElementClass>
</modelElementHandler>
<modelElementHandler
handler="org.fortiss.af3.mira.ui.handler.InterfaceBehaviourHandler">
<modelElementClass
modelElementClass="org.fortiss.af3.mira.model.interfacebehaviour.InterfaceBehaviour">
</modelElementClass>
</modelElementHandler>
<modelElementHandler
handler="org.fortiss.af3.mira.ui.handler.ScenarioHandler">
<modelElementClass
modelElementClass="org.fortiss.af3.mira.model.usecase.Scenario">
</modelElementClass>
</modelElementHandler>
<modelElementHandler
handler="org.fortiss.af3.mira.ui.handler.ScenarioStepHandler">
<modelElementClass
modelElementClass="org.fortiss.af3.mira.model.usecase.ScenarioStep">
</modelElementClass>
</modelElementHandler>
<modelElementHandler
handler="org.fortiss.af3.mira.ui.handler.RequirementSpecificationHandler">
<modelElementClass
modelElementClass="org.fortiss.af3.mira.model.RequirementSpecification">
</modelElementClass>
</modelElementHandler>
<modelElementHandler
handler="org.fortiss.af3.mira.ui.handler.ActorHandler">
<modelElementClass
modelElementClass="org.fortiss.af3.mira.model.usecase.Actor">
</modelElementClass>
</modelElementHandler>
<modelElementHandler
handler="org.fortiss.af3.mira.ui.handler.GlossaryHandler">
<modelElementClass
......@@ -191,12 +167,6 @@
modelElementClass="org.fortiss.af3.mira.model.interfacebehaviour.InterfaceBehaviourSpecification">
</modelElementClass>
</modelElementHandler>
<modelElementHandler
handler="org.fortiss.af3.mira.ui.handler.AspectHandlers$UseCaseSpecificationHandler">
<modelElementClass
modelElementClass="org.fortiss.af3.mira.model.usecase.UseCaseSpecification">
</modelElementClass>
</modelElementHandler>
</extension>
<extension
point="org.fortiss.tooling.kernel.ui.modelEditorBinding">
......@@ -206,12 +176,6 @@
modelElementClass="org.fortiss.af3.mira.model.Requirement">
</modelElementClass>
</modelEditorBinding>
<modelEditorBinding
binding="org.fortiss.af3.mira.ui.editorbinding.UseCaseEditorBinding">
<modelElementClass
modelElementClass="org.fortiss.af3.mira.model.usecase.UseCase">
</modelElementClass>
</modelEditorBinding>
<modelEditorBinding
binding="org.fortiss.af3.mira.ui.editorbinding.SignalRequirementEditorBinding">
<modelElementClass
......@@ -224,12 +188,6 @@
modelElementClass="org.fortiss.af3.mira.model.interfacebehaviour.InterfaceBehaviour">
</modelElementClass>
</modelEditorBinding>
<modelEditorBinding
binding="org.fortiss.af3.mira.ui.editorbinding.ScenarioEditorBinding">
<modelElementClass
modelElementClass="org.fortiss.af3.mira.model.usecase.Scenario">
</modelElementClass>
</modelEditorBinding>
<modelEditorBinding
binding="org.fortiss.af3.mira.ui.editorbinding.GlossaryEntryEditorBindings$GlossaryEntryEditorBinding">
<modelElementClass
......@@ -338,24 +296,12 @@
modelElementClass="org.fortiss.af3.mira.model.Requirement">
</modelElementClass>
</modelEditorBinding>
<modelEditorBinding
binding="org.fortiss.af3.mira.ui.editorbinding.TracesEditorBinding">
<modelElementClass
modelElementClass="org.fortiss.af3.mira.model.usecase.UseCase">
</modelElementClass>
</modelEditorBinding>
<modelEditorBinding
binding="org.fortiss.af3.mira.ui.editorbinding.TracesEditorBinding">
<modelElementClass
modelElementClass="org.fortiss.af3.mira.model.interfacebehaviour.InterfaceBehaviour">
</modelElementClass>
</modelEditorBinding>
<modelEditorBinding
binding="org.fortiss.af3.mira.ui.editorbinding.OtherEditorBinding">
<modelElementClass
modelElementClass="org.fortiss.af3.mira.model.usecase.UseCase">
</modelElementClass>
</modelEditorBinding>
<modelEditorBinding
binding="org.fortiss.af3.mira.ui.editorbinding.OtherEditorBinding">
<modelElementClass
......@@ -374,12 +320,6 @@
modelElementClass="org.fortiss.af3.mira.model.Requirement">
</modelElementClass>
</modelEditorBinding>
<modelEditorBinding
binding="org.fortiss.af3.mira.ui.editorbinding.AspectBindings$UseCaseBinding">
<modelElementClass
modelElementClass="org.fortiss.af3.mira.model.Requirement">
</modelElementClass>
</modelEditorBinding>
<modelEditorBinding
binding="org.fortiss.af3.mira.ui.editorbinding.AspectBindings$InterfaceBehaviourBinding">
<modelElementClass
......
......@@ -25,7 +25,6 @@ import org.eclipse.emf.ecore.EObject;
import org.eclipse.jface.action.ActionContributionItem;
import org.eclipse.jface.action.IContributionItem;
import org.fortiss.af3.mira.model.Analysis;
import org.fortiss.af3.mira.ui.action.ExportReportAction;
import org.fortiss.af3.mira.ui.action.GenerateSignals;
import org.fortiss.tooling.kernel.ui.extension.IContextMenuContributor;
import org.fortiss.tooling.kernel.ui.extension.data.ContextMenuContextProvider;
......@@ -47,8 +46,6 @@ public class MiraContextMenuContributor implements IContextMenuContributor {
Vector<IContributionItem> items = new Vector<IContributionItem>();
items.add(new ActionContributionItem(new GenerateSignals(selection,
getActiveWorkbenchWindow().getShell())));
items.add(new ActionContributionItem(new ExportReportAction(selection,
getActiveWorkbenchWindow().getShell())));
return items;
}
return null;
......
/*-------------------------------------------------------------------------+
| Copyright 2011 fortiss GmbH |
| |
| 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.fortiss.af3.mira.ui.action;
import static org.eclipse.emf.ecore.util.EcoreUtil.create;
import static org.eclipse.jface.dialogs.MessageDialog.openError;
import static org.eclipse.ui.plugin.AbstractUIPlugin.imageDescriptorFromPlugin;
import static org.fortiss.af3.mira.ui.AF3MiraUIActivator.PLUGIN_ID;
import static org.fortiss.af3.mira.ui.utils.SelectionDialogUtils.openStateSingleSelectDialog;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.swt.widgets.Shell;
import org.fortiss.af3.component.model.Component;
import org.fortiss.af3.mira.command.CreateRequirementSpecificationCommand;
import org.fortiss.af3.mira.model.RequirementSpecification;
import org.fortiss.af3.mira.model.usecase.ScopeSpecification;
import org.fortiss.af3.mira.model.usecase.UseCase;
import org.fortiss.af3.state.model.State;
import org.fortiss.tooling.kernel.service.ICommandStackService;
import org.fortiss.tooling.kernel.ui.extension.base.EObjectActionBase;
/**
* Action to connect a condition to a component by requirement specification
*
* @author uden
* @author mou
*/
public class ConnectUseCaseConditionToComponentAction extends EObjectActionBase<UseCase> {
/** The shell for the action. */
private final Shell shell;
/** The {@link EClass} of the requirement specification. */
private final EClass specClass;
/** Constructor. */
public ConnectUseCaseConditionToComponentAction(UseCase editedObject, Shell shell, EClass clazz) {
super("ConnectConditionToComponent", imageDescriptorFromPlugin(PLUGIN_ID,
"icons/sample.png"));
setTarget(editedObject);
this.shell = shell;
this.specClass = clazz;
}
/** {@inheritDoc} */
@Override
public void run() {
ScopeSpecification spec = getTarget().getScopeSpecification();
if(spec == null || !(spec.getSpecificationOf() instanceof Component)) {
openError(shell, "Scope", "Cannot find assigned scope component!");
return;
}
Component scope = (Component)spec.getSpecificationOf();
final State state = openStateSingleSelectDialog(shell, scope.getSpecifications());
if(state == null) {
return;
}
ICommandStackService.getInstance().runAsCommand(
state,
new CreateRequirementSpecificationCommand(getTarget(), state,
(RequirementSpecification)create(specClass), true));
}
}
/*-------------------------------------------------------------------------+
| Copyright 2012 fortiss GmbH |
| |
| 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.fortiss.af3.mira.ui.action;
import static org.fortiss.af3.mira.ui.utils.SelectionDialogUtils.openInputPortsMultiSelectDialog;
import static org.fortiss.af3.mira.utils.MiraModelElementFactory.createInputSpecification;
import java.util.List;
import org.eclipse.swt.widgets.Shell;
import org.fortiss.af3.component.model.Component;
import org.fortiss.af3.component.model.Port;
import org.fortiss.af3.mira.model.RequirementSpecification;
import org.fortiss.af3.mira.model.usecase.UseCase;
/**
* Implementation of {@link ConnectUseCaseToPortsActionBase} for inputs
*
* @author kisslinger
*/
public class ConnectUseCaseInputsToInputPortAction extends ConnectUseCaseToPortsActionBase {
/** Constructor. */
public ConnectUseCaseInputsToInputPortAction(UseCase editedObject, Shell shell) {
super(editedObject, shell);
}
/** {@inheritDoc} */
@Override
protected RequirementSpecification createSpecification() {
return createInputSpecification("", "");
}
/** {@inheritDoc} */
@Override
protected List<? extends RequirementSpecification> getSpecificationsBefore() {
return getTarget().getInputSpecification();
}
/** {@inheritDoc} */
@Override
protected List<? extends Port> openDialog(Component scope, List<Port> selectionBefore) {
return openInputPortsMultiSelectDialog(shell, scope, selectionBefore);
}
}
/*-------------------------------------------------------------------------+
| Copyright 2012 fortiss GmbH |
| |
| 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.fortiss.af3.mira.ui.action;
import static org.fortiss.af3.mira.ui.utils.SelectionDialogUtils.openOutputPortsMultiSelectDialog;
import static org.fortiss.af3.mira.utils.MiraModelElementFactory.createOutputSpecification;
import java.util.List;
import org.eclipse.swt.widgets.Shell;
import org.fortiss.af3.component.model.Component;
import org.fortiss.af3.component.model.OutputPort;
import org.fortiss.af3.component.model.Port;
import org.fortiss.af3.mira.model.RequirementSpecification;
import org.fortiss.af3.mira.model.usecase.OutputSpecification;
import org.fortiss.af3.mira.model.usecase.UseCase;
/**
* Implementation of {@link ConnectUseCaseToPortsActionBase} for outputs
*
* @author kisslinger
*/
public class ConnectUseCaseOutputsToOutputPortAction extends ConnectUseCaseToPortsActionBase {
/** Constructor. */
public ConnectUseCaseOutputsToOutputPortAction(UseCase editedObject, Shell shell) {
super(editedObject, shell);
}
/** {@inheritDoc} */
@Override
protected RequirementSpecification createSpecification() {
return createOutputSpecification("", "");
}
/** {@inheritDoc} */
@Override
protected List<OutputSpecification> getSpecificationsBefore() {
return getTarget().getOutputSpecification();
}
/** {@inheritDoc} */
@Override
protected List<OutputPort> openDialog(Component scope, List<Port> selectionBefore) {
return openOutputPortsMultiSelectDialog(shell, scope, selectionBefore);
}
}
/*-------------------------------------------------------------------------+
| Copyright 2011 fortiss GmbH |
| |
| 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.fortiss.af3.mira.ui.action;
import static org.eclipse.jface.dialogs.MessageDialog.openError;
import static org.eclipse.ui.plugin.AbstractUIPlugin.imageDescriptorFromPlugin;
import static org.fortiss.af3.mira.ui.AF3MiraUIActivator.PLUGIN_ID;
import static org.fortiss.af3.mira.ui.utils.SelectionDialogUtils.openComponentSingleSelectDialog;
import static org.fortiss.af3.mira.utils.MiraModelElementFactory.createScopeSpecification;
import org.eclipse.emf.common.util.EList;
import org.eclipse.swt.widgets.Shell;
import org.fortiss.af3.component.model.Component;
import org.fortiss.af3.component.model.ComponentArchitecture;
import org.fortiss.af3.mira.command.CreateRequirementSpecificationCommand;
import org.fortiss.af3.mira.model.usecase.ScopeSpecification;
import org.fortiss.af3.mira.model.usecase.UseCase;
import org.fortiss.tooling.kernel.service.ICommandStackService;
import org.fortiss.tooling.kernel.ui.extension.base.EObjectActionBase;
/**
* Action to connect scope to a component by using {@link ScopeSpecification}
*
* @author uden
*/
public final class ConnectUseCaseScopeToComponentAction extends EObjectActionBase<UseCase> {
/** The default shell */
private final Shell shell;
/** Constructor. */
public ConnectUseCaseScopeToComponentAction(UseCase editedObject, Shell shell) {
super("ConnectScopeToComponent", imageDescriptorFromPlugin(PLUGIN_ID, "icons/sample.png"));
setTarget(editedObject);
this.shell = shell;
}
/** {@inheritDoc} */
@Override
public void run() {
EList<ComponentArchitecture> arch =
getTarget().getAnalysis().getAssociatedComponentArchitectures();
if(arch == null) {
openError(shell, "Component Architecture", "Cannot find Component Architecture!");
return;
}
Component selected = null;
ScopeSpecification spec = getTarget().getScopeSpecification();
if(spec != null && spec.getSpecificationOf() instanceof Component) {
selected = (Component)spec.getSpecificationOf();
}
final Component component =
(Component)openComponentSingleSelectDialog(shell.getShell(), arch, selected);
if(component == null || component == selected) {
return;
}
ICommandStackService.getInstance().runAsCommand(
component,
new CreateRequirementSpecificationCommand(getTarget(), component,
createScopeSpecification("", ""), true));
}
}
/*-------------------------------------------------------------------------+
| Copyright 2012 fortiss GmbH |
| |
| 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.fortiss.af3.mira.ui.action;
import static org.eclipse.emf.ecore.util.EcoreUtil.delete;
import static org.eclipse.jface.dialogs.MessageDialog.openError;
import java.util.ArrayList;
import java.util.List;
import org.eclipse.swt.widgets.Shell;
import org.fortiss.af3.component.model.Component;
import org.fortiss.af3.component.model.Port;
import org.fortiss.af3.mira.command.CreateRequirementSpecificationCommand;
import org.fortiss.af3.mira.model.RequirementSpecification;
import org.fortiss.af3.mira.model.usecase.ScopeSpecification;
import org.fortiss.af3.mira.model.usecase.UseCase;
import org.fortiss.tooling.kernel.service.ICommandStackService;
import org.fortiss.tooling.kernel.ui.extension.base.EObjectActionBase;
/**
* Base class for the actions which connect either the inputs or outputs of a requirement to
* input/output ports of its scope component
*
* @author kisslinger
*/
public abstract class ConnectUseCaseToPortsActionBase extends EObjectActionBase<UseCase> {
/** The default shell. */
protected final Shell shell;
/** Constructor. */
public ConnectUseCaseToPortsActionBase(UseCase editedObject, Shell shell) {
super("ConnectUseCaseToPortsActionBase");
this.shell = shell;
setTarget(editedObject);
}
/**
* Opens a dialog to select ports and returns the selected ports as list.
*
* @param scope
* Component from which ports can be selected
* @param selectionBefore
* Ports which should be shown as selected when the dialog is opened
* @return returns the selected ports as list
*/
protected abstract List<? extends Port> openDialog(Component scope, List<Port> selectionBefore);
/**
* Returns the relevant specifications already attached to the requirement in order to
* pre-select the corresponding ports in the dialog.
*/
protected abstract List<? extends RequirementSpecification> getSpecificationsBefore();
/** Creates a new {@link RequirementSpecification} of the correct type. */
protected abstract RequirementSpecification createSpecification();
/** {@inheritDoc} */
@Override
public void run() {
// get scope component of requirement
ScopeSpecification scopeSpec = getTarget().getScopeSpecification();
if(scopeSpec == null || !(scopeSpec.getSpecificationOf() instanceof Component)) {
openError(shell, "Scope", "Cannot find assigned scope component!");
return;
}
Component scope = (Component)scopeSpec.getSpecificationOf();
List<Port> selectionBefore = new ArrayList<Port>();
List<? extends RequirementSpecification> specificationsBefore = getSpecificationsBefore();
for(RequirementSpecification spec : specificationsBefore)
selectionBefore.add((Port)spec.getSpecificationOf());
List<? extends Port> selectedPortsAfter = openDialog(scope, selectionBefore);
if(selectedPortsAfter != null) {
// remove elements no longer contained
for(RequirementSpecification spec : specificationsBefore) {
if(!selectedPortsAfter.contains(spec.getSpecificationOf())) {
ICommandStackService.getInstance().runAsCommand(spec.getSpecificationOf(),
() -> {
delete(spec);
});
}
}
// add elements not contained before
for(Port port : selectedPortsAfter) {
if(!selectionBefore.contains(port)) {
ICommandStackService.getInstance().runAsCommand(
port,
new CreateRequirementSpecificationCommand(getTarget(), port,
createSpecification(), false));
}
}
}
}
}
/*-------------------------------------------------------------------------+
| Copyright 2011 fortiss GmbH |
| |
| 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.fortiss.af3.mira.ui.action;
import static org.eclipse.jface.dialogs.MessageDialog.openError;
import static org.eclipse.ui.plugin.AbstractUIPlugin.imageDescriptorFromPlugin;
import static org.fortiss.af3.mira.ui.AF3MiraUIActivator.PLUGIN_ID;
import static org.fortiss.af3.mira.ui.utils.SelectionDialogUtils.openInputPortSelectDialog;
import static org.fortiss.af3.mira.utils.MiraModelElementFactory.createTriggerSpecification;
import org.eclipse.swt.widgets.Shell;
import org.fortiss.af3.component.model.Component;
import org.fortiss.af3.component.model.InputPort;
import org.fortiss.af3.mira.command.CreateRequirementSpecificationCommand;
import org.fortiss.af3.mira.model.usecase.ScopeSpecification;
import org.fortiss.af3.mira.model.usecase.TriggerSpecification;
import org.fortiss.af3.mira.model.usecase.UseCase;