Java Code Examples for org.apache.wicket.model.Model#ofList()

The following examples show how to use org.apache.wicket.model.Model#ofList() . 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: OIDCProviderMappingPanel.java    From syncope with Apache License 2.0 6 votes vote down vote up
@Override
protected IModel<List<String>> getExtAttrNames() {
    List<String> extAttrNames = new ArrayList<>();
    extAttrNames.add("email");
    extAttrNames.add("family_name");
    extAttrNames.add("name");
    extAttrNames.add("middle_name");
    extAttrNames.add("given_name");
    extAttrNames.add("preferred_username");
    extAttrNames.add("nickname");
    extAttrNames.add("profile");
    extAttrNames.add("gender");
    extAttrNames.add("locale");
    extAttrNames.add("zoneinfo");
    extAttrNames.add("birthdate");
    extAttrNames.add("phone_number");
    extAttrNames.add("address");
    extAttrNames.add("updated_at");

    return Model.ofList(extAttrNames);
}
 
Example 2
Source File: BinaryEditPanel.java    From Orienteer with Apache License 2.0 6 votes vote down vote up
public BinaryEditPanel(String id, IModel<byte[]> model) {
	super(id, model);
	fileUploadField = new FileUploadField("data", Model.ofList(new ArrayList<FileUpload>()));
	add(fileUploadField);
	fileUploadField.setOutputMarkupId(true);

	clear = new AjaxCheckBox("clear", Model.of(Boolean.FALSE)) {
		@Override
		protected void onUpdate(AjaxRequestTarget target) {
			Boolean shouldClear = clear.getConvertedInput();
			if (shouldClear) {
				fileUploadField.clearInput();
			}

			fileUploadField.setEnabled(!shouldClear);
			target.add(fileUploadField);
		}
	};

	add(clear);
}
 
Example 3
Source File: SelectableLayoutForm.java    From JPPF with Apache License 2.0 5 votes vote down vote up
@Override
protected void createFields() {
  final List<LocalizedListItem> all = layout.getAllItems();
  paletteField = new Palette<>(prefix + ".palette.field", Model.ofList(layout.getVisibleItems()), Model.ofList(all), new LocalizedListItemRenderer(), all.size(), true);
  paletteField.add(new DefaultTheme());
  add(paletteField);
}
 
Example 4
Source File: TableDataProvider.java    From webanno with Apache License 2.0 4 votes vote down vote up
@Override
public IModel<List<String>> model(List<String> object)
{
    return Model.ofList(object);
}
 
Example 5
Source File: SAML2IdPMappingPanel.java    From syncope with Apache License 2.0 4 votes vote down vote up
@Override
protected IModel<List<String>> getExtAttrNames() {
    return Model.ofList(Collections.<String>singletonList("NameID"));
}
 
Example 6
Source File: TabsPanel.java    From Orienteer with Apache License 2.0 4 votes vote down vote up
public TabsPanel(String id, IModel<T> model, List<T> tabs) {
	this(id, model, Model.ofList(tabs));
}
 
Example 7
Source File: StructureTable.java    From Orienteer with Apache License 2.0 4 votes vote down vote up
public StructureTable(String id, IModel<T> model, List<C> list) {
	this(id, model, Model.ofList(list));
}
 
Example 8
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;
}