Revision 6814f4f5
Added by Patrick Plitzner about 9 years ago
- added forceDirty() method to set the BulkEditor dirty when editing in MediaView #2407
- TODO: should be replaced with the possibility to set views dirty when we move to Eclipse 4
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/BulkEditor.java | ||
---|---|---|
10 | 10 |
|
11 | 11 |
package eu.etaxonomy.taxeditor.bulkeditor; |
12 | 12 |
|
13 |
import org.eclipse.core.runtime.IProgressMonitor; |
|
13 | 14 |
import org.eclipse.jface.action.IMenuManager; |
14 | 15 |
import org.eclipse.jface.dialogs.MessageDialog; |
15 | 16 |
import org.eclipse.jface.dialogs.MessageDialogWithToggle; |
... | ... | |
64 | 65 |
|
65 | 66 |
private IPropertyChangeListener markerPreferenceListener; |
66 | 67 |
|
68 |
private boolean isDirty; |
|
69 |
|
|
67 | 70 |
/** |
68 | 71 |
* <p>Constructor for BulkEditor.</p> |
69 | 72 |
*/ |
... | ... | |
247 | 250 |
} |
248 | 251 |
} |
249 | 252 |
|
253 |
/* (non-Javadoc) |
|
254 |
* @see eu.etaxonomy.taxeditor.annotatedlineeditor.AnnotatedLineEditor#isDirty() |
|
255 |
*/ |
|
256 |
@Override |
|
257 |
public boolean isDirty() { |
|
258 |
if(isDirty){ |
|
259 |
return isDirty; |
|
260 |
} |
|
261 |
else{ |
|
262 |
return super.isDirty(); |
|
263 |
} |
|
264 |
} |
|
265 |
|
|
266 |
public void forceDirty(){ |
|
267 |
isDirty = true; |
|
268 |
firePropertyChange(PROP_DIRTY); |
|
269 |
} |
|
270 |
|
|
271 |
/* (non-Javadoc) |
|
272 |
* @see eu.etaxonomy.taxeditor.annotatedlineeditor.AnnotatedLineEditor#doSave(org.eclipse.core.runtime.IProgressMonitor) |
|
273 |
*/ |
|
274 |
@Override |
|
275 |
public void doSave(IProgressMonitor progressMonitor) { |
|
276 |
isDirty = false; |
|
277 |
super.doSave(progressMonitor); |
|
278 |
} |
|
279 |
|
|
250 | 280 |
/** {@inheritDoc} */ |
251 | 281 |
@Override |
252 | 282 |
public void changed(Object object) { |
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/media/MediaViewPart.java | ||
---|---|---|
27 | 27 |
import org.eclipse.ui.IWorkbenchActionConstants; |
28 | 28 |
import org.eclipse.ui.IWorkbenchPart; |
29 | 29 |
|
30 |
import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase; |
|
30 | 31 |
import eu.etaxonomy.taxeditor.bulkeditor.BulkEditor; |
31 | 32 |
import eu.etaxonomy.taxeditor.editor.MultiPageTaxonEditor; |
32 | 33 |
import eu.etaxonomy.taxeditor.model.AbstractUtility; |
... | ... | |
112 | 113 |
@Override |
113 | 114 |
public void changed(Object object) { |
114 | 115 |
viewer.refresh(); |
116 |
//TODO: should be replaced with the possibility to set views dirty |
|
117 |
// when we move to Eclipse 4 |
|
118 |
if(part instanceof BulkEditor && !(object instanceof SpecimenOrObservationBase<?>)){ |
|
119 |
((BulkEditor) part).forceDirty(); |
|
120 |
} |
|
115 | 121 |
super.changed(object); |
116 | 122 |
} |
117 | 123 |
|
Also available in: Unified diff