• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java ListModel类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.apache.wicket.model.util.ListModel的典型用法代码示例。如果您正苦于以下问题:Java ListModel类的具体用法?Java ListModel怎么用?Java ListModel使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



ListModel类属于org.apache.wicket.model.util包,在下文中一共展示了ListModel类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: CategoryResponsePanel

import org.apache.wicket.model.util.ListModel; //导入依赖的package包/类
public CategoryResponsePanel(String id, IModel<? extends CategoryModel> categoryModel) {
    super(id);

    CategoryModel category = categoryModel.getObject();
    this.add(new Label("type", getType()));
    this.add(new Label("term", category.getTerm()));
    this.add(new Label("schema", category.getSchema()));
    this.add(new WebMarkupContainer("titleRow") {
        @Override
        public boolean isVisible() {
            return null != category.getTitle();
        }
    }.add(new Label("title", category.getTitle())));

    this.add(new ListView<AttributeModel>("attributeContainer", new ListModel<>(new ArrayList<>(category.getAttributes()))) {
        @Override
        protected void populateItem(ListItem<AttributeModel> listItem) {
            AttributeModel attribute = listItem.getModelObject();
            listItem.add(new Label("name", attribute.getName()));
            listItem.add(new Label("value", attribute.getValue().toString()));
            listItem.add(new Label("description", attribute.getDescription()));
        }
    });
}
 
开发者ID:citlab,项目名称:Intercloud,代码行数:25,代码来源:CategoryResponsePanel.java


示例2: UriResponsePanel

import org.apache.wicket.model.util.ListModel; //导入依赖的package包/类
public UriResponsePanel(String id, IModel<UriListRepresentationModel> representationModel) {
    super(id);

    this.add(new ListView<String>("uriList", new ListModel<>(representationModel.getObject().getUriList())) {
        @Override
        protected void populateItem(ListItem<String> listItem) {
            AjaxLink link = new AjaxLink("uri") {
                @Override
                public void onClick(AjaxRequestTarget target) {
                    try {
                        XmppURI uri = new XmppURI(listItem.getModelObject());
                        setResponsePage(new BrowserPage(Model.of(uri)));
                    } catch (URISyntaxException e) {
                        logger.error("Could not parse Xmpp Uri. {}", listItem.getModelObject(), e);
                        target.appendJavaScript("alert('Could not parse Xmpp Uri.');");
                    }
                }
            };
            link.setBody(listItem.getModel());
            listItem.add(link);
        }
    });
}
 
开发者ID:citlab,项目名称:Intercloud,代码行数:24,代码来源:UriResponsePanel.java


示例3: createDefaultChartWithLowLevelAPI

import org.apache.wicket.model.util.ListModel; //导入依赖的package包/类
private static JQPlot createDefaultChartWithLowLevelAPI(String wicketId) {
	// Create series
	SimpleNumberSeries<Integer> accountsCreated = new SimpleNumberSeries<Integer>();
	for (Integer account : ACTIVE_USERS_STATS) {
		accountsCreated.addEntry(account);
	}
	
	// Build JQPlot object with given series
	JQPlot defaultChart = new JQPlot(wicketId, new ListModel<SimpleNumberSeries<Integer>>(Lists.newArrayList(accountsCreated)));
	
	// Select few options
	PlotOptions defaultChartOptions = defaultChart.getOptions();
	defaultChartOptions.setTitle("Active users");
	defaultChartOptions.getAxes().getXaxis().setRenderer("$.jqplot.CategoryAxisRenderer");
	defaultChartOptions.getAxes().getXaxis().setTicks("2007", "2008", "2009", "2010", "2011", "2012");
	
	return defaultChart;
}
 
开发者ID:openwide-java,项目名称:owsi-core-parent,代码行数:19,代码来源:StatisticsPage.java


示例4: createPieChartWithLowLevelAPI

