use of org.eclipse.ui.internal.WorkbenchWindow.WWinPartServiceSaveHandler in project eclipse.platform.ui by eclipse-platform.
the class Workbench method saveAllParts.
private boolean saveAllParts(boolean confirm, boolean closing) {
// Code to handle dirtied Editors and E4 parts too.
EPartService partService = e4Context.get(EPartService.class);
if (partService != null) {
Collection<MPart> parts = getDirtyMParts();
if (parts != null && parts.size() > 0) {
MPart selected = null;
for (MPart part : parts) {
selected = part;
break;
}
EModelService modelService = e4Context.get(EModelService.class);
if (modelService != null) {
IEclipseContext context = modelService.getContainingContext(selected);
if (context != null) {
ISaveHandler saveHandler = context.get(ISaveHandler.class);
if (saveHandler != null) {
if (saveHandler instanceof WWinPartServiceSaveHandler) {
try {
return ((WWinPartServiceSaveHandler) saveHandler).saveParts(parts, confirm, true, true);
} catch (UnsupportedOperationException e) {
// do nothing
}
}
}
}
}
}
}
// of E4 parts too.
return saveAllEditors(confirm, closing);
}
Aggregations