ColorMap colorMap = getCurrentSelection().getColorMap();
rasterSym.setColorMap(colorMap);
Style newStyle = SLD.wrapSymbolizers(rasterSym);
newStyle.setName(((Layer)getSelectedLayer()).getName() );
StyleBlackboard styleBlackboard = getSelectedLayer().getStyleBlackboard();
// put style back on blackboard
styleBlackboard.put(SLDContent.ID, newStyle);
styleBlackboard.setSelected(new String[]{SLDContent.ID});
Object x = ((IStructuredSelection)cmbPalette.getSelection()).getFirstElement();
if (x instanceof BrewerPalette){
BrewerPalette palette = (BrewerPalette) x;
if (palette != null){
styleBlackboard.put("org.locationtech.udig.style.raster.palette", palette.getName()); //$NON-NLS-1$
}
}else if (x instanceof PredefinedColorRule){
styleBlackboard.put("org.locationtech.udig.style.raster.palette", ((PredefinedColorRule) x).getName()); //$NON-NLS-1$
}
}