use of org.eclipse.gmf.runtime.emf.type.core.commands.SetValueCommand in project Palladio-Editors-Sirius by PalladioSimulator.
the class AddLatencyAndThroughputRecordingCommand method doExecute.
@Override
protected void doExecute() {
// Throughput
PCMRandomVariable rv = CoreFactory.eINSTANCE.createPCMRandomVariable();
rv.setSpecification("");
StochasticExpressionEditDialog dialog = new StochasticExpressionEditDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), TypeEnum.ANY, rv);
dialog.open();
rv.setSpecification(dialog.getResultText());
ICommand cmd = new MySetValueCommand(new SetRequest(communicationLinkResourceSpecification, ResourceenvironmentPackage.eINSTANCE.getCommunicationLinkResourceSpecification_Throughput_CommunicationLinkResourceSpecification(), rv));
cmd.setLabel("Throughput");
// Latency
rv = CoreFactory.eINSTANCE.createPCMRandomVariable();
rv.setSpecification("");
dialog = new StochasticExpressionEditDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), TypeEnum.ANY, rv);
dialog.open();
rv.setSpecification(dialog.getResultText());
cmd = new SetValueCommand(new SetRequest(communicationLinkResourceSpecification, ResourceenvironmentPackage.eINSTANCE.getCommunicationLinkResourceSpecification_Latency_CommunicationLinkResourceSpecification(), rv));
}
use of org.eclipse.gmf.runtime.emf.type.core.commands.SetValueCommand in project tdi-studio-se by Talend.
the class BusinessAbstractParser method getModificationCommand.
/**
* @generated
*/
protected ICommand getModificationCommand(EObject element, EStructuralFeature feature, Object value) {
value = getValidNewValue(feature, value);
if (value instanceof InvalidValue) {
return UnexecutableCommand.INSTANCE;
}
SetRequest request = new SetRequest(element, feature, value);
return new SetValueCommand(request);
}
Aggregations