ItEr39S10CUAltaUsuario: implemented removal of Profiles in the User edition interface

This commit is contained in:
Jacobo Aragunde Pérez 2009-12-18 10:50:46 +01:00 committed by Javier Moran Rua
parent 2900f0afab
commit 0131f43b50
4 changed files with 26 additions and 0 deletions

View file

@ -96,4 +96,12 @@ public interface IUserModel {
*/
List<Profile> getProfiles();
/**
* Removes a profile from the list of {@link Profile} objects associated
* with the current User.
*
* @param role The {@link Profile} object to be removed.
*/
void removeProfile(Profile profile);
}

View file

@ -168,6 +168,11 @@ public class UserCRUDController extends GenericForwardComposer implements
return userModel.getProfiles();
}
public void removeProfile(Profile profile) {
userModel.removeProfile(profile);
Util.reloadBindings(createWindow);
}
private OnlyOneVisible getVisibility() {
return (visibility == null) ? new OnlyOneVisible(createWindow,
listWindow)

View file

@ -137,4 +137,9 @@ public class UserModel implements IUserModel {
}
return list;
}
@Override
public void removeProfile(Profile profile) {
user.removeProfile(profile);
}
}

View file

@ -81,10 +81,18 @@
<grid id="profilesListing" model="@{controller.profiles}">
<columns sizable="true">
<column label="${i18n:_('Profile name')}" />
<column label="${i18n:_('Actions')}" />
</columns>
<rows>
<row self="@{each='profile'}" value="@{profile}">
<label value="@{profile.profileName}" />
<hbox>
<button sclass="icono" image="/common/img/ico_borrar1.png"
hoverImage="/common/img/ico_borrar.png"
tooltiptext="${i18n:_('Delete')}"
onClick="controller.removeProfile(self.parent.parent.value);">
</button>
</hbox>
</row>
</rows>
</grid>