Revision b692de70
Added by Patrick Plitzner over 6 years ago
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/model/AbstractUtility.java | ||
---|---|---|
34 | 34 |
import org.eclipse.core.runtime.SubProgressMonitor; |
35 | 35 |
import org.eclipse.core.runtime.jobs.ISchedulingRule; |
36 | 36 |
import org.eclipse.core.runtime.jobs.Job; |
37 |
import org.eclipse.e4.ui.workbench.modeling.EPartService; |
|
37 | 38 |
import org.eclipse.jface.action.IStatusLineManager; |
38 | 39 |
import org.eclipse.jface.operation.IRunnableWithProgress; |
39 | 40 |
import org.eclipse.jface.resource.ColorRegistry; |
... | ... | |
552 | 553 |
} |
553 | 554 |
|
554 | 555 |
public static Object getActiveE4Editor() { |
556 |
//FIXME E4 this can be simplified/removed when fully migrated |
|
555 | 557 |
if(getActivePage()!=null){ |
556 | 558 |
IEditorPart activeEditor = getActivePage().getActiveEditor(); |
557 |
Object wrappedPart = WorkbenchUtility.getE4WrappedPart(getActivePage().getActivePart()); |
|
559 |
Object activePart = getActivePage().getActivePart(); |
|
560 |
if(activeEditor==null){ |
|
561 |
activePart = TaxeditorStorePlugin.getDefault().getWorkbench().getService(EPartService.class).getActivePart(); |
|
562 |
} |
|
563 |
Object wrappedPart = WorkbenchUtility.getE4WrappedPart(activePart); |
|
558 | 564 |
return wrappedPart!=null?wrappedPart:activeEditor; |
559 | 565 |
} |
560 | 566 |
return null; |
Also available in: Unified diff
ref #6595 Fix active part fetching