當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。