/** * @param minimum * @param maximum * @return a {@link RangeValidator} that validates if a value falls within a range */ public static <T extends Comparable<? super T> & Serializable> RangeValidator<T> range(T minimum, T maximum) { return new RangeValidator<>(minimum, maximum); }
/** * @param minimum * @param maximum * @return a {@link RangeValidator} that validates if a value falls within a range */ public static <T extends Comparable<? super T> & Serializable> RangeValidator<T> range(T minimum, T maximum) { return new RangeValidator<>(minimum, maximum); }
/** * @param maximum * @return a {@link RangeValidator} that validates if a value is a most {@code maximum} */ public static <T extends Comparable<? super T> & Serializable> RangeValidator<T> maximum(T maximum) { return new RangeValidator<>(null, maximum); }
/** * @param minimum * @return a {@link RangeValidator} that validates if a value is a least {@code minimum} */ public static <T extends Comparable<? super T> & Serializable> RangeValidator<T> minimum(T minimum) { return new RangeValidator<>(minimum, null); }
/** * @param maximum * @return a {@link RangeValidator} that validates if a value is a most {@code maximum} */ public static <T extends Comparable<? super T> & Serializable> RangeValidator<T> maximum(T maximum) { return new RangeValidator<>(null, maximum); }
/** * @param minimum * @return a {@link RangeValidator} that validates if a value is a least {@code minimum} */ public static <T extends Comparable<? super T> & Serializable> RangeValidator<T> minimum(T minimum) { return new RangeValidator<>(minimum, null); }
/** * @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())); } }
minutesField.add(new RangeValidator<>(0, 59)); return minutesField;
minutesField.add(new RangeValidator<>(0, 59)); minutesField.setLabel(new Model<>(MINUTES)); return minutesField;
minutesField.add(new RangeValidator<>(0, 59)); minutesField.setLabel(new Model<>(MINUTES)); return minutesField;
new TextField<Integer>("duplicateCount", new Model<Integer>(100), Integer.class); duplicateCount.setRequired(true); duplicateCount.add(new RangeValidator<Integer>(1, 100000)); form.add(duplicateCount);
private void addHstRepositoryBasedMenuConfiguration() { CheckBox repositoryBased = new CheckBox("repobased"); repositoryBased.setOutputMarkupId(true); repositoryBased.setEnabled(!getLockInfo().isLocked()); form.add(repositoryBased); CheckBox foldersOnly = new CheckBox("foldersOnly"); foldersOnly.setOutputMarkupId(true); foldersOnly.setEnabled(!getLockInfo().isLocked()); form.add(foldersOnly); TextField depth = new TextField("depth"); depth.setOutputMarkupId(true); depth.add(new RangeValidator(0l, null)); depth.setEnabled(!getLockInfo().isLocked()); form.add(depth); }
final TextParamPanel maxConnections = new TextParamPanel("maxConnectionsPanel", connectionsModel, new ResourceModel("AbstractWMSStorePage.maxConnections"), true, new RangeValidator<Integer>(1, 128)); maxConnections.setOutputMarkupId(true); maxConnections.setEnabled(useHttpConnectionPoolModel.getObject()); "AbstractWMSStorePage.connectTimeout"), true, new RangeValidator<Integer>(1, 240))); "AbstractWMSStorePage.readTimeout"), true, new RangeValidator<Integer>(1, 360)));
form.add(new TextField("watermark.uRL").add(new FileExistsValidator(true))); TextField<Integer> transparency = new TextField<Integer>("watermark.transparency"); transparency.add(new RangeValidator<Integer>(0,100)); form.add(transparency); form.add(new DropDownChoice("watermark.position", Arrays.asList(Position.values()), new WatermarkPositionRenderer())); pngCompressionField.add(new RangeValidator<Integer>(0, 100)); form.add(pngCompressionField); jpegCompressionField.add(new RangeValidator<Integer>(0,100)); form.add(jpegCompressionField); maxAllowedFramesField.add(new RangeValidator<Integer>(0, Integer.MAX_VALUE)); form.add(maxAllowedFramesField); framesDelayField.add(new RangeValidator<Integer>(0, Integer.MAX_VALUE)); form.add(framesDelayField); kmScoreField.add(new RangeValidator<Integer>(0, 100)); form.add(kmScoreField);
new ResourceModel("AbstractWMSStorePage.maxConnections"), true, new RangeValidator<Integer>(1, 128)); maxConnections.setOutputMarkupId(true); maxConnections.setEnabled(useHttpConnectionPoolModel.getObject()); new ResourceModel("AbstractWMSStorePage.connectTimeout"), true, new RangeValidator<Integer>(1, 240))); new ResourceModel("AbstractWMSStorePage.readTimeout"), true, new RangeValidator<Integer>(1, 360)));
new ResourceModel("AbstractWMTSStorePage.maxConnections"), true, new RangeValidator<Integer>(1, 128)); maxConnections.setOutputMarkupId(true); maxConnections.setEnabled(useHttpConnectionPoolModel.getObject()); new ResourceModel("AbstractWMTSStorePage.connectTimeout"), true, new RangeValidator<Integer>(1, 240))); new ResourceModel("AbstractWMTSStorePage.readTimeout"), true, new RangeValidator<Integer>(1, 360)));
watermarkUrlField)); TextField<Integer> transparency = new TextField<Integer>("watermark.transparency"); transparency.add(new RangeValidator<Integer>(0, 100)); form.add(transparency); form.add( TextField<Integer> pngCompressionField = new TextField<Integer>("png.compression", pngCompression, Integer.class); pngCompressionField.add(new RangeValidator<Integer>(0, 100)); form.add(pngCompressionField); TextField<Integer> jpegCompressionField = new TextField<Integer>("jpeg.compression", jpegCompression, Integer.class); jpegCompressionField.add(new RangeValidator<Integer>(0, 100)); form.add(jpegCompressionField); TextField<Integer> maxAllowedFramesField = new TextField<Integer>("anim.maxallowedframes", maxAllowedFrames, Integer.class); maxAllowedFramesField.add(new RangeValidator<Integer>(0, Integer.MAX_VALUE)); form.add(maxAllowedFramesField); TextField<Integer> framesDelayField = new TextField<Integer>("anim.framesdelay", framesDelay, Integer.class); framesDelayField.add(new RangeValidator<Integer>(0, Integer.MAX_VALUE)); form.add(framesDelayField); TextField<Integer> kmScoreField = new TextField<Integer>("kml.kmscore", kmScore, Integer.class); kmScoreField.add(new RangeValidator<Integer>(0, 100));
this.compressionratioField.setEnabled(false); this.compressionratioField.setOutputMarkupId(true); this.compressionratioField.add(new RangeValidator<Integer>(0, 100)); this.form.add(this.compressionratioField); this.tilewidthField.setEnabled(false); this.tilewidthField.setOutputMarkupId(true); this.tilewidthField.add(new RangeValidator(64, 2048)); // SG make this parametric somehow, this.tileheightField.setEnabled(false); this.tileheightField.setOutputMarkupId(true); this.tileheightField.add(new RangeValidator(64, 2048)); this.form.add(this.tileheightField);
void initComponents() { updateFields(); final RangeValidator<Integer> validator = new RangeValidator<Integer>(0, Integer.MAX_VALUE); add(new TextField<Integer>("years", new PropertyModel<Integer>(this, "years")) .add(validator)); add(new TextField<Integer>("months", new PropertyModel<Integer>(this, "months")) .add(validator)); add(new TextField<Integer>("weeks", new PropertyModel<Integer>(this, "weeks")) .add(validator)); add(new TextField<Integer>("days", new PropertyModel<Integer>(this, "days")).add(validator)); add(new TextField<Integer>("hours", new PropertyModel<Integer>(this, "hours")) .add(validator)); add(new TextField<Integer>("minutes", new PropertyModel<Integer>(this, "minutes")) .add(validator)); add(new TextField<Integer>("seconds", new PropertyModel<Integer>(this, "seconds")) .add(validator)); }
void initComponents() { updateFields(); final RangeValidator<Integer> validator = new RangeValidator<Integer>(0, Integer.MAX_VALUE); add( new TextField<Integer>("years", new PropertyModel<Integer>(this, "years")) .add(validator)); add( new TextField<Integer>("months", new PropertyModel<Integer>(this, "months")) .add(validator)); add( new TextField<Integer>("weeks", new PropertyModel<Integer>(this, "weeks")) .add(validator)); add( new TextField<Integer>("days", new PropertyModel<Integer>(this, "days")) .add(validator)); add( new TextField<Integer>("hours", new PropertyModel<Integer>(this, "hours")) .add(validator)); add( new TextField<Integer>("minutes", new PropertyModel<Integer>(this, "minutes")) .add(validator)); add( new TextField<Integer>("seconds", new PropertyModel<Integer>(this, "seconds")) .add(validator)); }