use of org.talend.dataprofiler.core.ui.action.actions.predefined.PreviewColumnAction in project tdq-studio-se by Talend.
the class ModelElementTreeMenuProvider method previewSelectedElements.
/**
* DOC Zqin Comment method "previewSelectedElements".
*
* @param newTree
*/
private void previewSelectedElements(Tree newTree) {
TreeItem[] items = newTree.getSelection();
ModelElement[] mes = new ModelElement[items.length];
for (int i = 0; i < items.length; i++) {
ModelElementIndicator meIndicator = (ModelElementIndicator) items[i].getData(AbstractColumnDropTree.MODELELEMENT_INDICATOR_KEY);
ModelElement me = ((MetadataColumnRepositoryObject) meIndicator.getModelElementRepositoryNode().getObject()).getTdColumn();
mes[i] = me;
}
new PreviewColumnAction(mes).run();
}
use of org.talend.dataprofiler.core.ui.action.actions.predefined.PreviewColumnAction in project tdq-studio-se by Talend.
the class PreviewColumnProvider method fillContextMenu.
@Override
public void fillContextMenu(IMenuManager menu) {
// MOD mzhao user readonly role on svn repository mode.
if (!isShowMenu()) {
return;
}
TreeSelection treeSelection = ((TreeSelection) this.getContext().getSelection());
List<TdColumn> list = new ArrayList<TdColumn>();
Object[] selectedObjs = treeSelection.toArray();
for (Object obj : selectedObjs) {
// MOD msjian 2011-12-7 TDQ-4091: the tdColumn info is not correct
if (obj instanceof DBColumnRepNode) {
list.add(((DBColumnRepNode) obj).getTdColumn());
}
// TDQ-4091 ~
}
if (!list.isEmpty()) {
PreviewColumnAction action = new PreviewColumnAction(list.toArray(new TdColumn[list.size()]));
menu.add(action);
}
}
Aggregations