Search in sources :

Example 6 with IHCatalogNode

use of org.talend.repository.hcatalog.model.IHCatalogNode 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

IHCatalogNode (org.talend.repository.hcatalog.model.IHCatalogNode)6 ArrayList (java.util.ArrayList)1 ModifyEvent (org.eclipse.swt.events.ModifyEvent)1 ModifyListener (org.eclipse.swt.events.ModifyListener)1 SelectionEvent (org.eclipse.swt.events.SelectionEvent)1 Point (org.eclipse.swt.graphics.Point)1 GridData (org.eclipse.swt.layout.GridData)1 Event (org.eclipse.swt.widgets.Event)1 Listener (org.eclipse.swt.widgets.Listener)1 TreeColumn (org.eclipse.swt.widgets.TreeColumn)1 TreeItem (org.eclipse.swt.widgets.TreeItem)1 ContainerCheckedTreeViewer (org.eclipse.ui.dialogs.ContainerCheckedTreeViewer)1 SearchPattern (org.eclipse.ui.dialogs.SearchPattern)1 MetadataTable (org.talend.core.model.metadata.builder.connection.MetadataTable)1 AbstractMetadataExtractorViewProvider (org.talend.core.repository.model.provider.AbstractMetadataExtractorViewProvider)1 TdTable (org.talend.cwm.relational.TdTable)1 HCatalogNode (org.talend.repository.hcatalog.model.HCatalogNode)1 HCatalogConnection (org.talend.repository.model.hcatalog.HCatalogConnection)1