if (treeNode instanceof DBObjectList) {
DBObjectList objectsList = (DBObjectList) treeNode;
boolean isEmpty = objectsList.getTreeChildCount() == 0;
isLoading = objectsList.isLoading();
SimpleTextAttributes textAttributes =
isLoading ? SimpleTextAttributes.GRAY_ITALIC_ATTRIBUTES :
isEmpty ? SimpleTextAttributes.REGULAR_ATTRIBUTES :
SimpleTextAttributes.REGULAR_BOLD_ATTRIBUTES;
append(displayName, textAttributes);
// todo display load error
/*
SimpleTextAttributes descriptionTA = objectsList.getErrorMessage() == null ?
SimpleTextAttributes.GRAY_ATTRIBUTES : SimpleTextAttributes.ERROR_ATTRIBUTES;
append(" " + displayDetails, descriptionTA);
if (objectsList.getErrorMessage() != null) {
String msg = "Could not load " + displayName + ". Cause: " + objectsList.getErrorMessage();
setToolTipText(msg);
} else {
setToolTipText(null);
}
*/
} else {
boolean showBold = false;
boolean isError = false;
if (treeNode instanceof DBObject) {
DBObject object = (DBObject) treeNode;
if (object.isOfType(DBObjectType.SCHEMA)) {
DBSchema schema = (DBSchema) object;
showBold = schema.isUserSchema();
}
isError = !object.isValid();
}
SimpleTextAttributes textAttributes =
isError ? SimpleTextAttributes.ERROR_ATTRIBUTES :
showBold ? SimpleTextAttributes.REGULAR_BOLD_ATTRIBUTES :
SimpleTextAttributes.REGULAR_ATTRIBUTES;
if (displayName == null) displayName = "displayName null!!";