Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » NatTable » Disable RowHeader(How to do that)
Disable RowHeader [message #1064810] Fri, 21 June 2013 08:21 Go to next message
Nicholas Karwath is currently offline Nicholas KarwathFriend
Messages: 10
Registered: July 2009
Junior Member
I use a DefaultGridLayer inside a NatTable and need to disable the row headers completly. The RowHeaderLayer seems to be obligatory. Is there a configuration option or any other way to achieve that behaviour?
Re: Disable RowHeader [message #1064821 is a reply to message #1064810] Fri, 21 June 2013 08:44 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 1433
Registered: July 2012
Senior Member
No there isn't. A grid consists of the 4 regions. If you don't need the row header you should consider creating a CompositeLayer and set the column header and the body just like the GridLayer does for the 4 regions. There are several posts on that in this forum.
Re: Disable RowHeader [message #1065124 is a reply to message #1064821] Mon, 24 June 2013 12:51 Go to previous message
Nicholas Karwath is currently offline Nicholas KarwathFriend
Messages: 10
Registered: July 2009
Junior Member
Thanks for giving the point, Dirk. Here is the code that worked for me.

        DataLayer bodyDataLayer = new DataLayer(new RichTableDataProvider(model));
        DefaultBodyLayerStack bodyLayer = new DefaultBodyLayerStack(bodyDataLayer);

        ColumnOverrideLabelAccumulator columnLabelAccumulator = new ColumnOverrideLabelAccumulator(bodyLayer);
        bodyLayer.setConfigLabelAccumulator(columnLabelAccumulator);
        registerColumnLabels(columnLabelAccumulator);

        DataLayer colDataLayer = new DataLayer(new RichTableColumnDataProvider(model));
        SelectionLayer selLayer = new SelectionLayer(colDataLayer);
        ColumnHeaderLayer columnHeaderLayer = new ColumnHeaderLayer(colDataLayer, bodyDataLayer, selLayer);

        CompositeLayer compositelayer = new CompositeLayer(1, 2);
        compositelayer.setChildLayer(GridRegion.COLUMN_HEADER, columnHeaderLayer, 0, 0);
        compositelayer.setChildLayer(GridRegion.BODY, bodyLayer, 0, 1);

        NatTable table = new NatTable(pParent, compositelayer, false);


[Updated on: Mon, 24 June 2013 12:52]

Report message to a moderator

Previous Topic:NatTable bold border between rows?
Next Topic:GroupBy example has row count problems
Goto Forum:
  


Current Time: Fri Dec 19 13:54:43 GMT 2014

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

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