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


Java Form類代碼示例

本文整理匯總了Java中org.apache.wicket.markup.html.form.Form的典型用法代碼示例。如果您正苦於以下問題:Java Form類的具體用法?Java Form怎麽用?Java Form使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


Form類屬於org.apache.wicket.markup.html.form包,在下文中一共展示了Form類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: addUrlForm

import org.apache.wicket.markup.html.form.Form; //導入依賴的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: NotificationPage

import org.apache.wicket.markup.html.form.Form; //導入依賴的package包/類
public NotificationPage() {
	super();

	// Create the modal window.
	this.addNotificationModal = new AddNotificationModal("addNotificationModal", this);
	this.add(this.addNotificationModal);

	// add notificationList
	if (((AuthenticatedSession) Session.get()).getUser() != null) {
		// logged in users see their notifications
		final NotificationList notificationList = new NotificationList("notificationList", this);
		notificationList.setOutputMarkupId(true);
		this.add(notificationList);
	} else {
		final Label notificationListLabel = new Label("notificationList", "Log in to check your notifications.");
		notificationListLabel.setOutputMarkupId(true);
		this.add(notificationListLabel);
	}

	this.form = new Form<Void>("form");
	this.form.add(this.addAddButton());
	this.form.add(this.addDeleteAllButton());
	this.add(this.form);

	this.addNotificationRules();
}
 
開發者ID:bptlab,項目名稱:Unicorn,代碼行數:27,代碼來源:NotificationPage.java

示例3: buildMainLayout

import org.apache.wicket.markup.html.form.Form; //導入依賴的package包/類
private void buildMainLayout() {
	this.loginForm = new WarnOnExitForm("loginForm");

	this.emailInput = new TextField<String>("emailInput", Model.of(""));
	this.loginForm.add(this.emailInput);

	this.passwordInput = new PasswordTextField("passwordInput", Model.of(""));
	this.loginForm.add(this.passwordInput);

	this.addLoginButton();
	this.addRegisterLink();

	this.add(this.loginForm);

	this.logoutForm = new Form<Object>("logoutForm");

	this.addLogoutButton();

	this.add(this.logoutForm);

	if (((AuthenticatedSession) Session.get()).getUser() != null) {
		this.loginForm.setVisible(false);
	} else {
		this.logoutForm.setVisible(false);
	}
}
 
開發者ID:bptlab,項目名稱:Unicorn,代碼行數:27,代碼來源:LoginPage.java

示例4: 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

示例5: 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

示例6: 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

示例7: createFilterForm

import org.apache.wicket.markup.html.form.Form; //導入依賴的package包/類
/**
 * Creates a form with an input bound to the filter model
 *
 * @param id component id
 * @return filter form
 */
private Form createFilterForm(String id) {
    final Form filterForm = new Form(id);
    final TextField<String> filterField = new TextField<>("filterText",
            new PropertyModel<String>(filterModel, "name"));
    // make field update 
    filterField.add(new AjaxFormComponentUpdatingBehavior("keyup") {

        @Override
        protected void onUpdate(AjaxRequestTarget target) {
            //update values
            target.add(valuesContainer);
        }
    });
    filterForm.add(filterField);
    return filterForm;
}
 
開發者ID:acdh-oeaw,項目名稱:vlo-curation,代碼行數:23,代碼來源:FacetValuesPanel.java

示例8: createHeader

import org.apache.wicket.markup.html.form.Form; //導入依賴的package包/類
protected Component createHeader(String id, final IModel<ObjectWrapper<O>> model, final Form<ObjectWrapper<O>> form) {
 	PrismHeaderPanel header = new PrismHeaderPanel(ID_HEADER, model) {
private static final long serialVersionUID = 1L;

@Override
protected void onButtonClick(AjaxRequestTarget target) {
             addOrReplaceContainers(model, form, true);
	target.add(PrismObjectPanel.this);
}
 		
@Override
public boolean isButtonsVisible() {
	return true;
}
 	};
     return header;
 }
 
開發者ID:Pardus-Engerek,項目名稱:engerek,代碼行數:18,代碼來源:PrismObjectPanel.java

