• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java StringValidator类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.apache.wicket.validation.validator.StringValidator的典型用法代码示例。如果您正苦于以下问题:Java StringValidator类的具体用法?Java StringValidator怎么用?Java StringValidator使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



StringValidator类属于org.apache.wicket.validation.validator包,在下文中一共展示了StringValidator类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: onInitialize

import org.apache.wicket.validation.validator.StringValidator; //导入依赖的package包/类
@Override
protected void onInitialize() {
    super.onInitialize();
    Label label = new Label("label", this.name);
    this.add(label);
    TextField<String> field = new TextField<>("field", new PropertyModel<>(this.fields, this.name));
    field.setLabel(Model.of(name));
    field.add(StringValidator.maximumLength(255));
    TextFeedbackPanel feedback = new TextFeedbackPanel("feedback", field);
    this.add(field);
    this.add(feedback);
}
 
开发者ID:PkayJava,项目名称:MBaaS,代码行数:13,代码来源:StringPanel.java


示例2: UsernameTextField

import org.apache.wicket.validation.validator.StringValidator; //导入依赖的package包/类
public UsernameTextField(String id) {
	super(id);
	Injector.get().inject(this);
	add(StringValidator.minimumLength(3));
	setRequired(true);
	add(new UsernameExistsValidator());
}
 
开发者ID:MarcGiffing,项目名称:wicket-spring-boot,代码行数:8,代码来源:UsernameTextField.java


示例3: CustomerListPage

import org.apache.wicket.validation.validator.StringValidator; //导入依赖的package包/类
public CustomerListPage() {
	FeedbackPanel feedbackPanel = new FeedbackPanel("feedback");
	feedbackPanel.setOutputMarkupId(true);
	add(feedbackPanel);
	
	add(new WebSocketBehavior() {

		@Override
		protected void onPush(WebSocketRequestHandler handler, IWebSocketPushMessage message) {
			if (message instanceof CustomerChangedEvent) {
				CustomerChangedEvent event = (CustomerChangedEvent)message;
				info("changed/created " + event.getCustomer().getFirstname() + " " + event.getCustomer().getLastname());
				handler.add(feedbackPanel);
			}
		}

	});
	
	customerFilterModel = new CompoundPropertyModel<>(new CustomerFilter());
	CustomerDataProvider customerDataProvider = new CustomerDataProvider(customerFilterModel);
	
	queue(new BookmarkablePageLink<Customer>("create", CustomerCreatePage.class));
	
	queue(new ValidationForm<>("form", customerFilterModel));
	queue(new LabeledFormBorder<>(getString("id"), new TextField<>("id")));
	queue(new LabeledFormBorder<>(getString("username"), new UsernameSearchTextField("usernameLike")));
	queue(new LabeledFormBorder<>(getString("firstname"), new TextField<String>("firstnameLike").add(StringValidator.minimumLength(3))));
	queue(new LabeledFormBorder<>(getString("lastname"), new TextField<String>("lastnameLike").add(StringValidator.minimumLength(3))));
	queue(new LabeledFormBorder<>(getString("active"), new CheckBox("active")));
	queue(cancelButton());
	
	customerDataTable(customerDataProvider);

}
 
开发者ID:MarcGiffing,项目名称:wicket-spring-boot,代码行数:35,代码来源:CustomerListPage.java


示例4: GroupCreateUpdatePanel

