Skip to content

Commit

Permalink
Some assorted fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
aaime committed Dec 30, 2015
1 parent 9cd58ae commit 41f27e1
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 128 deletions.

This file was deleted.

Expand Up @@ -545,16 +545,16 @@ protected abstract Component getComponentForProperty(String id, IModel itemModel
protected void onPopulateItem(Property<T> property, ListItem item) {
}

IModel showingAllRecords(int first, int last, int size) {
IModel showingAllRecords(long first, long last, long size) {
return new ParamResourceModel("showingAllRecords", this, first, last, size);
}

IModel matchedXOutOfY(int first, int last, int size, int fullSize) {
IModel matchedXOutOfY(long first, long last, long size, long fullSize) {
return new ParamResourceModel("matchedXOutOfY", this, first, last, size, fullSize);
}

protected class PagerDelegate implements Serializable {
int fullSize, size, first, last;
long fullSize, size, first, last;

public PagerDelegate() {
updateMatched();
Expand Down Expand Up @@ -583,8 +583,8 @@ public IModel model() {
/**
* User oriented index of the first item in the current page
*/
int first(int fullSize) {
int size = fullSize;
long first(long fullSize) {
long size = fullSize;
if (dataProvider.getKeywords() != null) {
size = dataView.getDataProvider().size();
}
Expand All @@ -597,21 +597,21 @@ int first(int fullSize) {
/**
* User oriented index of the last item in the current page
*/
int last(int fullSize) {
long last(long fullSize) {

int count = dataProvider.getKeywords() != null ?
long count = dataProvider.getKeywords() != null ?
dataView.getPageCount() : optGetPageCount(fullSize);
int page = dataView.getCurrentPage();
long page = dataView.getCurrentPage();
if (page < (count - 1))
return dataView.getItemsPerPage() * (page + 1);
else {
return dataProvider.getKeywords() != null ? dataView.getDataProvider().size() : fullSize;
}
}

int optGetPageCount(int total) {
int page = dataView.getItemsPerPage();
int count = total / page;
long optGetPageCount(long total) {
long page = dataView.getItemsPerPage();
long count = total / page;

if (page * count < total)
{
Expand Down
Expand Up @@ -17,7 +17,7 @@
import org.apache.wicket.markup.html.form.TextField;
import org.apache.wicket.model.IModel;
import org.apache.wicket.model.PropertyModel;
import org.apache.wicket.validation.validator.NumberValidator;
import org.apache.wicket.validation.validator.RangeValidator;
import org.apache.wicket.validation.validator.UrlValidator;
import org.geoserver.catalog.LayerInfo;
import org.geoserver.catalog.PublishedInfo;
Expand Down Expand Up @@ -70,15 +70,15 @@ public AttributionLayerConfigPanel(String id, IModel<? extends PublishedInfo> mo
new PropertyModel<Integer>(model, "attribution.logoHeight"),
Integer.class
);
height.add(NumberValidator.minimum(0));
height.add(RangeValidator.minimum(0));
height.setOutputMarkupId(true);
add(height);

final TextField<Integer> width = new TextField<Integer>("wms.attribution.width",
new PropertyModel<Integer>(model, "attribution.logoWidth"),
Integer.class
);
width.add(NumberValidator.minimum(0));
width.add(RangeValidator.minimum(0));
width.setOutputMarkupId(true);
add(width);

Expand Down
Expand Up @@ -5,7 +5,6 @@
*/
package org.geoserver.wms.web.publish;

import java.util.List;
import java.util.Set;

import org.apache.wicket.Component;
Expand All @@ -21,7 +20,7 @@
import org.apache.wicket.model.IModel;
import org.apache.wicket.model.PropertyModel;
import org.apache.wicket.model.ResourceModel;
import org.apache.wicket.validation.validator.NumberValidator;
import org.apache.wicket.validation.validator.RangeValidator;
import org.geoserver.catalog.CoverageInfo;
import org.geoserver.catalog.FeatureTypeInfo;
import org.geoserver.catalog.LayerInfo;
Expand Down

0 comments on commit 41f27e1

Please sign in to comment.