Java Code Examples for org.apache.wicket.markup.html.list.ListItem#getModelObject()

The following examples show how to use org.apache.wicket.markup.html.list.ListItem#getModelObject() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: AccessSpecificSettingsPanel.java    From inception with Apache License 2.0 6 votes vote down vote up
private ListView<String> fileExtensionsExportList(String aId) {
    ListView<String> fileExListView = new ListView<String>(aId,
        EXPORT_FORMAT_FILE_EXTENSIONS)
    {

        private static final long serialVersionUID = -1869762759620557362L;

        @Override protected void populateItem(ListItem<String> item)
        {
            // creates an appropriately labeled {@link AjaxDownloadLink} which triggers the
            // download of the contents of the current KB in the given format
            String fileExtension = item.getModelObject();
            Model<String> exportFileNameModel = Model
                .of(kbModel.getObject().getKb().getName() + "." + fileExtension);
            AjaxDownloadLink exportLink = new AjaxDownloadLink("link", exportFileNameModel,
                    LambdaModel.of(() -> actionExport(fileExtension)));
            exportLink
                .add(new Label("label", new ResourceModel("kb.export." + fileExtension)));
            item.add(exportLink);
        }
    };
    return fileExListView;
}
 
Example 2
Source File: KeyBindingsConfigurationPanel.java    From webanno with Apache License 2.0 6 votes vote down vote up
private ListView<KeyBinding> createKeyBindingsList(String aId,
        IModel<List<KeyBinding>> aKeyBindings)
{
    return new ListView<KeyBinding>(aId, aKeyBindings)
    {
        private static final long serialVersionUID = 432136316377546825L;

        @Override
        protected void populateItem(ListItem<KeyBinding> aItem)
        {
            AnnotationFeature feature = KeyBindingsConfigurationPanel.this.getModelObject();
            FeatureSupport<?> fs = featureSupportRegistry.getFeatureSupport(feature);

            KeyBinding keyBinding = aItem.getModelObject();

            aItem.add(new Label("keyCombo", keyBinding.asHtml()).setEscapeModelStrings(false));

            aItem.add(
                    new Label("value", fs.renderFeatureValue(feature, keyBinding.getValue())));
            aItem.add(new LambdaAjaxLink("removeKeyBinding",
                _target -> removeKeyBinding(_target, aItem.getModelObject())));
        }
    };
}
 
Example 3
Source File: GradeImportConfirmationStep.java    From sakai with Educational Community License v2.0 6 votes vote down vote up
/**
 * Helper to create a listview for what needs to be shown for new assignments
 * @param markupId wicket markup id
 * @param itemList list of Assignments populated by the item creation steps
 */
private ListView<Assignment> makeAssignmentsToCreateListView(final String markupId, final List<Assignment> itemList) {
	final ListView<Assignment> rval = new ListView<Assignment>(markupId, itemList) {
		@Override
		protected void populateItem(final ListItem<Assignment> item) {
			final Assignment assignment = item.getModelObject();

			String extraCredit = assignment.isExtraCredit() ? yes : no;
			String dueDate = FormatHelper.formatDate(assignment.getDueDate(), "");
			String releaseToStudents = assignment.isReleased() ? yes : no;
			String includeInCourseGrades = assignment.isCounted() ? yes : no;

			item.add(new Label("title", assignment.getName()));
			item.add(new Label("points", assignment.getPoints()));
			item.add(new Label("extraCredit", extraCredit));
			item.add(new Label("dueDate", dueDate));
			item.add(new Label("releaseToStudents", releaseToStudents));
			item.add(new Label("includeInCourseGrades", includeInCourseGrades));
		}
	};

	return rval;
}
 
Example 4
Source File: ShoppingCartCouponsList.java    From yes-cart with Apache License 2.0 6 votes vote down vote up
/**
 * {@inheritDoc}
 */
@Override
protected void populateItem(final ListItem<String> couponListItem) {

    final String couponCode = couponListItem.getModelObject();

    final String messageKey;
    if (appliedCoupons.contains(couponCode)) {
        messageKey = "appliedPromoCode";
    } else {
        messageKey = "pendingPromoCode";
    }

    couponListItem.add(new Label(LIST_ITEM_TEXT,
            getLocalizer().getString(messageKey, this.getParent(),
                    new Model<>(new ValueMap(Collections.singletonMap("coupon", couponCode))))));

    couponListItem.add(wicketSupportFacade.links()
            .newRemoveCouponLink(REMOVE_COUPON, couponCode,
                    (Class) getPage().getClass(), getPage().getPageParameters()));

}
 