import org.apache.wicket.validation.validator.StringValidator; //导入依赖的package包/类
public GroupCreateUpdatePanel(CreateUpdateAction action, GroupInfo groupInfo,
        GroupsListPanel groupsListPanel) {
    super(action, groupInfo);
    setWidth(440);

    add(form);

    TitledBorder border = new TitledBorder("border");
    add(border);
    form.add(border);

    // Group name
    RequiredTextField<String> groupNameTf = new RequiredTextField<>("groupName");
    setDefaultFocusField(groupNameTf);
    groupNameTf.add(StringValidator.maximumLength(100));
    groupNameTf.setEnabled(isCreate());// don't allow groupname update
    groupNameTf.add(new NameValidator("Invalid group name '%s'"));
    border.add(groupNameTf);

    // Group description
    TextArea groupDescriptionTextArea = new TextArea("description");
    border.add(groupDescriptionTextArea);

    // If default for newly created users
    border.add(new StyledCheckbox("newUserDefault"));

    // Cancel button
    form.add(new ModalCloseLink("cancel"));

    // Submit button
    TitledAjaxSubmitLink submit = createSubmitButton(groupsListPanel);
    form.add(submit);
    form.add(new DefaultButtonBehavior(submit));
}
 
开发者ID:alancnet,项目名称:artifactory,代码行数:35,代码来源:GroupCreateUpdatePanel.java


示例5: CustomizingPanel

import org.apache.wicket.validation.validator.StringValidator; //导入依赖的package包/类
public CustomizingPanel(String id, IModel model) {
    super(id, model);
    add(new CssClass("general-settings-panel"));

    fileUploadLogo = new LogoFileUploadForm("logoPath", this);
    add(fileUploadLogo);

    TextField<String> urlLogo = new TextField<>("logo");
    urlLogo.add(new UriValidator("http", "https"));
    urlLogo.add(new UrlChangedBehavior());
    urlLogo.setOutputMarkupId(true);
    fileUploadLogo.add(urlLogo);

    TextField<String> footer = new TextField<>("footer");

    fileUploadLogo.add(new ResetLink("reset", fileUploadLogo));
    footer.add(StringValidator.maximumLength(MAX_FOOTER_LENGTH));
    footer.add(new AttributeModifier("maxlength", MAX_FOOTER_LENGTH));
    footer.setOutputMarkupId(true);
    add(footer);

    fileUploadLogo.add(new SchemaHelpBubble(("logo.help")));
    fileUploadLogo.add(new HelpBubble("logoFile.help", "Upload a logo image file."));
    add(new SchemaHelpBubble("footer.help"));

    fileUploadLogo.add(new PreviewLogoPanel("logoPreview"));
}
 
开发者ID:alancnet,项目名称:artifactory,代码行数:28,代码来源:CustomizingPanel.java


示例6: initEmenta

import org.apache.wicket.validation.validator.StringValidator; //导入依赖的package包/类
private void initEmenta() {
	String texto = getModelObject() != null ? getModelObject().getEmenta() : "";
	ementa = new TextArea<String>("ementa",Model.of(texto));
	ementa.setRequired(true);
	ementa.setOutputMarkupId(true);
	ementa.add(StringValidator.maximumLength(3000));
	form.add(ementa);
}
 
开发者ID:camaradosdeputadosoficial,项目名称:edemocracia,代码行数:9,代码来源:PropostaPage.java


示例7: nullIsNotValidated

import org.apache.wicket.validation.validator.StringValidator; //导入依赖的package包/类
@Test
public void nullIsNotValidated() {
    TestPage<String, AjaxTextFieldPanel> testPage =
            new TestPage.Builder<String, AjaxTextFieldPanel>().build(
                    new AjaxTextFieldPanel(TestPage.FIELD, TestPage.FIELD, TEXT_MODEL));
    testPage.getFieldPanel().getField().setRequired(false);
    testPage.getFieldPanel().getField().add(StringValidator.minimumLength(2));
    TESTER.startPage(testPage);
    FormTester formTester = TESTER.newFormTester(testPage.getForm().getId());
    formTester.setValue("field:textField", "");
    formTester.submit();
    assertNull(testPage.getFieldPanel().getDefaultModelObject());
    assertTrue(testPage.getFieldPanel().getField().isValid());
}
 
开发者ID:apache,项目名称:syncope,代码行数:15,代码来源:AjaxTextFieldITCase.java


示例8: init

