Revision 533fd1e8
Added by Patrick Plitzner almost 6 years ago
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/input/AbstractBulkEditorInput.java | ||
---|---|---|
42 | 42 |
import eu.etaxonomy.taxeditor.bulkeditor.input.sortprovider.TitleCacheComparator; |
43 | 43 |
import eu.etaxonomy.taxeditor.bulkeditor.internal.TaxeditorBulkeditorPlugin; |
44 | 44 |
import eu.etaxonomy.taxeditor.editor.CdmEntitySessionInput; |
45 |
import eu.etaxonomy.taxeditor.l10n.Messages; |
|
45 | 46 |
import eu.etaxonomy.taxeditor.model.MessagingUtils; |
46 | 47 |
import eu.etaxonomy.taxeditor.store.CdmStore; |
47 | 48 |
|
... | ... | |
143 | 144 |
|
144 | 145 |
public void performSearch(final BulkEditorQuery bulkEditorQuery) { |
145 | 146 |
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 |
MessagingUtils.informationDialog(Messages.AbstractBulkEditorInput_MULTIPLE_SEARCH_TITLE, Messages.AbstractBulkEditorInput_MULTIPLE_SEARCH_MESSAGE);
|
|
147 | 148 |
return; |
148 | 149 |
} |
149 | 150 |
model.clear(); |
... | ... | |
158 | 159 |
IIdentifiableEntityServiceConfigurator configurator = bulkEditorQuery.getSearchConfigurator(); |
159 | 160 |
Comparator queryComparator = (bulkEditorQuery.getComparator() != null) ? bulkEditorQuery.getComparator() : new TitleCacheComparator(); |
160 | 161 |
|
161 |
String jobLabel = "Loading "+getName();
|
|
162 |
String jobLabel = Messages.AbstractBulkEditorInput_LOADING+getName();
|
|
162 | 163 |
searchJob = Job.create(jobLabel, (ICoreRunnable) monitor -> { |
163 | 164 |
monitor.beginTask(jobLabel, IProgressMonitor.UNKNOWN); |
164 | 165 |
int pageNumber = 0; |
... | ... | |
199 | 200 |
try { |
200 | 201 |
CdmStore.getCommonService().merge(mergeTarget.getUuid(), entity.getUuid(), (Class<? extends CdmBase>)entity.getClass()); |
201 | 202 |
} catch (MergeException e) { |
202 |
MessagingUtils.errorDialog("Bulk Editor Merge Error",
|
|
203 |
MessagingUtils.errorDialog(Messages.AbstractBulkEditorInput_MERGE_ERROR_TITLE,
|
|
203 | 204 |
this, |
204 |
"Could not merge chosen objects of type " + entity.getClass().getName(),
|
|
205 |
String.format(Messages.AbstractBulkEditorInput_MERGE_ERROR_MESSAGE, entity.getClass().getName()),
|
|
205 | 206 |
TaxeditorBulkeditorPlugin.PLUGIN_ID, |
206 | 207 |
e, |
207 | 208 |
true); |
... | ... | |
282 | 283 |
public String getText(T entity) { |
283 | 284 |
if(entity instanceof IdentifiableEntity){ |
284 | 285 |
IdentifiableEntity identifiableEntity = (IdentifiableEntity) HibernateProxyHelper.deproxy(entity); |
285 |
String text = ""; |
|
286 |
String text = ""; //$NON-NLS-1$
|
|
286 | 287 |
if(markedMergeCandidates.contains(entity)){ |
287 |
text += "[Candidate] ";
|
|
288 |
text += Messages.AbstractBulkEditorInput_CANDIDATE;
|
|
288 | 289 |
} |
289 | 290 |
else if(markedMergeTarget==entity){ |
290 |
text += "[Target] ";
|
|
291 |
text += Messages.AbstractBulkEditorInput_TARGET;
|
|
291 | 292 |
} |
292 | 293 |
text += identifiableEntity.getTitleCache(); |
293 | 294 |
return text; |
294 | 295 |
} |
295 | 296 |
|
296 |
return "No text. Implement in subclass"; |
|
297 |
return "No text. Implement in subclass"; //$NON-NLS-1$
|
|
297 | 298 |
} |
298 | 299 |
|
299 | 300 |
public BasicEventList<T> getModel() { |
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/l10n/Messages.java | ||
---|---|---|
4 | 4 |
|
5 | 5 |
public class Messages extends NLS { |
6 | 6 |
private static final String BUNDLE_NAME = "src/main/java/eu.etaxonomy.taxeditor.l10n.messages"; //$NON-NLS-1$ |
7 |
public static String AbstractBulkEditorInput_CANDIDATE; |
|
8 |
public static String AbstractBulkEditorInput_LOADING; |
|
9 |
public static String AbstractBulkEditorInput_MERGE_ERROR_MESSAGE; |
|
10 |
public static String AbstractBulkEditorInput_MERGE_ERROR_TITLE; |
|
11 |
public static String AbstractBulkEditorInput_MULTIPLE_SEARCH_MESSAGE; |
|
12 |
public static String AbstractBulkEditorInput_MULTIPLE_SEARCH_TITLE; |
|
13 |
public static String AbstractBulkEditorInput_TARGET; |
|
7 | 14 |
public static String USER_CREATOR_user_exists_title; |
8 | 15 |
public static String USER_CREATOR_user_exists; |
9 | 16 |
public static String BulkEditorE4_CANCEL; |
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/l10n/messages.properties | ||
---|---|---|
1 |
AbstractBulkEditorInput_CANDIDATE=[Candidate] |
|
2 |
AbstractBulkEditorInput_LOADING=Loading |
|
3 |
AbstractBulkEditorInput_MERGE_ERROR_MESSAGE=Could not merge chosen objects of type %s |
|
4 |
AbstractBulkEditorInput_MERGE_ERROR_TITLE=Merging failes |
|
5 |
AbstractBulkEditorInput_MULTIPLE_SEARCH_MESSAGE=Please wait for the last search to finish or cancel it. |
|
6 |
AbstractBulkEditorInput_MULTIPLE_SEARCH_TITLE=Search not possible |
|
7 |
AbstractBulkEditorInput_TARGET=[Target] |
|
1 | 8 |
BulkEditorE4_CANCEL=Cancel |
2 | 9 |
BulkEditorE4_DONT_SAVE=Don't save (and Search) |
3 | 10 |
BulkEditorE4_SAVE_AND_SEARCH=Save (and Search) |
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/l10n/messages_de.properties | ||
---|---|---|
1 |
AbstractBulkEditorInput_CANDIDATE=[Kandidat] |
|
2 |
AbstractBulkEditorInput_LOADING=Lade |
|
3 |
AbstractBulkEditorInput_MERGE_ERROR_MESSAGE=Zusammenf?hren von Objekten des Typen %s fehlgeschlagen |
|
4 |
AbstractBulkEditorInput_MERGE_ERROR_TITLE=Zusammenf?hren fehlgeschlagen |
|
5 |
AbstractBulkEditorInput_MULTIPLE_SEARCH_MESSAGE=Bitte warten Sie, bis die letzte Suche beendet wurde oder brechen Sie sie ab. |
|
6 |
AbstractBulkEditorInput_MULTIPLE_SEARCH_TITLE=Suche nicht m?glich |
|
7 |
AbstractBulkEditorInput_TARGET=[Ziel] |
|
1 | 8 |
BulkEditorE4_CANCEL=Abbrechen |
2 | 9 |
BulkEditorE4_DONT_SAVE=Nicht specichern (und suchen) |
3 | 10 |
BulkEditorE4_SAVE_AND_SEARCH=Speichern (und suchen) |
Also available in: Unified diff
ref #6321 i18n