boolean isVAligned = (component.getVerticalAlignment() == SComponent.CENTER || component.getVerticalAlignment() == SComponent.BOTTOM );
boolean isVAligned = (component.getVerticalAlignment() == SConstants.CENTER || component.getVerticalAlignment() == SConstants.BOTTOM );
    public void writePrefix(Device device, SComponent component) throws IOException {        SDimension prefSize = component.getPreferredSize();        Utils.printDebugNewline(device, component);        Utils.printDebug(device, "<!-- ").print(component.getName()).print(" -->");        device.print("<div");        if (component.getStyle() != null && component.getStyle().length() > 0) {            device.print(" class=\"");            device.print(component.getStyle());            device.print("_Box\"");        }        // if sizes are spec'd in percentages, we need the outer box to have full size...        boolean isHeightPercentage = prefSize != null && prefSize.height != null && prefSize.height.indexOf("%") != -1;        boolean isWidthPercentage = prefSize != null && prefSize.width != null && prefSize.width.indexOf("%") != -1;        // special case of special case: if the component with relative size is vertically aligned, we must avoid 100% heigth        boolean isVAligned = (component.getVerticalAlignment() == SComponent.CENTER || component.getVerticalAlignment() == SComponent.BOTTOM );        if ( isHeightPercentage || isWidthPercentage ) {            device.print(" style=\"");            if (isHeightPercentage && isVAligned == false) {                device.print("height:100%;");            }            if (isWidthPercentage) {                device.print("width:100%;");            }            device.print("\"");        }                device.print(">");        device.print("<div id=\"").print(component.getName()).print("\"");        Utils.optAttribute(device, "class", component.getStyle());        Utils.printCSSInlinePreferredSize(device, prefSize);        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";            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(">"); // div        // Special handling: Render title of STitledBorder        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);    }