[Yanel-commits] rev 32802 - public/yanel/contributions/ajax-components/src/access-policy-editor/java/org/wyona/security/gwt/accesspolicyeditor/client

michi at wyona.com michi at wyona.com
Mon Mar 3 12:35:42 CET 2008


Author: michi
Date: 2008-03-03 12:35:41 +0100 (Mon, 03 Mar 2008)
New Revision: 32802

Modified:
   public/yanel/contributions/ajax-components/src/access-policy-editor/java/org/wyona/security/gwt/accesspolicyeditor/client/PolicyListBoxWidget.java
Log:
variables introduced

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	2008-03-03 11:31:44 UTC (rev 32801)
+++ public/yanel/contributions/ajax-components/src/access-policy-editor/java/org/wyona/security/gwt/accesspolicyeditor/client/PolicyListBoxWidget.java	2008-03-03 11:35:41 UTC (rev 32802)
@@ -44,6 +44,9 @@
 
     private VerticalPanel vp = new VerticalPanel();
 
+    private String READ_RIGHT = "Read";
+    private String WRITE_RIGHT = "Write";
+
     /**
      *
      */
@@ -78,14 +81,14 @@
         if (users != null || groups != null) {
             if (users != null) {
                 for (int i = 0; i < users.length; i++) {
-                    String label = "u: (Read,Write) " + users[i].getId();
+                    String label = "u: ("+READ_RIGHT+","+WRITE_RIGHT+") " + users[i].getId();
                     String value = "u: " + users[i].getId();
                     lb.addItem(label, value);
                 }
             }
             if (groups != null) {
                 for (int i = 0; i < groups.length; i++) {
-                    String label = "g: (Read,Write) " + groups[i].getId();
+                    String label = "g: ("+READ_RIGHT+","+WRITE_RIGHT+") " + groups[i].getId();
                     String value = "g: " + groups[i].getId();
                     lb.addItem(label, value);
                 }
@@ -126,10 +129,10 @@
                     String[] newRights;
                     if (readCB.isChecked()) {
                         Window.alert("Add Read right from selected identity " + selectedIdentity + " from policy");
-                        newRights = addRight(currentRights, "Read");
+                        newRights = addRight(currentRights, READ_RIGHT);
                     } else {
                         Window.alert("Remove Read right from selected identity " + selectedIdentity + " from policy");
-                        newRights = removeRight(currentRights, "Read");
+                        newRights = removeRight(currentRights, READ_RIGHT);
                     }
                     setSelectedListItem(newRights);
                 } else if (sender == writeCB) {
@@ -137,10 +140,10 @@
                     String[] newRights;
                     if (writeCB.isChecked()) {
                         Window.alert("Add Write right from selected identity " + selectedIdentity + " from policy");
-                        newRights = addRight(currentRights, "Write");
+                        newRights = addRight(currentRights, WRITE_RIGHT);
                     } else {
                         Window.alert("Remove Write right from selected identity " + selectedIdentity + " from policy");
-                        newRights = removeRight(currentRights, "Write");
+                        newRights = removeRight(currentRights, WRITE_RIGHT);
                     }
                     setSelectedListItem(newRights);
                 }
@@ -158,10 +161,10 @@
             boolean hasReadBeenChecked = false;
             boolean hasWriteBeenChecked = false;
             for (int j = 0; j < rights.length; j++) {
-                if (rights[j].equals("Read")) {
+                if (rights[j].equals(READ_RIGHT)) {
                     readCB.setChecked(true);
                     hasReadBeenChecked = true;
-                } else if (rights[j].equals("Write")) {
+                } else if (rights[j].equals(WRITE_RIGHT)) {
                     writeCB.setChecked(true);
                     hasWriteBeenChecked = true;
                 }



More information about the Yanel-commits mailing list