use of org.talend.dataquality.rules.SurvivorshipKeyDefinition in project tdq-studio-se by Talend.
the class SurvivorshipDefinitionSection method createSubContent.
@Override
protected Composite createSubContent(Composite sectionClient) {
Composite ruleComp = toolkit.createComposite(sectionClient, SWT.NONE);
GridData data = new GridData(GridData.FILL_BOTH);
ruleComp.setLayoutData(data);
GridLayout gridLayout = new GridLayout(1, true);
gridLayout.marginWidth = 0;
gridLayout.marginHeight = 0;
ruleComp.setLayout(gridLayout);
tableComposite = new SurvivorshipTableComposite(ruleComp, SWT.NO_FOCUS);
tableComposite.addPropertyChangeListener(this);
tableComposite.setLayout(gridLayout);
tableComposite.setLayoutData(data);
tableComposite.createContent();
section.setExpanded(true);
tableComposite.serViewerSorter(new KeyDefinitionTableViewerSorter<SurvivorshipKeyDefinition>(this.matchRuleDef.getSurvivorshipKeys()));
initTableInput();
return ruleComp;
}
use of org.talend.dataquality.rules.SurvivorshipKeyDefinition in project tdq-studio-se by Talend.
the class SurvivorshipDefinitionSection method moveUpTableItem.
/*
* (non-Javadoc)
*
* @see org.talend.dataquality.record.linkage.ui.section.AbstractMatchAnaysisTableSection#moveDownTableItem()
*/
@Override
public void moveUpTableItem() {
ISelection selectItems = tableComposite.getSelectItems();
if (selectItems instanceof StructuredSelection) {
if (selectItems.isEmpty()) {
return;
}
List<SurvivorshipKeyDefinition> currentElements = this.matchRuleDef.getSurvivorshipKeys();
List<SurvivorshipKeyDefinition> survivorshipKeyDefinitionlist = ((StructuredSelection) selectItems).toList();
for (int index = 0; index < survivorshipKeyDefinitionlist.size(); index++) {
if (!isSameWithCurrentModel(currentElements.get(index), survivorshipKeyDefinitionlist.get(index))) {
continue;
}
SurvivorshipKeyDefinition next = survivorshipKeyDefinitionlist.get(index);
tableComposite.moveUpKeyDefinition(next, currentElements);
}
tableComposite.selectAllItem(((StructuredSelection) selectItems).toList());
}
}
use of org.talend.dataquality.rules.SurvivorshipKeyDefinition in project tdq-studio-se by Talend.
the class SurvivorshipDefinitionSection method removeTableItem.
@Override
public void removeTableItem() {
boolean success = false;
ISelection selectItems = tableComposite.getSelectItems();
if (selectItems instanceof StructuredSelection) {
Iterator<SurvivorshipKeyDefinition> iterator = ((StructuredSelection) selectItems).iterator();
while (iterator.hasNext()) {
SurvivorshipKeyDefinition next = iterator.next();
tableComposite.removeKeyDefinition(next, matchRuleDef.getSurvivorshipKeys());
success = true;
}
if (success) {
listeners.firePropertyChange(MatchAnalysisConstant.ISDIRTY_PROPERTY, true, false);
}
}
}
use of org.talend.dataquality.rules.SurvivorshipKeyDefinition in project tdq-studio-se by Talend.
the class MatchKeyAndSurvivorshipTableViewer method createNewSurvivorshipKeyDefinition.
private SurvivorshipKeyDefinition createNewSurvivorshipKeyDefinition(String columnName) {
SurvivorshipKeyDefinition skd = RulesFactory.eINSTANCE.createSurvivorshipKeyDefinition();
skd.setName(columnName);
AlgorithmDefinition createAlgorithmDefinition = RulesFactory.eINSTANCE.createAlgorithmDefinition();
createAlgorithmDefinition.setAlgorithmType(SurvivorShipAlgorithmEnum.getTypeByIndex(3).getComponentValueName());
skd.setFunction(createAlgorithmDefinition);
skd.setAllowManualResolution(true);
return skd;
}
use of org.talend.dataquality.rules.SurvivorshipKeyDefinition in project tdq-studio-se by Talend.
the class MatchKeyAndSurvivorshipTableViewer method createNewKeyDefinition.
/*
* (non-Javadoc)
*
* @see
* org.talend.dataquality.record.linkage.ui.composite.tableviewer.definition.MatchKeyAndSurvivorshipTableViewer#
* createNewKeyDefinition(java.lang.String)
*/
@Override
protected MatchKeyAndSurvivorDefinition createNewKeyDefinition(String columnName) {
MatchKeyDefinition matchKeyDefinition = MatchRuleAnlaysisUtils.createDefaultMatchRow(columnName);
SurvivorshipKeyDefinition survivorshipKeyDefinition = createNewSurvivorshipKeyDefinition(columnName);
MatchKeyAndSurvivorDefinition matchKeySurvDef = new MatchKeyAndSurvivorDefinition();
matchKeySurvDef.setMatchKey(matchKeyDefinition);
matchKeySurvDef.setSurvivorShipKey(survivorshipKeyDefinition);
matchRule.getMatchKeys().add(matchKeySurvDef.getMatchKey());
((MatchRuleDefinition) matchRule.eContainer()).getSurvivorshipKeys().add(matchKeySurvDef.getSurvivorShipKey());
return matchKeySurvDef;
}
Aggregations