panel.getFormComponent().add(RangeValidator.minimum(minimum.doubleValue()));
@SuppressWarnings({"unchecked", "rawtypes"}) public NSGTimeoutPanel(final String id, final IModel<ServiceInfo> model) { super(id, model); PropertyModel<MetadataMap> metadata = new PropertyModel<>(model, "metadata"); MapModel timeoutModel = new MapModel(metadata, TimeoutCallback.TIMEOUT_CONFIG_KEY); if (timeoutModel.getObject() == null) { timeoutModel.setObject(TimeoutCallback.TIMEOUT_CONFIG_DEFAULT); } TextField<Integer> timeoutField = new TextField<>("timeoutSeconds", timeoutModel, Integer.class); timeoutField.setRequired(true); timeoutField.add(RangeValidator.minimum(0)); add(timeoutField); } }
protected void build(IModel info, Form form) { // overview policy form.add( new DropDownChoice( "overviewPolicy", Arrays.asList(OverviewPolicy.values()), new OverviewPolicyRenderer())); form.add(new CheckBox("subsamplingEnabled")); // limited srs list TextArea srsList = new SRSListTextArea( "srs", LiveCollectionModel.list(new PropertyModel(info, "sRS"))); form.add(srsList); // resource limits TextField maxInputMemory = new TextField("maxInputMemory"); maxInputMemory.add(RangeValidator.minimum(0l)); form.add(maxInputMemory); TextField maxOutputMemory = new TextField("maxOutputMemory"); maxOutputMemory.add(RangeValidator.minimum(0l)); form.add(maxOutputMemory); // max dimension values TextField<Integer> maxRequestedDimensionValues = new TextField<Integer>("maxRequestedDimensionValues"); maxRequestedDimensionValues.add(RangeValidator.minimum(0)); form.add(maxRequestedDimensionValues); // lat-lon VS lon-lat form.add(new CheckBox("latLon")); }
lines.add(RangeValidator.minimum(1)); form.add(lines);
form.add(new CheckBox("verboseExceptions")); form.add(new CheckBox("globalServices")); form.add(new TextField<Integer>("numDecimals").add(RangeValidator.minimum(0))); form.add(new Select2DropDownChoice<>("charset", AVAILABLE_CHARSETS)); form.add( "xmlPostRequestLogBufferSize", new PropertyModel<String>(globalInfoModel, "xmlPostRequestLogBufferSize")); xmlPostRequestLogBufferSize.add(RangeValidator.minimum(0)); form.add(xmlPostRequestLogBufferSize); form.add(new TextField<Integer>("featureTypeCacheSize").add(RangeValidator.minimum(0)));
form.add(memoryThreshold); TextField<Integer> tileThreads = new TextField<Integer>("tileThreads"); tileThreads.add(RangeValidator.minimum(0)); form.add(tileThreads); TextField<Integer> tilePriority = new TextField<Integer>("tilePriority"); tilePriority.add(RangeValidator.minimum(0)); form.add(tilePriority); form.add(new CheckBox("recycling"));
public KMLLayerConfigPanel(String id, IModel<LayerInfo> model) { super(id, model); PropertyModel<MetadataMap> metadata = new PropertyModel<MetadataMap>(model, "resource.metadata"); add( new DropDownChoice<String>( "kml.regionateAttribute", new MapModel(metadata, "kml.regionateAttribute"), new AttributeNamesModel(new PropertyModel(model, "resource")))); add( new DropDownChoice<String>( "kml.regionateStrategy", new MapModel(metadata, "kml.regionateStrategy"), KML_STRATEGIES)); TextField<Integer> maxFeatures = new TextField<Integer>( "kml.regionateFeatureLimit", new MapModel(metadata, "kml.regionateFeatureLimit"), Integer.class); maxFeatures.add(RangeValidator.minimum(1)); add(maxFeatures); }
new PropertyModel<Integer>(model, "attribution.logoHeight"), Integer.class); height.add(RangeValidator.minimum(0)); height.setOutputMarkupId(true); add(height); new PropertyModel<Integer>(model, "attribution.logoWidth"), Integer.class); width.add(RangeValidator.minimum(0)); width.setOutputMarkupId(true); add(width);
new PropertyModel<Integer>( this, "config.bruteForcePrevention.minDelaySeconds")); bfMinDelay.add(RangeValidator.minimum(0)); form.add(bfMinDelay); final TextField<Integer> bfMaxDelay = new PropertyModel<Integer>( this, "config.bruteForcePrevention.maxDelaySeconds")); bfMaxDelay.add(RangeValidator.minimum(0)); form.add(bfMaxDelay); new PropertyModel<Integer>( this, "config.bruteForcePrevention.maxBlockedThreads")); bfMaxBlockedThreads.add(RangeValidator.minimum(0)); form.add(bfMaxBlockedThreads);
maxMemory.add(RangeValidator.minimum(0)); form.add(maxMemory); TextField<Integer> maxTime = new TextField<Integer>("maxRenderingTime"); maxTime.add(RangeValidator.minimum(0)); form.add(maxTime); TextField<Integer> maxErrors = new TextField<Integer>("maxRenderingErrors"); maxErrors.add(RangeValidator.minimum(0)); form.add(maxErrors); maxBuffer.add(RangeValidator.minimum(0)); form.add(maxBuffer); maxRequestedDimensionValues.add(RangeValidator.minimum(0)); form.add(maxRequestedDimensionValues);
otherSettingsPanel.add(new CheckBox("localWorkspaceIncludesPrefix")); otherSettingsPanel.add( new TextField<Integer>("numDecimals").add(RangeValidator.minimum(0))); otherSettingsPanel.add( new DropDownChoice<String>("charset", GlobalSettingsPage.AVAILABLE_CHARSETS));
new MapModel(new PropertyModel(layerModel, "metadata"), LayerInfo.BUFFER), Integer.class); renderingBuffer.add(RangeValidator.minimum(0)); styleContainer.add(renderingBuffer);
.setType(Integer.TYPE) .add( (IValidator) RangeValidator.minimum(1025), (IValidator) RangeValidator.maximum(65535)); add(portPanel);