Example 5
Source File: ProductPerPageListView.java    From yes-cart with Apache License 2.0 6 votes vote down vote up
/**
 * {@inheritDoc}
 */
@Override
protected void populateItem(ListItem<String> stringListItem) {

    final String pageSize = stringListItem.getModelObject();
    final Label label = new Label(WebParametersKeys.QUANTITY, pageSize);

    final AbstractWebPage page = ((AbstractWebPage) getPage());
    final PageParameters pageParameters = page.getPageParameters();
    final LinksSupport links = page.getWicketSupportFacade().links();
    final PaginationSupport pagination = page.getWicketSupportFacade().pagination();

    final PageParameters params = links.getFilteredCurrentParameters(pageParameters);
    params.set(WebParametersKeys.QUANTITY, pageSize);

    final Link pageSizeLink = links.newLink(ITEMS_PER_PAGE, params);
    pageSizeLink.add(label);
    stringListItem.add(pageSizeLink);

    if (pagination.markSelectedPageSizeLink(pageSizeLink, pageParameters, getModelObject(), NumberUtils.toInt(pageSize))) {
        stringListItem.add(new AttributeModifier("class", "active"));
    }

}
 
Example 6
Source File: ProjectsOverviewPage.java    From inception with Apache License 2.0 6 votes vote down vote up
private void addActionsDropdown(ListItem<Project> aItem)
{
    User user = userRepository.getCurrentUser();
    Project currentProject = aItem.getModelObject();

    WebMarkupContainer container = new WebMarkupContainer("actionDropdown");
    
    LambdaAjaxLink leaveProjectLink = new LambdaAjaxLink(MID_LEAVE_PROJECT,
        _target -> actionConfirmLeaveProject(_target, aItem));
    boolean hasProjectPermissions = !projectService
            .listProjectPermissionLevel(user, currentProject).isEmpty();

    leaveProjectLink.add(LambdaBehavior.visibleWhen(() -> 
            hasProjectPermissions && !projectService.isAdmin(currentProject, user)));

    container.add(leaveProjectLink);
    
    // If there are no active items in the dropdown, then do not show the dropdown. However,
    // to still make it take up the usual space and keep the overview nicely aligned, we use
    // the "invisible" CSS class here instead of telling Wicket to not render the dropdown
    container.add(new CssClassNameAppender(LoadableDetachableModel.of(() -> 
            container.streamChildren().anyMatch(Component::isVisible) ? "" : "invisible")));
    
    aItem.add(container);
}
 
Example 7
Source File: HomePage.java    From nextreports-server with Apache License 2.0 6 votes vote down vote up
private void onSlidebarClick(AjaxRequestTarget target, String sectionId) {
    String oldSectionId = sectionManager.getSelectedSectionId();
    Section section = sectionManager.getSection(sectionId);
    sectionManager.setSelectedSectionId(sectionId);
    Panel newPanel = section.createView("sectionPanel");
    newPanel.setOutputMarkupId(true);
    sectionPanel.replaceWith(newPanel);
    target.add(newPanel);
    sectionPanel = newPanel;

    // close slidebar
    target.appendJavaScript("closeSlidebar();");

    // refresh active class
    ListView<String> view = (ListView<String>) get("section");
    Iterator<Component> it= view.iterator();
    while (it.hasNext()) {
        ListItem<String> item = (ListItem<String>) it.next();
        String itemId = item.getModelObject();
        if (itemId.equals(sectionId) || itemId.equals(oldSectionId)) {
            target.add(item);
        }
    }
}
 
Example 8
Source File: ProjectsOverviewPage.java    From inception with Apache License 2.0 5 votes vote down vote up
private void actionConfirmLeaveProject(AjaxRequestTarget aTarget, ListItem<Project> aItem)
{
    User user = userRepository.getCurrentUser();
    Project currentProject = aItem.getModelObject();
    confirmLeaveDialog.setConfirmAction((_target) -> {
        projectService.listProjectPermissionLevel(user, currentProject).stream()
                .forEach(projectService::removeProjectPermission);
        _target.add(projectListContainer);
        _target.addChildren(getPage(), IFeedback.class);
        success("You are no longer a member of project [" + currentProject.getName() + "]");
    });
    confirmLeaveDialog.show(aTarget);
}
 