import org.apache.wicket.model.util.ListModel; //导入依赖的package包/类
private static JQPlot createPieChartWithLowLevelAPI(String wicketId) {
	// Create series
	BaseSeries<String, Double> line = new BaseSeries<String, Double>();
	line.addEntry("frogs", 3.0);
	line.addEntry("buzzards", 7.0);
	line.addEntry("deer", 2.5);
	line.addEntry("turkeys", 6.0);
	line.addEntry("moles", 5.0);
	line.addEntry("ground hogs", 4.0);
	
	// Build JQPlot object with given series
	JQPlot pieChart = new JQPlot(wicketId, new ListModel<BaseSeries<String, Double>>(Lists.newArrayList(line)));
	
	// Chart options
	PlotOptions pieChartOptions = pieChart.getOptions();
	pieChartOptions.setTitle("Pie Chart with Legend and sliceMargin");
	PlotPieRendererOptions renderOptions = new PlotPieRendererOptions();
	renderOptions.setSliceMargin(8.0);
	pieChartOptions.getSeriesDefaults().setRenderer("$.jqplot.PieRenderer").setRendererOptions(renderOptions);
	pieChartOptions.getLegend().setShow(true).setLocation(PlotLegendLocation.nw);
	
	return pieChart;
}
 
开发者ID:openwide-java,项目名称:owsi-core-parent,代码行数:24,代码来源:StatisticsPage.java


示例5: NodeDropDownSingleChoice

import org.apache.wicket.model.util.ListModel; //导入依赖的package包/类
protected NodeDropDownSingleChoice(String id, IModel<INode> model) {
	super(
			id,
			model,
			new ListModel<>(),
			CHOICE_RENDERER
	);
	setChoices(
			new LoadableDetachableModel<List<INode>>() {
				private static final long serialVersionUID = 1L;
				@Override
				protected List<INode> load() {
					return infinispanClusterService.getNodes();
				}
			}
	);
}
 
开发者ID:openwide-java,项目名称:owsi-core-parent,代码行数:18,代码来源:NodeDropDownSingleChoice.java


示例6: createPalette

import org.apache.wicket.model.util.ListModel; //导入依赖的package包/类
private Palette<T> createPalette(
        final String id,
        final IModel<List<T>> model,
        final ListModel<T> choices,
        final IChoiceRenderer renderer) {

    final Palette<T> palette = new Palette(
            "paletteField",
            model,
            choices,
            renderer,
            8,
            false);

    return palette;
}
 
开发者ID:ilgrosso,项目名称:oldSyncopeIdM,代码行数:17,代码来源:AjaxPalettePanel.java


示例7: TagSetImportPanel

import org.apache.wicket.model.util.ListModel; //导入依赖的package包/类
public TagSetImportPanel(String aId, IModel<Project> aModel, IModel<TagSet> aTagSet)
{
    super(aId);
    
    setOutputMarkupId(true);
    setOutputMarkupPlaceholderTag(true);
    
    preferences = Model.of(new Preferences());
    selectedProject = aModel;
    selectedTagSet = aTagSet;
    
    Form<Preferences> form = new Form<>("form", CompoundPropertyModel.of(preferences));
    form.add(new DropDownChoice<>("format", LambdaModel.of(this::supportedFormats)));
    form.add(new CheckBox("overwrite"));
    form.add(fileUpload = new FileUploadField("content", new ListModel<>()));
    fileUpload.setRequired(true);
    form.add(new LambdaAjaxButton<>("import", this::actionImport));
    add(form);
}
 
开发者ID:webanno,项目名称:webanno,代码行数:20,代码来源:TagSetImportPanel.java


示例8: FileUploadForm

import org.apache.wicket.model.util.ListModel; //导入依赖的package包/类
/**
 * @param id            The wicket component id
 * @param tempUploadDir Path to a temp upload directory
 * @param listener      Parent component holding this upload form which will receive events
 */
public FileUploadForm(String id, String tempUploadDir, UploadListener listener) {
    super(id);
    this.listener = listener;
    tempUploadsDir = new File(tempUploadDir);

    //Set this form to multi-part mode (always needed for uploads!)
    setMultiPart(true);
    //Add one file input field
    add(fileUploadField = new FileUploadField("fileInput", new ListModel<FileUpload>()));
    // Add the progress bar
    UploadProgressBar progress = new UploadProgressBar("progress", this);
    progress.setOutputMarkupId(true);
    progress.setRenderBodyOnly(false);
    progress.setMarkupId("uploadProgress");
    add(progress);
}
 
开发者ID:alancnet,项目名称:artifactory,代码行数:22,代码来源:FileUploadForm.java


示例9: testRangeFilterCriteria

