use of org.eclipse.gmf.runtime.common.core.command.ICommand 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.common.core.command.ICommand in project tdi-studio-se by Talend.
the class BusinessStructuralFeatureParser method getParseCommand.
/**
* @generated
*/
public ICommand getParseCommand(IAdaptable adapter, Object[] values) {
EObject element = (EObject) adapter.getAdapter(EObject.class);
if (element == null) {
return UnexecutableCommand.INSTANCE;
}
TransactionalEditingDomain editingDomain = TransactionUtil.getEditingDomain(element);
if (editingDomain == null) {
return UnexecutableCommand.INSTANCE;
}
Object value = values.length == 1 ? values[0] : null;
ICommand command = getModificationCommand(element, feature, value);
return new CompositeTransactionalCommand(editingDomain, command.getLabel(), Collections.singletonList(command));
}
Aggregations