當前位置: 首頁>>代碼示例>>Java>>正文


Java Form.add方法代碼示例

本文整理匯總了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.";
}
 
開發者ID:intuit,項目名稱:karate,代碼行數:19,代碼來源:PostmanConvertPanel.java

示例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);
}
 
開發者ID:jmfgdev,項目名稱:gitplex-mit,代碼行數:23,代碼來源:SystemSettingPage.java

示例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);
}
 
開發者ID:jmfgdev,項目名稱:gitplex-mit,代碼行數:23,代碼來源:SecuritySettingPage.java

示例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);
}
 
開發者ID:bptlab,項目名稱:Unicorn,代碼行數:24,代碼來源:BPMNMonitoringPanel.java

示例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);

}
 
開發者ID:Pardus-Engerek,項目名稱:engerek,代碼行數:22,代碼來源:PageReports.java

示例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;
}
 
開發者ID:Pardus-Engerek,項目名稱:engerek,代碼行數:21,代碼來源:WebComponentUtil.java

示例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"));
}
 
開發者ID:intuit,項目名稱:karate,代碼行數:15,代碼來源:HomePanel.java

示例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);
}
 
開發者ID:jmfgdev,項目名稱:gitplex-mit,代碼行數:32,代碼來源:NewProjectPage.java

示例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);
}
 
開發者ID:jmfgdev,項目名稱:gitplex-mit,代碼行數:35,代碼來源:CommitMessageTransformPage.java

示例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));
}
 
開發者ID:jmfgdev,項目名稱:gitplex-mit,代碼行數:31,代碼來源:PasswordEditPage.java

示例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);
}
 
開發者ID:merzlikinvs,項目名稱:cas-playground,代碼行數:28,代碼來源:ExamplePage.java

示例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);
}
 
開發者ID:opensingular,項目名稱:singular-server,代碼行數:32,代碼來源:AbstractFormPage.java

示例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);
}
 
開發者ID:Pardus-Engerek,項目名稱:engerek,代碼行數:14,代碼來源:PageCertCampaign.java

示例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);
}
 
開發者ID:Pardus-Engerek,項目名稱:engerek,代碼行數:14,代碼來源:PageWorkItems.java

示例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);
    }
 
開發者ID:Pardus-Engerek,項目名稱:engerek,代碼行數:40,代碼來源:PageTaskAdd.java


注:本文中的org.apache.wicket.markup.html.form.Form.add方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。