Project

General

Profile

« Previous | Next » 

Revision 0fa0610e

Added by Patrick Plitzner over 6 years ago

ref #6913 Remove org.eclipse.ui dependency from AbstractUtility

  • fix changing type of description element

View differences:

eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/description/DescriptionElementDetailSection.java
9 9

  
10 10
package eu.etaxonomy.taxeditor.ui.section.description;
11 11

  
12
import org.eclipse.e4.ui.workbench.modeling.EPartService;
12 13
import org.eclipse.jface.action.Action;
14
import org.eclipse.jface.action.IAction;
13 15
import org.eclipse.jface.action.ToolBarManager;
14 16
import org.eclipse.jface.viewers.ISelectionProvider;
15 17
import org.eclipse.swt.SWT;
......
19 21
import eu.etaxonomy.cdm.model.description.DescriptionElementBase;
20 22
import eu.etaxonomy.cdm.model.description.Feature;
21 23
import eu.etaxonomy.cdm.model.description.TextData;
24
import eu.etaxonomy.taxeditor.model.AbstractUtility;
22 25
import eu.etaxonomy.taxeditor.model.MessagingUtils;
23 26
import eu.etaxonomy.taxeditor.store.CdmStore;
24 27
import eu.etaxonomy.taxeditor.store.StoreUtil;
......
27 30
import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
28 31
import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;
29 32
import eu.etaxonomy.taxeditor.ui.section.description.operation.ChangeDescriptionElementType;
33
import eu.etaxonomy.taxeditor.view.e4.details.DetailsPartE4;
30 34

  
31 35
/**
32 36
 * <p>DescriptionElementDetailSection class.</p>
......
62 66

  
63 67
		final String label = "Change to " + destinationString;
64 68

  
65
		Action addAction = new Action("Change Type", Action.AS_PUSH_BUTTON) {
69
		Action addAction = new Action("Change Type", IAction.AS_PUSH_BUTTON) {
66 70
			/* (non-Javadoc)
67 71
			 * @see org.eclipse.jface.action.Action#run()
68 72
			 */
......
71 75
				boolean confirmed = MessagingUtils.confirmDialog("Confirmation", "Do you really want to change to "
72 76
						+ destinationString + "? Current data will be lost.");
73 77
				if (confirmed) {
74
					// FIXME
75
					ChangeDescriptionElementType operation = new ChangeDescriptionElementType(label,
76
							getEntity(), StoreUtil.getDetailsView(), StoreUtil.getUndoContext());
77
					StoreUtil.executeOperation(operation);
78
					EPartService partService = formFactory.getContext().get(EPartService.class);
79
                    DetailsPartE4 detailsView = AbstractUtility.getDetailsView(partService);
80
                    ChangeDescriptionElementType operation = new ChangeDescriptionElementType(label,
81
							getEntity(), detailsView, StoreUtil.getUndoContext());
82
					AbstractUtility.executeOperation(operation);
78 83
				}
79 84
			}
80 85
		};

Also available in: Unified diff