Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » NatTable » Is it possible to add an SWT Widget to a Layer?
Is it possible to add an SWT Widget to a Layer? [message #1065282] Tue, 25 June 2013 08:43 Go to next message
Alex Kipling is currently offline Alex Kipling
Messages: 252
Registered: July 2012
Senior Member
I would like to add an SWT Composite to a CompositeLayer.
So that the CompositeLayer is composed of two Layers.
And the widget ocupes the top layer.
The second layer would then be filled by a table.
Re: Is it possible to add an SWT Widget to a Layer? [message #1065299 is a reply to message #1065282] Tue, 25 June 2013 09:38 Go to previous message
Dirk Fauth is currently offline Dirk Fauth
Messages: 1289
Registered: July 2012
Senior Member
Then do it! You just need a painter that is able to render the control in the table like e.g.

Control myControl = new Label(natTable, SWT.NONE);

ICellPainter cellPainter = new AbstractCellPainter() {
	public void paintCell(ILayerCell cell, GC gc, Rectangle bounds, IConfigRegistry configRegistry) {
		myControl.setBounds(bounds);
	}
						
	public int getPreferredWidth(ILayerCell cell, GC gc, IConfigRegistry configRegistry) {
		return myControl.getBounds().y;
	}
						
	public int getPreferredHeight(ILayerCell cell, GC gc, IConfigRegistry configRegistry) {
		return myControl.getBounds().x;
						}
};
Previous Topic:GroupBy example has row count problems
Next Topic:CompositeMatcherEditor - how to add dropdowns to few column only?
Goto Forum:
  


Current Time: Fri Sep 19 11:54:28 GMT 2014

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

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