Example 9
Source File: AjaxCheckBoxPanel.java    From syncope with Apache License 2.0 5 votes vote down vote up
@SuppressWarnings("rawtypes")
@Override
public FieldPanel<Boolean> setNewModel(final ListItem item) {
    IModel<Boolean> model = new Model<Boolean>() {

        private static final long serialVersionUID = 6799404673615637845L;

        @Override
        public Boolean getObject() {
            Boolean bool = null;

            final Object obj = item.getModelObject();

            if (obj != null && !obj.toString().isEmpty()) {
                if (obj instanceof String) {
                    bool = Boolean.TRUE.toString().equalsIgnoreCase(obj.toString());
                } else if (obj instanceof Boolean) {
                    // Don't parse anything
                    bool = (Boolean) obj;
                }
            }

            return bool;
        }

        @Override
        @SuppressWarnings("unchecked")
        public void setObject(final Boolean object) {
            item.setModelObject(Optional.ofNullable(object)
                    .map(Object::toString).orElseGet(Boolean.FALSE::toString));
        }
    };

    field.setModel(model);
    return this;
}
 
Example 10
Source File: BulkEditItemsPanel.java    From sakai with Educational Community License v2.0 5 votes vote down vote up
@Override
protected void populateItem(final ListItem<Assignment> item) {

	final Assignment assignment = item.getModelObject();

	item.add(new Label("itemTitle", assignment.getName()));

	final ReleaseCheckbox release = new ReleaseCheckbox("release", new PropertyModel<Boolean>(assignment, "released"));
	final IncludeCheckbox include = new IncludeCheckbox("include", new PropertyModel<Boolean>(assignment, "counted"));
	final AjaxCheckBox delete = new AjaxCheckBox("delete", Model.of(Boolean.FALSE)){
		@Override
		protected void onUpdate(AjaxRequestTarget target) {
			updateModel();
			if (this.getModel().getObject()) {  // if the checkbox has just been checked, this will be True.
				BulkEditItemsPanel.this.deletableItemsList.add(item.getModelObject().getId());
			} else {    // this means the checkbox has been unchecked.
				BulkEditItemsPanel.this.deletableItemsList.remove(item.getModelObject().getId());
			}
		}
	};

	// Are there categories in this Gradebook? If so, and this item is not in a category, disabled grade
	// calculation inclusion.
	List<CategoryDefinition> categories = businessService.getGradebookCategories();
	if (categories != null && categories.size() > 0 && StringUtils.isBlank(assignment.getCategoryName())) {
		include.setEnabled(false);
	}
	if (assignment.isExternallyMaintained()){	//don't allow External items to be deleted.
		delete.setEnabled(false);
	}
	item.add(release);
	item.add(include);
	item.add(delete);
}
 
Example 11
Source File: TopicListPanel.java    From ontopia with Apache License 2.0 5 votes vote down vote up
@Override
protected void populateItem(ListItem<Topic> item) {
  Topic topic = item.getModelObject();
  // FIXME: upgrade to TopicLink
  item.add(new TopicInstanceLink("topicLink", new TopicModel<Topic>(topic)));
  //item.add(new org.apache.wicket.markup.html.basic.Label("topicName", topic.getName()));
}
 
Example 12
Source File: MyPictures.java    From sakai with Educational Community License v2.0 5 votes vote down vote up
protected void populateItem(ListItem<File> listItem) {
	final File file = (File) listItem.getModelObject();
	listItem.add(new Label("file", file.getName()));
	listItem.add(new Link("delete") {
		public void onClick() {
			Files.remove(file);
		}
	});
}
 
Example 13
Source File: ColoringRulesConfigurationPanel.java    From webanno with Apache License 2.0 5 votes vote down vote up
private ListView<ColoringRule> createKeyBindingsList(String aId,
        IModel<List<ColoringRule>> aKeyBindings)
{
    return new ListView<ColoringRule>(aId, aKeyBindings)
    {
        private static final long serialVersionUID = 432136316377546825L;

        @Override
        protected void populateItem(ListItem<ColoringRule> aItem)
        {
            ColoringRule coloringRule = aItem.getModelObject();

            Label value = new Label("pattern", coloringRule.getPattern());
            
            value.add(new StyleAttributeModifier()
            {
                private static final long serialVersionUID = 3627596292626670610L;

                @Override
                protected Map<String, String> update(Map<String, String> aStyles)
                {
                    aStyles.put("background-color", coloringRule.getColor());
                    return aStyles;
                }
            });
            
            aItem.add(value);
            aItem.add(new LambdaAjaxLink("removeColoringRule",
                _target -> removeColoringRule(_target, aItem.getModelObject())));
        }
    };
}
 
