Revision 8b4e88a6
Added by Patrick Plitzner almost 6 years ago
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/input/AbstractBulkEditorInput.java | ||
---|---|---|
70 | 70 |
private IEntityCreator<T> entityCreator; |
71 | 71 |
private final ConversationHolder conversation; |
72 | 72 |
|
73 |
private Job searchJob; |
|
74 |
|
|
73 | 75 |
public AbstractBulkEditorInput() { |
74 | 76 |
super(true); |
75 | 77 |
this.conversation = CdmStore.createConversation(); |
... | ... | |
140 | 142 |
} |
141 | 143 |
|
142 | 144 |
public void performSearch(final BulkEditorQuery bulkEditorQuery) { |
145 |
if(searchJob!=null && searchJob.getState()!=Job.NONE){ |
|
146 |
MessagingUtils.informationDialog("Search not possible", "Please wait for the last search to finish or cancel it."); |
|
147 |
return; |
|
148 |
} |
|
143 | 149 |
model.clear(); |
144 | 150 |
|
145 | 151 |
if(getEntityUuid() != null){ |
... | ... | |
152 | 158 |
IIdentifiableEntityServiceConfigurator configurator = bulkEditorQuery.getSearchConfigurator(); |
153 | 159 |
Comparator queryComparator = (bulkEditorQuery.getComparator() != null) ? bulkEditorQuery.getComparator() : new TitleCacheComparator(); |
154 | 160 |
|
155 |
String jobLabel = "Load data";
|
|
156 |
Job job = Job.create(jobLabel, (ICoreRunnable) monitor -> {
|
|
161 |
String jobLabel = "Loading "+getName();
|
|
162 |
searchJob = Job.create(jobLabel, (ICoreRunnable) monitor -> {
|
|
157 | 163 |
monitor.beginTask(jobLabel, IProgressMonitor.UNKNOWN); |
158 | 164 |
int pageNumber = 0; |
159 | 165 |
List<T> entities = listEntities(configurator); |
... | ... | |
169 | 175 |
} |
170 | 176 |
monitor.done(); |
171 | 177 |
}); |
172 |
job.schedule();
|
|
178 |
searchJob.schedule();
|
|
173 | 179 |
} |
174 | 180 |
} |
175 | 181 |
|
Also available in: Unified diff
ref #6321 Avoid multiple parallel searches for same bulk editor