[Yanel-commits] rev 45029 -
public/yanel/contributions/ajax-components/src/access-policy-editor/java/org/wyona/security/gwt/accesspolicyeditor/client
michi at wyona.com
michi at wyona.com
Thu Oct 15 00:08:41 CEST 2009
Author: michi
Date: 2009-10-15 00:08:40 +0200 (Thu, 15 Oct 2009)
New Revision: 45029
Modified:
public/yanel/contributions/ajax-components/src/access-policy-editor/java/org/wyona/security/gwt/accesspolicyeditor/client/PolicyListBoxWidget.java
Log:
more documentation added and log statements improved
Modified: public/yanel/contributions/ajax-components/src/access-policy-editor/java/org/wyona/security/gwt/accesspolicyeditor/client/PolicyListBoxWidget.java
===================================================================
--- public/yanel/contributions/ajax-components/src/access-policy-editor/java/org/wyona/security/gwt/accesspolicyeditor/client/PolicyListBoxWidget.java 2009-10-14 22:07:59 UTC (rev 45028)
+++ public/yanel/contributions/ajax-components/src/access-policy-editor/java/org/wyona/security/gwt/accesspolicyeditor/client/PolicyListBoxWidget.java 2009-10-14 22:08:40 UTC (rev 45029)
@@ -80,7 +80,7 @@
Right[] rights = users[i].getRights();
//Window.alert("User: " + users[i].getId() + " (Number of rights: " + rights.length + ")");
String value = type+": " + id;
- lb.addItem(getListLabel(type, id, rights), value);
+ lb.addItem(getListItemLabel(type, id, rights), value);
}
}
if (groups != null) {
@@ -90,7 +90,7 @@
Right[] rights = groups[i].getRights();
//Window.alert("Group: " + groups[i].getId() + " (Number of rights: " + rights.length + ")");
String value = type+": " + id;
- lb.addItem(getListLabel(type, id, rights), value);
+ lb.addItem(getListItemLabel(type, id, rights), value);
}
} else {
Window.alert("No groups!");
@@ -306,11 +306,23 @@
}
/**
+ * Generate list item label, e.g. "u: (view, -, toolbar) user-foo-bar"
+ *
* @param type u for user and g for group
* @param id
* @param rights Rights
*/
- private String getListLabel(String type, String id, Right[] rights) {
+ private String getListItemLabel(String type, String id, Right[] rights) {
+
+/*
+ if (availableRights == null) {
+ Window.alert("INFO: Available rights not loaded yet! Wait some more seconds ...");
+ for (int i = 0; i < 10; i ++) {
+ // sleep(1);
+ }
+ }
+*/
+
StringBuffer sb = new StringBuffer(type + ":");
if (availableRights != null) {
@@ -334,7 +346,7 @@
}
sb.append(")");
} else {
- Window.alert("Available rights not loaded yet!");
+ Window.alert("ERROR: Available rights are null (probably not loaded yet) and hence label cannot be completed!");
}
sb.append(" " + id);
return sb.toString();
More information about the Yanel-commits
mailing list