Revision ae137b34
Added by Patrick Plitzner about 7 years ago
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/MultiPageTaxonEditor.java | ||
---|---|---|
61 | 61 |
IDirtyMarkable, IPartContentHasDetails, ISecuredEditor, IPartContentHasMedia { |
62 | 62 |
|
63 | 63 |
/** Constant <code>ID="eu.etaxonomy.taxeditor.editor.taxon"{trunked}</code> */ |
64 |
public static final String ID = "eu.etaxonomy.taxeditor.editor.taxon"; |
|
64 |
public static final String ID = "eu.etaxonomy.taxeditor.editor.taxon"; //$NON-NLS-1$
|
|
65 | 65 |
|
66 | 66 |
private boolean dirty; |
67 | 67 |
|
... | ... | |
124 | 124 |
/** {@inheritDoc} */ |
125 | 125 |
@Override |
126 | 126 |
public void doSave(IProgressMonitor monitor) { |
127 |
monitor.beginTask("Saving Editor", 4);
|
|
127 |
monitor.beginTask(Messages.MultiPageTaxonEditor_SAVING_EDITOR, 4);
|
|
128 | 128 |
try { |
129 | 129 |
if (!conversation.isBound()) { |
130 | 130 |
conversation.bind(); |
... | ... | |
134 | 134 |
for (IEditorPart editorPage : getPages()) { |
135 | 135 |
if (editorPage instanceof TaxonNameEditor) { |
136 | 136 |
if (((TaxonNameEditor) editorPage).checkForEmptyNames()) { |
137 |
MessageDialog.openWarning(AbstractUtility.getShell(), "No Name Specified", |
|
138 |
"An attempt was made to save a taxon or synonym with " |
|
139 |
+ "an empty name. Operation was cancelled."); |
|
137 |
MessageDialog.openWarning(AbstractUtility.getShell(), Messages.MultiPageTaxonEditor_NO_NAME_SPECIFIED, |
|
138 |
Messages.MultiPageTaxonEditor_NO_NAME_SPECIFIED_MESSAGE); |
|
140 | 139 |
return; |
141 | 140 |
} |
142 | 141 |
} |
... | ... | |
148 | 147 |
// commit the conversation and start a new transaction immediately |
149 | 148 |
|
150 | 149 |
input.merge(); |
151 |
|
|
150 |
|
|
152 | 151 |
conversation.commit(true); |
153 | 152 |
CdmApplicationState.getCurrentDataChangeService() |
154 | 153 |
.fireChangeEvent(new CdmChangeEvent(Action.Update, input.getTaxonNode() , MultiPageTaxonEditor.class), true); |
... | ... | |
158 | 157 |
monitor.worked(1); |
159 | 158 |
} catch (Exception e) { |
160 | 159 |
setFocus(); |
161 |
MessagingUtils.operationDialog(this, e, TaxeditorEditorPlugin.PLUGIN_ID,"saving a taxon", " Please close and reopen the taxon again.");
|
|
160 |
MessagingUtils.operationDialog(this, e, TaxeditorEditorPlugin.PLUGIN_ID,Messages.MultiPageTaxonEditor_SAVING_TAXON, Messages.MultiPageTaxonEditor_SAVING_TAXON_MESSAGE);
|
|
162 | 161 |
disableEditor(true); |
163 | 162 |
} finally { |
164 | 163 |
monitor.done(); |
... | ... | |
252 | 251 |
|
253 | 252 |
if (!(input instanceof TaxonEditorInput)) { |
254 | 253 |
throw new PartInitException( |
255 |
"Invalid Input: Must be TaxonEditorInput");
|
|
254 |
Messages.MultiPageTaxonEditor_INVALID_INPUT);
|
|
256 | 255 |
} |
257 | 256 |
|
258 | 257 |
this.input = (TaxonEditorInput) input; |
... | ... | |
294 | 293 |
partName = name.getTitleCache(); |
295 | 294 |
} |
296 | 295 |
|
297 |
if (partName == null || partName.equals("")) { |
|
298 |
partName = ("New taxon");
|
|
296 |
if (partName == null || partName.equals("")) { //$NON-NLS-1$
|
|
297 |
partName = (Messages.MultiPageTaxonEditor_NEW_TAXON);
|
|
299 | 298 |
} |
300 | 299 |
|
301 | 300 |
setPartName(partName); |
... | ... | |
447 | 446 |
if (editor instanceof IPostOperationEnabled) { |
448 | 447 |
((IPostOperationEnabled) editor).postOperation(objectAffectedByOperation); |
449 | 448 |
} else { |
450 |
MessagingUtils.warn(getClass(), "postOperation not enabled for editor " + editor);
|
|
449 |
MessagingUtils.warn(getClass(), Messages.MultiPageTaxonEditor_POST_OP_NOT_ENABLED + editor);
|
|
451 | 450 |
} |
452 | 451 |
} |
453 |
MessagingUtils.warn(getClass(), "postOperation called on MultiPageTaxonEditor. Can you make it more specific?");
|
|
452 |
MessagingUtils.warn(getClass(), Messages.MultiPageTaxonEditor_POST_OP_CALLED);
|
|
454 | 453 |
|
455 | 454 |
return false; |
456 | 455 |
} |
... | ... | |
530 | 529 |
*/ |
531 | 530 |
public void reload() { |
532 | 531 |
if (isDirty()) { |
533 |
MessagingUtils.warningDialog("Editor has unsaved data", getClass(), "This editor can not be " |
|
534 |
+ "refreshed because it contains unsaved data. Refreshing " |
|
535 |
+ "this editor would discard the changes. Please save this editor, " |
|
536 |
+ "close and reopen it manually in order to get the latest content"); |
|
532 |
MessagingUtils.warningDialog(Messages.MultiPageTaxonEditor_UNSAVED_DATA, getClass(), Messages.MultiPageTaxonEditor_UNSAVED_DATA_MESSAGE); |
|
537 | 533 |
} else { |
538 | 534 |
TaxonEditorInput input = (TaxonEditorInput) getEditorInput(); |
539 | 535 |
|
... | ... | |
548 | 544 |
editorPart.redraw(); |
549 | 545 |
} |
550 | 546 |
} catch (Exception e) { |
551 |
MessagingUtils.messageDialog("Error refreshing editor", getClass(), "Could not refresh this editor", e);
|
|
547 |
MessagingUtils.messageDialog(Messages.MultiPageTaxonEditor_REFRESH_ERROR, getClass(), Messages.MultiPageTaxonEditor_REFRESH_ERROR_MESSAGE, e);
|
|
552 | 548 |
} |
553 | 549 |
} |
554 | 550 |
} |
555 | 551 |
|
556 | 552 |
@Override |
557 | 553 |
public String toString() { |
558 |
return String.format("%s[%s]", this.getClass().getSimpleName(), getEditorInput()); |
|
554 |
return String.format("%s[%s]", this.getClass().getSimpleName(), getEditorInput()); //$NON-NLS-1$
|
|
559 | 555 |
} |
560 | 556 |
|
561 | 557 |
@Override |
Also available in: Unified diff
ref #4611 some l10n for taxeditor and taxeditor.editor plugin