Skip to main content


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 KiplingFriend
Messages: 260
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 FauthFriend
Messages: 2902
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:CompositeMatcherEditor - how to add dropdowns to few column only?
Next Topic:How to add own CellPainters and Editors to the FilterRowHeaderComposite?
Goto Forum:
  


Current Time: Thu Apr 25 14:08:03 GMT 2024

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

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

Back to the top