import org.apache.wicket.model.util.ListModel; //导入依赖的package包/类
@Test
public void testRangeFilterCriteria() {
    List<Integer> models = Lists.newArrayList();
    models.add(NUM_VALUE_1);
    models.add(NUM_VALUE_3);
    IModel<List<Integer>> listModel = new ListModel<>(models);
    IFilterCriteriaManager manager = new FilterCriteriaManager(wicket.getProperty(NUMBER_FIELD));
    manager.addFilterCriteria(manager.createRangeFilterCriteria(listModel, Model.of(true)));
    String field = wicket.getProperty(NUMBER_FIELD).getObject().getName();
    queryModel.addFilterCriteriaManager(field, manager);
    queryModel.setSort(NUMBER_FIELD, SortOrder.ASCENDING);
    assertTrue("size must be 3, but it is - " + queryModel.size(), queryModel.size() == 3);
    assertTrue(queryModel.getObject().get(0).field(NUMBER_FIELD).equals(NUM_VALUE_1));
    assertTrue(queryModel.getObject().get(1).field(NUMBER_FIELD).equals(NUM_VALUE_2));
    assertTrue(queryModel.getObject().get(2).field(NUMBER_FIELD).equals(NUM_VALUE_3));
}
 
开发者ID:OrienteerBAP,项目名称:wicket-orientdb,代码行数:17,代码来源:TestFilters.java


示例10: getClauseBuilder

import org.apache.wicket.model.util.ListModel; //导入依赖的package包/类
private AbstractSearchPanel.Builder<?> getClauseBuilder(
        final String type, final ListModel<SearchClause> clauseModel) {

    AbstractSearchPanel.Builder<?> clause;

    switch (type) {
        case "USER":
            clause = new UserSearchPanel.Builder(clauseModel);
            break;

        case "GROUP":
            clause = new GroupSearchPanel.Builder(clauseModel);
            break;

        default:
            clause = new AnyObjectSearchPanel.Builder(type, clauseModel);
    }

    return clause;
}
 
开发者ID:apache,项目名称:syncope,代码行数:21,代码来源:NotificationWizardBuilder.java


示例11: ChangePasswordModal

import org.apache.wicket.model.util.ListModel; //导入依赖的package包/类
public ChangePasswordModal(
        final BaseModal<AnyWrapper<UserTO>> baseModal,
        final PageReference pageReference,
        final UserWrapper wrapper) {
    super(baseModal, pageReference);

    this.wrapper = wrapper;

    final PasswordPanel passwordPanel = new PasswordPanel("passwordPanel", wrapper, false);
    passwordPanel.setOutputMarkupId(true);
    add(passwordPanel);

    statusModel = new ListModel<>(new ArrayList<>());
    StatusPanel statusPanel = new StatusPanel("status", wrapper.getInnerObject(), statusModel, pageReference);
    statusPanel.setCheckAvailability(ListViewPanel.CheckAvailability.AVAILABLE);
    add(statusPanel.setRenderBodyOnly(true));
}
 
开发者ID:apache,项目名称:syncope,代码行数:18,代码来源:ChangePasswordModal.java


示例12: customResultBody

import org.apache.wicket.model.util.ListModel; //导入依赖的package包/类
@Override
@SuppressWarnings("unchecked")
protected Panel customResultBody(final String panelId, final AnyWrapper<A> item, final Serializable result) {
    if (!(result instanceof ProvisioningResult)) {
        throw new IllegalStateException("Unsupported result type");
    }

    return new StatusPanel(
            panelId,
            ((ProvisioningResult<A>) result).getEntity(),
            new ListModel<>(new ArrayList<>()),
            ((ProvisioningResult<A>) result).getPropagationStatuses().stream().
                    map(input -> {
                        ConnObjectTO before = input.getBeforeObj();
                        ConnObjectWrapper afterObjWrapper = new ConnObjectWrapper(
                                ((ProvisioningResult<A>) result).getEntity(),
                                input.getResource(),
                                input.getAfterObj());
                        return Pair.of(before, afterObjWrapper);
                    }).collect(Collectors.toList()),
            pageRef);
}
 
开发者ID:apache,项目名称:syncope,代码行数:23,代码来源:AnyDirectoryPanel.java


示例13: getLatestAlerts

