Search in sources :

Example 31 with DBColumnRepNode

use of org.talend.dq.nodes.DBColumnRepNode in project tdq-studio-se by Talend.

the class ColumnsMapSelectionDialog method buildUserMap.

/**
 * DOC xqliu Comment method "buildUserMap".
 *
 * @param allCheckedElements
 */
private void buildUserMap(List<IRepositoryNode> allCheckedElements) {
    if (allCheckedElements != null && !allCheckedElements.isEmpty()) {
        List<TdColumn> userColumnsAll = new ArrayList<TdColumn>();
        for (IRepositoryNode node : allCheckedElements) {
            if (node instanceof DBColumnRepNode) {
                userColumnsAll.add(((DBColumnRepNode) node).getTdColumn());
            }
        }
        Set<ColumnSet> keySet = this.allMap.keySet();
        for (ColumnSet cs : keySet) {
            List<TdColumn> userColumns = new ArrayList<TdColumn>();
            List<TdColumn> list = this.allMap.get(cs);
            for (TdColumn column : list) {
                if (userColumnsAll.contains(column)) {
                    userColumns.add(column);
                }
            }
            if (!userColumns.isEmpty()) {
                this.userMap.put(cs, userColumns);
            }
        }
    }
}
Also used : TdColumn(org.talend.cwm.relational.TdColumn) IRepositoryNode(org.talend.repository.model.IRepositoryNode) ArrayList(java.util.ArrayList) ColumnSet(orgomg.cwm.resource.relational.ColumnSet) DBColumnRepNode(org.talend.dq.nodes.DBColumnRepNode)

Aggregations

DBColumnRepNode (org.talend.dq.nodes.DBColumnRepNode)31 IRepositoryNode (org.talend.repository.model.IRepositoryNode)15 TdColumn (org.talend.cwm.relational.TdColumn)14 RepositoryNode (org.talend.repository.model.RepositoryNode)13 ArrayList (java.util.ArrayList)12 MetadataColumnRepositoryObject (org.talend.core.repository.model.repositoryObject.MetadataColumnRepositoryObject)12 IRepositoryViewObject (org.talend.core.model.repository.IRepositoryViewObject)9 DBTableRepNode (org.talend.dq.nodes.DBTableRepNode)9 TdTable (org.talend.cwm.relational.TdTable)7 DBViewRepNode (org.talend.dq.nodes.DBViewRepNode)7 List (java.util.List)6 DFColumnRepNode (org.talend.dq.nodes.DFColumnRepNode)6 DFTableRepNode (org.talend.dq.nodes.DFTableRepNode)5 LocalSelectionTransfer (org.eclipse.jface.util.LocalSelectionTransfer)4 IStructuredSelection (org.eclipse.jface.viewers.IStructuredSelection)4 DropTarget (org.eclipse.swt.dnd.DropTarget)4 DropTargetEvent (org.eclipse.swt.dnd.DropTargetEvent)4 DatabaseConnectionItem (org.talend.core.model.properties.DatabaseConnectionItem)4 DBCatalogRepNode (org.talend.dq.nodes.DBCatalogRepNode)4 DBConnectionRepNode (org.talend.dq.nodes.DBConnectionRepNode)4