import org.apache.wicket.validation.validator.StringValidator; //导入依赖的package包/类
private void init(final Integer maxLength)
{
  if (maxLength != null) {
    add(StringValidator.maximumLength(maxLength));
    //add(AttributeModifier.replace("maxlength", String.valueOf(maxLength))); // Done by StringValidator
  }
}
 
开发者ID:micromata,项目名称:projectforge-webapp,代码行数:8,代码来源:PFAutoCompleteMaxLengthTextField.java


示例9: init

import org.apache.wicket.validation.validator.StringValidator; //导入依赖的package包/类
private void init(final String id, final Integer maxLength)
{
  if (maxLength != null) {
    add(StringValidator.maximumLength(maxLength));
    // add(AttributeModifier.replace("maxlength", String.valueOf(maxLength))); // Done by StringValidator
  }
}
 
开发者ID:micromata,项目名称:projectforge-webapp,代码行数:8,代码来源:AjaxMaxLengthEditableLabel.java


示例10: init

import org.apache.wicket.validation.validator.StringValidator; //导入依赖的package包/类
private void init(final String id, final Integer maxLength)
{
  if (maxLength != null) {
    add(StringValidator.maximumLength(maxLength));
    // add(AttributeModifier.replace("maxlength", String.valueOf(maxLength))); // Not supported by html textarea!
    this.maxLength = maxLength;
  }
}
 
开发者ID:micromata,项目名称:projectforge-webapp,代码行数:9,代码来源:MaxLengthTextArea.java


示例11: init

import org.apache.wicket.validation.validator.StringValidator; //导入依赖的package包/类
private void init(final String id, final Integer maxLength)
{
  if (maxLength != null) {
    add(StringValidator.maximumLength(maxLength));
    // add(AttributeModifier.replace("maxlength", String.valueOf(maxLength))); // Field maxlength is produced by StringValidator.
  }
}
 
开发者ID:micromata,项目名称:projectforge-webapp,代码行数:8,代码来源:MaxLengthTextField.java


示例12: AddEditAnalyzerClassPanel

import org.apache.wicket.validation.validator.StringValidator; //导入依赖的package包/类
public AddEditAnalyzerClassPanel(String id, AnalyzerClass analyzerClass, Component refreshComponentP) {
	super(id, true);
	this.analyzerClassModel = new ReloadableEntityModel<AnalyzerClass>(analyzerClass);
	this.refreshComponent = refreshComponentP;
	this.isCreation = analyzerClass.getId() == null;
	
	Form form = getForm();
	form.setModel(new CompoundPropertyModel(analyzerClassModel));
	form.add(new SetFocusBehavior(form));

	TextField classNameField = new RequiredTextField("className");
	classNameField.add(new StringValidator.MaximumLengthValidator(255));
	form.add(classNameField);
}
 
开发者ID:BassJel,项目名称:Jouve-Project,代码行数:15,代码来源:AddEditAnalyzerClassPanel.java


示例13: AddEditFilterClassPanel

import org.apache.wicket.validation.validator.StringValidator; //导入依赖的package包/类
public AddEditFilterClassPanel(String id, FilterClass filterClass, Component refreshComponentP) {
	super(id, true);
	this.filterClassModel = new ReloadableEntityModel<FilterClass>(filterClass);
	this.refreshComponent = refreshComponentP;

	Form form = getForm();
	form.setModel(new CompoundPropertyModel(filterClassModel));

	TextField classNameField = new RequiredTextField("className");
	classNameField.add(new StringValidator.MaximumLengthValidator(255));
	form.add(classNameField);
}
 
开发者ID:BassJel,项目名称:Jouve-Project,代码行数:13,代码来源:AddEditFilterClassPanel.java


示例14: AddEditFieldTypeClassPanel

