Search in sources :

Example 1 with SetRequest

use of org.eclipse.gmf.runtime.emf.type.core.requests.SetRequest 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));
}
Also used : SetRequest(org.eclipse.gmf.runtime.emf.type.core.requests.SetRequest) SetValueCommand(org.eclipse.gmf.runtime.emf.type.core.commands.SetValueCommand) ICommand(org.eclipse.gmf.runtime.common.core.command.ICommand) StochasticExpressionEditDialog(org.palladiosimulator.editors.commons.dialogs.stoex.StochasticExpressionEditDialog) PCMRandomVariable(org.palladiosimulator.pcm.core.PCMRandomVariable)

Example 2 with SetRequest

use of org.eclipse.gmf.runtime.emf.type.core.requests.SetRequest 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);
}
Also used : SetRequest(org.eclipse.gmf.runtime.emf.type.core.requests.SetRequest) SetValueCommand(org.eclipse.gmf.runtime.emf.type.core.commands.SetValueCommand)

Aggregations

SetValueCommand (org.eclipse.gmf.runtime.emf.type.core.commands.SetValueCommand)2 SetRequest (org.eclipse.gmf.runtime.emf.type.core.requests.SetRequest)2 ICommand (org.eclipse.gmf.runtime.common.core.command.ICommand)1 StochasticExpressionEditDialog (org.palladiosimulator.editors.commons.dialogs.stoex.StochasticExpressionEditDialog)1 PCMRandomVariable (org.palladiosimulator.pcm.core.PCMRandomVariable)1