Project

General

Profile

« Previous | Next » 

Revision 860fc861

Added by Patrick Plitzner over 6 years ago

ref #6907 Migrate factual data view

View differences:

eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/media/e4/MediaViewPartE4.java
29 29
import org.eclipse.swt.widgets.Composite;
30 30
import org.eclipse.swt.widgets.Tree;
31 31

  
32
import eu.etaxonomy.cdm.model.common.CdmBase;
33 32
import eu.etaxonomy.cdm.model.description.IDescribable;
34 33
import eu.etaxonomy.taxeditor.editor.MultiPageTaxonEditor;
35 34
import eu.etaxonomy.taxeditor.editor.l10n.Messages;
......
40 39
import eu.etaxonomy.taxeditor.model.IPartContentHasDetails;
41 40
import eu.etaxonomy.taxeditor.model.IPartContentHasMedia;
42 41
import eu.etaxonomy.taxeditor.model.IPartContentHasSupplementalData;
43
import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
44 42
import eu.etaxonomy.taxeditor.view.e4.AbstractCdmEditorPartE4;
45 43
import eu.etaxonomy.taxeditor.view.e4.details.DetailsPartE4;
46 44
import eu.etaxonomy.taxeditor.view.e4.supplementaldata.SupplementalDataPartE4;
......
52 50
 *
53 51
 */
54 52
public class MediaViewPartE4 extends AbstractCdmEditorPartE4
55
        implements IPartContentHasDetails, IPartContentHasSupplementalData, IPostOperationEnabled {
53
        implements IPartContentHasDetails, IPartContentHasSupplementalData {
56 54

  
57 55
    private ISelectionChangedListener selectionChangedListener;
58 56

  
......
76 74

  
77 75
        //create context menu
78 76
        menuService.registerContextMenu(viewer.getControl(), "eu.etaxonomy.taxeditor.editor.popupmenu.mediaview");
77

  
79 78
	}
80 79

  
81 80
	@Inject
......
117 116
	        }
118 117
	        else if(firstElement!=null
119 118
	                && firstElement instanceof IDescribable<?>){
120
	            showViewer((IStructuredSelection) selection, activePart, viewer);
119
	            showViewer(structuredSelection, activePart, viewer);
121 120
	            return;
122 121
	        }
123 122
	    }
......
134 133
	        StructuredSelection selection = new StructuredSelection(object);
135 134
	        viewer.setSelection(selection, true);
136 135
	    }
137
//	    //TODO: should be replaced with the possibility to set views dirty
138
//	    // when we move to Eclipse 4
139
//	    // take a look at ISaveblePart
140
//	    if(part instanceof BulkEditor && !(object instanceof SpecimenOrObservationBase<?>)){
141
//	        ((BulkEditor) part).forceDirty();
142
//	        IStructuredSelection selection = (IStructuredSelection) ((BulkEditor) part).getSelectionProvider().getSelection();
143
//            ((BulkEditor) part).changed(selection.getFirstElement());
144
//
145
//	    }
146
//	    if (part instanceof E4PartWrapper){
147
//	    	part = WorkbenchUtility.getE4WrappedPart(part);
148
//	    	if (part instanceof IDirtyMarkable){
149
//	    		 StructuredSelection selection = new StructuredSelection(object);
150
//	    		((IDirtyMarkable)part).changed(selection.getFirstElement());
151
//	    	}
152
//	    }
153

  
154 136
	    super.changed(object);
155 137
	}
156 138

  
......
163 145
        return viewer;
164 146
    }
165 147

  
166
    /**
167
     * {@inheritDoc}
168
     */
169
    @Override
170
    public boolean postOperation(CdmBase objectAffectedByOperation) {
171
        changed(objectAffectedByOperation);
172
        return true;
173
    }
174

  
175
    /**
176
     * {@inheritDoc}
177
     */
178
    @Override
179
    public boolean onComplete() {
180
        viewer.refresh();
181
        return true;
182
    }
183 148
}

Also available in: Unified diff