Project

General

Profile

Revision 0bd0e199

ID0bd0e19900b4cc4a909db538a00a3c5d9dee8ec6
Parent c175c2ff
Child 4ae1033f

Added by Patrick Plitzner almost 3 years ago

ref #6595 Remove exception from editor opening

View differences:

eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/EditorUtil.java
84 84
        derivateView.init(input);
85 85
    }
86 86

  
87
	public static void openTaxonNodeE4(UUID taxonNodeUuid, EModelService modelService, EPartService partService, MApplication application) throws Exception {
87
	public static void openTaxonNodeE4(UUID taxonNodeUuid, EModelService modelService, EPartService partService, MApplication application) {
88 88
	    TaxonEditorInputE4 input = TaxonEditorInputE4.NewInstance(taxonNodeUuid);
89 89
	    openNameEditor_internal(input, modelService, partService, application);
90 90
	}
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/e4/TaxonEditorInputE4.java
184 184
        }
185 185
    }
186 186

  
187
    public static TaxonEditorInputE4 NewInstance(UUID taxonNodeUuid) throws Exception {
187
    public static TaxonEditorInputE4 NewInstance(UUID taxonNodeUuid) {
188 188
        return new TaxonEditorInputE4(taxonNodeUuid, CdmType.TAXON_NODE);
189 189

  
190 190
    }
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/e4/handler/ChangeSynonymToAcceptedTaxonHandlerE4.java
25 25
import org.eclipse.e4.ui.workbench.modeling.EPartService;
26 26
import org.eclipse.jface.viewers.IStructuredSelection;
27 27
import org.eclipse.swt.widgets.Shell;
28
import org.eclipse.ui.PartInitException;
29 28

  
30 29
import eu.etaxonomy.cdm.model.common.CdmBase;
31 30
import eu.etaxonomy.cdm.model.name.HomotypicalGroup;
......
40 39
import eu.etaxonomy.taxeditor.editor.name.handler.NameEditorMenuPropertyTester;
41 40
import eu.etaxonomy.taxeditor.editor.name.operation.ChangeSynonymToAcceptedTaxonOperation;
42 41
import eu.etaxonomy.taxeditor.model.AbstractUtility;
43
import eu.etaxonomy.taxeditor.model.MessagingUtils;
44 42
import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
45 43
import eu.etaxonomy.taxeditor.ui.dialog.selection.TaxonNodeSelectionDialog;
46 44

  
......
121 119
			// Open new unsaved editor with existing taxon's parent as temporary parent
122 120
			TaxonNode newNode = (TaxonNode) objectAffectedByOperation;
123 121

  
124
			try {
125
				EditorUtil.openTaxonNodeE4(newNode.getUuid(), modelService, partService, application);
126
			} catch (PartInitException e) {
127
				e.printStackTrace();
128
			} catch (Exception e) {
129
				MessagingUtils.warningDialog(Messages.ChangeSynonymToAcceptedTaxonHandler_CREATE_FAILURE, this, e.getMessage());
130
			}
122
			EditorUtil.openTaxonNodeE4(newNode.getUuid(), modelService, partService, application);
131 123
		}
132 124
		return true;
133 125
	}
......
147 139
                NameEditorMenuPropertyTester.isNotHomotypicSynonymOfAcceptedTaxon(selectedElement)
148 140
                && !NameEditorMenuPropertyTester.isAccepted(selectedElement)
149 141
                && !NameEditorMenuPropertyTester.isMisapplication(selectedElement);
150
//        menuItem.setVisible(canExecute);
142
        menuItem.setVisible(canExecute);
151 143
        return canExecute;
152 144
    }
153 145

  
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/e4/handler/MoveDescriptionElementsHandlerE4.java
30 30
import org.eclipse.jface.viewers.IStructuredSelection;
31 31
import org.eclipse.swt.widgets.Display;
32 32
import org.eclipse.swt.widgets.Shell;
33
import org.eclipse.ui.PartInitException;
34 33

  
35 34
import eu.etaxonomy.cdm.api.service.IDescriptionService;
36 35
import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
......
48 47
import eu.etaxonomy.taxeditor.editor.view.descriptive.operation.MoveDescriptionElementsOperation;
49 48
import eu.etaxonomy.taxeditor.model.AbstractUtility;
50 49
import eu.etaxonomy.taxeditor.model.FeatureNodeContainer;
51
import eu.etaxonomy.taxeditor.model.MessagingUtils;
52 50
import eu.etaxonomy.taxeditor.operation.AbstractPostOperation;
53 51
import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
54 52
import eu.etaxonomy.taxeditor.store.CdmStore;
......
159 157
            public void run() {
160 158
                //AbstractUtility.close(editor.getMultiPageTaxonEditor());
161 159

  
162
                try {
163 160
                    //FIXME E4 migrate
164 161
//                    MultiPageTaxonEditor possibleOpenEditor = (MultiPageTaxonEditor) EditorUtil.findEditorByTaxonNodeUuid(newAcceptedTaxonNodeUuid);
165 162
//                    if(possibleOpenEditor != null){
166 163
//                        AbstractUtility.close(possibleOpenEditor);
167 164
//                    }
168
                    EditorUtil.openTaxonNodeE4(newAcceptedTaxonNodeUuid, modelService, partService, application);
169
                } catch (PartInitException e) {
170
                    MessagingUtils.error(this.getClass(), e);
171
                    throw new RuntimeException(e);
172
                } catch (Exception e) {
173
                    MessagingUtils.warningDialog(Messages.MoveDescriptionElementsHandler_CREATE_FAILURE, this, e.getMessage());
174
                }
165
                EditorUtil.openTaxonNodeE4(newAcceptedTaxonNodeUuid, modelService, partService, application);
175 166
            }
176 167

  
177 168
        });

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)