use of org.talend.commons.ui.runtime.expressionbuilder.IExpressionDataBean in project tdi-studio-se by Talend.
the class PigExpressionBuilderDialog method openDialog.
/*
* (non-Javadoc)
*
* @see org.talend.expressionbuilder.ui.IExpressionBuilderDialogController#openDialog()
*/
@Override
public void openDialog(Object obj) {
if (obj instanceof IExpressionDataBean) {
List<Variable> vars = new ArrayList<Variable>();
IExpressionDataBean bean = (IExpressionDataBean) obj;
setDefaultExpression(bean.getExpression());
if (bean.getVariables() != null) {
vars.addAll(bean.getVariables());
}
ExpressionPersistance persistance = ExpressionPersistance.getInstance();
persistance.setOwnerId(bean.getOwnerId());
persistance.setPath(getExpressionStorePath());
for (Variable var1 : persistance.loadExpression().getVariables()) {
boolean needAdd = true;
for (Variable var2 : vars) {
if (var1.getName() != null && var1.getName().equals(var2.getName())) {
needAdd = false;
break;
}
}
if (var1.getName() != null && needAdd) {
vars.add(var1);
}
}
}
open();
setBlockOnOpen(true);
}
use of org.talend.commons.ui.runtime.expressionbuilder.IExpressionDataBean in project tdi-studio-se by Talend.
the class BatchExpressionBuilderDialog method openDialog.
/*
* (non-Javadoc)
*
* @see org.talend.expressionbuilder.ui.IExpressionBuilderDialogController#openDialog()
*/
@Override
public void openDialog(Object obj) {
if (obj instanceof IExpressionDataBean) {
IExpressionDataBean bean = (IExpressionDataBean) obj;
setDefaultExpression(bean.getExpression());
ExpressionPersistance persistance = ExpressionPersistance.getInstance();
persistance.setOwnerId(bean.getOwnerId());
persistance.setPath(getExpressionStorePath());
}
open();
setBlockOnOpen(true);
}
use of org.talend.commons.ui.runtime.expressionbuilder.IExpressionDataBean in project tdi-studio-se by Talend.
the class ExpressionBuilderDialog method openDialog.
/*
* (non-Javadoc)
*
* @see org.talend.expressionbuilder.ui.IExpressionBuilderDialogController#openDialog()
*/
@Override
public void openDialog(Object obj) {
if (obj instanceof IExpressionDataBean) {
List<Variable> vars = new ArrayList<Variable>();
IExpressionDataBean bean = (IExpressionDataBean) obj;
setDefaultExpression(bean.getExpression());
ExpressionPersistance persistance = ExpressionPersistance.getInstance();
persistance.setOwnerId(bean.getOwnerId());
persistance.setPath(getExpressionStorePath());
List<Variable> varList = new ArrayList<Variable>(persistance.loadExpression().getVariables());
vars.addAll(varList);
if (bean.getVariables() != null) {
for (Variable var1 : bean.getVariables()) {
boolean needAdd = true;
for (Variable var2 : varList) {
if (var1.getName() != null && var1.getName().equals(var2.getName())) {
needAdd = false;
break;
}
}
if (var1.getName() != null && needAdd) {
vars.add(var1);
}
}
}
addVariables(vars);
}
open();
setBlockOnOpen(true);
}
Aggregations