[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.newcomer] Re: Closing eclipse without clicking close button?

Thanks alot Eric..It worked.

Eric Rizzo wrote:

On 4/13/2009 8:50 AM, ankit baphna wrote:
Hi all,

How can I close eclipse without clicking on the close button or closing
it from task manager? Is there any function which I can call from my
program to close the eclipse?

Something like this should do it:

final IWorkbench workbench = PlatformUI.getWorkbench();
if (workbench != null) {
	final Display display = workbench.getDisplay();
	display.asyncExec(new Runnable() {
		public void run() {
			if (!display.isDisposed()) {
				workbench.close();
			}
		}
	});
}