Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » NatTable » Excel Like coloring facility(Providing color to Nattable, Something simillar to excel.)
Excel Like coloring facility [message #1741595] Fri, 26 August 2016 08:07 Go to next message
Naveen Sabapathy is currently offline Naveen SabapathyFriend
Messages: 46
Registered: July 2016
Member
I've constructed a Nattable, I want to give the coloring capability something similar to excel. And I want to store and retrive it.

1) I have provided the ColorDialog, And got the RGB got selected.

2) For columns I have provided the register column override to provide the color. (Its working fine).

3) Using ColumnOverrideLabelAccumulator I'm setting the color for the Row and cells.

And I'm setting the DefaultNatTableStyleConfiguration, with the new registry configuration.

Then I configure the Nattable and redrawing the Nattable. The latest color state is not getting applied to the cells.

Whats is the way to redraw the Nattable.

And what is the method you are suggesting to store the color configuration for future reference.
Re: Excel Like coloring facility [message #1741600 is a reply to message #1741595] Fri, 26 August 2016 08:46 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2902
Registered: July 2012
Senior Member
Look at the Classic Examples - Styling - Styled Grid example as a reference. There you can use the styling dialog from the column header menu. The DisplayColumnStyleEditorCommandHandler is a persistable, so there you can get an idea about how to store such configurations for future use. Basically we have a StylePersistor class for that purpose.

I can't tell why your style configurations are not applied. Maybe an issue with your label accumulator or you are doing something wrong with the configuration. Add the DebugMenuConfiguration to be able to check on the rendered NatTable if the labels are correctly applied.
Re: Excel Like coloring facility [message #1742271 is a reply to message #1741600] Thu, 01 September 2016 10:42 Go to previous messageGo to next message
Naveen Sabapathy is currently offline Naveen SabapathyFriend
Messages: 46
Registered: July 2016
Member
Hello,

I have applied the color configurations to the table. And i'm sysout the lable configurations, it prints the details correctly. Its having inconsistant behaviour.

And how to use the DebugMenuConfiguration ? Which example I need to use for that.

Re: Excel Like coloring facility [message #1742273 is a reply to message #1742271] Thu, 01 September 2016 10:54 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2902
Registered: July 2012
Senior Member
natTable.addConfiguration(new DebugMenuConfiguration(natTable);


With that configuration applied you can right click on a body cell and select the "Debug info" menu entry, which will open a dialog with some information on the selected cell. There are several examples that include that.
Re: Excel Like coloring facility [message #1743544 is a reply to message #1742273] Fri, 16 September 2016 09:43 Go to previous message
Naveen Sabapathy is currently offline Naveen SabapathyFriend
Messages: 46
Registered: July 2016
Member
Thanks for the support.
with following modifications and its working fine.

1) DefaultNatTableStyleConfiguration - Register config attributes for the new color.
configRegistry.registerConfigAttribute(CellConfigAttributes.CELL_STYLE,custStyle, DisplayMode.NORMAL, colorName);


2) Recreated ColumnOverrideLabelAccumulator with the new color values.

3) DataLayer.registerPersistable(columnLabelAccumulator);
Previous Topic:How to resize the nattable row header column width
Next Topic:ShowCellInViewportCommand on _513_FreezeExample
Goto Forum:
  


Current Time: Thu Mar 28 16:09:12 GMT 2024

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

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

Back to the top