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


Java CompoundPropertyModel.of方法代码示例

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


在下文中一共展示了CompoundPropertyModel.of方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: addUrlForm

import org.apache.wicket.model.CompoundPropertyModel; //导入方法依赖的package包/类
private void addUrlForm() {
  urlForm = new Form<SeedUrl>("urlForm", CompoundPropertyModel.of(Model
      .of(new SeedUrl())));
  urlForm.setOutputMarkupId(true);
  urlForm.add(new TextField<String>("url"));
  urlForm.add(new AjaxSubmitLink("addUrl", urlForm) {
    @Override
    protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
      addSeedUrl();
      urlForm.setModelObject(new SeedUrl());
      target.add(urlForm);
      target.add(seedUrlsTable);
    }
  });
  add(urlForm);
}
 
开发者ID:jorcox,项目名称:GeoCrawler,代码行数:17,代码来源:SeedPage.java

示例2: TagEditorPanel

import org.apache.wicket.model.CompoundPropertyModel; //导入方法依赖的package包/类
public TagEditorPanel(String aId, IModel<TagSet> aTagSet, IModel<Tag> aTag)
{
    super(aId, aTag);
    
    setOutputMarkupId(true);
    setOutputMarkupPlaceholderTag(true);
    
    selectedTagSet = aTagSet;
    selectedTag = aTag;
    
    Form<Tag> form = new Form<>("form", CompoundPropertyModel.of(aTag));
    add(form);
    
    form.add(new TextField<String>("name")
            .add(new TagExistsValidator())
            .setRequired(true));
    form.add(new TextArea<String>("description"));
    
    form.add(new LambdaAjaxButton<>("save", this::actionSave));
    form.add(new LambdaAjaxLink("delete", this::actionDelete)
            .onConfigure(_this -> _this.setVisible(form.getModelObject().getId() != 0)));
    form.add(new LambdaAjaxLink("cancel", this::actionCancel));
}
 
开发者ID:webanno,项目名称:webanno,代码行数:24,代码来源:TagEditorPanel.java

示例3: TagSetImportPanel

import org.apache.wicket.model.CompoundPropertyModel; //导入方法依赖的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

示例4: ProjectImportPanel

import org.apache.wicket.model.CompoundPropertyModel; //导入方法依赖的package包/类
public ProjectImportPanel(String aId, IModel<Project> aModel)
{
    super(aId);
    
    preferences = Model.of(new Preferences());
    selectedModel = aModel;
    
    Form<Preferences> form = new Form<>("form", CompoundPropertyModel.of(preferences));
    form.add(new CheckBox("generateUsers"));
    form.add(fileUpload = new FileUploadField("content", new ListModel<>()));
    fileUpload.setRequired(true);
    form.add(new LambdaAjaxButton<>("import", this::actionImport));
    add(form);
}
 
开发者ID:webanno,项目名称:webanno,代码行数:15,代码来源:ProjectImportPanel.java

示例5: TagSetEditorPanel

import org.apache.wicket.model.CompoundPropertyModel; //导入方法依赖的package包/类
public TagSetEditorPanel(String aId, IModel<Project> aProject, IModel<TagSet> aTagSet,
        IModel<Tag> aSelectedTag)
{
    super(aId, aTagSet);
    
    setOutputMarkupId(true);
    setOutputMarkupPlaceholderTag(true);
    
    selectedProject = aProject;
    selectedTagSet = aTagSet;
    selectedTag = aSelectedTag;
    exportFormat = Model.of(supportedFormats().get(0));
    
    Form<TagSet> form = new Form<>("form", CompoundPropertyModel.of(aTagSet));
    add(form);
    
    form.add(new TextField<String>("name")
            .add(new TagSetExistsValidator())
            .setRequired(true));
    form.add(new TextField<String>("language"));
    form.add(new TextArea<String>("description"));
    form.add(new CheckBox("createTag"));
    
    form.add(new LambdaAjaxButton<>("save", this::actionSave));
    form.add(new LambdaAjaxLink("delete", this::actionDelete)
            .onConfigure(_this -> _this.setVisible(form.getModelObject().getId() != 0)));
    form.add(new LambdaAjaxLink("cancel", this::actionCancel));
    
    form.add(new DropDownChoice<>("format", exportFormat,
            LambdaModel.of(this::supportedFormats))
            .add(new LambdaAjaxFormComponentUpdatingBehavior("change",  (t) -> { })));
    form.add(new AjaxDownloadLink("export", LambdaModel.of(this::export)));
    
    confirmationDialog = new ConfirmationDialog("confirmationDialog");
    confirmationDialog.setTitleModel(new StringResourceModel("DeleteDialog.title", this));
    add(confirmationDialog);
}
 
开发者ID:webanno,项目名称:webanno,代码行数:38,代码来源:TagSetEditorPanel.java

示例6: ProjectDetailPanel

import org.apache.wicket.model.CompoundPropertyModel; //导入方法依赖的package包/类
public ProjectDetailPanel(String id, IModel<Project> aModel)
{
    super(id);
    
    projectModel = aModel;
    
    Form<Project> form = new Form<>("form", CompoundPropertyModel.of(aModel));
    add(form);
    
    TextField<String> projectNameTextField = new TextField<>("name");
    projectNameTextField.setRequired(true);
    projectNameTextField.add(new ProjectExistsValidator());
    projectNameTextField.add(new ProjectNameValidator());
    form.add(projectNameTextField);

    // If we run in development mode, then also show the ID of the project
    form.add(idLabel = new Label("id"));
    idLabel.setVisible(RuntimeConfigurationType.DEVELOPMENT
            .equals(getApplication().getConfigurationType()));

    form.add(new TextArea<String>("description").setOutputMarkupId(true));
    
    DropDownChoice<ScriptDirection> scriptDirection = new DropDownChoice<>("scriptDirection");
    scriptDirection.setChoiceRenderer(new EnumChoiceRenderer<>(this));
    scriptDirection.setChoices(Arrays.asList(ScriptDirection.values()));
    form.add(scriptDirection);
    
    form.add(new CheckBox("disableExport"));
    
    form.add(makeProjectTypeChoice());
    
    form.add(new LambdaAjaxButton<>("save", this::actionSave));
    form.add(new LambdaAjaxLink("cancel", this::actionCancel));
    form.add(new LambdaAjaxLink("delete", this::actionDelete).onConfigure((_this) -> 
        _this.setEnabled(projectModel.getObject() != null && 
                projectModel.getObject().getId() > 0 )));

    IModel<String> projectNameModel = PropertyModel.of(projectModel, "name");
    add(deleteProjectDialog = new ChallengeResponseDialog("deleteProjectDialog",
            new StringResourceModel("DeleteProjectDialog.title", this),
            new StringResourceModel("DeleteProjectDialog.text", this)
                    .setModel(projectModel).setParameters(projectNameModel),
            projectNameModel));
    deleteProjectDialog.setConfirmAction((target) -> {
        try {
            projectService.removeProject(projectModel.getObject());
            projectModel.setObject(null);
            target.add(getPage());
        }
        catch (IOException e) {
            LOG.error("Unable to remove project :" + ExceptionUtils.getRootCauseMessage(e));
            error("Unable to remove project " + ":" + ExceptionUtils.getRootCauseMessage(e));
            target.addChildren(getPage(), IFeedback.class);
        }
    });
}
 
开发者ID:webanno,项目名称:webanno,代码行数:57,代码来源:ProjectDetailPanel.java


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