use of org.talend.dataquality.rules.ParticularDefaultSurvivorshipDefinitions in project tdq-studio-se by Talend.
the class ParticularDefSurshipDefinitionSection method setColumnValueIfMatch.
/*
* (non-Javadoc)
*
* @see
* org.talend.dataquality.record.linkage.ui.section.AbstractMatchAnaysisTableSection#setColumnValueIfMatch(org.talend.dataquality
* .rules.KeyDefinition)
*/
@Override
protected void setColumnValueIfMatch(KeyDefinition keyDefinition) {
String columnName = StringUtils.EMPTY;
String columnType = StringUtils.EMPTY;
if (this.columnMap != null) {
for (MetadataColumn column : columnMap.keySet()) {
if (StringUtils.equalsIgnoreCase(getColumnName(column), getMappingName(keyDefinition))) {
columnName = column.getLabel();
columnType = column.getTalendType();
break;
}
}
}
keyDefinition.setColumn(columnName);
((ParticularDefaultSurvivorshipDefinitions) keyDefinition).setDataType(columnType);
}
use of org.talend.dataquality.rules.ParticularDefaultSurvivorshipDefinitions in project tdq-studio-se by Talend.
the class ParticularDefSurshipDefinitionSection method moveUpTableItem.
/*
* (non-Javadoc)
*
* @see org.talend.dataquality.record.linkage.ui.section.AbstractMatchAnaysisTableSection#moveUpTableItem()
*/
@Override
public void moveUpTableItem() {
ISelection selectItems = tableComposite.getSelectItems();
if (selectItems instanceof StructuredSelection) {
if (selectItems.isEmpty()) {
return;
}
List<ParticularDefaultSurvivorshipDefinitions> currentElements = this.matchRuleDef.getParticularDefaultSurvivorshipDefinitions();
List<ParticularDefaultSurvivorshipDefinitions> particularDefaultSurvivorshipKeyDefinitionlist = ((StructuredSelection) selectItems).toList();
for (int index = 0; index < particularDefaultSurvivorshipKeyDefinitionlist.size(); index++) {
if (!isSameWithCurrentModel(currentElements.get(index), particularDefaultSurvivorshipKeyDefinitionlist.get(index))) {
continue;
}
ParticularDefaultSurvivorshipDefinitions next = particularDefaultSurvivorshipKeyDefinitionlist.get(index);
tableComposite.moveUpKeyDefinition(next, currentElements);
}
tableComposite.selectAllItem(((StructuredSelection) selectItems).toList());
}
}
use of org.talend.dataquality.rules.ParticularDefaultSurvivorshipDefinitions in project tdq-studio-se by Talend.
the class FunctionEditingSupport method getValue.
/*
* (non-Javadoc)
*
* @see org.eclipse.jface.viewers.EditingSupport#getValue(java.lang.Object)
*/
@Override
protected Object getValue(Object element) {
String talendDataType = ((ParticularDefaultSurvivorshipDefinitions) element).getDataType();
String[] allShowTypes = getAllFunctionByDataTypes(talendDataType);
SurvivorShipAlgorithmEnum typeBySavedValue = SurvivorShipAlgorithmEnum.getTypeBySavedValue(((ParticularDefaultSurvivorshipDefinitions) element).getFunction().getAlgorithmType());
for (int index = 0; index < allShowTypes.length; index++) {
if (typeBySavedValue.getValue().equals(allShowTypes[index])) {
return index;
}
}
return -1;
}
use of org.talend.dataquality.rules.ParticularDefaultSurvivorshipDefinitions in project tdq-studio-se by Talend.
the class FunctionEditingSupport method getCellEditor.
/*
* (non-Javadoc)
*
* @see org.eclipse.jface.viewers.EditingSupport#getCellEditor(java.lang.Object)
*/
@Override
protected CellEditor getCellEditor(Object element) {
String talendDataType = ((ParticularDefaultSurvivorshipDefinitions) element).getDataType();
ComboBoxCellEditor comboBoxCellEditor = new ComboBoxCellEditor(((ParticularDefaultSurvivorShipTableViewer) this.getViewer()).getTable(), getAllFunctionByDataTypes(talendDataType), SWT.READ_ONLY);
return comboBoxCellEditor;
}
use of org.talend.dataquality.rules.ParticularDefaultSurvivorshipDefinitions in project tdq-studio-se by Talend.
the class FunctionEditingSupport method setValue.
/*
* (non-Javadoc)
*
* @see org.eclipse.jface.viewers.EditingSupport#setValue(java.lang.Object, java.lang.Object)
*/
@Override
protected void setValue(Object element, Object value) {
ParticularDefaultSurvivorshipDefinitions pdskd = ((ParticularDefaultSurvivorshipDefinitions) element);
String talendDataType = ((ParticularDefaultSurvivorshipDefinitions) element).getDataType();
int functionTypeIndex = Integer.valueOf(value.toString()).intValue();
SurvivorShipAlgorithmEnum valueByIndex = findEnumValue(talendDataType, functionTypeIndex);
if (StringUtils.equals(pdskd.getFunction().getAlgorithmType(), valueByIndex.getComponentValueName())) {
return;
}
pdskd.getFunction().setAlgorithmType(valueByIndex.getComponentValueName());
if (!(isSurvivorShipAlgorithm(pdskd, SurvivorShipAlgorithmEnum.MOST_TRUSTED_SOURCE) || isSurvivorShipAlgorithm(pdskd, SurvivorShipAlgorithmEnum.CONCATENATE))) {
pdskd.getFunction().setAlgorithmParameters(StringUtils.EMPTY);
CellEditor[] cellEditors = this.getViewer().getCellEditors();
if (cellEditors.length == 3) {
cellEditors[2].setValue(StringUtils.EMPTY);
}
}
this.getViewer().update(element, null);
}
Aggregations