import eu.etaxonomy.taxeditor.bulkeditor.BulkEditorQuery;
import eu.etaxonomy.taxeditor.bulkeditor.input.AbstractBulkEditorInput;
import eu.etaxonomy.taxeditor.bulkeditor.input.GroupEditorInput;
+import eu.etaxonomy.taxeditor.bulkeditor.input.MediaEditorInput;
import eu.etaxonomy.taxeditor.bulkeditor.input.NameEditorInput;
import eu.etaxonomy.taxeditor.bulkeditor.input.TaxonEditorInput;
import eu.etaxonomy.taxeditor.editor.IBulkEditor;
}
public void save(IProgressMonitor monitor, boolean resetMerge) {
+ IStructuredSelection selection = getLastSelection();
for(AbstractPostOperation<?> entry:operations){
IStatus status = Status.CANCEL_STATUS;
final IAdaptable uiInfoAdapter = WorkspaceUndoUtil
}
input.saveModel(resetMerge);
- IStructuredSelection selection = getSelection();
+// IStructuredSelection selection = getSelection();
dirty.setDirty(false);
input.dispose();
if (lastQuery != null){
bulkEditorComposite.performSearch(lastQuery, selection);
}
+
}
+ private IStructuredSelection getLastSelection() {
+ return new StructuredSelection(this.bulkEditorComposite.getLastSelectedObject());
+ }
+
@Focus
public void setFocus() {
//make sure to bind again if maybe in another view the conversation was unbound
getEditorInput().addSaveCandidate(changedSpecimen);
input.replaceInModel(changedSpecimen);
}
- }else if (element instanceof Media){
+ }else if (element instanceof Media && input instanceof MediaEditorInput){
+ getEditorInput().addSaveCandidate((Media)element);
+ input.replaceInModel((Media)element);
+ }else if (element instanceof Media ) {
IStructuredSelection sel = getSelection();
Object firstElement = sel.getFirstElement();
if (firstElement instanceof TaxonBase){
SpecimenOrObservationBase changedSpecimen = (SpecimenOrObservationBase)sel.getFirstElement();
getEditorInput().addSaveCandidate(changedSpecimen);
input.replaceInModel(changedSpecimen);
- } else if (firstElement instanceof Media){
- getEditorInput().addSaveCandidate((Media)element);
- input.replaceInModel((Media)element);
- }
+ }
}else if(element instanceof Group){
Group oldGroup = ((GroupEditorInput)input).getEntityFromModel((Group)element);
((GroupEditorInput)input).getSaveUserCandidates().addAll(oldGroup.getMembers());
@Inject
private IEventBroker eventBroker;
+ private Object lastSelectedObject;
public BulkEditorComposite(BulkEditor bulkEditor, Composite parent, int style) {
super(parent, style);
protected File getStatePropertiesFile() {
return bulkEditorSearch.getStatePropertiesFile();
}
+
+ public Object getLastSelectedObject() {
+ return lastSelectedObject;
+ }
+
+ public void setLastSelectedObject(Object lastSelectedObject) {
+ this.lastSelectedObject = lastSelectedObject;
+ }
}