use of org.talend.dq.nodes.SysIndicatorFolderRepNode in project tdq-studio-se by Talend.
the class ResourceViewContentProvider method hasChildren.
@Override
public boolean hasChildren(Object element) {
try {
if (element instanceof IRepositoryNode) {
IRepositoryNode node = (IRepositoryNode) element;
IRepositoryViewObject viewObject = node.getObject();
if (viewObject instanceof MetadataColumnRepositoryObject) {
return false;
} else if (node instanceof ExchangeFolderRepNode || node instanceof ExchangeCategoryRepNode || node instanceof SysIndicatorFolderRepNode || element instanceof DBTableRepNode || element instanceof DBViewRepNode || element instanceof DBCatalogRepNode || element instanceof DBSchemaRepNode) {
// ExchangeCategoryRepNode always have children
return true;
} else if (node instanceof ExchangeComponentRepNode) {
// ExchangeComponentRepNode always don't have children
return false;
} else if (element instanceof DBTableFolderRepNode) {
// MOD gdbu 2011-9-1 TDQ-3457
if (DQRepositoryNode.isOnFilterring()) {
return true;
}
DBTableFolderRepNode dbTableFolder = (DBTableFolderRepNode) element;
return dbTableFolder.hasChildren();
} else if (element instanceof DBViewFolderRepNode) {
if (DQRepositoryNode.isOnFilterring()) {
return true;
}
DBViewFolderRepNode dbViewFolder = (DBViewFolderRepNode) element;
return dbViewFolder.hasChildren();
// ~TDQ-3457
}
} else if (element instanceof IEcosCategory) {
return true;
}
// // MOD qiongli feature 9486
// if (element instanceof IFolder) {
// // MOD yyi 2010-09-30 15271: svn project can't load exchange nodes
// if (ResourceManager.isExchangeFolder((IFolder) element)) {
// return true;
// }
// // ~15271
// List<Object> obsLs = Arrays.asList(super.getChildren(element));
// if (obsLs.size() == 1) {
// Object obj = (Object) obsLs.get(0);
// if (obj instanceof IFolder && ((IFolder) obj).getName().equals(PluginConstant.SVN_SUFFIX))
// return false;
// }
// } else if (element instanceof DQRecycleBinNode) {
// DQRecycleBinNode rbn = (DQRecycleBinNode) element;
// Object obj = rbn.getObject();
// if (obj instanceof IFolder) {
// try {
// return ((IFolder) obj).members().length > 0;
// } catch (CoreException e) {
// log.error(e);
// }
// }
// return false;
// }
} catch (MissingDriverException e) {
if (PluginChecker.isOnlyTopLoaded()) {
MessageDialog.openWarning(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), // $NON-NLS-1$
DefaultMessagesImpl.getString("ResourceViewContentProvider.warining"), e.getErrorMessage());
} else {
log.error(e, e);
}
return false;
}
return super.hasChildren(element);
}
Aggregations