Example 14
Source File: ActiveLearningSidebar.java    From inception with Apache License 2.0 5 votes vote down vote up
private ListView<LearningRecord> createLearningHistoryListView()
{
    ListView<LearningRecord> learningHistory = new ListView<LearningRecord>(
            CID_HISTORY_LISTVIEW)
    {
        private static final long serialVersionUID = 5594228545985423567L;

        @Override
        protected void populateItem(ListItem<LearningRecord> item)
        {
            LearningRecord rec = item.getModelObject();
            AnnotationFeature recAnnotationFeature = rec.getAnnotationFeature();
            String recFeatureValue;
            if (recAnnotationFeature != null) {
                FeatureSupport featureSupport = featureSupportRegistry
                    .getFeatureSupport(recAnnotationFeature);
                recFeatureValue = featureSupport
                    .renderFeatureValue(recAnnotationFeature, rec.getAnnotation());
            }
            else {
                recFeatureValue = rec.getAnnotation();
            }
            LambdaAjaxLink textLink = new LambdaAjaxLink(CID_JUMP_TO_ANNOTATION, _target -> 
                    actionSelectHistoryItem(_target, item.getModelObject()));
            textLink.setBody(rec::getTokenText);
            item.add(textLink);

            item.add(new Label(CID_RECOMMENDED_ANNOTATION, recFeatureValue));
            item.add(new Label(CID_USER_ACTION, rec.getUserAction()));
            item.add(
                new LambdaAjaxLink(CID_REMOVE_RECORD, t -> actionRemoveHistoryItem(t, rec)));
        }
    };
    learningRecords = LambdaModel.of(this::listLearningRecords);
    learningHistory.setModel(learningRecords);
    return learningHistory;
}
 
Example 15
Source File: FortunePage.java    From FrameworkBenchmarks with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
public FortunePage() throws Exception {
	List<Fortune> fortunes = new ArrayList<>();

	DataSource dataSource = WicketApplication.get().getDataSource();
	try ( //
			Connection connection = dataSource.getConnection();
			PreparedStatement statement = connection.prepareStatement("SELECT id, message FROM Fortune",
					ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY);
			ResultSet resultSet = statement.executeQuery()) {

		while (resultSet.next()) {
			fortunes.add(new Fortune(resultSet.getInt("id"), resultSet.getString("message")));
		}
	}

	fortunes.add(new Fortune(0, "Additional fortune added at request time."));

	Collections.sort(fortunes);

	ListView<Fortune> listView = new ListView<Fortune>("fortunes", fortunes) {
		private static final long serialVersionUID = 1L;

		@Override
		protected void populateItem(ListItem<Fortune> item) {
			Fortune fortune = item.getModelObject();
			item.add(new Label("id", fortune.id));
			item.add(new Label("message", fortune.message));
		}
	};
	add(listView);
}
 
Example 16
Source File: BulkEditItemsPanel.java    From sakai with Educational Community License v2.0 5 votes vote down vote up
@Override
protected void populateItem(final ListItem<Assignment> item) {

	final Assignment assignment = item.getModelObject();

	item.add(new Label("itemTitle", assignment.getName()));

	final ReleaseCheckbox release = new ReleaseCheckbox("release", new PropertyModel<Boolean>(assignment, "released"));
	final IncludeCheckbox include = new IncludeCheckbox("include", new PropertyModel<Boolean>(assignment, "counted"));
	final AjaxCheckBox delete = new AjaxCheckBox("delete", Model.of(Boolean.FALSE)){
		@Override
		protected void onUpdate(AjaxRequestTarget target) {
			updateModel();
			if (this.getModel().getObject()) {  // if the checkbox has just been checked, this will be True.
				BulkEditItemsPanel.this.deletableItemsList.add(item.getModelObject().getId());
			} else {    // this means the checkbox has been unchecked.
				BulkEditItemsPanel.this.deletableItemsList.remove(item.getModelObject().getId());
			}
		}
	};

	// Are there categories in this Gradebook? If so, and this item is not in a category, disabled grade
	// calculation inclusion.
	List<CategoryDefinition> categories = businessService.getGradebookCategories();
	if (categories != null && categories.size() > 0 && StringUtils.isBlank(assignment.getCategoryName())) {
		include.setEnabled(false);
	}
	if (assignment.isExternallyMaintained()){	//don't allow External items to be deleted.
		delete.setEnabled(false);
	}
	item.add(release);
	item.add(include);
	item.add(delete);
}
 
