use of de.uka.ipd.sdq.stoex.RandomVariable in project Palladio-Editors-Sirius by PalladioSimulator.
the class SetRandomVariable method execute.
@Override
public void execute(Collection<? extends EObject> selections, Map<String, Object> parameters) {
RandomVariable randomVariable = getRandomVariable((EObject) parameters.get("element"));
StochasticExpressionEditDialog dialog = new StochasticExpressionEditDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), getExpectedType());
dialog.setInitialExpression(randomVariable);
dialog.open();
if (dialog.getReturnCode() == Dialog.OK) {
randomVariable.setSpecification(dialog.getResultText());
randomVariable.setSpecification(new PCMStoExPrettyPrintVisitor().prettyPrint(dialog.getResult()));
}
}
use of de.uka.ipd.sdq.stoex.RandomVariable in project Palladio-Editors-Sirius by PalladioSimulator.
the class OpenExternalStoexEditor method execute.
@Override
public void execute(final Collection<? extends EObject> arg0, final Map<String, Object> arg1) {
if (arg0.size() != 1) {
throw new IllegalArgumentException("Multiselection not supported");
}
final var element = arg0.iterator().next();
final var typedElement = this.getTypedElement(element);
final var action = (String) arg1.get(this.actionParameterType);
final RandomVariable randVar = this.editStoexAction(action, typedElement);
if (randVar.getSpecification() == null) {
this.dialogEmptyRandomVariable(randVar);
} else {
this.dialogNotEmptyRandomVariable(randVar);
}
}
Aggregations