use of org.talend.dataquality.domain.JavaUDIIndicatorParameter in project tdq-studio-se by Talend.
the class JavaUDIParametersForm method attachCellEditors.
/**
* DOC klliu Comment method "attachCellEditors".figure 13429 2010-08-03.
*
* @param viewer
* @param parent
*/
private void attachCellEditors(final TableViewer viewer, Composite parent) {
viewer.setCellModifier(new ICellModifier() {
public boolean canModify(Object element, String property) {
return true;
}
public Object getValue(Object element, String property) {
if (NAME_PROPERTY.equals(property)) {
return ((JavaUDIIndicatorParameter) element).getKey();
} else {
return ((JavaUDIIndicatorParameter) element).getValue();
}
}
public void modify(Object element, String property, Object value) {
TableItem tableItem = (TableItem) element;
JavaUDIIndicatorParameter data = (JavaUDIIndicatorParameter) tableItem.getData();
if (NAME_PROPERTY.equals(property)) {
data.setKey(value.toString());
} else {
data.setValue(value.toString());
}
viewer.refresh(data);
checkFieldsValue();
}
});
viewer.setCellEditors(new CellEditor[] { new TextCellEditor(parent), new TextCellEditor(parent) });
viewer.setColumnProperties(new String[] { NAME_PROPERTY, VALUE_PROPERTY });
}
use of org.talend.dataquality.domain.JavaUDIIndicatorParameter in project tdq-studio-se by Talend.
the class JavaUDIParametersForm method createDefinitionParametersButton.
private void createDefinitionParametersButton(Composite comp, final TableViewer parView) {
Composite composite = new Composite(comp, SWT.NONE);
GridData gd = new GridData();
gd.horizontalSpan = 2;
gd.horizontalAlignment = SWT.CENTER;
composite.setLayout(new GridLayout(2, false));
composite.setLayoutData(gd);
final Button addButton = new Button(composite, SWT.NONE);
addButton.setImage(ImageLib.getImage(ImageLib.ADD_ACTION));
// $NON-NLS-1$
addButton.setToolTipText(DefaultMessagesImpl.getString("PatternMasterDetailsPage.add"));
GridData labelGd = new GridData(GridData.HORIZONTAL_ALIGN_CENTER);
labelGd.horizontalAlignment = SWT.RIGHT;
labelGd.widthHint = 65;
addButton.setLayoutData(labelGd);
addButton.addListener(SWT.MouseDown, new Listener() {
public void handleEvent(Event event) {
// $NON-NLS-1$ //$NON-NLS-2$
JavaUDIIndicatorParameter newItem = DomainHelper.createJavaUDIIndicatorParameter("key", "value");
content.add(newItem);
viewer.refresh();
checkFieldsValue();
}
});
final Button romveButton = new Button(composite, SWT.NONE);
romveButton.setImage(ImageLib.getImage(ImageLib.DELETE_ACTION));
// $NON-NLS-1$
romveButton.setToolTipText(DefaultMessagesImpl.getString("PatternMasterDetailsPage.del"));
GridData reGd = new GridData();
reGd.horizontalAlignment = SWT.LEFT;
reGd.widthHint = 65;
romveButton.setLayoutData(reGd);
romveButton.addListener(SWT.MouseDown, new Listener() {
public void handleEvent(Event event) {
IStructuredSelection selection = (IStructuredSelection) parView.getSelection();
Object o = selection.getFirstElement();
if (o instanceof JavaUDIIndicatorParameter) {
content.remove(o);
viewer.refresh(content);
checkFieldsValue();
}
}
});
}
use of org.talend.dataquality.domain.JavaUDIIndicatorParameter in project tdq-studio-se by Talend.
the class DomainHelper method createJavaUDIIndicatorParameter.
/**
* DOC klliu Comment method "createJavaUDIIndicatorParameter".
*
* @param key
* @param value
* @return
*/
public static JavaUDIIndicatorParameter createJavaUDIIndicatorParameter(String key, String value) {
JavaUDIIndicatorParameter javaUDIIndicatorParameter = DOMAIN.createJavaUDIIndicatorParameter();
javaUDIIndicatorParameter.setKey(key);
javaUDIIndicatorParameter.setValue(value);
return javaUDIIndicatorParameter;
}
Aggregations