Example 17
Source File: BaseTreePage.java    From sakai with Educational Community License v2.0 4 votes vote down vote up
private void createInheritedSpan(){
	WebMarkupContainer inheritedSpan = new WebMarkupContainer("inheritedSpan");
	inheritedSpan.setOutputMarkupId(true);
	final String inheritedSpanId = inheritedSpan.getMarkupId();
	add(inheritedSpan);
	
	AbstractReadOnlyModel<List<? extends ListOptionSerialized>> inheritedRestrictedToolsModel = new AbstractReadOnlyModel<List<? extends ListOptionSerialized>>(){
		private static final long serialVersionUID = 1L;

		@Override
		public List<? extends ListOptionSerialized> getObject() {
			return new ArrayList<ListOptionSerialized>();
		}

	};
	
	final ListView<ListOptionSerialized> inheritedListView = new ListView<ListOptionSerialized>("inheritedRestrictedTools",inheritedRestrictedToolsModel){
		private static final long serialVersionUID = 1L;
		@Override
		protected void populateItem(ListItem<ListOptionSerialized> item) {
			ListOptionSerialized tool = (ListOptionSerialized) item.getModelObject();
			Label name = new Label("name", tool.getName());
			item.add(name);
		}
	};
	inheritedListView.setOutputMarkupId(true);
	inheritedSpan.add(inheritedListView);
	
	
	AjaxLink<Void> closeInheritedSpanLink = new AjaxLink("closeInheritedSpanLink"){
		@Override
		public void onClick(AjaxRequestTarget arg0) {
		}
	};
	inheritedSpan.add(closeInheritedSpanLink);

	Label inheritedNodeTitle = new Label("inheritedNodeTitle", "");
	inheritedSpan.add(inheritedNodeTitle);
	
	
	
	Label noInheritedToolsLabel = new Label("noToolsInherited", new StringResourceModel("inheritedNothing", null));
	inheritedSpan.add(noInheritedToolsLabel);

}
 
Example 18
Source File: RecommenderInfoPanel.java    From inception with Apache License 2.0 4 votes vote down vote up
public RecommenderInfoPanel(String aId, IModel<AnnotatorState> aModel)
{
    super(aId, aModel);
    
    setOutputMarkupId(true);
    
    WebMarkupContainer recommenderContainer = new WebMarkupContainer("recommenderContainer");
    add(recommenderContainer);
    
    ListView<Recommender> searchResultGroups = new ListView<Recommender>("recommender")
    {
        private static final long serialVersionUID = -631500052426449048L;

        @Override
        protected void populateItem(ListItem<Recommender> item)
        {
            User user = userService.getCurrentUser();
            Recommender recommender = item.getModelObject();
            List<EvaluatedRecommender> activeRecommenders = recommendationService
                    .getActiveRecommenders(user, recommender.getLayer());
            Optional<EvaluationResult> evalResult = activeRecommenders.stream()
                    .filter(r -> r.getRecommender().equals(recommender))
                    .map(EvaluatedRecommender::getEvaluationResult)
                    .findAny();
            item.add(new Label("name", recommender.getName()));
            item.add(new Label("state", evalResult.isPresent() ? "active" : "off"));

            item.add(new LambdaAjaxLink("acceptAll", _target -> 
                    actionAcceptAll(_target, recommender)));
            
            WebMarkupContainer resultsContainer = new WebMarkupContainer("resultsContainer");
            // Show results only if the evaluation was not skipped (and of course only if the
            // result is actually present).
            resultsContainer.setVisible(evalResult.map(r -> !r.isEvaluationSkipped())
                    .orElse(evalResult.isPresent()));
            resultsContainer.add(new Label("f1Score",
                    evalResult.map(EvaluationResult::computeF1Score).orElse(0.0d)));
            resultsContainer.add(new Label("accuracy",
                    evalResult.map(EvaluationResult::computeAccuracyScore).orElse(0.0d)));
            resultsContainer.add(new Label("precision",
                    evalResult.map(EvaluationResult::computePrecisionScore).orElse(0.0d)));
            resultsContainer.add(new Label("recall",
                    evalResult.map(EvaluationResult::computeRecallScore).orElse(0.0d)));
            item.add(resultsContainer);
        }
    };
    IModel<List<Recommender>> recommenders = LoadableDetachableModel.of(() -> 
            recommendationService.listEnabledRecommenders(aModel.getObject().getProject()));
    searchResultGroups.setModel(recommenders);
    
    recommenderContainer.add(visibleWhen(() -> !recommenders.getObject().isEmpty()));
    recommenderContainer.add(searchResultGroups);

    WebMarkupContainer noRecommendersWarning = new WebMarkupContainer("noRecommendersWarning");
    noRecommendersWarning.setOutputMarkupPlaceholderTag(true);
    noRecommendersWarning.add(visibleWhen(() -> recommenders.getObject().isEmpty()));
    add(noRecommendersWarning);
}
 