示例9: addOrReplaceContainers

import org.apache.wicket.markup.html.form.Form; //導入依賴的package包/類
private void addOrReplaceContainers(IModel<ObjectWrapper<O>> model, final Form form, boolean isToBeReplaced){
    ListView<ContainerWrapper> containers = new ListView<ContainerWrapper>(ID_CONTAINERS,
            createContainerModel(model)) {
        private static final long serialVersionUID = 1L;

        @Override
        protected void populateItem(ListItem<ContainerWrapper> item) {
            PrismContainerPanel containerPanel = createContainerPanel(item, form);
            createMetadataPanel(model, item, containerPanel);
        }
    };
    containers.setReuseItems(true);

    if (isToBeReplaced) {
        replace(containers);
    } else {
        add(containers);
    }
}
 
開發者ID:Pardus-Engerek,項目名稱:engerek,代碼行數:20,代碼來源:PrismObjectPanel.java

示例10: buildSaveButton

import org.apache.wicket.markup.html.form.Form; //導入依賴的package包/類
private Component buildSaveButton() {
    final Component button = new SingularButton("save-btn", getFormInstance()) {

        @Override
        protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
            super.onSubmit(target, form);
            try {
                saveForm(getFormInstance());
                addToastrSuccessMessage("message.success");
                atualizarContentWorklist(target);
            } catch (HibernateOptimisticLockingFailureException e) {
                getLogger().debug(e.getMessage(), e);
                addToastrErrorMessage("message.save.concurrent_error");
            }
        }
    };
    return button.add(visibleOnlyInEditionBehaviour());
}
 
開發者ID:opensingular,項目名稱:singular-server,代碼行數:19,代碼來源:AbstractFormPage.java

示例11: updateConfigurationTabs

import org.apache.wicket.markup.html.form.Form; //導入依賴的package包/類
private void updateConfigurationTabs() {
	final com.evolveum.midpoint.web.component.form.Form form = getForm();
	TabbedPanel<ITab> tabbedPanel = getConfigurationTabbedPanel();
	List<ITab> tabs = tabbedPanel.getTabs().getObject();
	tabs.clear();

	List<ContainerWrapper> wrappers = configurationPropertiesModel.getObject();
	for (final ContainerWrapper wrapper : wrappers) {
		String tabName = getString(wrapper.getDisplayName(), null, wrapper.getDisplayName());
		tabs.add(new AbstractTab(new Model<>(tabName)) {
			@Override
			public WebMarkupContainer getPanel(String panelId) {
				return new PrismContainerPanel(panelId, new Model<>(wrapper), true, form, parentPage);
			}
		});
	}
	int i = tabbedPanel.getSelectedTab();
	if (i < 0 || i > tabs.size()) {
		i = 0;
	}
	tabbedPanel.setSelectedTab(i);
}
 
開發者ID:Pardus-Engerek,項目名稱:engerek,代碼行數:23,代碼來源:ConfigurationStep.java

示例12: RepeatPatternOperatorRangePanel

import org.apache.wicket.markup.html.form.Form; //導入依賴的package包/類
public RepeatPatternOperatorRangePanel(final String id, final PatternOperatorElement element, final AdvancedTransformationRuleEditorPanel panel) {
	super(id);

	this.layoutForm = new Form<Void>("layoutForm");

	final RangeElement rangeElement = element.getRangeElement();

	this.matchCount = rangeElement.getLeftEndpoint();

	this.matchCountInput = new TextField<Integer>("matchCountInput", new PropertyModel<Integer>(this, "matchCount"));
	final OnChangeAjaxBehavior onChangeAjaxBehavior = new OnChangeAjaxBehavior() {
		private static final long serialVersionUID = 2251803290291534439L;

		@Override
		protected void onUpdate(final AjaxRequestTarget target) {
			rangeElement.setLeftEndpoint(RepeatPatternOperatorRangePanel.this.matchCount);
			target.add(panel.getAttributeTreePanel().getAttributeTreeTable());
		}
	};
	this.matchCountInput.add(onChangeAjaxBehavior);
	this.matchCountInput.setOutputMarkupId(true);
	this.layoutForm.add(this.matchCountInput);

	this.add(this.layoutForm);
}
 
