Eclipse Java Plugin Development - programmatically save all project files

I am developing a plugin for Eclipse. I would like it to prompt the user to save unsaved resources before starting. This is similar to how eclipse prompts you to save unsaved files before debugging.

In essence, I would like to open the following dialog:

alt text

Any help would be greatly appreciated.

+3
source share
2 answers

If you press alt-shift-F1 in this dialog box, you will see which plug-in it is in, and then you can call this action or call this code directly.

+5
source

dplass, , . , :

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();
       }
}
0

Source: https://habr.com/ru/post/1746865/


All Articles