Revision 288183cd
Added by Niels Hoffmann over 12 years ago
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/MultiPageTaxonEditor.java | ||
---|---|---|
17 | 17 |
import org.eclipse.core.commands.operations.UndoContext; |
18 | 18 |
import org.eclipse.core.runtime.IProgressMonitor; |
19 | 19 |
import org.eclipse.jface.dialogs.MessageDialog; |
20 |
import org.eclipse.jface.viewers.StructuredSelection; |
|
20 | 21 |
import org.eclipse.ui.IEditorInput; |
21 | 22 |
import org.eclipse.ui.IEditorPart; |
22 | 23 |
import org.eclipse.ui.IEditorSite; |
... | ... | |
132 | 133 |
|
133 | 134 |
this.setDirty(false); |
134 | 135 |
monitor.worked(1); |
136 |
}catch(Exception e){ |
|
137 |
EditorUtil.errorDialog("An error occurred while saving", getClass(), "An error occurred while saving the editor. Please close and reopen the taxon again.", e); |
|
138 |
disableEditor(); |
|
135 | 139 |
}finally{ |
136 | 140 |
monitor.done(); |
137 | 141 |
} |
138 | 142 |
} |
139 | 143 |
|
140 | 144 |
|
145 |
private void disableEditor() { |
|
146 |
for(IMultiPageTaxonEditorPage editorPage : getPages()){ |
|
147 |
editorPage.setDisabled(); |
|
148 |
} |
|
149 |
setDirty(false); |
|
150 |
getSite().getSelectionProvider().setSelection(new StructuredSelection()); |
|
151 |
getSite().setSelectionProvider(null); |
|
152 |
} |
|
153 |
|
|
141 | 154 |
private void setDirty(boolean dirty) { |
142 | 155 |
this.dirty = dirty; |
143 | 156 |
firePropertyChange(PROP_DIRTY); |
Also available in: Unified diff
Upgraded to cdmlib-3.0.9, working on error warning for unsavable editor