use of org.talend.core.repository.model.repositoryObject.TdTableRepositoryObject in project tdq-studio-se by Talend.
the class DBColumnFolderRepNode method getChildrenCount.
/**
* TDQ-11431: use this way to get children count correctly.
*
* @return
*/
private int getChildrenCount() {
List<TdColumn> columnsList = new ArrayList<TdColumn>();
IRepositoryViewObject object = this.getParent().getObject();
if (object instanceof TdTableRepositoryObject) {
tdTable = (TdTable) ((TdTableRepositoryObject) object).getTable();
columnsList = TableHelper.getColumns(tdTable);
} else {
tdView = ((TdViewRepositoryObject) object).getTdView();
columnsList = ViewHelper.getColumns(tdView);
}
return columnsList.size();
}
use of org.talend.core.repository.model.repositoryObject.TdTableRepositoryObject in project tdq-studio-se by Talend.
the class DBTableFolderRepNode method createTableRepositoryNode.
/**
* DOC klliu Comment method "createTableRepositoryNode".
*
* @param tables
*/
private void createTableRepositoryNode(List<TdTable> tables, List<IRepositoryNode> node) {
if (tables != null) {
for (TdTable table : tables) {
// $NON-NLS-1$
table.setTableType("TABLE");
TdTableRepositoryObject metadataTable = new TdTableRepositoryObject(viewObject, table);
metadataTable.setTableName(table.getName());
metadataTable.setLabel(table.getName());
metadataTable.setId(table.getName());
DBTableRepNode tableNode = new DBTableRepNode(metadataTable, this, ENodeType.TDQ_REPOSITORY_ELEMENT, getProject());
tableNode.setProperties(EProperties.LABEL, ERepositoryObjectType.METADATA_CON_TABLE);
tableNode.setProperties(EProperties.CONTENT_TYPE, ERepositoryObjectType.METADATA_CON_TABLE);
metadataTable.setRepositoryNode(tableNode);
node.add(tableNode);
}
}
}
use of org.talend.core.repository.model.repositoryObject.TdTableRepositoryObject in project tdq-studio-se by Talend.
the class CreateColumnAnalysis method init.
@Override
public void init(ICommonActionExtensionSite site) {
if (site.getViewSite() instanceof ICommonViewerWorkbenchSite) {
StructuredSelection selection = (StructuredSelection) site.getStructuredViewer().getSelection();
Object fe = selection.getFirstElement();
if (fe instanceof IRepositoryNode) {
IRepositoryViewObject object = ((IRepositoryNode) fe).getObject();
if (object instanceof TdTableRepositoryObject) {
TdTableRepositoryObject tableObject = (TdTableRepositoryObject) object;
modelElement = tableObject.getTdTable();
} else if (object instanceof TdViewRepositoryObject) {
TdViewRepositoryObject viewObject = (TdViewRepositoryObject) object;
modelElement = viewObject.getTdView();
}
}
}
super.init(site);
}
Aggregations