Skip to content

Commit

Permalink
Detection and warning when a brick has more than one version.
Browse files Browse the repository at this point in the history
Each brick must have exactly one version.
  • Loading branch information
danv61 committed Feb 14, 2020
1 parent a49b433 commit 7756c7a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,13 @@ public java.awt.Component getTreeCellRendererComponent(JTree tree, Object value,
component.setText(modelName);
component.setToolTipText(toolTip);
} else {
component.setText(modelName); // keep it simple for anything else
String str = modelName;
if(node.getChildCount() > 1) {
String prefix = sel ? "" : "<span style=\"color:#8B0000\">";
String suffix = sel ? "" : "</span>";
str += prefix + " (" + node.getChildCount() + ")" + suffix;
}
component.setText("<html>" + str + "</html>");
component.setToolTipText(toolTip);
}
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import javax.swing.JLabel;
import javax.swing.JTree;

import org.omg.PortableInterceptor.USER_EXCEPTION;
import org.vcell.util.document.GroupAccess;
import org.vcell.util.document.User;
import org.vcell.util.document.VCDocumentInfo;
Expand Down Expand Up @@ -201,6 +202,11 @@ else if(userObject instanceof VCDocumentInfoNode) {
}
}
}
} else if(sessionUser != null && nodeUser != null && VCDocumentDbTreeModel.USER_modelBricks.equals(nodeUser.getName())) {
// we warn if any brick has more than one version
if(node.getChildCount() != 1) {
setIcon(fieldFolderWarningIcon);
}
}
}
}
Expand Down

0 comments on commit 7756c7a

Please sign in to comment.