本文整理汇总了Java中org.eclipse.e4.ui.workbench.modeling.EPartService.saveAll方法的典型用法代码示例。如果您正苦于以下问题:Java EPartService.saveAll方法的具体用法?Java EPartService.saveAll怎么用?Java EPartService.saveAll使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.e4.ui.workbench.modeling.EPartService
的用法示例。
在下文中一共展示了EPartService.saveAll方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: execute
import org.eclipse.e4.ui.workbench.modeling.EPartService; //导入方法依赖的package包/类
@Execute
public void execute(EPartService partService, final IWorkbench workbench,
Shell shell, DBManager dbManager, UISynchronize sync) {
boolean saveAll = false;
boolean close = false;
if (!partService.getDirtyParts().isEmpty()) {
saveAll = MessageDialog.openConfirm(shell, "Unsaved Data",
"Unsaved data, do you want to save and restart?");
} else {
close = MessageDialog.openConfirm(shell, "Restart",
"Restart application?");
}
if (saveAll) {
partService.saveAll(false);
}
if (close || saveAll) {
try {
if (dbManager.optimizationRequired()) {
// ask user if optimize
dbManager.optimize();
}
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
sync.asyncExec(new Runnable() {
@Override
public void run() {
workbench.restart();
}
});
}
}
示例2: close
import org.eclipse.e4.ui.workbench.modeling.EPartService; //导入方法依赖的package包/类
@Override
public boolean close(MWindow window) {
EPartService partService = window.getContext().get(EPartService.class);
partService.saveAll(true);
return true;
}
示例3: execute
import org.eclipse.e4.ui.workbench.modeling.EPartService; //导入方法依赖的package包/类
@Execute
void execute(EPartService partService) {
partService.saveAll(true);
}
示例4: execute
import org.eclipse.e4.ui.workbench.modeling.EPartService; //导入方法依赖的package包/类
@Execute
public void execute(EPartService partService) {
partService.saveAll(false);
}
示例5: execute
import org.eclipse.e4.ui.workbench.modeling.EPartService; //导入方法依赖的package包/类
@Execute
void execute(EPartService partService) {
partService.saveAll(false);
}
示例6: execute
import org.eclipse.e4.ui.workbench.modeling.EPartService; //导入方法依赖的package包/类
@Execute
void execute(final EPartService partService) {
LOGGER.info(this.getClass().getSimpleName() + " called.");
partService.saveAll(false);
}
示例7: execute
import org.eclipse.e4.ui.workbench.modeling.EPartService; //导入方法依赖的package包/类
@Execute
public void execute(IWorkbench workbench, EPartService partService){
partService.saveAll(true);
workbench.close();
}