Project

General

Profile

« Previous | Next » 

Revision c8cdc672

Added by Patrick Plitzner over 6 years ago

ref #6595 Propagate dirty state handling

View differences:

eu.etaxonomy.taxeditor.editor/fragment.e4xmi
96 96
      <handlers xmi:id="_DgC2MIG5EeehlNPrK_b5JA" elementId="eu.etaxonomy.taxeditor.editor.view.descriptive.e4.handler.DeleteHandler" contributionURI="bundleclass://eu.etaxonomy.taxeditor.editor/eu.etaxonomy.taxeditor.editor.view.descriptive.e4.handler.DeleteHandlerE4" command="_AqgMcIG5EeehlNPrK_b5JA"/>
97 97
      <handlers xmi:id="_o7njgIy0EeeQaL4TL8oz7Q" elementId="eu.etaxonomy.taxeditor.editor.view.descriptive.e4.handler.CreateDescriptionElementHandlerE4" contributionURI="bundleclass://eu.etaxonomy.taxeditor.editor/eu.etaxonomy.taxeditor.editor.view.descriptive.e4.handler.CreateDescriptionElementHandlerE4" command="_8ccfgIHXEeehlNPrK_b5JA"/>
98 98
      <handlers xmi:id="_xJ3XUIy0EeeQaL4TL8oz7Q" elementId="eu.etaxonomy.taxeditor.editor.view.descriptive.e4.handler.ToggleShowOnlyIndividualAssociationsHandlerE4" contributionURI="bundleclass://eu.etaxonomy.taxeditor.editor/eu.etaxonomy.taxeditor.editor.view.descriptive.e4.handler.ToggleShowOnlyIndividualAssociationsHandlerE4" command="_4eDWoIy0EeeQaL4TL8oz7Q"/>
99
      <handlers xmi:id="_Te6qAIy3EeeQaL4TL8oz7Q" elementId="eu.etaxonomy.taxeditor.editor.factualData.saveHandler" contributionURI="bundleclass://eu.etaxonomy.taxeditor.workbench/eu.etaxonomy.taxeditor.workbench.SaveHandler" command="_majwMEaQEeeXMc6kSYO7Xg"/>
99 100
      <menus xsi:type="menu:PopupMenu" xmi:id="_HxxDt4GxEeehlNPrK_b5JA" elementId="eu.etaxonomy.taxeditor.editor.popupmenu.factualDataView">
100 101
        <visibleWhen xsi:type="ui:CoreExpression" xmi:id="_bMfdYIG5EeehlNPrK_b5JA" coreExpressionId="isCdmStoreConnected"/>
101 102
        <children xsi:type="menu:HandledMenuItem" xmi:id="_jvmnkIGxEeehlNPrK_b5JA" elementId="eu.etaxonomy.taxeditor.editor.handledmenuitem.factualData.addDescription" label="%command.label.27" command="_gE3lwIGyEeehlNPrK_b5JA"/>
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/EditorUtil.java
365 365
	            return false;
366 366
	        }
367 367

  
368
	        editor.doSave(AbstractUtility.getMonitor());
368
	        editor.save(AbstractUtility.getMonitor());
369 369
	    }
370 370
	    return true;
371 371
	}
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/e4/TaxonNameEditorE4.java
52 52
import eu.etaxonomy.cdm.model.taxon.Taxon;
53 53
import eu.etaxonomy.cdm.model.taxon.TaxonBase;
54 54
import eu.etaxonomy.cdm.model.taxon.TaxonNode;
55
import eu.etaxonomy.cdm.model.taxon.TaxonRelationship;
55 56
import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap;
56 57
import eu.etaxonomy.taxeditor.editor.ISecuredEditor;
57 58
import eu.etaxonomy.taxeditor.editor.e4.TaxonEditorInputE4;
......
75 76
import eu.etaxonomy.taxeditor.preference.Resources;
76 77
import eu.etaxonomy.taxeditor.security.RequiredPermissions;
77 78
import eu.etaxonomy.taxeditor.store.CdmStore;
79
import eu.etaxonomy.taxeditor.workbench.part.IE4SavablePart;
78 80

  
79 81
/**
80 82
 *
......
84 86
 */
85 87
public class TaxonNameEditorE4 implements IConversationEnabled, IDirtyMarkable, IPartContentHasDetails,
86 88
        IPartContentHasSupplementalData, IPartContentHasMedia, IPartContentHasFactualData, IPartChangeListener,
87
        ISelectionListener, ISecuredEditor, IPostOperationEnabled {
89
        ISelectionListener, ISecuredEditor, IPostOperationEnabled, IE4SavablePart {
88 90

  
89 91
	private Taxon taxon;
90 92

  
......
325 327
	}
326 328

  
327 329
	/** {@inheritDoc} */
328
	@Persist
329
	public void doSave(IProgressMonitor monitor) {
330
	@Override
331
    @Persist
332
	public void save(IProgressMonitor monitor) {
330 333

  
331 334
	    monitor.beginTask(Messages.TaxonNameEditor_SAVING_NAMES, getGroupedContainers().size());
332 335
	    if (!conversation.isBound()) {
......
604 607

  
605 608
    @Override
606 609
    public void changed(Object element) {
607
        // TODO Auto-generated method stub
610
        // setDirty(true);
611
        // if the attribute is null then do not set the dirty flag -> hotfix for the problem that for tasks done in service methods the changes are saved automatically
612
        if (element != null){
613
            dirty.setDirty(true);
614
        }
608 615

  
616
        if (element instanceof TaxonBase) {
617
            AbstractGroupedContainerE4 container = getContainer((TaxonBase) element);
618
            if (container != null) {
619
                container.refresh();
620
            }
621
        }
622
        if (element instanceof TaxonRelationship) {
623
            AbstractGroupedContainerE4 container = getContainer(((TaxonRelationship) element).getFromTaxon());
624
            if (container != null) {
625
                container.refresh();
626
            }
627
        }
628
        //refresh part title
629
        //TODO: refresh taxon node in taxon navigator
630
        //FIXME E4 migrate
631
//        setPartName();
609 632
    }
610 633

  
611 634
    @Override
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/e4/handler/ChangeSynonymToAcceptedTaxonHandlerE4.java
106 106
		// Redraw existing editor
107 107
		((IPostOperationEnabled) editor).postOperation(null);
108 108

  
109
		editor.doSave(AbstractUtility.getMonitor());
109
		editor.save(AbstractUtility.getMonitor());
110 110

  
111 111
		if (objectAffectedByOperation instanceof TaxonNode) {
112 112

  
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/e4/handler/SwapSynonymAndAcceptedHandlerE4.java
86 86
        // Redraw existing editor
87 87
        // ((IPostOperationEnabled) editor).postOperation(null);
88 88

  
89
        editor.doSave(AbstractUtility.getMonitor());
89
        editor.save(AbstractUtility.getMonitor());
90 90
        partService.hidePart(activePart);
91 91

  
92 92
        if (objectAffectedByOperation instanceof Taxon) {

Also available in: Unified diff