Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » NatTable » [SOLVED] CellEditor in a column header?
[SOLVED] CellEditor in a column header? [message #1123149] Wed, 02 October 2013 08:44 Go to next message
Jens Rabe is currently offline Jens RabeFriend
Messages: 81
Registered: September 2013
Member
I need a combo box cell editor in a column header of a NatTable. I registered it as I would register it for a table body, however on clicking the cell, the default behaviour is triggered, i.e., instead of popping up a combo box the column is selected. What am I missing here?

[Updated on: Wed, 02 October 2013 09:16]

Report message to a moderator

Re: CellEditor in a column header? [message #1123154 is a reply to message #1123149] Wed, 02 October 2013 08:50 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2902
Registered: July 2012
Senior Member
Did you ensure that the edit bindings are also registered for the column header? Have a look at the DefaultEditBindings, which only enable editing in the body region.
Re: CellEditor in a column header? [message #1123158 is a reply to message #1123154] Wed, 02 October 2013 08:54 Go to previous messageGo to next message
Jens Rabe is currently offline Jens RabeFriend
Messages: 81
Registered: September 2013
Member
Do I have to attach new modified DefaultEditBindings to the column header layer or to the table itself?
Re: CellEditor in a column header? [message #1123164 is a reply to message #1123158] Wed, 02 October 2013 08:57 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2902
Registered: July 2012
Senior Member
I think it should be possible to add additional edit bindings to the table.
Re: CellEditor in a column header? [message #1123174 is a reply to message #1123164] Wed, 02 October 2013 09:15 Go to previous message
Jens Rabe is currently offline Jens RabeFriend
Messages: 81
Registered: September 2013
Member
I got it to work adding it to the column header layers like this:

columnHeaderLayerStack.addConfiguration(new DefaultEditBindings() {
    @Override
    public void configureUiBindings(final UiBindingRegistry uiBindingRegistry) {
        uiBindingRegistry.registerSingleClickBinding(
            new CellEditorMouseEventMatcher(GridRegion.COLUMN_HEADER), new MouseEditAction());
    }
});


Now I can add labels to the column header cells and add the editors via the config registry as if I would add them to the body cells.

[Updated on: Wed, 02 October 2013 09:18]

Report message to a moderator

Previous Topic:How to change max and min values of chart using bookmark
Next Topic:CellPainter painting outside of NatTable?
Goto Forum:
  


Current Time: Thu Mar 28 15:21:53 GMT 2024

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

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

Back to the top