質問

We have developed an Eclipse RCP Applicatoin. We have a requirement to check for all the dirty editors and prompt the user to save the same before we launch our dialog.

Please let me know if we have any reusable dialog to achieve the same.

Thanks in Advance, Harish

役に立ちましたか?

解決 2

Use org.eclipse.ui.ide.IDE.saveAllEditors:

IResource [] resources = array of IFile, IFolder, IProject 

boolean ok = IDE.saveAllEditors(resources, confirm);

From the JavaDoc:

Save all dirty editors in the workbench whose editor input is a child resource of one of the IResource's provided. Opens a dialog to prompt the user if confirm is true. Return true if successful. Return false if the user has canceled the command.

他のヒント

PlatformUI.getWorkbench().saveAllEditors(confirm);

Saves all dirty editors in the workbench. Opens a dialog to prompt the user if confirm is true

Source: http://www.eclipse.org/forums/index.php/t/95433/ and javadoc

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top