本文整理汇总了Java中org.apache.wicket.validation.validator.RangeValidator类的典型用法代码示例。如果您正苦于以下问题:Java RangeValidator类的具体用法?Java RangeValidator怎么用?Java RangeValidator使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
RangeValidator类属于org.apache.wicket.validation.validator包,在下文中一共展示了RangeValidator类的16个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: GeneralSettingsPanel
import org.apache.wicket.validation.validator.RangeValidator; //导入依赖的package包/类
public GeneralSettingsPanel(String id) {
super(id);
add(new CssClass("general-settings-panel"));
add(new TextField("serverName"));
WebApplicationAddon applicationAddon = addonsManager.addonByType(WebApplicationAddon.class);
add(applicationAddon.getUrlBaseLabel("urlBaseLabel"));
add(applicationAddon.getUrlBaseTextField("urlBase"));
RequiredTextField<Integer> uploadSizeField = new RequiredTextField<>("fileUploadMaxSizeMb");
uploadSizeField.add(new RangeValidator<>(0, Integer.MAX_VALUE));
add(uploadSizeField);
RequiredTextField<String> dateFormatField = new RequiredTextField<>("dateFormat");
dateFormatField.add(new DateFormatValidator());
add(dateFormatField);
add(new StyledCheckbox("offlineMode"));
add(new SchemaHelpBubble("serverName.help"));
add(applicationAddon.getUrlBaseHelpBubble("urlBase.help"));
add(new SchemaHelpBubble("fileUploadMaxSizeMb.help"));
add(new SchemaHelpBubble("dateFormat.help"));
add(new SchemaHelpBubble("offlineMode.help"));
}
开发者ID:alancnet,项目名称:artifactory,代码行数:24,代码来源:GeneralSettingsPanel.java
示例2: HourlyJobPanel
import org.apache.wicket.validation.validator.RangeValidator; //导入依赖的package包/类
public HourlyJobPanel(String id, SchedulerJob schedulerJob) {
super(id);
this.schedulerJob = schedulerJob;
hourLabel = new Label("hourLabel", getString("JobPanel.everyHour"));
add(hourLabel);
hourText = new TextField<Integer>("hourText", new PropertyModel<Integer>(schedulerJob, "time.gap"));
hourText.setLabel(new Model<String>(getString("JobPanel.everyHour")));
hourText.add(new RangeValidator<Integer>(1, 23));
add(hourText);
add(minuteLabel = new Label("minuteLabel", getString("JobPanel.minute")));
add(minuteChoice = new DropDownChoice<Integer>("minuteChoice", new PropertyModel<Integer>(schedulerJob, "time.minute"), getMinutes()));
add(hLabel = new Label("hLabel", getString("hours")));
add(hoursPanel = new IntervalFieldPanel("hoursPanel", new PropertyModel(schedulerJob, "time.hours"), SelectIntervalPanel.HOUR_ENTITY,TimeValues.INTERVAL_TYPE));
add(dLabel = new Label("dLabel", getString("days")));
add(daysPanel = new IntervalFieldPanel("daysPanel", new PropertyModel(schedulerJob, "time.days"), SelectIntervalPanel.DAY_ENTITY, null));
add(mLabel = new Label("mLabel", getString("months")));
add(monthsPanel = new IntervalFieldPanel("monthsPanel", new PropertyModel(schedulerJob, "time.months"), SelectIntervalPanel.MONTH_ENTITY, null));
setAdvancedType(false);
}
开发者ID:nextreports,项目名称:nextreports-server,代码行数:24,代码来源:HourlyJobPanel.java
示例3: MinutelyJobPanel
import org.apache.wicket.validation.validator.RangeValidator; //导入依赖的package包/类
public MinutelyJobPanel(String id, SchedulerJob schedulerJob) {
super(id);
this.schedulerJob = schedulerJob;
add(minuteLabel = new Label("minuteLabel", getString("JobPanel.everyMinute")));
add(hoursLabel = new Label("hoursLabel", getString("hours")));
add(daysLabel = new Label("daysLabel", getString("days")));
add(monthsLabel = new Label("monthsLabel", getString("months")));
minuteText = new TextField<Integer>("minuteText", new PropertyModel<Integer>(schedulerJob, "time.gap"));
minuteText.setLabel(new Model<String>(getString("JobPanel.everyMinute")));
minuteText.add(new RangeValidator<Integer>(1, 59));
add(minuteText);
add(hoursPanel = new IntervalFieldPanel("hoursPanel", new PropertyModel(schedulerJob, "time.hours"), SelectIntervalPanel.HOUR_ENTITY, null));
add(daysPanel = new IntervalFieldPanel("daysPanel", new PropertyModel(schedulerJob, "time.days"), SelectIntervalPanel.DAY_ENTITY, null));
add(monthsPanel = new IntervalFieldPanel("monthsPanel", new PropertyModel(schedulerJob, "time.months"), SelectIntervalPanel.MONTH_ENTITY, null));
setAdvancedType(false);
}
开发者ID:nextreports,项目名称:nextreports-server,代码行数:22,代码来源:MinutelyJobPanel.java
示例4: addComponents
import org.apache.wicket.validation.validator.RangeValidator; //导入依赖的package包/类
@SuppressWarnings("unchecked")
private void addComponents() {
add(new Label("useLabel", getString("ActionContributor.Cache.use")));
CheckBox checkBox = new CheckBox("useCheck", new PropertyModel(this, "useCache"));
add(checkBox);
checkBox.add(new AjaxFormComponentUpdatingBehavior("onclick") {
protected void onUpdate(AjaxRequestTarget target) {
container.setEnabled(useCache);
target.add(container);
}
});
container = new WebMarkupContainer("container");
container.setEnabled(useCache);
container.setOutputMarkupId(true);
container.add(new Label("time", getString("ActionContributor.Cache.expiration")));
TextField<Integer> timeField = new TextField<Integer>("timeField", new PropertyModel<Integer>(this, "expirationTime"));
timeField.setLabel(new Model<String>(getString("ActionContributor.Cache.expiration")));
timeField.setRequired(true);
timeField.add(RangeValidator.minimum(1));
container.add(timeField);
add(container);
}
开发者ID:nextreports,项目名称:nextreports-server,代码行数:27,代码来源:CacheSettingsPanel.java
示例5: onInitialize
import org.apache.wicket.validation.validator.RangeValidator; //导入依赖的package包/类
@Override
protected void onInitialize() {
super.onInitialize();
Label label = new Label("label", this.name);
this.add(label);
TextField<Double> field = new TextField<>("field", new PropertyModel<>(this.fields, this.name));
field.add(RangeValidator.range(Double.MIN_VALUE, Double.MAX_VALUE));
field.setType(Double.class);
field.setLabel(Model.of(name));
TextFeedbackPanel feedback = new TextFeedbackPanel("feedback", field);
this.add(field);
this.add(feedback);
}
开发者ID:PkayJava,项目名称:MBaaS,代码行数:14,代码来源:DoublePanel.java
示例6: onInitialize
import org.apache.wicket.validation.validator.RangeValidator; //导入依赖的package包/类
@Override
protected void onInitialize() {
super.onInitialize();
Label label = new Label("label", this.name);
this.add(label);
TextField<Long> field = new TextField<>("field", new PropertyModel<>(this.fields, this.name));
field.setLabel(Model.of(name));
field.setType(Long.class);
field.add(RangeValidator.range(Long.MIN_VALUE, Long.MAX_VALUE));
TextFeedbackPanel feedback = new TextFeedbackPanel("feedback", field);
this.add(field);
this.add(feedback);
}
开发者ID:PkayJava,项目名称:MBaaS,代码行数:14,代码来源:LongPanel.java
示例7: addEventCountField
import org.apache.wicket.validation.validator.RangeValidator; //导入依赖的package包/类
/**
* Add field to specify the number of events to generate.
*/
private void addEventCountField() {
eventCountField = new TextField<>("eventCountField", new PropertyModel<Integer>(this, "eventCount"));
eventCountField.setRequired(true);
eventCountField.add(new RangeValidator<>(1, MAXIMUM_EVENTCOUNT));
eventCountField.add(new AjaxFormComponentUpdatingBehavior(AJAX_BEHAVIOR) {
@Override
public void onUpdate(AjaxRequestTarget target) {
target.add(eventCountField);
}
});
eventCountField.setOutputMarkupId(true);
layoutForm.add(eventCountField);
}
开发者ID:bptlab,项目名称:Unicorn,代码行数:17,代码来源:GeneratePanel.java
示例8: BintrayConfigPage
import org.apache.wicket.validation.validator.RangeValidator; //导入依赖的package包/类
public BintrayConfigPage() {
setOutputMarkupId(true);
form = new SecureForm("form");
saveLink = createSaveButton(form);
saveLink.setEnabled(true);
saveLink.setVisible(true);
add(saveLink);
form.add(new DefaultButtonBehavior(saveLink));
cancelLink = new CancelLink("cancel", form) {
@Override
public void onClick(AjaxRequestTarget target) {
setResponsePage(BintrayConfigPage.class);
}
};
add(cancelLink);
bintrayPanel = new GlobalBintrayConfigPanel<>("globalBintrayPanel", getBintrayDescriptor());
form.add(bintrayPanel);
form.add(new SchemaHelpBubble("fileUploadLimit.help",
new SchemaHelpModel(getBintrayDescriptor(), "fileUploadLimit")));
fileUploadLimit = new RequiredTextField<Integer>("fileUploadLimit");
fileUploadLimit.setOutputMarkupId(true);
fileUploadLimit.setDefaultModel(
new PropertyModel<Integer>(bintrayPanel.getDefaultModelObject(), "fileUploadLimit"));
fileUploadLimit.add(new RangeValidator<>(0, Integer.MAX_VALUE));
fileUploadLimit.setEnabled(true);
form.add(fileUploadLimit);
add(form);
}
开发者ID:alancnet,项目名称:artifactory,代码行数:36,代码来源:BintrayConfigPage.java
示例9: addDiskQuotaManagement
import org.apache.wicket.validation.validator.RangeValidator; //导入依赖的package包/类
private void addDiskQuotaManagement(Form form) {
final Border quotaBorder = new TitledBorder("quotaBorder", new CompoundPropertyModel(quotaConfigDescriptor));
form.add(quotaBorder);
final StyledCheckbox enableCheckbox = new StyledCheckbox("enabled");
enableCheckbox.setOutputMarkupId(true);
quotaBorder.add(enableCheckbox.setTitle("Enable Quota Control"));
quotaBorder.add(new SchemaHelpBubble("enabled.help"));
boolean quotaEnabled = quotaConfigDescriptor.isEnabled();
final TextField<Integer> diskSpaceLimitPercentage = new TextField<>("diskSpaceLimitPercentage",
Integer.class);
diskSpaceLimitPercentage.add(new RangeValidator<>(0, 99));
diskSpaceLimitPercentage.setEnabled(quotaEnabled).setOutputMarkupId(true);
quotaBorder.add(diskSpaceLimitPercentage);
quotaBorder.add(new SchemaHelpBubble("diskSpaceLimitPercentage.help"));
final TextField<Integer> diskSpaceWarningPercentage = new TextField<>("diskSpaceWarningPercentage",
Integer.class);
diskSpaceWarningPercentage.add(new RangeValidator<>(0, 99));
diskSpaceWarningPercentage.setEnabled(quotaEnabled).setOutputMarkupId(true);
quotaBorder.add(diskSpaceWarningPercentage);
quotaBorder.add(new SchemaHelpBubble("diskSpaceWarningPercentage.help"));
enableCheckbox.add(new AjaxFormComponentUpdatingBehavior("onclick") {
@Override
protected void onUpdate(AjaxRequestTarget ajaxRequestTarget) {
boolean enabled = enableCheckbox.isChecked();
diskSpaceLimitPercentage.setEnabled(enabled);
diskSpaceWarningPercentage.setEnabled(enabled);
ajaxRequestTarget.add(diskSpaceLimitPercentage, diskSpaceWarningPercentage);
}
});
}
开发者ID:alancnet,项目名称:artifactory,代码行数:35,代码来源:MaintenancePage.java
示例10: MinMaxNumberField
import org.apache.wicket.validation.validator.RangeValidator; //导入依赖的package包/类
/**
* @param id
* @param model
* @see org.apache.wicket.Component#Component(String, IModel)
*/
public MinMaxNumberField(final String id, final IModel<Z> model, final Z minimum, final Z maximum)
{
super(id, model);
if (minimum.compareTo(maximum) <= 0) {
add(new RangeValidator<Z>(minimum, maximum));
} else {
add(new RangeValidator<Z>(maximum, minimum));
}
if (ClassUtils.isAssignable(minimum.getClass(), Integer.class) == true) {
setMaxLength(Math.max(String.valueOf(minimum).length(), String.valueOf(maximum).length()));
}
}
开发者ID:micromata,项目名称:projectforge-webapp,代码行数:19,代码来源:MinMaxNumberField.java
示例11: addWicketComponents
import org.apache.wicket.validation.validator.RangeValidator; //导入依赖的package包/类
@SuppressWarnings("unchecked")
public void addWicketComponents() {
super.addWicketComponents();
TextField<Integer> rowsPerPageText = new TextField<Integer>("rowsPerPage", new PropertyModel(runtimeModel, "rowsPerPage"));
rowsPerPageText.setRequired(true);
rowsPerPageText.add(new RangeValidator<Integer>(5, 100));
add(rowsPerPageText);
final CheckBox filterChkBox = new CheckBox("enableFilter", new PropertyModel(runtimeModel, "enableFilter"));
add(filterChkBox);
}
开发者ID:nextreports,项目名称:nextreports-server,代码行数:14,代码来源:TableWidgetRuntimePanel.java
示例12: addWicketComponents
import org.apache.wicket.validation.validator.RangeValidator; //导入依赖的package包/类
@SuppressWarnings("unchecked")
public void addWicketComponents() {
TextField<Integer> refreshText = new TextField<Integer>("refreshTime", new PropertyModel(runtimeModel, "refreshTime"));
refreshText.setRequired(true);
refreshText.add(new ZeroRangeValidator(10, 3600));
add(refreshText);
TextField<Integer> timeoutText = new TextField<Integer>("timeout", new PropertyModel(runtimeModel, "timeout"));
timeoutText.add(new RangeValidator<Integer>(5, 600));
timeoutText.setLabel(new Model<String>("Timeout"));
timeoutText.setRequired(true);
add(timeoutText);
}
开发者ID:nextreports,项目名称:nextreports-server,代码行数:14,代码来源:GeneralWidgetRuntimePanel.java
示例13: PaginatePanel
import org.apache.wicket.validation.validator.RangeValidator; //导入依赖的package包/类
public PaginatePanel(IModel<Analysis> model) {
super(FormPanel.CONTENT_ID);
add(new Label("info", new StringResourceModel("PaginatePanel.info", null, null)));
add(new Label("rows", new StringResourceModel("PaginatePanel.rows", this, null)));
TextField<Integer> rowsText = new TextField<Integer>("rowsText", new PropertyModel<Integer>(model.getObject(), "rowsPerPage"));
rowsText.add(RangeValidator.range(1, 500));
rowsText.setLabel(new StringResourceModel("PaginatePanel.rows", this, null));
add(rowsText);
}
开发者ID:nextreports,项目名称:nextreports-server,代码行数:12,代码来源:PaginatePanel.java
示例14: ConsoleMaintenanceFilePage
import org.apache.wicket.validation.validator.RangeValidator; //导入依赖的package包/类
public ConsoleMaintenanceFilePage(PageParameters parameters) {
super(parameters);
addHeadPageTitleKey("console.maintenance.file");
Form<Void> form = new Form<Void>("form") {
private static final long serialVersionUID = 1L;
@Override
protected void onSubmit() {
try {
HashTableFileStorePathGeneratorImpl pathGenerator = new HashTableFileStorePathGeneratorImpl(hashTableByteSizeModel.getObject());
pathModel.setObject(pathGenerator.getFilePath(fileKeyModel.getObject(), extensionModel.getObject()));
pathModel.detach();
} catch (Exception e) {
LOGGER.error("Unexpected error while generating file path through hashtable.");
pathModel.setObject(null);
Session.get().error(getString("common.error"));
}
}
@Override
protected void onError() {
pathModel.setObject(null);
}
};
add(form);
form.add(
new TextField<Integer>("hashTableByteSize", hashTableByteSizeModel, Integer.class)
.setRequired(true)
.setLabel(new ResourceModel("console.maintenance.file.hashTableByteSize"))
.add(
new RangeValidator<Integer>(
HashTableFileStorePathGeneratorImpl.MIN_HASH_TABLE_BYTE_SIZE,
HashTableFileStorePathGeneratorImpl.MAX_HASH_TABLE_BYTE_SIZE)
),
new TextField<String>("fileKey", fileKeyModel)
.setRequired(true)
.setLabel(new ResourceModel("console.maintenance.file.fileKey")),
new TextField<String>("extension", extensionModel)
.setLabel(new ResourceModel("console.maintenance.file.extension")),
new CoreLabel("path", pathModel).hideIfEmpty()
);
}
开发者ID:openwide-java,项目名称:owsi-core-parent,代码行数:47,代码来源:ConsoleMaintenanceFilePage.java
示例15: MaxUniqueSnapshotsTextField
import org.apache.wicket.validation.validator.RangeValidator; //导入依赖的package包/类
public MaxUniqueSnapshotsTextField(String id) {
super(id, Integer.class);
add(new RangeValidator<>(0, Integer.MAX_VALUE));
setRequired(true);
setOutputMarkupId(true);
}
开发者ID:alancnet,项目名称:artifactory,代码行数:7,代码来源:LocalRepoBasicPanel.java
示例16: addWicketComponents
import org.apache.wicket.validation.validator.RangeValidator; //导入依赖的package包/类
@SuppressWarnings("unchecked")
public void addWicketComponents() {
ChoiceRenderer<String> typeRenderer = new ChoiceRenderer<String>() {
@Override
public Object getDisplayValue(String chartType) {
if (chartType == null) {
return ChartUtil.CHART_NONE;
} else if (chartType.equals(ChartUtil.CHART_BAR)) {
return getString("chart.bar");
} else if (chartType.equals(ChartUtil.CHART_NEGATIVE_BAR)) {
return getString("chart.negativebar");
} else if (chartType.equals(ChartUtil.CHART_BAR_COMBO)) {
return getString("chart.barcombo");
} else if (chartType.equals(ChartUtil.CHART_HORIZONTAL_BAR)) {
return getString("chart.horizontalbar");
} else if (chartType.equals(ChartUtil.CHART_STACKED_BAR)) {
return getString("chart.stackedbar");
} else if (chartType.equals(ChartUtil.CHART_STACKED_BAR_COMBO)) {
return getString("chart.stackedbarcombo");
} else if (chartType.equals(ChartUtil.CHART_HORIZONTAL_STACKED_BAR)) {
return getString("chart.horizontalstackedbar");
} else if (chartType.equals(ChartUtil.CHART_PIE)) {
return getString("chart.pie");
} else if (chartType.equals(ChartUtil.CHART_LINE)) {
return getString("chart.line");
} else if (chartType.equals(ChartUtil.CHART_AREA)) {
return getString("chart.area");
} else if (chartType.equals(ChartUtil.CHART_BUBBLE)) {
return getString("chart.bubble");
} else {
return ChartUtil.CHART_NONE;
}
}
};
DropDownChoice exportChoice = new DropDownChoice("chartType", new PropertyModel(runtimeModel, "chartType"), ChartUtil.CHART_TYPES, typeRenderer);
exportChoice.setRequired(true);
add(exportChoice);
TextField<Integer> refreshText = new TextField<Integer>("refreshTime", new PropertyModel(runtimeModel, "refreshTime"));
refreshText.add(new ZeroRangeValidator(10, 3600));
refreshText.setRequired(true);
add(refreshText);
TextField<Integer> timeoutText = new TextField<Integer>("timeout", new PropertyModel(runtimeModel, "timeout"));
timeoutText.add(new RangeValidator<Integer>(5, 600));
timeoutText.setLabel(new Model<String>("Timeout"));
timeoutText.setRequired(true);
add(timeoutText);
}
开发者ID:nextreports,项目名称:nextreports-server,代码行数:54,代码来源:ChartRuntimePanel.java
注:本文中的org.apache.wicket.validation.validator.RangeValidator类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论