* @param comp the component
* @param styleName the style to lookup
*/
public static void applyStyle( XProject currentProject, Object comp, String styleName )
{
XStyleManager styleManager = currentProject.getStyleManager();
XStyle xstyle = styleManager.getStyle( styleName );
WidgetAdapter adapter = WidgetAdapter.getInstance();
if ( xstyle != null ) {
adapter.setFont( comp, styleManager.getFont( xstyle ) );
adapter.setBackground( comp, xstyle.getStyleAsColor( XStyle.COLOR_BACK ) );
adapter.setForeground( comp, xstyle.getStyleAsColor( XStyle.COLOR_FORE ) );
if ( comp instanceof XStyleComponent )
(( XStyleComponent)comp).setStyle( styleName );