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


Java TextField類代碼示例

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


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

示例1: onInitialize

import org.apache.wicket.markup.html.form.TextField; //導入依賴的package包/類
@Override
protected void onInitialize() {
	super.onInitialize();
	
	input = new TextField<Number>("input", Model.of(getModelObject()));
	input.setType(getPropertyDescriptor().getPropertyClass());
	add(input);

	add(new AttributeAppender("class", new LoadableDetachableModel<String>() {

		@Override
		protected String load() {
			if (hasErrors(true))
				return " has-error";
			else
				return "";
		}
		
	}));
}
 
開發者ID:jmfgdev,項目名稱:gitplex-mit,代碼行數:21,代碼來源:NumericPropertyEditor.java

示例2: addUrlForm

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

示例3: buildMainLayout

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

import org.apache.wicket.markup.html.form.TextField; //導入依賴的package包/類
public UserSearchPanel(String id, IPageable pageable, AbstractUserDataProvider<User> dataProvider) {
	super(id);
	
	// Quick search
	add(new UserQuickSearchComponent("userQuickSearch"));
	
	// Search form
	Form<Void> form = new PageableSearchForm<Void>("form", pageable);
	
	TextField<String> searchInput = new TextField<String>("searchInput", dataProvider.getNameModel());
	searchInput.setLabel(new ResourceModel("user.portfolio.search.name"));
	searchInput.add(new LabelPlaceholderBehavior());
	form.add(searchInput);
	
	CheckBox active = new CheckBox("includeInactive", dataProvider.getIncludeInactivesModel());
	active.setLabel(new ResourceModel("user.portfolio.search.includeInactive"));
	form.add(active);
	
	add(form);
}
 
開發者ID:openwide-java,項目名稱:owsi-core-parent,代碼行數:21,代碼來源:UserSearchPanel.java

示例5: SettingsPage

import org.apache.wicket.markup.html.form.TextField; //導入依賴的package包/類
public SettingsPage() {
  settingsTable = new WebMarkupContainer("settingsTable");
  settingsTable.setOutputMarkupId(true);
  RefreshingView<NutchConfig> nutchConfig = new RefreshingView<NutchConfig>(
      "settings") {

    @Override
    protected Iterator<IModel<NutchConfig>> getItemModels() {
      return new CpmIteratorAdapter<NutchConfig>(
          convertNutchConfig(nutchService.getNutchConfig(getCurrentInstance()
              .getId())));
    }

    @Override
    protected void populateItem(Item<NutchConfig> item) {
      item.add(new Label("name"));
      item.add(new TextField<String>("value"));
    }
  };
  settingsTable.add(nutchConfig);
  add(settingsTable);
}
 
開發者ID:jorcox,項目名稱:GeoCrawler,代碼行數:23,代碼來源:SettingsPage.java

示例6: doInitialize

import org.apache.wicket.markup.html.form.TextField; //導入依賴的package包/類
@Override
protected void doInitialize(Border layout) {
    add(layout);

    this.form = new Form<>("form");
    layout.add(this.form);

    this.nameField = new TextField<>("nameField", new PropertyModel<>(this, "name"));
    this.nameField.add(new CollectionNameValidator());
    this.nameField.setRequired(true);
    this.form.add(this.nameField);

    this.nameFeedback = new TextFeedbackPanel("nameFeedback", this.nameField);
    this.form.add(this.nameFeedback);

    this.closeButton = new BookmarkablePageLink<>("closeButton", CollectionBrowsePage.class);
    this.form.add(this.closeButton);

    this.saveButton = new Button("saveButton");
    this.saveButton.setOnSubmit(this::saveButtonOnSubmit);
    this.form.add(this.saveButton);
}
 
開發者ID:PkayJava,項目名稱:MBaaS,代碼行數:23,代碼來源:CollectionCreatePage.java

示例7: initLayout

import org.apache.wicket.markup.html.form.TextField; //導入依賴的package包/類
private void initLayout() {
    final TextField input = initTextField();

    input.add(new AjaxFormComponentUpdatingBehavior("blur") {

        @Override
        protected void onUpdate(AjaxRequestTarget target) {
            //nothing to do, just update model data
        }
    });
    input.add(new Behavior() {

        @Override
        public void bind(Component component) {
            super.bind(component);

            component.add(AttributeModifier.replace("onkeydown",
                    Model.of("if(event.keyCode == 13) {event.preventDefault();}")));
        }
    });
    input.setOutputMarkupId(true);
    add(input);
}
 
開發者ID:Pardus-Engerek,項目名稱:engerek,代碼行數:24,代碼來源:TextPopupPanel.java

示例8: TextDetailsPanel

import org.apache.wicket.markup.html.form.TextField; //導入依賴的package包/類
public TextDetailsPanel(String id, IModel<T> model, Class clazz){
    super(id);

    final TextField<T> text = new TextField<>(ID_INPUT, model);
    text.setType(clazz);
    add(text);

    Label details = new Label(ID_DETAILS);
    details.add(AttributeModifier.replace("title", new AbstractReadOnlyModel<String>() {

        @Override
        public String getObject() {
            return createAssociationTooltip();
        }
    }));
    details.add(new InfoTooltipBehavior(){

        @Override
        public String getDataPlacement(){
            return "bottom";
        }
    });
    add(details);
}
 
開發者ID:Pardus-Engerek,項目名稱:engerek,代碼行數:25,代碼來源:TextDetailsPanel.java

示例9: createOptionsForm

