Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » NatTable » Problem with cell selection
Problem with cell selection [message #1043390] Wed, 17 April 2013 16:39 Go to next message
Nandita Uppalapati is currently offline Nandita UppalapatiFriend
Messages: 16
Registered: March 2013
Junior Member
I have a problem when I am selecting a cell within a nattable i.e right clicking or left clicking. I am sure I am doing something wrong but not sure what. I am using a custom data provider and I am able to move the scroll bar horizontally and vertically on the nattable so I am guessing nothing is wrong with the data provider, data layer and the viewport layer. But when I click on any cell suddenly my application hangs and the nattable vanishes when minimized and maximized. Here is the code corresponding to it

bodyDataProvider - my custom body data provider

DataLayer bodyDataLayer = new DataLayer(bodyDataProvider);
		 ColumnReorderLayer columnReorderLayer = new ColumnReorderLayer(bodyDataLayer);
		    ColumnHideShowLayer columnHideShowLayer = new ColumnHideShowLayer(columnReorderLayer);
		    SelectionLayer selectionLayer = new SelectionLayer(columnHideShowLayer);
		    ViewportLayer viewportLayer = new ViewportLayer(selectionLayer);

final FreezeLayer freezeLayer = new FreezeLayer(selectionLayer);
		final CompositeFreezeLayer compositeFreezeLayer = new CompositeFreezeLayer(freezeLayer,
				viewportLayer, selectionLayer);

columnHeaderDataProvider - custom column header data provider.

final ILayer columnHeaderLayer = new ColumnHeaderLayer(new DefaultColumnHeaderDataLayer(
				columnHeaderDataProvider), compositeFreezeLayer, selectionLayer);
		// Row header
		final IDataProvider rowHeaderDataProvider = new DefaultRowHeaderDataProvider(bodyDataProvider);
		final ILayer rowHeaderLayer = new RowHeaderLayer(new DefaultRowHeaderDataLayer(rowHeaderDataProvider),
				compositeFreezeLayer, selectionLayer);

		// Corner
		final DefaultCornerDataProvider cornerDataProvider = new DefaultCornerDataProvider(columnHeaderDataProvider,
		final CornerLayer cornerLayer = new CornerLayer(new DataLayer(cornerDataProvider), rowHeaderLayer,

		// Grid
		final GridLayer gridLayer = new GridLayer(compositeFreezeLayer, columnHeaderLayer, rowHeaderLayer, cornerLayer);

		patientCareResultsComposite.tblPCRResults = new NatTable(patientCareResultsComposite, gridLayer, false);

selectionLayer.addConfiguration(new DefaultSelectionLayerConfiguration());

		patientCareResultsComposite.tblPCRResults.addConfiguration(new DefaultNatTableStyleConfiguration());
		patientCareResultsComposite.tblPCRResults.addConfiguration(new HeaderMenuConfiguration(patientCareResultsComposite.tblPCRResults));
		patientCareResultsComposite.tblPCRResults.addConfiguration(new DefaultFreezeGridBindings());
		patientCareResultsComposite.tblPCRResults.addConfiguration(new BodyMenuConfiguration(patientCareResultsComposite.tblPCRResults, selectionLayer));

		 selectionLayer.setSelectedCell(2, 0);
		   patientCareResultsComposite.tblPCRResults.doCommand(new FreezeSelectionCommand());

		patientCareResultsComposite.tblPCRResults.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
Re: Problem with cell selection [message #1043912 is a reply to message #1043390] Thu, 18 April 2013 08:56 Go to previous message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2824
Registered: July 2012
Senior Member
Well not quite sure, but why are you adding the DefaultSelectionLayerConfiguration yourself? Creating the SelectionLayer the way you do should add it by default.
Previous Topic:"Friends of NatTable"
Next Topic:Treelist only contains the root
Goto Forum:

Current Time: Tue Sep 21 18:28:31 GMT 2021

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

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

Back to the top