Search in sources :

Example 1 with HCatalogNode

use of org.talend.repository.hcatalog.model.HCatalogNode in project tbd-studio-se by Talend.

the class TableSelectorTreeViewerProvider method getChildren.

@Override
public Object[] getChildren(Object parentElement) {
    List<IHCatalogNode> nodes = new ArrayList<IHCatalogNode>();
    if (parentElement instanceof HCatalogConnection) {
        try {
            List<TdTable> tables = ExtractMetaDataFromHCatalog.extractTables((HCatalogConnection) parentElement);
            for (TdTable table : tables) {
                IHCatalogNode node = new HCatalogNode();
                node.setValue(table.getLabel());
                node.setTable(table);
                nodes.add(node);
            }
        } catch (Exception e) {
            ExceptionHandler.process(e);
        }
    }
    return nodes.toArray();
}
Also used : HCatalogConnection(org.talend.repository.model.hcatalog.HCatalogConnection) TdTable(org.talend.cwm.relational.TdTable) IHCatalogNode(org.talend.repository.hcatalog.model.IHCatalogNode) HCatalogNode(org.talend.repository.hcatalog.model.HCatalogNode) ArrayList(java.util.ArrayList) IHCatalogNode(org.talend.repository.hcatalog.model.IHCatalogNode)

Aggregations

ArrayList (java.util.ArrayList)1 TdTable (org.talend.cwm.relational.TdTable)1 HCatalogNode (org.talend.repository.hcatalog.model.HCatalogNode)1 IHCatalogNode (org.talend.repository.hcatalog.model.IHCatalogNode)1 HCatalogConnection (org.talend.repository.model.hcatalog.HCatalogConnection)1