import org.apache.wicket.validation.validator.StringValidator; //导入依赖的package包/类
public AddEditFieldTypeClassPanel(String id, FieldTypeClass fieldTypeClass, Component refreshComponentP) {
	super(id, true);
	this.fieldTypeClassModel = new ReloadableEntityModel<FieldTypeClass>(fieldTypeClass);
	this.refreshComponent = refreshComponentP;

	Form form = getForm();
	form.setModel(new CompoundPropertyModel(fieldTypeClassModel));
	add(form);
	form.add(new SetFocusBehavior(form));

	TextField classNameField = new RequiredTextField("className");
	classNameField.add(new StringValidator.MaximumLengthValidator(255));
	form.add(classNameField);
}
 
开发者ID:BassJel,项目名称:Jouve-Project,代码行数:15,代码来源:AddEditFieldTypeClassPanel.java


示例15: AddEditTokenizerClassPanel

import org.apache.wicket.validation.validator.StringValidator; //导入依赖的package包/类
public AddEditTokenizerClassPanel(String id, TokenizerClass tokenizerClass, Component refreshComponentP) {
	super(id, true);
	this.tokenizerClassModel = new ReloadableEntityModel<TokenizerClass>(tokenizerClass);
	this.refreshComponent = refreshComponentP;

	Form form = getForm();
	form.setModel(new CompoundPropertyModel(tokenizerClassModel));

	TextField classNameField = new RequiredTextField("className");
	classNameField.add(new StringValidator.MaximumLengthValidator(255));
	form.add(classNameField);
}
 
开发者ID:BassJel,项目名称:Jouve-Project,代码行数:13,代码来源:AddEditTokenizerClassPanel.java


示例16: AddEditCredentialGroupPanel

import org.apache.wicket.validation.validator.StringValidator; //导入依赖的package包/类
public AddEditCredentialGroupPanel(String id, CredentialGroup credentialGroup) {
    super(id, true);
    this.credentialGroupModel = new EntityModel<CredentialGroup>(credentialGroup);
    this.isCreation = credentialGroup.getId() == null;

    Form form = getForm();
    form.setModel(new CompoundPropertyModel(credentialGroupModel));
    form.add(new SetFocusBehavior(form));

    nameField = new RequiredTextField("name");
    nameField.add(new StringValidator.MaximumLengthValidator(255));

    connectorInstancesCheckGroup = new CheckGroup("connectorInstances", new PropertyModel(
        credentialGroupModel, "connectorInstances"));

    IModel connectorInstancesModel = new LoadableDetachableModel() {
        @Override
        protected Object load() {
            AdminCollectionPanel adminCollectionPanel = (AdminCollectionPanel) findParent(AdminCollectionPanel.class);
            RecordCollection collection = adminCollectionPanel.getCollection();
            return new ArrayList<ConnectorInstance>(collection.getConnectorInstances());
        }
    };
    connectorInstancesListView = new ListView("connectorInstancesListView", connectorInstancesModel) {
        @Override
        protected void populateItem(ListItem item) {
            ConnectorInstance connectorInstance = (ConnectorInstance) item.getModelObject();
            Check check = new Check("check", new ReloadableEntityModel<ConnectorInstance>(
                connectorInstance));
            Label label = new Label("label", connectorInstance.getDisplayName());
            item.add(check);
            item.add(label);
        }
    };
    connectorInstancesListView.setReuseItems(true);

    form.add(nameField);
    form.add(connectorInstancesCheckGroup);
    connectorInstancesCheckGroup.add(connectorInstancesListView);
}
 
开发者ID:BassJel,项目名称:Jouve-Project,代码行数:41,代码来源:AddEditCredentialGroupPanel.java


示例17: initComponent

import org.apache.wicket.validation.validator.StringValidator; //导入依赖的package包/类
private void initComponent() {
	add(StringValidator.minimumLength(MINIMUM_INPUT_LENGTH));
}
 
开发者ID:MarcGiffing,项目名称:wicket-spring-boot,代码行数:4,代码来源:UsernameSearchTextField.java


示例18: initNomeAgrupamento

