Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » CommonNavigator: allowing the selection of one element only
CommonNavigator: allowing the selection of one element only [message #714952] Thu, 11 August 2011 17:23 Go to next message
McNuggets Missing name is currently offline McNuggets Missing name
Messages: 12
Registered: August 2011
Junior Member
Hi,

I extend a CommonNavigtor for a view. This view is intended to serve as the master in a master-detail pattern (I have a second view to show the detail). Therefore, I need to be able to select only 1 item in my CommonNavigator view. How to achieve that?

Thanks,

McNuggets
Re: CommonNavigator: allowing the selection of one element only [message #714956 is a reply to message #714952] Thu, 11 August 2011 17:51 Go to previous messageGo to next message
Francis Upton IV is currently offline Francis Upton IV
Messages: 472
Registered: July 2009
Location: Oakland, CA
Senior Member
You will need to subclass the CommonNavigator class and override this method:

	protected CommonViewer createCommonViewerObject(Composite aParent) {
		return new CommonViewer(getViewSite().getId(), aParent,
				SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL);
	}


Change the SWT.MULTI to SWT.SINGLE


Re: CommonNavigator: allowing the selection of one element only [message #714962 is a reply to message #714956] Thu, 11 August 2011 18:26 Go to previous message
McNuggets Missing name is currently offline McNuggets Missing name
Messages: 12
Registered: August 2011
Junior Member
Hello,

So thanks again, this is perfect, it just works fine with SWT.SINGLE.

Cheers
Previous Topic:CommonNavigator: removing the "Link with Editor" button
Next Topic:Setting Status Line.
Goto Forum:
  


Current Time: Thu Jul 24 02:35:18 EDT 2014

Powered by FUDForum. Page generated in 0.14711 seconds