use of org.talend.dataprofiler.core.model.OverviewIndUIElement in project tdq-studio-se by Talend.
the class OverviewResultPage method createResultSection.
@Override
protected void createResultSection(Composite parent) {
statisticalSection = this.createSection(form, parent, DefaultMessagesImpl.getString("ConnectionMasterDetailsPage.statisticalinformations"), // $NON-NLS-1$
null);
Composite sectionClient = toolkit.createComposite(statisticalSection);
sectionClient.setLayout(new GridLayout());
catalogTableViewer = new TableViewer(sectionClient, SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER | SWT.FULL_SELECTION);
Table catalogTable = catalogTableViewer.getTable();
TableUtils.addActionTooltip(catalogTable);
catalogTable.setHeaderVisible(true);
catalogTable.setBackgroundMode(SWT.INHERIT_FORCE);
catalogTable.setLinesVisible(true);
GridDataFactory.fillDefaults().align(SWT.FILL, SWT.FILL).grab(true, true).applyTo(catalogTable);
List<Catalog> catalogs = getCatalogs();
boolean containSubSchema = false;
for (Catalog catalog : catalogs) {
List<Schema> schemas = CatalogHelper.getSchemas(catalog);
if (schemas.size() > 0) {
containSubSchema = true;
break;
}
}
if (catalogs.size() > 0 && containSubSchema) {
createCatalogSchemaColumns(catalogTable);
provider = new CatalogSchemaViewerProvier();
addColumnSorters(catalogTableViewer, catalogTable.getColumns(), catalogWithSchemaSorters);
createSchemaTableViewer(sectionClient);
schemaTableViewer.addSelectionChangedListener(new DisplayTableAndViewListener());
catalogTableViewer.addSelectionChangedListener(new ISelectionChangedListener() {
public void selectionChanged(SelectionChangedEvent event) {
StructuredSelection selection = (StructuredSelection) event.getSelection();
OverviewIndUIElement firstElement = (OverviewIndUIElement) selection.getFirstElement();
List<OverviewIndUIElement> cataUIEleList = new ArrayList<OverviewIndUIElement>();
if (firstElement != null) {
Indicator overviewIndicator = firstElement.getOverviewIndicator();
// selection.getFirstElement();
CatalogIndicator catalogIndicator = (CatalogIndicator) overviewIndicator;
// MOD qiongli bug 13093,2010-7-2,
// selection.getFirstElement();
currentCatalogIndicator = (SchemaIndicator) overviewIndicator;
// MOD xqliu 2009-11-30 bug 9114
if (catalogIndicator != null) {
EList<SchemaIndicator> schemaIndicators = catalogIndicator.getSchemaIndicators();
for (SchemaIndicator schemaIndicator : schemaIndicators) {
RepositoryNode schemaNode = RepositoryNodeHelper.recursiveFind(schemaIndicator.getAnalyzedElement());
OverviewIndUIElement cataUIEle = new OverviewIndUIElement();
cataUIEle.setNode(schemaNode);
cataUIEle.setOverviewIndicator(schemaIndicator);
cataUIEleList.add(cataUIEle);
}
schemaTableViewer.setInput(cataUIEleList);
schemaTableViewer.getTable().setVisible(true);
addColumnSorters(schemaTableViewer, schemaTableViewer.getTable().getColumns(), schemaSorters);
}
}
// ~
}
});
createContextMenuFor(schemaTableViewer);
} else {
if (catalogs.size() > 0) {
createCatalogTableColumns(catalogTable);
provider = new CatalogViewerProvier();
} else {
createSchemaTableColumns(catalogTable);
provider = new SchemaViewerProvier();
}
addColumnSorters(catalogTableViewer, catalogTable.getColumns(), schemaSorters);
catalogTableViewer.addSelectionChangedListener(new DisplayTableAndViewListener());
}
catalogTableViewer.setLabelProvider(provider);
catalogTableViewer.setContentProvider(provider);
doSetInput();
tableAndViewComposite = new Composite(sectionClient, SWT.NONE);
GridDataFactory.fillDefaults().align(SWT.FILL, SWT.FILL).grab(true, true).applyTo(tableAndViewComposite);
GridLayout layout = new GridLayout(2, false);
layout.marginWidth = 0;
layout.horizontalSpacing = 50;
tableAndViewComposite.setLayout(layout);
tableAndViewComposite.setVisible(false);
sectionClient.layout();
statisticalSection.setClient(sectionClient);
createContextMenuFor(catalogTableViewer);
}
use of org.talend.dataprofiler.core.model.OverviewIndUIElement in project tdq-studio-se by Talend.
the class OverviewResultPage method wapperInput.
/**
* DOC klliu Comment method "wapperInput". relations
*
* @param indicatorTableList
* @param parentNode
* @return
*/
private List<OverviewIndUIElement> wapperInput(EList<TableIndicator> indicatorTableList, IRepositoryNode parentNode) {
List<OverviewIndUIElement> cataUIEleList = new ArrayList<OverviewIndUIElement>();
List<IRepositoryNode> children = parentNode.getChildren();
for (IRepositoryNode folderNode : children) {
if (folderNode instanceof DBTableFolderRepNode) {
List<IRepositoryNode> tableNodes = folderNode.getChildren();
// MOD 20120315 klliu&yyin TDQ-2391, avoid getting many times for table nodes.
for (TableIndicator indicator : indicatorTableList) {
boolean equals = false;
for (IRepositoryNode tableNode : tableNodes) {
MetadataTable table = ((MetadataTableRepositoryObject) tableNode.getObject()).getTable();
String name = table.getName();
String tableName = indicator.getTableName();
// String connUuid = ResourceHelper.getUUID(table);
// String anaUuid = ResourceHelper.getUUID(indicator.getAnalyzedElement());
equals = name.equals(tableName);
if (equals) {
OverviewIndUIElement tableUIEle = new OverviewIndUIElement();
tableUIEle.setNode(tableNode);
tableUIEle.setOverviewIndicator(indicator);
if (DqRepositoryViewService.isComeFromRefrenceProject(getTdDataProvider()) && ColumnSetHelper.getColumns((ColumnSet) table).isEmpty()) {
tableUIEle.setVirtualNode(true);
}
cataUIEleList.add(tableUIEle);
break;
}
}
if (!equals) {
OverviewIndUIElement tableUIEle = new OverviewIndUIElement();
tableUIEle.setOverviewIndicator(indicator);
tableUIEle.setVirtualNode(true);
cataUIEleList.add(tableUIEle);
}
}
}
}
return cataUIEleList;
}
use of org.talend.dataprofiler.core.model.OverviewIndUIElement in project tdq-studio-se by Talend.
the class ConnectionAnalysisDetailsPage method getSchemaIndicators.
@Override
public List<OverviewIndUIElement> getSchemaIndicators() {
ConnectionIndicator conIndicator = (ConnectionIndicator) getCurrentModelElement().getResults().getIndicators().get(0);
Connection analyzedElement = (Connection) conIndicator.getAnalyzedElement();
EList<SchemaIndicator> schemaIndicators = conIndicator.getSchemaIndicators();
List<OverviewIndUIElement> cataUIEleList = new ArrayList<OverviewIndUIElement>();
RepositoryNode connNode = RepositoryNodeHelper.recursiveFind(analyzedElement);
for (Indicator indicator : schemaIndicators) {
if (connNode != null) {
for (IRepositoryNode schemaNode : connNode.getChildren()) {
String nodeUuid = ResourceHelper.getUUID(((MetadataSchemaRepositoryObject) schemaNode.getObject()).getSchema());
String anaUuid = ResourceHelper.getUUID(indicator.getAnalyzedElement());
if (nodeUuid.equals(anaUuid)) {
OverviewIndUIElement cataUIEle = new OverviewIndUIElement();
cataUIEle.setNode(schemaNode);
cataUIEle.setOverviewIndicator(indicator);
cataUIEleList.add(cataUIEle);
break;
}
}
}
}
return cataUIEleList;
}
use of org.talend.dataprofiler.core.model.OverviewIndUIElement in project tdq-studio-se by Talend.
the class AbstractStatisticalViewerProvider method getColumnText.
public String getColumnText(Object element, int columnIndex) {
String text = PluginConstant.EMPTY_STRING;
if (element instanceof OverviewIndUIElement) {
SchemaIndicator indicator = (SchemaIndicator) ((OverviewIndUIElement) element).getOverviewIndicator();
switch(columnIndex) {
case 0:
// for TDQ-8833 vertica database has a catalog and the name of it is PluginConstant.EMPTY_STRING
ModelElement analyzedElement = indicator.getAnalyzedElement();
if (analyzedElement.getClass() == orgomg.cwm.resource.relational.impl.CatalogImpl.class) {
if (PluginConstant.EMPTY_STRING.equals(analyzedElement.getName())) {
return text = org.talend.dataquality.PluginConstant.DEFAULT_STRING;
}
}
// ~
text = analyzedElement.getName();
return text;
case 1:
text = PluginConstant.EMPTY_STRING + indicator.getTableRowCount();
return text;
default:
break;
}
return getOtherColumnText(columnIndex, indicator);
}
return text;
}
use of org.talend.dataprofiler.core.model.OverviewIndUIElement in project tdq-studio-se by Talend.
the class CatalogAnalysisDetailsPage method getCatalogIndicators.
/*
* (non-Javadoc)
*
* @see org.talend.dataprofiler.core.ui.editor.analysis.AbstractFilterMetadataPage#getCatalogIndicators()
*/
@Override
protected List<OverviewIndUIElement> getCatalogIndicators() {
List<OverviewIndUIElement> cataUIEleList = new ArrayList<OverviewIndUIElement>();
EList<Indicator> indicators = getCurrentModelElement().getResults().getIndicators();
catalogIndicatorList.clear();
IRepositoryNode connNode = getCurrentConnectionRepNode();
for (Indicator indicator : indicators) {
if (connNode != null) {
for (IRepositoryNode catalogNode : connNode.getChildren()) {
String nodeUuid = ResourceHelper.getUUID(((MetadataCatalogRepositoryObject) catalogNode.getObject()).getCatalog());
String anaUuid = ResourceHelper.getUUID(indicator.getAnalyzedElement());
if (nodeUuid.equals(anaUuid)) {
OverviewIndUIElement cataUIEle = new OverviewIndUIElement();
cataUIEle.setNode(catalogNode);
cataUIEle.setOverviewIndicator(indicator);
cataUIEleList.add(cataUIEle);
break;
}
}
}
}
return cataUIEleList;
}
Aggregations