Project

General

Profile

« Previous | Next » 

Revision a3bbf873

Added by Katja Luther over 6 years ago

catch widget is disposed exceptions

View differences:

eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/e4/details/DetailsPartE4.java
14 14

  
15 15
import org.eclipse.e4.core.contexts.ContextInjectionFactory;
16 16
import org.eclipse.e4.core.contexts.IEclipseContext;
17
import org.eclipse.e4.core.services.log.Logger;
17 18
import org.eclipse.e4.ui.model.application.ui.basic.MPart;
18 19
import org.eclipse.jface.viewers.IStructuredSelection;
20
import org.eclipse.swt.SWTException;
19 21
import org.eclipse.swt.widgets.Composite;
20 22

  
21 23
import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;
......
25 27
import eu.etaxonomy.taxeditor.model.FeatureNodeContainer;
26 28
import eu.etaxonomy.taxeditor.model.IPartContentHasDetails;
27 29
import eu.etaxonomy.taxeditor.model.IPartContentHasSupplementalData;
30
import eu.etaxonomy.taxeditor.model.MessagingUtils;
31
import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
28 32
import eu.etaxonomy.taxeditor.view.e4.AbstractCdmEditorPartE4;
29 33
import eu.etaxonomy.taxeditor.view.e4.supplementaldata.SupplementalDataPartE4;
30 34
import eu.etaxonomy.taxeditor.workbench.part.ISelectionElementEditingPart;
......
35 39
 *
36 40
 */
37 41
public class DetailsPartE4 extends AbstractCdmEditorPartE4 implements IPartContentHasSupplementalData {
38

  
39
    @Inject
42
	@Inject
43
	private Logger logger;
44
    
45
	@Inject
40 46
    public DetailsPartE4() {
41 47
    }
42 48

  
......
108 114
    protected void showEmptyPage() {
109 115
        super.showEmptyPage();
110 116
        if(viewer!=null && viewer.getControl()!=null && !viewer.getControl().isDisposed() ){
111
            ((DetailsViewerE4)viewer).destroySections();
117
        	try{
118
        		((DetailsViewerE4)viewer).destroySections();
119
        	}catch(SWTException e){
120
        		if (PreferencesUtil.isShowUpWidgetIsDisposedMessages() && e.getMessage().equals("Widget is disposed")){
121
                    MessagingUtils.errorDialog("Widget is disposed",
122
                            null,
123
                            MessagingUtils.WIDGET_IS_DISPOSED_MESSAGE,
124
                            null,
125
                            e,
126
                            true);
127

  
128
                }
129
        	}
112 130
        }
113 131
    }
114 132

  

Also available in: Unified diff