I'm developing a plugin for Eclipse. I'd like it to suggest the user to save unsaved resources before running. This is in a similar behavior to how eclipse suggest you to save unsaved files before debugging.
In essence, I would like to open the following dialog:
Any help will be greatly appreciate.
如果您在该对话框上点击alt-shift-F1,您将看到它所在的插件,然后您可以触发该操作,或直接调用该代码。
Using dplass's tip I reached this solution, which works perfectly. I'm putting it here for other people who might encounter this problem:
import org.eclipse.core.resources.IProject;
@SuppressWarnings("restriction")
public class SaveOpenFilesHandler extends org.eclipse.debug.internal.ui.launchConfigurations.SaveScopeResourcesHandler
{
public void showSaveDialog(IProject project)
{
super.showSaveDialog(new IProject[] {project}, true, true);
super.doSave();
}
}
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.