import org.apache.wicket.model.util.ListModel; //导入依赖的package包/类
@Override
protected IModel<List<String>> getLatestAlerts() {
    return new ListModel<String>() {

        private static final long serialVersionUID = -2583290457773357445L;

        @Override
        public List<String> getObject() {
            List<String> result = new ArrayList<>();
            if (StringUtils.isNotBlank(item.getPropagationJEXLTransformer())) {
                result.add(item.getPropagationJEXLTransformer());
            }
            if (StringUtils.isNotBlank(item.getPullJEXLTransformer())) {
                result.add(item.getPullJEXLTransformer());
            }
            return result;
        }
    };
}
 
开发者ID:apache,项目名称:syncope,代码行数:20,代码来源:JEXLTransformerWidget.java


示例14: getLatestAlerts

import org.apache.wicket.model.util.ListModel; //导入依赖的package包/类
@Override
protected IModel<List<WorkflowFormTO>> getLatestAlerts() {
    return new ListModel<WorkflowFormTO>() {

        private static final long serialVersionUID = -2583290457773357445L;

        @Override
        public List<WorkflowFormTO> getObject() {
            List<WorkflowFormTO> updatedApprovals;
            if (SyncopeConsoleSession.get().owns(StandardEntitlement.WORKFLOW_FORM_LIST)
                    && SyncopeConsoleSession.get().owns(StandardEntitlement.WORKFLOW_FORM_READ)) {

                updatedApprovals = restClient.getForms();
                Collections.sort(updatedApprovals, new WorkflowFormComparator());
            } else {
                updatedApprovals = Collections.<WorkflowFormTO>emptyList();
            }

            return updatedApprovals;
        }
    };
}
 
开发者ID:apache,项目名称:syncope,代码行数:23,代码来源:ApprovalsWidget.java


示例15: getValuePanel

import org.apache.wicket.model.util.ListModel; //导入依赖的package包/类
/**
 * Get panel for attribute value (not remote status).
 *
 * @param id component id to be replaced with the fragment content.
 * @param attrTO remote attribute.
 * @return fragment.
 */
private Panel getValuePanel(final String id, final String schemaName, final AttrTO attrTO) {
    Panel field;
    if (attrTO == null) {
        field = new AjaxTextFieldPanel(id, schemaName, new Model<>());
    } else if (CollectionUtils.isEmpty(attrTO.getValues())) {
        field = new AjaxTextFieldPanel(id, schemaName, new Model<>());
    } else if (ConnIdSpecialName.PASSWORD.equals(schemaName)) {
        field = new AjaxTextFieldPanel(id, schemaName, new Model<>("********"));
    } else if (attrTO.getValues().size() == 1) {
        field = new AjaxTextFieldPanel(id, schemaName, new Model<>(attrTO.getValues().get(0)));
    } else {
        field = new MultiFieldPanel.Builder<>(new ListModel<>(attrTO.getValues())).build(
                id,
                schemaName,
                new AjaxTextFieldPanel("panel", schemaName, new Model<>()));
    }

    field.setEnabled(false);
    return field;
}
 
开发者ID:apache,项目名称:syncope,代码行数:28,代码来源:ConnObjectPanel.java


示例16: Entitlements

import org.apache.wicket.model.util.ListModel; //导入依赖的package包/类
public Entitlements(final RoleTO modelObject) {
    setTitleModel(new ResourceModel("entitlements"));
    add(new AjaxPalettePanel.Builder<String>().build("entitlements",
            new PropertyModel<List<String>>(modelObject, "entitlements") {

        private static final long serialVersionUID = -7809699384012595307L;

        @Override
        public List<String> getObject() {
            return new ArrayList<>(modelObject.getEntitlements());
        }

        @Override
        public void setObject(final List<String> object) {
            modelObject.getEntitlements().clear();
            modelObject.getEntitlements().addAll(object);
        }
    }, new ListModel<>(new RoleRestClient().getAllAvailableEntitlements())).
            hideLabel().setOutputMarkupId(true));
}
 
开发者ID:apache,项目名称:syncope,代码行数:21,代码来源:RoleWizardBuilder.java


示例17: SAML2IdPMappingPanel

import org.apache.wicket.model.util.ListModel; //导入依赖的package包/类
public SAML2IdPMappingPanel(
        final String id,
        final SAML2IdPTO idpTO,
        final ItemTransformersTogglePanel mapItemTransformers,
        final JEXLTransformersTogglePanel jexlTransformers) {

    super(id,
            mapItemTransformers,
            jexlTransformers,
            new ListModel<ItemTO>(idpTO.getItems()),
            true,
            true,
            MappingPurpose.NONE);

    setOutputMarkupId(true);
}
 