import org.apache.wicket.validation.validator.StringValidator; //导入依赖的package包/类
private void initNomeAgrupamento() {
	nomeAgrupamento = new TextField<String>("nomeAgrupamento",Model.of(""));
	nomeAgrupamento.add(StringValidator.maximumLength(300));
	nomeAgrupamento.setOutputMarkupId(true);
	form.add(nomeAgrupamento);
}
 
开发者ID:camaradosdeputadosoficial,项目名称:edemocracia,代码行数:7,代码来源:AlterarEstruturaPanel.java


示例19: initNovoAgrupamento

import org.apache.wicket.validation.validator.StringValidator; //导入依赖的package包/类
private void initNovoAgrupamento() {
	novoAgrupamento = new TextField<String>("novoAgrupamento", Model.of(""));
	novoAgrupamento.add(StringValidator.maximumLength(300));
	novoAgrupamento.setOutputMarkupId(true);
	form.add(novoAgrupamento);
}
 
开发者ID:camaradosdeputadosoficial,项目名称:edemocracia,代码行数:7,代码来源:NovaEstruturaPanel.java


示例20: AddEditConnectorTypeMetaMappingPanel

import org.apache.wicket.validation.validator.StringValidator; //导入依赖的package包/类
public AddEditConnectorTypeMetaMappingPanel(String id, ConnectorTypeMetaMapping metaMapping) {
        super(id, true);
        this.metaMappingModel = new ReloadableEntityModel<ConnectorTypeMetaMapping>(metaMapping);

        Form form = getForm();
        form.setModel(new CompoundPropertyModel(metaMappingModel));

        TextField metaNameField = new RequiredTextField("metaName");
        metaNameField.add(new StringValidator.MaximumLengthValidator(255));
        form.add(metaNameField);

        TextField indexFieldNameField = new RequiredTextField("indexFieldName");
        indexFieldNameField.add(new StringValidator.MaximumLengthValidator(255));
        form.add(indexFieldNameField);

        final CheckBox indexedCheckbox = new CheckBox("indexed");
        form.add(indexedCheckbox);

//        final CheckBox storedCheckbox = new CheckBox("stored");
//        form.add(storedCheckbox);

        final CheckBox multiValuedCheckbox = new CheckBox("multiValued");
        form.add(multiValuedCheckbox);

        final ModalWindow fieldTypeModal = new ModalWindow("fieldTypeModal");
        form.add(fieldTypeModal);
        fieldTypeModal.setCssClassName(ModalWindow.CSS_CLASS_GRAY);

        IModel fieldTypesModel = new LoadableDetachableModel() {
            @Override
            protected Object load() {
                FieldTypeServices fieldTypeServices = ConstellioSpringUtils.getFieldTypeServices();
                return fieldTypeServices.list();
            }
        };

        IChoiceRenderer fieldTypeRenderer = new ChoiceRenderer("name");

        final DropDownChoice fieldTypeField = new DropDownChoice("fieldType", fieldTypesModel,
            fieldTypeRenderer);
        form.add(fieldTypeField);
        fieldTypeField.setOutputMarkupId(true);

        AjaxLink addFieldTypeLink = new AjaxLink("addFieldTypeLink") {
            @Override
            public void onClick(AjaxRequestTarget target) {
                AddEditFieldTypePanel addEditFieldTypePanel = new AddEditFieldTypePanel(fieldTypeModal
                    .getContentId(), new FieldType(), fieldTypeField);
                fieldTypeModal.setContent(addEditFieldTypePanel);
                fieldTypeModal.show(target);
            }
        };
        form.add(addFieldTypeLink);
    }
 
开发者ID:BassJel,项目名称:Jouve-Project,代码行数:55,代码来源:AddEditConnectorTypeMetaMappingPanel.java



注:本文中的org.apache.wicket.validation.validator.StringValidator类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java GLXVolatileSurfaceManager类代码示例发布时间:2022-05-21
下一篇:
Java ModelMBeanInfoSupport类代码示例发布时间:2022-05-21
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap