本文整理汇总了Java中com.smartgwt.client.widgets.form.validator.IsIntegerValidator类的典型用法代码示例。如果您正苦于以下问题:Java IsIntegerValidator类的具体用法?Java IsIntegerValidator怎么用?Java IsIntegerValidator使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
IsIntegerValidator类属于com.smartgwt.client.widgets.form.validator包,在下文中一共展示了IsIntegerValidator类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: updatePageNumberValidators
import com.smartgwt.client.widgets.form.validator.IsIntegerValidator; //导入依赖的package包/类
private void updatePageNumberValidators(String seriesType) {
numberExample.setPrompt(seriesType);
if (ARABIC_SERIES.equals(seriesType)) {
numberStart.setValidators(new IsIntegerValidator(), integerStartValidator, numberStartRequired);
integerIncrementValidator.setMin(-1000);
integerIncrementValidator.setMax(1000);
} else if (ROMAN_LOWER_SERIES.equals(seriesType) || ROMAN_UPPER_SERIES.equals(seriesType)) {
numberStart.setValidators(romanStartValidator, numberStartRequired);
integerIncrementValidator.setMin(-1000);
integerIncrementValidator.setMax(1000);
} else {
numberStart.setValidators(alphabetStartValidator, numberStartRequired);
integerIncrementValidator.setMin(-26);
integerIncrementValidator.setMax(26);
}
}
示例2: MonographUnitForm
import com.smartgwt.client.widgets.form.validator.IsIntegerValidator; //导入依赖的package包/类
public MonographUnitForm(final ClientMessages i18n) {
setWidth100();
setHeight100();
setTitleOrientation(TitleOrientation.TOP);
setNumCols(1);
// identifiers
final RepeatableFormItem identifiers = new RepeatableFormItem(ModsCustomDataSource.FIELD_IDENTIFIERS,
i18n.MonographUnitForm_Identifiers_Title());
identifiers.setDataSource(IdentifierDataSource.getInstance());
identifiers.setValidators(
new IdentifiersValidator(i18n, Arrays.asList(IdentifierDataSource.TYPE_UUID)));
DynamicForm identifierForm = new DynamicForm();
identifierForm.setUseAllDataSourceFields(true);
identifierForm.setNumCols(4);
identifiers.setFormPrototype(identifierForm);
identifiers.setEndRow(true);
identifiers.setColSpan("2");
TextItem unitNumber = new TextItem(ModsCustomDataSource.FIELD_MONOGRAPHUNIT_NUMBER);
unitNumber.setTitle(i18n.MonographUnitForm_UnitNumber_Title());
unitNumber.setRequired(true);
unitNumber.setValidators(new IsIntegerValidator());
TextAreaItem note = new TextAreaItem(ModsCustomDataSource.FIELD_NOTE, i18n.MonographUnitForm_Note_Title());
note.setWidth("*");
note.setHeight("*");
note.setColSpan("*");
setFields(unitNumber, identifiers, note);
}
示例3: createApplyToUi
import com.smartgwt.client.widgets.form.validator.IsIntegerValidator; //导入依赖的package包/类
private void createApplyToUi() {
formApply = createForm();
applyTo = new ComboBoxItem("applyTo", i18n.PageMetadataEditor_ApplyTo_Title());
applyTo.setPrompt(i18n.PageMetadataEditor_ApplyTo_Hint());
applyTo.setRequired(true);
LinkedHashMap<String, String> vals = new LinkedHashMap<String, String>();
vals.put("1", i18n.PageMetadataEditor_ApplyToEachItem_Title());
for (int i = 2; i <= 20; i++) {
String nth = String.valueOf(i);
vals.put(nth, i18n.PageMetadataEditor_ApplyToEachNthItem_Title(nth));
}
applyTo.setValueMap(vals);
applyTo.setDefaultValue(1);
applyTo.setValue(1);
applyToValidator = new IntegerRangeValidator();
applyToValidator.setMin(1);
applyToValidator.setMax(applyToMaxValue);
applyTo.setValidators(new IsIntegerValidator(), applyToValidator);
applyFromFirst = new CheckboxItem("applyFromFirst", i18n.PageMetadataEditor_ApplyFromFirst_Title());
applyFromFirst.setPrompt(i18n.PageMetadataEditor_ApplyFromFirst_Hint());
formApply.setItems(applyTo, applyFromFirst);
applyTo.addChangedHandler(new ChangedHandler() {
@Override
public void onChanged(ChangedEvent event) {
applyFromFirst.setDisabled("1".equals(applyTo.getValueAsString()));
}
});
}
示例4: PageForm
import com.smartgwt.client.widgets.form.validator.IsIntegerValidator; //导入依赖的package包/类
/**
* Create a new form.
* @param i18n I18N
* @param typeValueMapId {@link ValueMapDataSource#getOptionDataSource}
* reference to bundle with page types.
*/
public PageForm(ClientMessages i18n, String typeValueMapId) {
// save on Enter is supposed mainly for ImportBatchItemEditor
// see submit handler in ModsMultiEditor
setSaveOnEnter(true);
setWidth100();
setHeight100();
setTitleOrientation(TitleOrientation.TOP);
SelectItem pageType = new SelectItem(ModsCustomDataSource.FIELD_PAGE_TYPE, i18n.PageForm_PageType_Title());
pageType.setOptionDataSource(ValueMapDataSource.getInstance().getOptionDataSource(typeValueMapId));
pageType.setValueField(BundleValue.KEY);
pageType.setDisplayField(BundleValue.VALUE);
pageType.setDefaultValue(ModsCustomDataSource.getDefaultPageType());
pageType.setWidth(200);
pageType.setEndRow(true);
IntegerItem pageIndex = new IntegerItem(ModsCustomDataSource.FIELD_PAGE_INDEX);
pageIndex.setTitle(i18n.PageForm_PageIndex_Title());
pageIndex.setValidators(new IsIntegerValidator());
pageIndex.setRequired(true);
pageIndex.setEndRow(true);
TextItem pageNumber = new TextItem(ModsCustomDataSource.FIELD_PAGE_NUMBER);
pageNumber.setTitle(i18n.PageForm_PageNumber_Title());
pageNumber.setEndRow(true);
pageNumber.setRequired(true);
pageNumber.setValidators(new StringTrimValidator());
// pageNumber.setLength(5);
final RepeatableFormItem identifiers = new RepeatableFormItem(ModsCustomDataSource.FIELD_IDENTIFIERS,
i18n.PageForm_Identifiers_Title());
identifiers.setDataSource(IdentifierDataSource.getInstance());
identifiers.setRequired(true);
identifiers.setValidators(
new IdentifiersValidator(i18n, Arrays.asList(IdentifierDataSource.TYPE_UUID)));
DynamicForm identifierForm = new DynamicForm();
identifierForm.setUseAllDataSourceFields(true);
identifierForm.setNumCols(4);
identifiers.setFormPrototype(identifierForm);
identifiers.setEndRow(true);
identifiers.setColSpan("3");
// TextAreaItem note = new AutoFitTextAreaItem(ModsCustomDataSource.FIELD_NOTE, "Note");
TextAreaItem note = new TextAreaItem(ModsCustomDataSource.FIELD_NOTE, i18n.PageForm_Note_Title());
note.setWidth("*");
note.setHeight("*");
note.setColSpan("*");
setFields(pageType, pageIndex, pageNumber, identifiers, note);
IntegerRangeValidator integerRangeValidator = new IntegerRangeValidator();
integerRangeValidator.setMin(0);
integerRangeValidator.setMax(Integer.MAX_VALUE);
pageIndex.setValidators(integerRangeValidator);
}