use of org.talend.repository.viewer.ui.provider.RepositoryContentProvider in project tdi-studio-se by Talend.
the class DynamicComposite method getConnectionItems.
/**
* DOC qzhang Comment method "getConnectionItems".
*
* @return
* @throws PersistenceException
*/
private List<ConnectionItem> getConnectionItems() throws PersistenceException {
List<ConnectionItem> list = new ArrayList<ConnectionItem>();
IRepositoryView repositoryView = RepositoryManagerHelper.findRepositoryView();
if (repositoryView != null) {
TreeViewer viewer = (TreeViewer) repositoryView.getViewer();
IContentProvider contentProvider = viewer.getContentProvider();
if (contentProvider instanceof RepositoryContentProvider) {
RepositoryContentProvider provider = (RepositoryContentProvider) contentProvider;
RepositoryNode metadataConNode = provider.getRootRepositoryNode(ERepositoryObjectType.METADATA);
for (IRepositoryNode connectionItem : metadataConNode.getChildren()) {
if (viewer.isExpandable(connectionItem)) {
provider.getChildren(connectionItem);
}
for (IRepositoryNode node : connectionItem.getChildren()) {
addConnectionItem(viewer, provider, list, (RepositoryNode) node);
}
}
}
}
return list;
}
Aggregations