Utils.appendCSSComponentInlineColorStyle(inlineStyles, component);
    public void writePrefix(Device device, SComponent component) throws IOException {        SDimension prefSize = component.getPreferredSize();        final int align = component.getHorizontalAlignment();        // For centering or right-alignment we need we surrounding helper table to be stretched to full width.        if (prefSize == null && (align == SConstants.CENTER || align == SConstants.RIGHT))            prefSize = new SDimension("100%", null);        StringBuffer inlineStyles = Utils.generateCSSInlinePreferredSize(prefSize);        Utils.printDebugNewline(device, component);        Utils.printDebug(device, "<!-- ").print(component.getName()).print(" -->");                device.print("<table id=\"").print(component.getName()).print("\"");        if (component instanceof DragSource) {            device.print(" style=\"position:relative;\"");        }        // Special handling: Mark Titled Borders for styling        if (component.getBorder() instanceof STitledBorder) {            Utils.optAttribute(device, "class", component.getStyle() + " STitledBorder SLayout");        } else {            Utils.optAttribute(device, "class", component.getStyle() + " SLayout");        }        Utils.optAttribute(device, "style", inlineStyles.toString());        if (component instanceof LowLevelEventListener) {            LowLevelEventListener lowLevelEventListener = (LowLevelEventListener) component;            device.print(" eid=\"")                    .print(lowLevelEventListener.getEncodedLowLevelEventId()).print("\"");        }        String toolTip = component.getToolTipText();        if (toolTip != null)            device.print(" onmouseover=\"return makeTrue(domTT_activate(this, event, 'content', '")                    .print(toolTip)                    .print("', 'predefined', 'default'));\"");        InputMap inputMap = component.getInputMap();        if (inputMap != null && !(inputMap instanceof VersionedInputMap)) {            log.debug("inputMap = " + inputMap);            inputMap = new VersionedInputMap(inputMap);            component.setInputMap(inputMap);        }        if (inputMap != null) {            VersionedInputMap versionedInputMap = (VersionedInputMap) inputMap;            Integer inputMapVersion = (Integer) component.getClientProperty("inputMapVersion");            if (inputMapVersion == null || versionedInputMap.getVersion() != inputMapVersion.intValue()) {                log.debug("inputMapVersion = " + inputMapVersion);                InputMapScriptListener.install(component);                component.putClientProperty("inputMapVersion", new Integer(versionedInputMap.getVersion()));            }        }        SPopupMenu menu = component.getComponentPopupMenu();        if (menu != null) {            //ComponentCG menuCG = menu.getCG();            String componentId = menu.getName();            String popupId = componentId + "_pop";            //String hookId = component.getName();            device.print(" onContextMenu=\"javascript:return wpm_menuPopup(event, '");            device.print(popupId);            device.print("');\" onMouseDown=\"javascript:return wpm_menuPopup(event, '");            device.print(popupId);            device.print("');\"");        }        device.print("><tr>"); // table        AbstractLayoutCG.openLayouterCell(device, false, 0, 0, 0, component);        device.print(">");        // Special handling: Render title of STitledBorder        // TODO Attention - This may break CSS selectors as a new element is introduced inbetween.        // Maybe move out of DIV with the componentn ID.        if (component.getBorder() instanceof STitledBorder) {            STitledBorder titledBorder = (STitledBorder) component.getBorder();            device.print("<div class=\"STitledBorderLegend\" style=\"");            titledBorder.getTitleAttributes().write(device);            device.print("\">");            device.print(titledBorder.getTitle());            device.print("</div>");        }        component.fireRenderEvent(SComponent.START_RENDERING);    }