use of org.talend.dataquality.rules.ParticularDefaultSurvivorshipDefinitions in project tdq-studio-se by Talend.
the class ParticularDefaultSurvivorShipCellModifier method modify.
/*
* (non-Javadoc)
*
* @see org.eclipse.jface.viewers.ICellModifier#modify(java.lang.Object, java.lang.String, java.lang.Object)
*/
@Override
public void modify(Object element, String property, Object value) {
if (element instanceof TableItem) {
ParticularDefaultSurvivorshipDefinitions pdskd = (ParticularDefaultSurvivorshipDefinitions) ((TableItem) element).getData();
String newValue = String.valueOf(value);
if (MatchAnalysisConstant.PRECOLUMN.equalsIgnoreCase(property)) {
if (Integer.parseInt(newValue) == -1) {
return;
}
MetadataColumn metadataColumn = columnList.get(Integer.parseInt(newValue));
String columnName = metadataColumn.getName();
if (StringUtils.equals(pdskd.getColumn(), columnName)) {
return;
}
pdskd.setColumn(columnName);
pdskd.setDataType(metadataColumn.getTalendType());
if (isFunctionInvalid(pdskd, metadataColumn.getTalendType())) {
resetFunction(pdskd);
}
} else if (MatchAnalysisConstant.FUNCTION.equalsIgnoreCase(property)) {
SurvivorShipAlgorithmEnum valueByIndex = SurvivorShipAlgorithmEnum.getTypeByIndex(Integer.valueOf(newValue).intValue());
if (StringUtils.equals(pdskd.getFunction().getAlgorithmType(), valueByIndex.getComponentValueName())) {
return;
}
setFunction(pdskd, valueByIndex);
} else if (MatchAnalysisConstant.PARAMETER.equalsIgnoreCase(property)) {
pdskd.getFunction().setAlgorithmParameters(newValue);
} else {
return;
}
tableViewer.update(pdskd, null);
}
}
use of org.talend.dataquality.rules.ParticularDefaultSurvivorshipDefinitions in project tdq-studio-se by Talend.
the class ParticularDefaultSurvivorShipTableViewer method removeElement.
/*
* (non-Javadoc)
*
* @see
* org.talend.dataquality.record.linkage.ui.composite.tableviewer.AbstractMatchAnalysisTableViewer#removeElement(java.lang
* .Object, java.util.List)
*/
@Override
public void removeElement(ParticularDefaultSurvivorshipDefinitions keyPDef, List<ParticularDefaultSurvivorshipDefinitions> keyList) {
if (!keyList.remove(keyPDef)) {
Iterator<ParticularDefaultSurvivorshipDefinitions> keyIterator = keyList.iterator();
while (keyIterator.hasNext()) {
ParticularDefaultSurvivorshipDefinitions tmpKeyDef = keyIterator.next();
if (StringUtils.equals(keyPDef.getColumn(), tmpKeyDef.getColumn())) {
keyList.remove(keyPDef);
// Update table view.
remove(keyPDef);
break;
}
}
} else {
remove(keyPDef);
}
}
use of org.talend.dataquality.rules.ParticularDefaultSurvivorshipDefinitions in project tdq-studio-se by Talend.
the class ParticularDefaultSurvivorShipTableViewer method createNewKeyDefinition.
@Override
protected ParticularDefaultSurvivorshipDefinitions createNewKeyDefinition(String columnName) {
ParticularDefaultSurvivorshipDefinitions pskd = RulesFactory.eINSTANCE.createParticularDefaultSurvivorshipDefinitions();
AlgorithmDefinition createAlgorithmDefinition = RulesFactory.eINSTANCE.createAlgorithmDefinition();
createAlgorithmDefinition.setAlgorithmType(SurvivorShipAlgorithmEnum.getTypeByIndex(3).getComponentValueName());
pskd.setFunction(createAlgorithmDefinition);
return pskd;
}
use of org.talend.dataquality.rules.ParticularDefaultSurvivorshipDefinitions in project tdq-studio-se by Talend.
the class ParticularDefaultSurvivorShipDefinitionCellModifier method modify.
/*
* (non-Javadoc)
*
* @see
* org.talend.dataquality.record.linkage.ui.composite.tableviewer.ParticularDefaultSurvivorShipCellModifier#modify(java.lang
* .Object, java.lang.String, java.lang.Object)
*/
@Override
public void modify(Object element, String property, Object value) {
if (element instanceof TableItem) {
ParticularDefaultSurvivorshipDefinitions pdskd = (ParticularDefaultSurvivorshipDefinitions) ((TableItem) element).getData();
String newColumnName = String.valueOf(value);
if (MatchAnalysisConstant.PRECOLUMN.equalsIgnoreCase(property)) {
pdskd.setColumn(newColumnName);
tableViewer.update(pdskd, null);
return;
}
}
super.modify(element, property, value);
}
use of org.talend.dataquality.rules.ParticularDefaultSurvivorshipDefinitions in project tdq-studio-se by Talend.
the class ParticularDefaultSurvivorShipDefintionTableViewer method createNewKeyDefinition.
/*
* (non-Javadoc)
*
* @see
* org.talend.dataquality.record.linkage.ui.composite.tableviewer.ParticularDefaultSurvivorShipTableViewer#createNewKeyDefinition
* (java.lang.String)
*/
@Override
protected ParticularDefaultSurvivorshipDefinitions createNewKeyDefinition(String columnName) {
ParticularDefaultSurvivorshipDefinitions newKeyDefinition = super.createNewKeyDefinition(columnName);
newKeyDefinition.setColumn(columnName);
return newKeyDefinition;
}
Aggregations