Project

General

Profile

Revision ede4ba36

IDede4ba36a71e3c9aa9b0772e181a043460327b18
Parent 31a9124b
Child f6fe3908

Added by Patrick Plitzner about 1 year ago

ref #7439 set dirty flag to false when closing bulkeditor

  • code cleanup

View differences:

eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/e4/BulkEditorE4.java
112 112
    @Inject
113 113
	private MDirtyable dirty;
114 114

  
115
    private AbstractBulkEditorInput<?> input;
115
    private AbstractBulkEditorInput input;
116 116

  
117 117
    private Composite topComposite;
118 118

  
......
181 181
        Map<String, String> propertyToLabels = new HashMap<>();
182 182
        propertyToLabels.put(getEditorInput().getName(), getEditorInput().getName());
183 183
        propertyToLabels.put(TYPE_PROPERTY, TYPE_PROPERTY);
184
        String[] propertyNames = new String[] { getEditorInput().getName(), TYPE_PROPERTY };
184
        String[] propertyNames = new String[] { input.getName(), TYPE_PROPERTY };
185 185
        //sorted list
186
        SortedList<CdmBase> sortedList = new SortedList<>(getEditorInput().getModel(), new TitleCacheComparator());
186
        SortedList<CdmBase> sortedList = new SortedList<>(input.getModel(), new TitleCacheComparator());
187 187
        //data provider
188
        BulkEditorPropertyAccessor columnPropertyAccessor = new BulkEditorPropertyAccessor(getEditorInput());
188
        BulkEditorPropertyAccessor columnPropertyAccessor = new BulkEditorPropertyAccessor(input);
189 189
        bodyDataProvider = new ListDataProvider<CdmBase>(sortedList,
190 190
                columnPropertyAccessor);
191 191
        DefaultColumnHeaderDataProvider colHeaderDataProvider = new DefaultColumnHeaderDataProvider(
......
194 194
                bodyDataProvider);
195 195
        //body
196 196
        DataLayer dataLayer = new DataLayer(bodyDataProvider);
197
        GlazedListsEventLayer<CdmBase> eventLayer = new GlazedListsEventLayer<>(dataLayer, getEditorInput().getModel());
197
        dataLayer.registerCommandHandler(new VisualRefreshCommandHandler());
198
        GlazedListsEventLayer<CdmBase> eventLayer = new GlazedListsEventLayer<>(dataLayer, input.getModel());
198 199
        DefaultBodyLayerStack bodyLayer = new DefaultBodyLayerStack(eventLayer);
199 200
        selectionLayer = bodyLayer.getSelectionLayer();
200 201
        //column
......
233 234
        bodyLayer.getSelectionLayer().setSelectionModel(new RowSelectionModel<CdmBase>(bodyLayer.getSelectionLayer(), bodyDataProvider, new IRowIdAccessor<CdmBase>() {
234 235
            @Override
235 236
            public Serializable getRowId(CdmBase rowObject) {
236
                return getEditorInput().getModel().indexOf(rowObject);
237
                return input.getModel().indexOf(rowObject);
237 238
            }
238 239
        }));
239 240
	}
......
324 325
	    if(input!=null){
325 326
	        input.dispose();
326 327
	    }
328
	    dirty.setDirty(false);
327 329
	}
328 330

  
329 331
	public void save(IProgressMonitor monitor, boolean resetMerge) {
......
335 337
	    IStructuredSelection selection = getSelection();
336 338

  
337 339
        dirty.setDirty(false);
338
        getEditorInput().dispose();
339
        getEditorInput().bind();
340
        input.dispose();
341
        input.bind();
340 342
        conversation.commit(true);
341 343

  
342 344
        if (lastQuery != null){
......
360 362
                }
361 363
            }
362 364
            dirty.setDirty(false);
363
            getEditorInput().performSearch(query);
365
            input.performSearch(query);
364 366
            lastQuery = query;
365 367
        }
366 368
    }

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)