本文整理匯總了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);
}
示例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));
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
});
}