Project

General

Profile

« Previous | Next » 

Revision 264fff91

Added by Patrick Plitzner almost 6 years ago

ref #6321 Use individual page size for different editor inputs

View differences:

eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/input/AbstractBulkEditorInput.java
98 98
        return getName();
99 99
    }
100 100

  
101
    protected int getPageSize(){
102
        return 100;
103
    }
104

  
101 105
	protected abstract List<T> listEntities(IIdentifiableEntityServiceConfigurator configurator);
102 106

  
103 107
	protected abstract long countEntities(IIdentifiableEntityServiceConfigurator configurator);
......
160 164
			IIdentifiableEntityServiceConfigurator configurator = bulkEditorQuery.getSearchConfigurator();
161 165
			Comparator queryComparator = (bulkEditorQuery.getComparator() != null) ? bulkEditorQuery.getComparator() : new TitleCacheComparator();
162 166

  
167

  
168
            int pageSize = configurator.getPageSize()!=null?configurator.getPageSize():getPageSize();
163 169
			long count = countEntities(configurator);
164 170
			int totalWork = count>Integer.MAX_VALUE?Integer.MAX_VALUE:(int)count;
165 171
			String jobLabel = String.format(Messages.AbstractBulkEditorInput_LOADING, getName(), bulkEditorQuery.getSearchString());
......
175 181
                    entities = listEntities(configurator);
176 182
                    model.addAll(entities);
177 183
                    pageNumber++;
178
                    monitor.worked(configurator.getPageSize());
179
                    long workedLong = configurator.getPageSize()*pageNumber;
184
                    monitor.worked(pageSize);
185
                    long workedLong = pageSize*pageNumber;
180 186
                    int loadedCount =  workedLong>Integer.MAX_VALUE?Integer.MAX_VALUE:(int)workedLong;
181 187
                    monitor.setTaskName(String.format(Messages.AbstractBulkEditorInput_LOADED, loadedCount, totalWork, getName()));
182 188
                } while (!entities.isEmpty());

Also available in: Unified diff