Skip to main content


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 21:23 Go to next message
McNuggets Missing name is currently offline McNuggets Missing nameFriend
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 21:51 Go to previous messageGo to next message
Francis Upton IV is currently offline Francis Upton IVFriend
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 22:26 Go to previous message
McNuggets Missing name is currently offline McNuggets Missing nameFriend
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 Apr 18 20:21:10 GMT 2024

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

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

Back to the top