use of org.palladiosimulator.editors.commons.dialogs.stoex.StochasticExpressionEditDialog in project Palladio-Editors-Sirius by PalladioSimulator.
the class AddHDDProcessingResourceSpecification method getReadProcessingRate.
private PCMRandomVariable getReadProcessingRate() {
final PCMRandomVariable pcmRandomVariable = CoreFactory.eINSTANCE.createPCMRandomVariable();
pcmRandomVariable.setSpecification("");
final StochasticExpressionEditDialog dialog = new StochasticExpressionEditDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), TypeEnum.DOUBLE, pcmRandomVariable);
dialog.setDisplayTitle(SET_READ_PROCESSING_RATE);
dialog.open();
if (dialog.getResult() == null) {
return null;
}
pcmRandomVariable.setSpecification(dialog.getResultText());
return pcmRandomVariable;
}
use of org.palladiosimulator.editors.commons.dialogs.stoex.StochasticExpressionEditDialog in project Palladio-Editors-Sirius by PalladioSimulator.
the class AddLinkingResourceAction method getRandomVariableFromStoExDialog.
/**
* Opens a StoxEx dialog and returns the resulting {@link PCMRandomVariable}.
*
* @param displayTitle
* Title of the StoEx dialog
* @return PCMRandomVariable if user entered valid data and confirmed. Will return null if user
* canceled dialog
*/
private PCMRandomVariable getRandomVariableFromStoExDialog(final String displayTitle) {
final PCMRandomVariable randomVariable = CoreFactory.eINSTANCE.createPCMRandomVariable();
randomVariable.setSpecification("");
final StochasticExpressionEditDialog dialog = new StochasticExpressionEditDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), TypeEnum.DOUBLE, randomVariable);
dialog.setDisplayTitle(displayTitle);
dialog.open();
if (dialog.getReturnCode() == Dialog.CANCEL) {
return null;
}
randomVariable.setSpecification(dialog.getResultText());
return randomVariable;
}
use of org.palladiosimulator.editors.commons.dialogs.stoex.StochasticExpressionEditDialog in project Palladio-Editors-Sirius by PalladioSimulator.
the class OpenExternalStoexEditor method dialogNotEmptyRandomVariable.
private void dialogNotEmptyRandomVariable(final RandomVariable randVar) {
final StochasticExpressionEditDialog dialog = this.createDialog(randVar);
if (dialog.getReturnCode() == Window.OK) {
final String result = dialog.getResultText();
randVar.setSpecification(result);
}
}
use of org.palladiosimulator.editors.commons.dialogs.stoex.StochasticExpressionEditDialog in project Palladio-Editors-Sirius by PalladioSimulator.
the class OpenExternalStoexEditor method createDialog.
private StochasticExpressionEditDialog createDialog(final RandomVariable randVar) {
final StochasticExpressionEditDialog dialog = new StochasticExpressionEditDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), this.getExpectedType(randVar), randVar);
dialog.setInitialExpression(randVar);
dialog.open();
return dialog;
}
Aggregations