Revision 4d869bf1 src/gr/grnet/pithos/web/client/PermissionsList.java

b/src/gr/grnet/pithos/web/client/PermissionsList.java
43 43
import com.google.gwt.event.dom.client.ClickHandler;
44 44
import com.google.gwt.event.logical.shared.ValueChangeEvent;
45 45
import com.google.gwt.event.logical.shared.ValueChangeHandler;
46
import com.google.gwt.user.client.Command;
46 47
import com.google.gwt.user.client.ui.AbstractImagePrototype;
47 48
import com.google.gwt.user.client.ui.CheckBox;
48 49
import com.google.gwt.user.client.ui.Composite;
......
67 68
	protected boolean hasChanges = false;
68 69

  
69 70
    private boolean readonly = false;
71
    
72
    Command changePermissionsCallback;
70 73
	
71
	public PermissionsList(final Images theImages, Map<String, Boolean[]> thePermissions, String theOwner, boolean inheritsPermissions){
74
	public PermissionsList(final Images theImages, Map<String, Boolean[]> thePermissions, String theOwner, boolean inheritsPermissions, Command _changePermissionsCallback){
75
		changePermissionsCallback = _changePermissionsCallback;
72 76
		images = theImages;
73 77
		owner = theOwner;
74 78
		permissions =  new HashMap<String, Boolean[]>(thePermissions);
......
103 107
		permissions.put(user, new Boolean[] {Boolean.valueOf(read), Boolean.valueOf(write)});
104 108
		hasChanges = true;
105 109
        updatePermissionTable();
110
        if (changePermissionsCallback != null)
111
        	changePermissionsCallback.execute();
106 112
	}
107 113

  
108 114
	/**
......
141 147
                        Boolean[] ps = permissions.get(user);
142 148
                        ps[0] = booleanValueChangeEvent.getValue();
143 149
                        hasChanges = true;
150
                        if (changePermissionsCallback != null)
151
                        	changePermissionsCallback.execute();
144 152
                    }
145 153
                });
146 154
                write.addValueChangeHandler(new ValueChangeHandler<Boolean>() {
......
149 157
                        Boolean[] ps = permissions.get(user);
150 158
                        ps[1] = booleanValueChangeEvent.getValue();
151 159
                        hasChanges = true;
160
                        if (changePermissionsCallback != null)
161
                        	changePermissionsCallback.execute();
152 162
                    }
153 163
                });
154 164
                PushButton removeButton = new PushButton(AbstractImagePrototype.create(images.delete()).createImage(), new ClickHandler() {
......
157 167
                        permissions.remove(user);
158 168
                        updatePermissionTable();
159 169
                        hasChanges = true;
170
                        if (changePermissionsCallback != null)
171
                        	changePermissionsCallback.execute();
160 172
                    }
161 173
                });
162 174
                permTable.setWidget(i, 3, removeButton);

Also available in: Unified diff