문제

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