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 Uppalapati
Messages: 14
Registered: March 2013
Junior Member
Hi,
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,
				rowHeaderDataProvider);
		final CornerLayer cornerLayer = new CornerLayer(new DataLayer(cornerDataProvider), rowHeaderLayer,
				columnHeaderLayer);

		// 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());
		// ADD BODY MENU CONFIG
		patientCareResultsComposite.tblPCRResults.addConfiguration(new BodyMenuConfiguration(patientCareResultsComposite.tblPCRResults, selectionLayer));

		patientCareResultsComposite.tblPCRResults.configure();
		 selectionLayer.setSelectedCell(2, 0);
		   patientCareResultsComposite.tblPCRResults.doCommand(new FreezeSelectionCommand());
		   //patientCareResultsComposite.tblPCRResults.updateResize();
		   selectionLayer.clear();

		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 Fauth
Messages: 1349
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:Bug PaddingDecorator?
Next Topic:Nattable in a eclipse Plugin
Goto Forum:
  


Current Time: Fri Oct 31 06:28:28 GMT 2014

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

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