private Expression createExpression(final Data d) { final Expression exp = ExpressionFactory.eINSTANCE.createExpression(); exp.setType(ExpressionConstants.VARIABLE_TYPE); exp.setContent(d.getName()); exp.setName(d.getName()); exp.setReturnType(org.bonitasoft.studio.common.DataUtil.getTechnicalTypeFor(d)); exp.getReferencedElements().add(ExpressionHelper.createDependencyFromEObject(d)); return exp; }
protected void switchEditorType() { if (!control.isVisible()) { switchToExpressionMode(); bindExpression(); } else { if (MessageDialog.openQuestion( mc.getShell(), Messages.eraseExpressionTitle, Messages.eraseExpressionMsg)) { switchToCheckBoxMode(); // Reset checkbox to false final Expression falseExp = ExpressionFactory.eINSTANCE.createExpression(); falseExp.setName(Boolean.FALSE.toString()); falseExp.setContent(Boolean.FALSE.toString()); falseExp.setReturnType(Boolean.class.getName()); falseExp.setType(ExpressionConstants.CONSTANT_TYPE); updateSelection(null, falseExp); bindExpression(); } } mc.layout(true, true); }