Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » close editor in it's init method
close editor in it's init method [message #634845] Sun, 24 October 2010 15:05 Go to next message
Sebastian  is currently offline Sebastian
Messages: 22
Registered: September 2010
Junior Member
hey. i want to close an editor if any exceptions occur during initialization.

the call to page.closeEditor(this, false) throws exceptions though. is there another way to do this ?

thanks Smile
Re: close editor in it's init method [message #634854 is a reply to message #634845] Sun, 24 October 2010 16:52 Go to previous message
Devi Vara Prasad Bandaru is currently offline Devi Vara Prasad Bandaru
Messages: 98
Registered: March 2010
Location: Hyderabad
Member

Run the code in aysnc thread this will make sure that close method is called after the editor initialization is completed.


Display.getDefault().asyncExec(new Runnable() {
		@Override
		public void run() {
			getSite().getPage().closeEditor(ShapesEditor.this, false); 
		}
	});




Previous Topic:Could not detect registered XULRunner to use
Next Topic:GEF AND EMF
Goto Forum:
  


Current Time: Thu Oct 23 11:56:26 GMT 2014

Powered by FUDForum. Page generated in 0.33970 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software