当前位置: 首页>>代码示例>>Java>>正文


Java ListModel类代码示例

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


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


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