I am trying to change the color of a row in a table based on the hex value for a row element. I am basically trying to generate css on the fly, similar to creating a cssLayout like this
CssLayout content = new CssLayout( ) { @Override public String getCss( Component c ) { return "background: " + colorCode + ";"; } };
Here is the code I'm using now
table.setCellStyleGenerator( new Table.CellStyleGenerator( ) { public String getStyle( Object itemId, Object propertyId ) { return "green"; } } );
But it only works to set the style name, so I need to have millions of style names to accommodate all the possible hexadecimal values ββfor the colors that the user wants.
source share