本文整理匯總了Java中org.apache.wicket.markup.html.form.Form.add方法的典型用法代碼示例。如果您正苦於以下問題:Java Form.add方法的具體用法?Java Form.add怎麽用?Java Form.add使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.apache.wicket.markup.html.form.Form
的用法示例。
在下文中一共展示了Form.add方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: PostmanConvertPanel
import org.apache.wicket.markup.html.form.Form; //導入方法依賴的package包/類
public PostmanConvertPanel(String id) {
super(id);
setDefaultModel(new CompoundPropertyModel(this));
Form form = new Form("form") {
@Override
protected void onSubmit() {
logger.debug("text is: {}", text);
List<PostmanRequest> requests = ConvertUtils.readPostmanJson(text);
String feature = ConvertUtils.toKarateFeature(requests);
KarateSession session = service.createSession("dev", feature);
setResponsePage(new FeaturePage(session.getId()));
}
};
form.add(new TextArea("text"));
add(form);
add(new FeedbackPanel("feedback"));
text = "Paste your postman collection here.";
}
示例2: onInitialize
import org.apache.wicket.markup.html.form.Form; //導入方法依賴的package包/類
@Override
protected void onInitialize() {
super.onInitialize();
SystemSetting systemSetting = GitPlex.getInstance(ConfigManager.class).getSystemSetting();
Form<?> form = new Form<Void>("form") {
@Override
protected void onSubmit() {
super.onSubmit();
GitPlex.getInstance(ConfigManager.class).saveSystemSetting(systemSetting);
getSession().success("System setting has been updated");
setResponsePage(SystemSettingPage.class);
}
};
form.add(BeanContext.editBean("editor", systemSetting));
add(form);
}
示例3: onInitialize
import org.apache.wicket.markup.html.form.Form; //導入方法依賴的package包/類
@Override
protected void onInitialize() {
super.onInitialize();
SecuritySetting securitySetting = GitPlex.getInstance(ConfigManager.class).getSecuritySetting();
Form<?> form = new Form<Void>("securitySetting") {
@Override
protected void onSubmit() {
super.onSubmit();
GitPlex.getInstance(ConfigManager.class).saveSecuritySetting(securitySetting);
getSession().success("Security setting has been updated");
setResponsePage(SecuritySettingPage.class);
}
};
form.add(BeanContext.editBean("editor", securitySetting));
add(form);
}
示例4: addProcessSelect
import org.apache.wicket.markup.html.form.Form; //導入方法依賴的package包/類
private void addProcessSelect(final Form<Void> layoutForm) {
this.processNameList = new ArrayList<String>();
for (final CorrelationProcess process : CorrelationProcess.findAll()) {
this.processNameList.add(process.getName());
}
this.processSelect = new DropDownChoice<String>("processSelect", new Model<String>(), this.processNameList);
this.processSelect.setOutputMarkupId(true);
this.processSelect.add(new AjaxFormComponentUpdatingBehavior("onchange") {
private static final long serialVersionUID = 1L;
@Override
protected void onUpdate(final AjaxRequestTarget target) {
BPMNMonitoringPanel.this.process = CorrelationProcess.findByName(BPMNMonitoringPanel.this.processSelect.getChoices().get(Integer.parseInt(BPMNMonitoringPanel.this.processSelect.getValue()))).get(0);
BPMNMonitoringPanel.this.createProcessInstanceMonitoringProvider();
target.add(BPMNMonitoringPanel.this.dataTable);
}
});
layoutForm.add(this.processSelect);
}
示例5: initLayout
import org.apache.wicket.markup.html.form.Form; //導入方法依賴的package包/類
private void initLayout() {
Form mainForm = new Form(ID_MAIN_FORM);
add(mainForm);
ObjectDataProvider provider = new ObjectDataProvider(PageReports.this, ReportType.class);
provider.setQuery(createQuery());
BoxedTablePanel table = new BoxedTablePanel(ID_REPORTS_TABLE, provider, initColumns(),
UserProfileStorage.TableId.PAGE_REPORTS,
(int) getItemsPerPage(UserProfileStorage.TableId.PAGE_REPORTS)) {
@Override
protected WebMarkupContainer createHeader(String headerId) {
return new SearchFragment(headerId, ID_TABLE_HEADER, PageReports.this, searchModel);
}
};
table.setShowPaging(false);
table.setOutputMarkupId(true);
mainForm.add(table);
}
示例6: getRangeValidator
import org.apache.wicket.markup.html.form.Form; //導入方法依賴的package包/類
public static DateValidator getRangeValidator(Form<?> form, ItemPath path) {
DateValidator validator = null;
List<DateValidator> validators = form.getBehaviors(DateValidator.class);
if (validators != null) {
for (DateValidator val : validators) {
if (path.equivalent(val.getIdentifier())) {
validator = val;
break;
}
}
}
if (validator == null) {
validator = new DateValidator();
validator.setIdentifier(path);
form.add(validator);
}
return validator;
}
示例7: setUpPanel
import org.apache.wicket.markup.html.form.Form; //導入方法依賴的package包/類
private void setUpPanel(String id) {
setDefaultModel(new CompoundPropertyModel(this));
Form form = new Form("form") {
@Override
protected void onSubmit() {
logger.debug("text is: {}", text);
KarateSession session = service.createSession("dev", text);
setResponsePage(new FeaturePage(session.getId()));
}
};
form.add(new TextArea("text"));
add(form);
add(new FeedbackPanel("feedback"));
}
示例8: onInitialize
import org.apache.wicket.markup.html.form.Form; //導入方法依賴的package包/類
@Override
protected void onInitialize() {
super.onInitialize();
Project project = new Project();
BeanEditor<?> editor = BeanContext.editBean("editor", project);
Form<?> form = new Form<Void>("form") {
@Override
protected void onSubmit() {
super.onSubmit();
ProjectManager projectManager = GitPlex.getInstance(ProjectManager.class);
Project projectWithSameName = projectManager.find(project.getName());
if (projectWithSameName != null) {
editor.getErrorContext(new PathSegment.Property("name"))
.addError("This name has already been used by another project");
} else {
projectManager.save(project, null);
Session.get().success("New project created");
setResponsePage(ProjectBlobPage.class, ProjectBlobPage.paramsOf(project));
}
}
};
form.add(editor);
add(form);
}
示例9: onInitialize
import org.apache.wicket.markup.html.form.Form; //導入方法依賴的package包/類
@Override
protected void onInitialize() {
super.onInitialize();
Form<?> form = new Form<Void>("commitMessageTransformSetting") {
@Override
protected void onSubmit() {
super.onSubmit();
GitPlex.getInstance(ProjectManager.class).save(getProject());
Session.get().success("Commit message transform setting is updated");
}
};
form.add(new ReflectionPropertyEditor("editor", new PropertyDescriptor(Project.class, "commitMessageTransformSetting"), new IModel<Serializable>() {
@Override
public void detach() {
}
@Override
public Serializable getObject() {
return getProject().getCommitMessageTransformSetting();
}
@Override
public void setObject(Serializable object) {
getProject().setCommitMessageTransformSetting((CommitMessageTransformSetting) object);
}
}));
add(form);
}
示例10: onInitialize
import org.apache.wicket.markup.html.form.Form; //導入方法依賴的package包/類
@Override
protected void onInitialize() {
super.onInitialize();
PasswordEditBean bean = new PasswordEditBean();
Set<String> excludedProperties = new HashSet<>();
// in case administrator changes password we do not ask for old password
if (SecurityUtils.isAdministrator())
excludedProperties.add("oldPassword");
Form<?> form = new Form<Void>("form") {
@Override
protected void onSubmit() {
super.onSubmit();
getUser().setPassword(AppLoader.getInstance(PasswordService.class).encryptPassword(bean.getNewPassword()));
GitPlex.getInstance(UserManager.class).save(getUser(), null);
Session.get().success("Password has been changed");
bean.setOldPassword(null);
replace(BeanContext.editBean("editor", bean, excludedProperties));
}
};
add(form);
form.add(BeanContext.editBean("editor", bean, excludedProperties));
}
示例11: onInitialize
import org.apache.wicket.markup.html.form.Form; //導入方法依賴的package包/類
@Override
protected void onInitialize() {
super.onInitialize();
Form form1 = new Form("form1") {
@Override
protected void onSubmit() {
success("Success");
Session.get().invalidateNow();
}
};
form1.add(new FeedbackPanel("feedback", new ComponentFeedbackMessageFilter(form1)));
add(form1);
WebMarkupContainer c = new WebMarkupContainer("cont");
c.setOutputMarkupId(true);
Form form2 = new Form("form2");
form2.add(new FeedbackPanel("feedback", new ComponentFeedbackMessageFilter(form2)));
form2.add(new AjaxSubmitLink("submit") {
@Override
protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
super.onSubmit(target, form);
form.success("Ajax success");
target.add(form2);
}
});
c.add(form2);
add(c);
}
示例12: onInitialize
import org.apache.wicket.markup.html.form.Form; //導入方法依賴的package包/類
@Override
protected void onInitialize() {
super.onInitialize();
final RI requirement = loadRequirement();
currentModel = $m.loadable(() -> requirement != null && requirement.getCod() != null ? requirementService.getRequirement(requirement.getCod()) : requirement);
currentModel.setObject(requirement);
fillTransitionControllerMap(transitionControllerMap);
SingularSpringInjector.get().injectAll(transitionControllerMap.values());
SingularSpringInjector.get().injectAll(transitionConfirmModalMap.values());
singularFormPanel.setViewMode(getViewMode(config));
singularFormPanel.setAnnotationMode(getAnnotationMode(config));
singularFormPanel.setInstanceCreator(() -> createInstance(formRequirementService.loadRefType(config.getFormName())));
Form<?> form = new Form<>("save-form");
form.setMultiPart(true);
form.add(singularFormPanel);
form.add(modalContainer);
BSModalBorder enviarModal = buildConfirmationModal(modalContainer, getInstanceModel());
form.add(buildSendButton(enviarModal));
form.add(buildSaveButton());
form.add(buildFlowButtons());
form.add(buildValidateButton());
form.add(buildExtensionButtons());
form.add(buildCloseButton());
form.add(closeModal);
form.add(buildExtraContent("extra-content"));
add(form);
}
示例13: initTableLayout
import org.apache.wicket.markup.html.form.Form; //導入方法依賴的package包/類
private void initTableLayout(Form mainForm) {
CertCaseDtoProvider provider = new CertCaseDtoProvider(PageCertCampaign.this);
provider.setQuery(createCaseQuery());
provider.setCampaignOid(campaignOid);
provider.setSort(AccessCertificationCaseType.F_OBJECT_REF.getLocalPart(), SortOrder.ASCENDING); // default sorting
int itemsPerPage = (int) getItemsPerPage(UserProfileStorage.TableId.PAGE_CERT_CAMPAIGN_OUTCOMES_PANEL);
BoxedTablePanel table = new BoxedTablePanel<>(ID_OUTCOMES_TABLE, provider, initColumns(),
UserProfileStorage.TableId.PAGE_CERT_CAMPAIGN_OUTCOMES_PANEL, itemsPerPage);
table.setShowPaging(true);
table.setOutputMarkupId(true);
table.setItemsPerPage(itemsPerPage);
mainForm.add(table);
}
示例14: initLayout
import org.apache.wicket.markup.html.form.Form; //導入方法依賴的package包/類
private void initLayout() {
Form mainForm = new Form(ID_MAIN_FORM);
add(mainForm);
WorkItemsPanel panel = new WorkItemsPanel(ID_WORK_ITEMS_PANEL, new WorkItemDtoProvider(PageWorkItems.this, claimable, all),
UserProfileStorage.TableId.PAGE_WORK_ITEMS, (int) getItemsPerPage(UserProfileStorage.TableId.PAGE_WORK_ITEMS),
WorkItemsPanel.View.FULL_LIST);
panel.setOutputMarkupId(true);
mainForm.add(panel);
initItemButtons(mainForm);
}
示例15: initAdvanced
import org.apache.wicket.markup.html.form.Form; //導入方法依賴的package包/類
private void initAdvanced(Form mainForm) {
CheckBox runUntilNodeDown = new CheckBox(ID_RUN_UNTIL_NODW_DOWN, new PropertyModel<Boolean>(model,
TaskAddDto.F_RUN_UNTIL_NODW_DOWN));
mainForm.add(runUntilNodeDown);
final IModel<Boolean> createSuspendedCheck = new PropertyModel<>(model, TaskAddDto.F_SUSPENDED_STATE);
CheckBox createSuspended = new CheckBox(ID_CREATE_SUSPENDED, createSuspendedCheck);
mainForm.add(createSuspended);
DropDownChoice threadStop = new DropDownChoice<>(ID_THREAD_STOP, new Model<ThreadStopActionType>() {
@Override
public ThreadStopActionType getObject() {
TaskAddDto dto = model.getObject();
// if (dto.getThreadStop() == null) {
// if (!dto.getRunUntilNodeDown()) {
// dto.setThreadStop(ThreadStopActionType.RESTART);
// } else {
// dto.setThreadStop(ThreadStopActionType.CLOSE);
// }
// }
return dto.getThreadStop();
}
@Override
public void setObject(ThreadStopActionType object) {
model.getObject().setThreadStop(object);
}
}, WebComponentUtil.createReadonlyModelFromEnum(ThreadStopActionType.class),
new EnumChoiceRenderer<ThreadStopActionType>(PageTaskAdd.this));
mainForm.add(threadStop);
mainForm.add(new TsaValidator(runUntilNodeDown, threadStop));
DropDownChoice misfire = new DropDownChoice<>(ID_MISFIRE_ACTION, new PropertyModel<MisfireActionType>(
model, TaskAddDto.F_MISFIRE_ACTION), WebComponentUtil.createReadonlyModelFromEnum(MisfireActionType.class),
new EnumChoiceRenderer<MisfireActionType>(PageTaskAdd.this));
mainForm.add(misfire);
}