import org.apache.wicket.markup.html.form.TextField; //導入依賴的package包/類
private Form createOptionsForm(String id) {
    final Form options = new AjaxIndicatingForm(id);

    final DropDownChoice<SortParam<FieldValuesOrder>> sortSelect
            = new FieldValueOrderSelector("sort", new PropertyModel<SortParam<FieldValuesOrder>>(valuesProvider, "sort"));
    sortSelect.add(new UpdateOptionsFormBehavior(options));
    options.add(sortSelect);

    final TextField filterField = new TextField<>("filter", new PropertyModel(filterModel, "name"));
    filterField.add(new AjaxFormComponentUpdatingBehavior("keyup") {

        @Override
        protected void onUpdate(AjaxRequestTarget target) {
            target.add(valuesContainer);
        }
    });
    options.add(filterField);

    addOccurenceOptions(options);

    return options;
}
 
開發者ID:acdh-oeaw,項目名稱:vlo-curation,代碼行數:23,代碼來源:AllFacetValuesPanel.java

示例10: createFilterForm

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

示例11: BookmarkLinkPanel

import org.apache.wicket.markup.html.form.TextField; //導入依賴的package包/類
public BookmarkLinkPanel(String id, IModel<String> linkModel, IModel<String> pageTitleModel) {
    super(id);
    this.linkModel = linkModel;
    this.pageTitleModel = pageTitleModel;

    add(new ExternalLink("link", linkModel)
            .add(new Label("linkText", pageTitleModel)));
    add(new TextField("linkInput", linkModel));

    add(new WebMarkupContainer("bookmarkInstructions") {
        @Override
        protected void onConfigure() {
            setVisible(bookmarkMode);
        }

    });
    add(new WebMarkupContainer("copyInstructions") {
        @Override
        protected void onConfigure() {
            setVisible(copyMode);
        }

    });
}
 
開發者ID:acdh-oeaw,項目名稱:vlo-curation,代碼行數:25,代碼來源:BookmarkLinkPanel.java

示例12: testLoadDraft

import org.apache.wicket.markup.html.form.TextField; //導入依賴的package包/類
@WithUserDetails("vinicius.nunes")
@Test
public void testLoadDraft() {
    tester = new SingularWicketTester(singularApplication);

    FormPage p = saveDraft();

    RequirementInstance requirement = getRequirementFrom(p);

    ActionContext context = new ActionContext();
    context.setFormName(SPackageFOO.STypeFOO.FULL_NAME);
    context.setFormAction(FormAction.FORM_FILL);
    context.setRequirementId(requirement.getCod());

    FormPage p2 = new FormPage(context);
    tester.startPage(p2);
    tester.assertRenderedPage(FormPage.class);

    TextField<String> t2 = (TextField<String>) new AssertionsWComponent(p2).getSubComponents(TextField.class).first().getTarget();
    assertEquals(SUPER_TESTE_STRING, t2.getDefaultModelObject());
}
 
開發者ID:opensingular,項目名稱:singular-server,代碼行數:22,代碼來源:FormPageTest.java

示例13: ProbabilityEntryPanel

import org.apache.wicket.markup.html.form.TextField; //導入依賴的package包/類
public ProbabilityEntryPanel(final String id, final int entryId, final SimulationTreeTableProvider<Object> simulationTreeTableProvider) {
	super(id);
	final Form<Void> form = new Form<Void>("form");

	this.textField = new TextField<String>("textFieldID", Model.of(simulationTreeTableProvider.getProbabilityForEntry(entryId)));
	this.textField.setOutputMarkupPlaceholderTag(true);
	this.textField.setOutputMarkupId(true);
	this.textField.add(new AjaxFormComponentUpdatingBehavior("onchange") {

		private static final long serialVersionUID = 1L;

		@Override
		protected void onUpdate(final AjaxRequestTarget target) {

			simulationTreeTableProvider.setProbabilityForEntry(ProbabilityEntryPanel.this.textField.getValue(), entryId);
		}
	});

	form.add(this.textField);

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

示例14: buildTextFields

import org.apache.wicket.markup.html.form.TextField; //導入依賴的package包/類
private void buildTextFields() {
	this.transformationRuleNameTextField = new TextField<String>("transformationRuleNameTextField", new PropertyModel<String>(this, "transformationRuleName"));
	this.transformationRuleNameTextField.setOutputMarkupId(true);
	this.layoutForm.add(this.transformationRuleNameTextField);

	final List<String> eventTypes = EapEventType.getAllTypeNames();
	this.eventTypeDropDownChoice = new DropDownChoice<String>("eventTypeDropDownChoice", new PropertyModel<String>(this, "selectedEventTypeName"), eventTypes);
	this.eventTypeDropDownChoice.add(new AjaxFormComponentUpdatingBehavior("onchange") {
		private static final long serialVersionUID = 1L;

		@Override
		protected void onUpdate(final AjaxRequestTarget target) {
			BasicTransformationRuleEditorPanel.this.updateOnChangeOfDropDownChoice(target);
		}
	});
	this.layoutForm.add(this.eventTypeDropDownChoice);

	this.transformationRuleTextArea = new TextArea<String>("transformationRuleTextArea", new PropertyModel<String>(this, "transformationRule"));
	this.transformationRuleTextArea.setOutputMarkupId(true);
	this.layoutForm.add(this.transformationRuleTextArea);
}
 
開發者ID:bptlab,項目名稱:Unicorn,代碼行數:22,代碼來源:BasicTransformationRuleEditorPanel.java

示例15: RepeatPatternOperatorRangePanel

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


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