开发者ID:apache,项目名称:syncope,代码行数:17,代码来源:SAML2IdPMappingPanel.java


示例18: AddCriteriaForm

import org.apache.wicket.model.util.ListModel; //导入依赖的package包/类
/**
 * @param id
 *          The wicket:id component ID of this form.
 */
public AddCriteriaForm(String id) {
  super(id, new CompoundPropertyModel<ElementCrit>(new ElementCrit()));
  List<Element> ptypeElements = fm.safeGetElementsForProductType(type);
  Collections.sort(ptypeElements, new Comparator<Element>() {
    public int compare(Element e1, Element e2) {
      return e1.getElementName().compareTo(e2.getElementName());
    }
  });

  add(new DropDownChoice<Element>("criteria_list", new PropertyModel(
      getDefaultModelObject(), "elem"), new ListModel<Element>(
      ptypeElements), new ChoiceRenderer<Element>("elementName",
      "elementId")));
  add(new TextField<TermQueryCriteria>(
      "criteria_form_add_element_value",
      new PropertyModel<TermQueryCriteria>(getDefaultModelObject(), "value")));
  add(new Button("criteria_elem_add"));
}
 
开发者ID:apache,项目名称:oodt,代码行数:23,代码来源:TypeBrowser.java


示例19: addFileUploafForm

import org.apache.wicket.model.util.ListModel; //导入依赖的package包/类
private void addFileUploafForm() {
    final IModel<List<FileUpload>> model = new ListModel<FileUpload>();
    BootstrapForm<Void> form = new BootstrapForm<Void>("form");
    form.setOutputMarkupId(true);
    add(form);
    
    BootstrapFileInput bootstrapFileInput = new BootstrapFileInput("bootstrapFileinput", model) {
        @Override
        protected void onSubmit(AjaxRequestTarget target) {
            super.onSubmit(target);

            List<FileUpload> fileUploads = model.getObject();
            if (fileUploads != null) {
                for (FileUpload upload : fileUploads) {
                    success("Uploaded: " + upload.getClientFileName());
                }
            }

        }
    };
    form.add(bootstrapFileInput);
}
 
开发者ID:dmbeer,项目名称:wicket-bootstrap-example,代码行数:23,代码来源:FileUploadPage.java


示例20: NewVersionsAdditionalEmailHtmlNotificationDemoPage

import org.apache.wicket.model.util.ListModel; //导入依赖的package包/类
public NewVersionsAdditionalEmailHtmlNotificationDemoPage(PageParameters parameters) {
	super(parameters);
	
	User user = userService.getByUserName(ConsoleNotificationIndexPage.DEFAULT_USERNAME);
	if (user == null) {
		LOGGER.error("There is no user available");
		Session.get().error(getString("console.notifications.noDataAvailable"));
		
		throw new RestartResponseException(ConsoleNotificationIndexPage.class);
	}
	
	Collection<EmailAddress> emailAddresses = user.getAdditionalEmails();
	if (emailAddresses == null || emailAddresses.isEmpty()) {
		LOGGER.error("There is no additional email address available");
		Session.get().error(getString("console.notifications.noDataAvailable"));
		
		throw new RestartResponseException(ConsoleNotificationIndexPage.class);
	}
	EmailAddress additionalEmail = Iterables.get(emailAddresses, 0);
	
	List<ArtifactVersionNotification> notifications = userService.listRecentNotifications(user);
	
	IModel<List<ArtifactVersionNotification>> notificationsModel = new ListModel<ArtifactVersionNotification>(notifications);
	add(new NewVersionsHtmlNotificationPanel("htmlPanel", notificationsModel,
			new GenericEntityModel<Long, EmailAddress>(additionalEmail)));
}
 
开发者ID:openwide-java,项目名称:artifact-listener,代码行数:27,代码来源:NewVersionsAdditionalEmailHtmlNotificationDemoPage.java



注:本文中的org.apache.wicket.model.util.ListModel类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java AbstractHttpMessage类代码示例发布时间:2022-05-21
下一篇:
Java BasicRequestLine类代码示例发布时间:2022-05-21
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap