use of org.talend.dataprofiler.core.ui.imex.model.ItemRecord in project tdq-studio-se by Talend.
the class ImportAndExportUtils method iterateUncheckClientDependency.
/**
* when uncheck an item,should uncheck related client depenedences.
*
* @param dependencyClients
*/
public static void iterateUncheckClientDependency(List<ModelElement> dependencyClients, CheckboxTreeViewer repositoryTree) {
for (ModelElement dependency : dependencyClients) {
List<ModelElement> iterdependencyClients = EObjectHelper.getDependencyClients(dependency);
if (!iterdependencyClients.isEmpty()) {
iterateUncheckClientDependency(iterdependencyClients, repositoryTree);
}
URI uri = EObjectHelper.getURI(dependency);
if (uri != null) {
String uriString = WorkspaceUtils.toFile(uri);
File depFile = new File(uriString);
ItemRecord findRecord = ItemRecord.findRecord(depFile);
if (findRecord != null) {
repositoryTree.setChecked(findRecord, false);
}
}
}
}
use of org.talend.dataprofiler.core.ui.imex.model.ItemRecord in project tdq-studio-se by Talend.
the class ExportForExchangeWizard method buildItemRecordList.
/**
* build the export record map.
*
* @param records key = export zip file name; value = record list which should be add to the zip file
* @return
*/
protected Map<String, ItemRecord[]> buildItemRecordList(ItemRecord[] records) {
Map<String, ItemRecord[]> map = new HashMap<String, ItemRecord[]>();
for (ItemRecord record : records) {
ModelElement element = record.getElement();
if (element != null) {
// $NON-NLS-1$
String zipFileName = element.getName() + ".zip";
List<ItemRecord> list = new ArrayList<ItemRecord>();
list.add(record);
map.put(zipFileName, list.toArray(new ItemRecord[list.size()]));
}
}
return map;
}
use of org.talend.dataprofiler.core.ui.imex.model.ItemRecord in project tdq-studio-se by Talend.
the class ExportUdiForExchangeWizard method buildItemRecordList.
/*
* (non-Javadoc)
*
* @see
* org.talend.dataprofiler.core.ui.imex.ExportForExchangeWizard#buildItemRecordList(org.talend.dataprofiler.core
* .ui.imex.model.ItemRecord[])
*/
@Override
protected Map<String, ItemRecord[]> buildItemRecordList(ItemRecord[] records) {
Map<String, ItemRecord[]> map = new HashMap<String, ItemRecord[]>();
for (ItemRecord record : records) {
ModelElement element = record.getElement();
if (element != null) {
// $NON-NLS-1$
String zipFileName = element.getName() + ".zip";
List<ItemRecord> list = new ArrayList<ItemRecord>();
list.add(record);
list.addAll(getDependencyRecords(record));
map.put(zipFileName, list.toArray(new ItemRecord[list.size()]));
}
}
return map;
}
use of org.talend.dataprofiler.core.ui.imex.model.ItemRecord in project tdq-studio-se by Talend.
the class ExportUdiForExchangeWizard method getDependencyRecords.
/**
* get the dependency ItemRecord for UDI.
*
* @param record UDI ItemRecord
* @param records jar files ItemRecord which dependencied by UDI
* @return
*/
private List<ItemRecord> getDependencyRecords(ItemRecord record) {
List<ItemRecord> list = new ArrayList<ItemRecord>();
List<File> udiJarfiles = new ArrayList<File>();
TaggedValue tv = TaggedValueHelper.getTaggedValue(TaggedValueHelper.JAR_FILE_PATH, record.getElement().getTaggedValue());
if (tv != null) {
for (IFile udiJarFile : UDIUtils.getLibJarFileList()) {
for (String jarName : tv.getValue().split("\\|\\|")) {
// $NON-NLS-1$
if (udiJarFile.getName().equals(jarName)) {
udiJarfiles.add(udiJarFile.getLocation().toFile());
break;
}
}
}
}
for (File jarFile : udiJarfiles) {
list.add(new ItemRecord(jarFile));
}
return list;
}
use of org.talend.dataprofiler.core.ui.imex.model.ItemRecord in project tdq-studio-se by Talend.
the class ExportWizardPage method createRepositoryTree.
/**
* DOC bZhou Comment method "createRepositoryTree".
*
* @param top
*/
protected void createRepositoryTree(Composite top) {
Composite treeComposite = new Composite(top, SWT.NONE);
treeComposite.setLayout(new GridLayout(2, false));
treeComposite.setLayoutData(new GridData(GridData.FILL_BOTH));
repositoryTree = new ContainerCheckedTreeViewer(treeComposite);
repositoryTree.setContentProvider(new FileTreeContentProvider());
repositoryTree.setLabelProvider(new FileTreeLabelProvider());
repositoryTree.setInput(writer.computeInput(specifiedPath));
repositoryTree.expandAll();
repositoryTree.getTree().setLayoutData(new GridData(GridData.FILL_BOTH));
// ADD msjian TDQ-14573: automatically checked the initial selected items.
if (intCheckedElements != null) {
List<ItemRecord> selectedItemRecords = new ArrayList<ItemRecord>();
for (Object intCheckedElement : intCheckedElements) {
getFileFromNode(selectedItemRecords, (IRepositoryNode) intCheckedElement);
}
repositoryTree.setCheckedElements(selectedItemRecords.toArray());
}
// show the same order with repository tree
repositoryTree.setComparator(new ViewerComparator() {
@Override
public int compare(Viewer iviewer, Object o1, Object o2) {
DQRepositoryNode recursiveFind = RepositoryNodeHelper.recursiveFind(((ItemRecord) o1).getElement());
DQRepositoryNode recursiveFind2 = RepositoryNodeHelper.recursiveFind(((ItemRecord) o2).getElement());
return new RepositoryNodeComparator().compare(recursiveFind, recursiveFind2);
}
});
// TDQ-14573~
createUtilityButtons(treeComposite);
}
Aggregations