+ IIdentifiableEntityServiceConfigurator<?> configurator = bulkEditorQuery.getSearchConfigurator();
+
+ // check for UUID search
+ String titleSearchString = configurator.getTitleSearchString();
+ try {
+ UUID uuid = UUID.fromString(titleSearchString);
+ T entity = loadEntity(uuid);
+ //UUID search found -> add entity to list and return
+ model.add(entity);
+ return;
+ } catch (IllegalArgumentException e) {
+ // search string was no UUID
+ }
+ //-> continue with standard search
+
+ int pageSize = configurator.getPageSize()!=null?configurator.getPageSize():getPageSize();
+ configurator.setPageSize(pageSize);
+ long count = countEntities(configurator);
+ int totalWork = count>Integer.MAX_VALUE?Integer.MAX_VALUE:(int)count;
+ String jobLabel = String.format(Messages.AbstractBulkEditorInput_LOADING, getName(), bulkEditorQuery.getSearchString());
+ searchJob = Job.create(jobLabel, (ICoreRunnable) monitor -> {
+ monitor.beginTask(jobLabel, totalWork);
+ int pageNumber = 0;
+ List<T> entities;
+
+ //load previously selected element
+ UUID selectedUuid = null;
+ if(selection!=null && selection.getFirstElement() instanceof CdmBase){
+ selectedUuid = ((CdmBase) selection.getFirstElement()).getUuid();
+ T entity = loadEntity(selectedUuid);
+ model.add(entity);
+ }
+
+ do {
+ if (monitor.isCanceled()) {
+ break;
+ }
+ configurator.setPageNumber(pageNumber);
+ entities = listEntities(configurator);
+
+ addToModel(entities, selectedUuid);
+
+ pageNumber++;
+ monitor.worked(pageSize);
+ long workedLong = pageSize*pageNumber;
+ int loadedCount = workedLong>Integer.MAX_VALUE?Integer.MAX_VALUE:(int)workedLong;
+ monitor.setTaskName(String.format(Messages.AbstractBulkEditorInput_LOADED, loadedCount, totalWork, getName()));
+
+ //Update selection
+ EventUtility.postAsyncEvent(WorkbenchEventConstants.BULK_EDITOR_SEARCH_FINISHED, selection);
+ } while (!entities.isEmpty());
+ monitor.done();
+ EventUtility.postAsyncEvent(WorkbenchEventConstants.BULK_EDITOR_SEARCH_FINISHED, selection);
+ });
+ searchJob.schedule();