開發者ID:bptlab,項目名稱:Unicorn,代碼行數:26,代碼來源:RepeatPatternOperatorRangePanel.java

示例13: addEventsCheckBoxMultipleChoice

import org.apache.wicket.markup.html.form.Form; //導入依賴的package包/類
private void addEventsCheckBoxMultipleChoice(final Form<Void> layoutForm) {
	this.eventsCheckBoxMultipleChoice = new CheckBoxMultipleChoice<ReplayFileBean>("eventsCheckBoxMultipleChoice", new PropertyModel<List<ReplayFileBean>>(this, "selectedFiles"), beans);
	this.eventsCheckBoxMultipleChoice.setOutputMarkupId(true);
	layoutForm.add(this.eventsCheckBoxMultipleChoice);

	// this.eventsCheckGroup = new
	// CheckGroup<ReplayFileBean>("eventsCheckGroup",
	// new PropertyModel<List<ReplayFileBean>>(this, "selectedFiles"));
	// this.eventsCheckGroup.add(new CheckGroupSelector("groupSelector"));
	//
	// ListView<ReplayFileBean> files = new
	// ListView<ReplayFileBean>("beans", beans) {
	// @Override
	// protected void populateItem(ListItem<ReplayFileBean> item) {
	// item.add(new Label("name", item.getModelObject().toString()));
	// }
	// };
	// files.setReuseItems(true);
	// this.eventsCheckGroup.add(files);
	// this.eventsCheckGroup.setOutputMarkupId(true);
	// layoutForm.add(this.eventsCheckGroup);
}
 
開發者ID:bptlab,項目名稱:Unicorn,代碼行數:23,代碼來源:CategoryPanel.java

示例14: addDeleteAllButton

import org.apache.wicket.markup.html.form.Form; //導入依賴的package包/類
private Component addDeleteAllButton() {
	this.deleteAllButton = new BlockingAjaxButton("deleteAllNotificationsButton", this.form) {
		private static final long serialVersionUID = 1L;

		@Override
		public void onSubmit(final AjaxRequestTarget target, final Form form) {
			super.onSubmit(target, form);
			final List<NotificationRule> rules = new ArrayList<NotificationRule>(NotificationPage.this.notificationRulesListView.notificationRuleProvider.getEntities());
			for (final NotificationRule rule : rules) {
				rule.remove();
				NotificationPage.this.notificationRulesListView.notificationRuleProvider.removeItem(rule);
				NotificationPage.this.notificationRulesListView.notificationRuleTable.detach();
				target.add(NotificationPage.this.notificationRulesListView.notificationRuleTable);
			}
		}
	};
	this.deleteAllButton.setOutputMarkupId(true);
	return this.deleteAllButton;
}
 
開發者ID:bptlab,項目名稱:Unicorn,代碼行數:20,代碼來源:NotificationPage.java

示例15: initLayout

import org.apache.wicket.markup.html.form.Form; //導入依賴的package包/類
private void initLayout() {
    Form mainForm = new Form("mainForm");
    mainForm.setMultiPart(true);
    add(mainForm);

    WebMarkupContainer protectedMessage = new WebMarkupContainer(ID_PROTECTED_MESSAGE);
    protectedMessage.add(new VisibleEnableBehaviour() {

        @Override
        public boolean isVisible() {
            ObjectWrapper wrapper = accountModel.getObject();
            return wrapper.isProtectedAccount();
        }
    });
    mainForm.add(protectedMessage);

    PrismObjectPanel<ShadowType> userForm = new PrismObjectPanel<ShadowType>("account", accountModel, new PackageResourceReference(
            ImgResources.class, ImgResources.HDD_PRISM), mainForm, this);
    mainForm.add(userForm);

    initButtons(mainForm);
}
 
開發者ID:Pardus-Engerek,項目名稱:engerek,代碼行數:23,代碼來源:PageAccount.java


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