Search in sources :

Example 1 with CreateColumnAnalysisAction

use of org.talend.dataprofiler.core.ui.action.actions.predefined.CreateColumnAnalysisAction in project tdq-studio-se by Talend.

the class CreateAnalysisOnHDFSAction method run.

/*
     * (non-Javadoc)
     * 
     * @see org.eclipse.jface.action.Action#run()
     */
@Override
public void run() {
    DBTableRepNode newTableNode = openCreateHiveTable();
    if (newTableNode != null) {
        List<IRepositoryNode> allColumns = newTableNode.getAllColumns();
        TreePath[] paths = new TreePath[allColumns.size()];
        int i = 0;
        for (IRepositoryNode column : allColumns) {
            paths[i++] = new TreePath(new Object[] { column });
        }
        CreateColumnAnalysisAction analysisAction = new CreateColumnAnalysisAction();
        analysisAction.setSelection(new TreeSelection(paths));
        analysisAction.run();
    }
}
Also used : DBTableRepNode(org.talend.dq.nodes.DBTableRepNode) IRepositoryNode(org.talend.repository.model.IRepositoryNode) TreePath(org.eclipse.jface.viewers.TreePath) CreateColumnAnalysisAction(org.talend.dataprofiler.core.ui.action.actions.predefined.CreateColumnAnalysisAction) TreeSelection(org.eclipse.jface.viewers.TreeSelection)

Example 2 with CreateColumnAnalysisAction

use of org.talend.dataprofiler.core.ui.action.actions.predefined.CreateColumnAnalysisAction in project tdq-studio-se by Talend.

the class ModelElementTreeMenuProvider method createColumnAnalysis.

/**
 * DOC qiongli Comment method "createColumnAnalysis".bug 16252.
 *
 * @param newTree
 */
private void createColumnAnalysis(Tree newTree) {
    TreeItem[] items = newTree.getSelection();
    if (items.length > 0) {
        TreePath[] paths = new TreePath[items.length];
        for (int i = 0; i < items.length; i++) {
            // MOD klliu bug 20820 change TDcolum to IRepositoryNode, then solve NPE 2011-04-29
            // $NON-NLS-1$
            ModelElementIndicator data = (ModelElementIndicator) items[i].getData("MODELELEMENT_INDICATOR_KEY");
            IRepositoryNode modelElementRepositoryNode = data.getModelElementRepositoryNode();
            paths[i] = new TreePath(new Object[] { modelElementRepositoryNode });
        }
        CreateColumnAnalysisAction analysisAction = new CreateColumnAnalysisAction();
        analysisAction.setSelection(new TreeSelection(paths));
        analysisAction.run();
    }
}
Also used : TreePath(org.eclipse.jface.viewers.TreePath) IRepositoryNode(org.talend.repository.model.IRepositoryNode) TreeItem(org.eclipse.swt.widgets.TreeItem) CreateColumnAnalysisAction(org.talend.dataprofiler.core.ui.action.actions.predefined.CreateColumnAnalysisAction) TreeSelection(org.eclipse.jface.viewers.TreeSelection) MetadataColumnRepositoryObject(org.talend.core.repository.model.repositoryObject.MetadataColumnRepositoryObject) ISubRepositoryObject(org.talend.core.model.repository.ISubRepositoryObject) ModelElementIndicator(org.talend.dataprofiler.core.model.ModelElementIndicator)

Aggregations

TreePath (org.eclipse.jface.viewers.TreePath)2 TreeSelection (org.eclipse.jface.viewers.TreeSelection)2 CreateColumnAnalysisAction (org.talend.dataprofiler.core.ui.action.actions.predefined.CreateColumnAnalysisAction)2 IRepositoryNode (org.talend.repository.model.IRepositoryNode)2 TreeItem (org.eclipse.swt.widgets.TreeItem)1 ISubRepositoryObject (org.talend.core.model.repository.ISubRepositoryObject)1 MetadataColumnRepositoryObject (org.talend.core.repository.model.repositoryObject.MetadataColumnRepositoryObject)1 ModelElementIndicator (org.talend.dataprofiler.core.model.ModelElementIndicator)1 DBTableRepNode (org.talend.dq.nodes.DBTableRepNode)1