Example 19
Source File: AnnotationPreferencesDialogContent.java    From webanno with Apache License 2.0 4 votes vote down vote up
private ListView<AnnotationLayer> createLayerContainer()
{
    return new ListView<AnnotationLayer>("annotationLayers")
    {
        private static final long serialVersionUID = -4040731191748923013L;

        @Override
        protected void populateItem(ListItem<AnnotationLayer> aItem)
        {
            Preferences prefs = form.getModelObject();
            AnnotationLayer layer = aItem.getModelObject();
            Set<Long> hiddenLayerIds = stateModel.getObject().getPreferences()
                    .getHiddenAnnotationLayerIds();
            
            // add visibility checkbox
            CheckBox layerVisible = new CheckBox("annotationLayerActive",
                    Model.of(!hiddenLayerIds.contains(layer.getId())));

            layerVisible.add(new LambdaAjaxFormComponentUpdatingBehavior("change", _target -> {
                if (!layerVisible.getModelObject()) {
                    hiddenLayerIds.add(layer.getId());
                }
                else {
                    hiddenLayerIds.remove(layer.getId());
                }
            }));
            aItem.add(layerVisible);

            // add coloring strategy choice
            DropDownChoice<ColoringStrategyType> layerColor = new BootstrapSelect<>(
                    "layercoloring");
            layerColor.setModel(Model.of(prefs.colorPerLayer.get(layer.getId())));
            layerColor.setChoiceRenderer(new ChoiceRenderer<>("descriptiveName"));
            layerColor.setChoices(asList(ColoringStrategyType.values()));
            layerColor.add(new LambdaAjaxFormComponentUpdatingBehavior("change", _target ->
                    prefs.colorPerLayer.put(layer.getId(), layerColor.getModelObject())));
            aItem.add(layerColor);

            // add label
            aItem.add(new Label("annotationLayerDesc", layer.getUiName()));
        }
    };
}
 
Example 20
Source File: UserGroupFormPopupPanel.java    From artifact-listener with Apache License 2.0 4 votes vote down vote up
@Override
protected Component createBody(String wicketId) {
	DelegatedMarkupPanel body = new DelegatedMarkupPanel(wicketId, UserGroupFormPopupPanel.class);
	
	userGroupForm = new Form<UserGroup>("form", getModel());
	body.add(userGroupForm);
	
	TextField<String> nameField = new RequiredTextField<String>("name", BindingModel.of(userGroupForm.getModel(),
			Binding.userGroup().name()));
	nameField.setLabel(new ResourceModel("administration.usergroup.field.name"));
	userGroupForm.add(nameField);
	
	TextArea<String> descriptionField = new TextArea<String>("description", BindingModel.of(userGroupForm.getModel(),
			Binding.userGroup().description()));
	descriptionField.setLabel(new ResourceModel("administration.usergroup.field.description"));
	userGroupForm.add(descriptionField);
	
	final CheckGroup<Authority> authorityCheckGroup = new CheckGroup<Authority>("authoritiesGroup",
			BindingModel.of(userGroupForm.getModel(), Binding.userGroup().authorities()), Suppliers2.<Authority>hashSet());
	userGroupForm.add(authorityCheckGroup);
	
	ListView<Authority> authoritiesListView = new ListView<Authority>("authorities",
			Model.ofList(authorityUtils.getPublicAuthorities())) {
		private static final long serialVersionUID = -7557232825932251026L;
		
		@Override
		protected void populateItem(ListItem<Authority> item) {
			Authority authority = item.getModelObject();
			
			Check<Authority> authorityCheck = new Check<Authority>("authorityCheck",
					new GenericEntityModel<Long, Authority>(authority));
			
			authorityCheck.setLabel(new ResourceModel("administration.usergroup.authority." + authority.getName()));
			
			authorityCheckGroup.add(authorityCheck);
			item.add(authorityCheck);
		}
	};
	authorityCheckGroup.add(authoritiesListView);
	
	return body;
}