use of org.talend.dataprofiler.core.ui.dialog.ExpressionEditDialog in project tdq-studio-se by Talend.
the class IndicatorDefinitionMaterPage method createExpressionEditButton.
/**
* DOC yyi 2009-09-11 Feature:9030.
*
* @param expressComp
* @param patternText
*
* @return
*/
private void createExpressionEditButton(Composite expressComp, final Text patternText, final CCombo combo, final Text dbVersionText) {
Button editButton = new Button(expressComp, SWT.PUSH);
// $NON-NLS-1$
editButton.setText(DefaultMessagesImpl.getString("IndicatorDefinitionMaterPage.editExpression"));
// $NON-NLS-1$
editButton.setToolTipText(DefaultMessagesImpl.getString("IndicatorDefinitionMaterPage.editExpression"));
editButton.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
final ExpressionEditDialog editDialog = initExpresstionEditDialog(combo, dbVersionText.getText(), patternText.getText());
if (Dialog.OK == editDialog.open()) {
patternText.setText(editDialog.getTempExpression().getBody());
handleSelectExpression(combo, editDialog);
setDirty(true);
}
}
});
}
use of org.talend.dataprofiler.core.ui.dialog.ExpressionEditDialog in project tdq-studio-se by Talend.
the class UDIMasterPage method initExpresstionEditDialog.
@Override
protected ExpressionEditDialog initExpresstionEditDialog(final CCombo combo, final String version, String patternText) {
TdExpression tdExpression = getTdExpression(combo, version);
String language = tdExpression.getLanguage();
ExpressionEditDialog editDialog = new ExpressionEditDialog(null, patternText, true, cloneExpression(tdExpression));
editDialog.setVersion(version);
editDialog.setLanguage(language);
editDialog.setCategory(category);
if (IndicatorCategoryHelper.isUserDefMatching(category)) {
EList<TdExpression> viewValidRowsExpression = ((UDIndicatorDefinition) getCurrentModelElement()).getViewValidRowsExpression();
TdExpression viewValidRows = getCurrentLanguageExp(viewValidRowsExpression, language, version);
if (isDirty()) {
viewValidRows = tempViewValidRowsExpressionMap.get(combo);
}
editDialog.setTempViewValidRowsExp(cloneExpression(viewValidRows));
EList<TdExpression> viewInvalidRowsExpression = ((UDIndicatorDefinition) getCurrentModelElement()).getViewInvalidRowsExpression();
TdExpression viewInvalidRows = getCurrentLanguageExp(viewInvalidRowsExpression, language, version);
if (isDirty()) {
viewInvalidRows = tempViewInvalidRowsExpressionMap.get(combo);
}
editDialog.setTempViewInvalidRowsExp(cloneExpression(viewInvalidRows));
EList<TdExpression> viewValidValuesExpression = ((UDIndicatorDefinition) getCurrentModelElement()).getViewValidValuesExpression();
TdExpression viewValidValues = getCurrentLanguageExp(viewValidValuesExpression, language, version);
if (isDirty()) {
viewValidValues = tempViewValidValuesExpressionMap.get(combo);
}
editDialog.setTempViewValidValuesExp(cloneExpression(viewValidValues));
EList<TdExpression> viewInvalidValuesExpression = ((UDIndicatorDefinition) getCurrentModelElement()).getViewInvalidValuesExpression();
TdExpression viewInvalidValues = getCurrentLanguageExp(viewInvalidValuesExpression, language, version);
if (isDirty()) {
viewInvalidValues = tempViewInvalidValuesExpressionMap.get(combo);
}
editDialog.setTempViewInvalidValuesExp(cloneExpression(viewInvalidValues));
} else {
EList<TdExpression> viewRowsExpression = ((UDIndicatorDefinition) getCurrentModelElement()).getViewRowsExpression();
TdExpression viewRows = getCurrentLanguageExp(viewRowsExpression, language, version);
if (isDirty()) {
viewRows = tempViewRowsExpressionMap.get(combo);
}
editDialog.setTempViewRowsExp(cloneExpression(viewRows));
}
return editDialog;
}
use of org.talend.dataprofiler.core.ui.dialog.ExpressionEditDialog in project tdq-studio-se by Talend.
the class IndicatorDefinitionMaterPage method initExpresstionEditDialog.
protected ExpressionEditDialog initExpresstionEditDialog(final CCombo combo, final String version, String patternText) {
TdExpression tdExpression = getTdExpression(combo, version);
String language = tdExpression.getLanguage();
ExpressionEditDialog editDialog = new ExpressionEditDialog(null, patternText, false, cloneExpression(tdExpression));
editDialog.setVersion(version);
editDialog.setLanguage(language);
editDialog.setCategory(category);
return editDialog;
}
Aggregations