gridBuilder.newSplitPanel(GridSize.COL50, GridType.CONTAINER);
// Full access groups
fs = gridBuilder.newFieldset(getString("plugins.teamcal.fullAccess"), getString("plugins.teamcal.access.groups"));
final GroupsProvider groupsFullAccessProvider = new GroupsProvider();
final Collection<GroupDO> fullAccessGroups = new GroupsProvider().getSortedGroups(getData().getFullAccessGroupIds());
fullAccessGroupsListHelper = new MultiChoiceListHelper<GroupDO>().setComparator(new GroupsComparator()).setFullList(
groupsFullAccessProvider.getSortedGroups());
if (fullAccessGroups != null) {
for (final GroupDO group : fullAccessGroups) {
fullAccessGroupsListHelper.addOriginalAssignedItem(group).assignItem(group);
}
}
final Select2MultiChoice<GroupDO> groupsFullAccess = new Select2MultiChoice<GroupDO>(fs.getSelect2MultiChoiceId(),
new PropertyModel<Collection<GroupDO>>(this.fullAccessGroupsListHelper, "assignedItems"), groupsFullAccessProvider);
fs.add(groupsFullAccess);
// Full access groups inherited rights
fs = gridBuilder.newFieldset("", getString("plugins.skillmatrix.skill.inherited"));
@SuppressWarnings("serial")
final DivTextPanel labelFull = new DivTextPanel(fs.newChildId(), new Model<String>() {
/**
* @see org.apache.wicket.model.Model#getObject()
*/
@Override
public String getObject()
{
if (getData().getParent() != null) {
return getGroupnames(skillRight.getFullAccessGroupIds(getData().getParent()));
}
return "";
}
});
fs.suppressLabelForWarning();
fs.add(labelFull);
ajaxTargets.add(labelFull.getLabel4Ajax());
gridBuilder.newSplitPanel(GridSize.COL50, GridType.CONTAINER);
{
// Read-only access groups
fs = gridBuilder.newFieldset(getString("plugins.teamcal.readonlyAccess"), getString("plugins.teamcal.access.groups"));
final GroupsProvider groupsProvider = new GroupsProvider();
final Collection<GroupDO> readOnlyAccessGroups = new GroupsProvider().getSortedGroups(getData().getReadOnlyAccessGroupIds());
readOnlyAccessGroupsListHelper = new MultiChoiceListHelper<GroupDO>().setComparator(new GroupsComparator()).setFullList(
groupsProvider.getSortedGroups());
if (readOnlyAccessGroups != null) {
for (final GroupDO group : readOnlyAccessGroups) {
readOnlyAccessGroupsListHelper.addOriginalAssignedItem(group).assignItem(group);
}
}
final Select2MultiChoice<GroupDO> groups = new Select2MultiChoice<GroupDO>(fs.getSelect2MultiChoiceId(),
new PropertyModel<Collection<GroupDO>>(this.readOnlyAccessGroupsListHelper, "assignedItems"), groupsProvider);
fs.add(groups);
// Read-only access groups inherited rights
fs = gridBuilder.newFieldset("", getString("plugins.skillmatrix.skill.inherited"));
@SuppressWarnings("serial")
final DivTextPanel labelReadOnly = new DivTextPanel(fs.newChildId(), new Model<String>() {
/**
* @see org.apache.wicket.model.Model#getObject()
*/
@Override
public String getObject()
{
if (getData().getParent() != null) {
return getGroupnames(skillRight.getReadOnlyAccessGroupIds(getData().getParent()));
}
return "";
}
});
fs.add(labelReadOnly);
fs.suppressLabelForWarning();
ajaxTargets.add(labelReadOnly.getLabel4Ajax());
}
gridBuilder.newSplitPanel(GridSize.COL50, GridType.CONTAINER);
{
// Training access groups
fs = gridBuilder.newFieldset(getString("plugins.skillmatrix.skill.trainingAccess"), getString("plugins.teamcal.access.groups"));
final GroupsProvider groupsProvider = new GroupsProvider();
final Collection<GroupDO> trainingAccessGroups = new GroupsProvider().getSortedGroups(getData().getTrainingAccessGroupIds());
trainingAccessGroupsListHelper = new MultiChoiceListHelper<GroupDO>().setComparator(new GroupsComparator()).setFullList(
groupsProvider.getSortedGroups());
if (trainingAccessGroups != null) {
for (final GroupDO group : trainingAccessGroups) {
trainingAccessGroupsListHelper.addOriginalAssignedItem(group).assignItem(group);
}