Project

General

Profile

« Previous | Next » 

Revision 549f7853

Added by Katja Luther almost 7 years ago

ref #6664: fix problem of not deleted objects in bulkeditor by setting offset = 1 if offset = 0

View differences:

eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/annotatedlineeditor/AnnotatedLineDocumentProvider.java
275 275
				}
276 276
				if (annotation.isMarkedAsMerged()) {
277 277
					persistenceService.merge(annotation.getEntity(), annotation.getMergeTarget()); //  merge
278
				} if (annotation.isMarkedAsDeleted()) {
278
				} 
279
				if (annotation.isMarkedAsDeleted()) {
279 280
					try {
280 281
						persistenceService.delete(annotation.getEntity(), annotation.getDeleteConfigurator());
281 282
					} catch (ReferencedObjectUndeletableException e) {
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/BulkEditor.java
74 74
	private boolean isDirty;
75 75

  
76 76
    private IUndoContext undoContext;
77
  
77

  
78 78
	public BulkEditor() {
79 79
		super(CdmStore.createConversation());
80 80
        undoContext = new UndoContext();
......
254 254
	    isDirty = true;
255 255
	    firePropertyChange(PROP_DIRTY);
256 256
	}
257
	
258
	
257

  
258

  
259 259
   	@Override
260 260
	public void doSave(IProgressMonitor progressMonitor) {
261 261
	    isDirty = false;
262 262

  
263 263
	    super.doSave(progressMonitor);
264 264

  
265
	    this.searchBar.updateEditorInput();
265 266
	    selectFirstItem();
266 267

  
267 268
		getSourceViewer().getTextWidget().setFocus();
......
300 301
			getEditorInput().dispose();
301 302
			getEditorInput().bind();
302 303
			getEditorInput().performSearch(query);
303
			
304

  
304 305
			refresh();
305 306

  
306 307
			selectFirstItem();
......
345 346
        return undoContext;
346 347
    }
347 348

  
348
	
349

  
349 350
}
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/BulkEditorSearch.java
96 96
	 */
97 97
	private void registerAtFocusService() {
98 98
		IFocusService focusService =
99
			(IFocusService) PlatformUI.getWorkbench().getService(IFocusService.class);
99
			PlatformUI.getWorkbench().getService(IFocusService.class);
100 100
		if (focusService != null) {
101 101
			focusService.addFocusTracker(text, "bulkeditor.textControlId");
102 102
		}
......
150 150
	/**
151 151
	 * Shows the results of the search.
152 152
	 */
153
	private void updateEditorInput() {
153
	public void updateEditorInput() {
154 154

  
155 155
		String searchString = getSearchString().trim();
156 156

  
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/handler/DeleteHandler.java
9 9

  
10 10
package eu.etaxonomy.taxeditor.bulkeditor.handler;
11 11

  
12

  
12 13
import java.util.ArrayList;
13 14
import java.util.Iterator;
14 15
import java.util.List;
......
19 20
import org.eclipse.core.runtime.Status;
20 21
import org.eclipse.jface.dialogs.MessageDialog;
21 22
import org.eclipse.jface.text.TextSelection;
23
import org.eclipse.jface.text.source.Annotation;
22 24
import org.eclipse.jface.viewers.IStructuredSelection;
23 25
import org.eclipse.ui.IEditorInput;
24 26
import org.eclipse.ui.IEditorPart;
......
216 218
    						MessagingUtils.messageDialog("Delete not possible", getClass(), "The object could not be deleted. An exception occured.", null);
217 219
    					}
218 220
    				}else if (model != null) {
219
                        Iterator iter = model.getAnnotationIterator(selection.getOffset(), selection.getLength(), true, true);
221
    					int offset = selection.getOffset();
222
    					if (offset == 0){
223
    						offset = 1;
224
    					}
225
                        Iterator iter = model.getAnnotationIterator(offset, selection.getLength(), true, true);
226
                   //     Iterator<Annotation> iter = model.getAnnotationIterator(selection.getOffset(), selection.getLength(), true, true);
220 227
                        while (iter.hasNext()) {
221 228
                            Object next = iter.next();
222 229
                            if (next instanceof LineAnnotation) {

Also available in: Unified diff