Project

General

Profile

« Previous | Next » 

Revision da0bf48a

Added by Patrick Plitzner over 6 years ago

ref #6911, #6925 Clear views when selection providing editor is closed

View differences:

eu.etaxonomy.taxeditor.workbench/src/main/java/eu/etaxonomy/taxeditor/workbench/WorkbenchUtility.java
11 11
import java.lang.reflect.Field;
12 12

  
13 13
import org.eclipse.e4.ui.model.application.ui.basic.MPart;
14
import org.eclipse.ui.ISaveablePart;
14 15
import org.eclipse.ui.internal.E4PartWrapper;
15 16
import org.eclipse.ui.internal.e4.compatibility.CompatibilityEditor;
16 17
import org.eclipse.ui.internal.e4.compatibility.CompatibilityView;
17 18

  
19
import eu.etaxonomy.taxeditor.workbench.part.IE4SavablePart;
20
import eu.etaxonomy.taxeditor.workbench.part.ISelectionElementEditingPart;
21

  
18 22
/**
19 23
 * Utility class for e4 workbench related operations
20 24
 * @author pplitzner
......
57 61
        }
58 62
        return object;
59 63
    }
64

  
65
    public static Object findSavablePart(ISelectionElementEditingPart part){
66
        Object selectionProvidingPart = getE4WrappedPart(part.getSelectionProvidingPart());
67
        if(selectionProvidingPart instanceof ISelectionElementEditingPart){
68
            return findSavablePart((ISelectionElementEditingPart) selectionProvidingPart);
69
        }
70
        else if(selectionProvidingPart instanceof ISaveablePart || selectionProvidingPart instanceof IE4SavablePart || selectionProvidingPart instanceof MPart){
71
            return selectionProvidingPart;
72
        }
73
        return null;
74
    }
60 75
}

Also available in: Unified diff