Package com.volantis.styling

Examples of com.volantis.styling.Styles


     * already has styles, the styles of the emulated elements are correctly
     * captured on the emulating elements.
     */
    public void testFlattenTableCellWithStylesAndNamedStyledParent() {

        Styles expectedStyles = generateTestColorStyles();

        // the table cell should be removed because doInlineDiv was true
        Element newParent = doFlattenTableCell(expectedStyles,
                false, true, true, true);
        assertNotNull(newParent.getStyles());
        Styles actualStyles = newParent.getStyles();
        checkFlattenedValues(expectedStyles, actualStyles, true);

        // the table cell should be removed because doInlineDiv was true
        newParent = doFlattenTableCell(expectedStyles, true, true,
                true, true);
View Full Code Here


     * emulated elements are correctly captured on the emulating elements.
     */
    public void testFlattenTableCellWithStylesAndUnnamedUnstyledParent()
            throws IOException, SAXException, ParserConfigurationException {

        Styles expectedStyles = generateTestColorStyles();

        Element newParent = doFlattenTableCell(expectedStyles,
                false, true, false, false);

        assertNull(newParent.getStyles());
        Element child = (Element)newParent.getHead();
        assertNotNull(child);
        assertNotNull(child.getStyles());
        Styles actualStyles = child.getStyles();
        checkFlattenedValues(expectedStyles, actualStyles, true);

        newParent = doFlattenTableCell(expectedStyles,
                true, true, false, false);
        assertNull(newParent.getStyles());
View Full Code Here

                            "</div>";

        Document dom = getStrictStyledDOMHelper().parse(input);
        Element table = dom.getRootElement();

        Styles tableStyles = generateTestColorStyles();
        table.setStyles(tableStyles);
        table.setAttribute("styleClass", "testClass");

        Element flattenedTable = doFlattenTable(table, expected2);
        assertTrue("div".equals(flattenedTable.getName()));
View Full Code Here

     * @return Element  the flattened table
     * @throws Exception if there was a problem running the test
     */
    private Element doFlattenTable(Element input, String expected)
            throws Exception {
        Styles originalStyles = input.getStyles();
        MyXHTMLBasicTransformer transformer = new MyXHTMLBasicTransformer();
        DOMProtocol protocol = createProtocol();
        transformer.initialize(protocol);

        Element flattenedTable = transformer.proxyFlattenTable(input, 2, 1);
View Full Code Here


        DoSelectInputTestHelper helper = new DoSelectInputTestHelper();

        XFSelectAttributes atts = helper.buildSelectAttributes();
        Styles styles = atts.getStyles();
        MutablePropertyValues propertyValues = styles.getPropertyValues();

        if(!multiSelect) {
            for(int i=0; i<selectedOtions.length; i++) {
                if(selectedOtions[i]) {
                    atts.setInitial("Value" + (i+1));
View Full Code Here

    public void testXFOptionStyles() throws Exception {
        privateSetUp();
        final DoSelectInputTestHelper helper = new DoSelectInputTestHelper();

        final XFSelectAttributes attributes = helper.buildSelectAttributes();
        Styles styles = attributes.getStyles();
        MutablePropertyValues propertyValues = styles.getPropertyValues();
        attributes.setMultiple(false);

        // add some optionsDOMP
        helper.addOption(attributes, "Caption1", "Prompt1", "Value1", true);
        helper.addOption(attributes, "Caption2", "Prompt2", "Value2", false);
        final Styles captionStyles =
                StylesBuilder.getCompleteStyles("font-weight: bold");
        ((SelectOption) attributes.getOptions().get(0)).setCaptionStyles(captionStyles);

        // create style
        propertyValues.setComputedValue(
View Full Code Here

     * mcs-form-action-image is null, the mcs-image url is returned from
     * XHTMLBasic#getActionURL.
     */
    public void testGetActionURLWithMCSImageAndNullFormImage() {

        final Styles styles = StylesBuilder.getEmptyStyles();
        styles.getPropertyValues().setComputedValue(
                StylePropertyDetails.MCS_IMAGE,
                styleValueFactory.getURI(null, MCS_IMAGE_URL));

        String url = protocol.getActionImageURL(styles);
        if (protocol.supportsImageButtons) {
View Full Code Here

     * mcs-form-action-image is MarinerImageEnumeration#NONE, the mcs-image url
     * is returned from XHTMLBasic#getActionURL.
     */
    public void testGetActionURLWithMCSImageAndFormImageOfNone() {

        final Styles styles = StylesBuilder.getEmptyStyles();
        styles.getPropertyValues().setComputedValue(
                StylePropertyDetails.MCS_IMAGE,
                styleValueFactory.getURI(null, MCS_IMAGE_URL));
        styles.getPropertyValues().setComputedValue(
                StylePropertyDetails.MCS_FORM_ACTION_IMAGE,
                MCSImageKeywords.NONE);

        String url = protocol.getActionImageURL(styles);
        if (protocol.supportsImageButtons) {
View Full Code Here

     * Verify that if both the mcs-image property and mcs-form-action-image
     * have valid URLs, the mcs-image url is returned from
     * XHTMLBasic#getActionURL
     */
    public void testGetActionURLWithMCSImageAndFormImage() {
        final Styles styles = StylesBuilder.getEmptyStyles();
        styles.getPropertyValues().setComputedValue(
                StylePropertyDetails.MCS_IMAGE,
                styleValueFactory.getURI(null, MCS_IMAGE_URL));
        styles.getPropertyValues().setComputedValue(
                StylePropertyDetails.MCS_FORM_ACTION_IMAGE,
                styleValueFactory.getURI(null, FORM_IMAGE_URL));

        String url = protocol.getActionImageURL(styles);
        if (protocol.supportsImageButtons) {
View Full Code Here

     * Verify that if the mcs-form-action-image property has a valid URL and
     * mcs-image is null, the mcs-form-action-image url is returned from
     * XHTMLBasic#getActionURL.
     */
    public void testGetActionURLWithNullMCSImageAndFormImage() {
        final Styles styles = StylesBuilder.getEmptyStyles();
        styles.getPropertyValues().setComputedValue(
                StylePropertyDetails.MCS_FORM_ACTION_IMAGE,
                styleValueFactory.getURI(null, FORM_IMAGE_URL));

        String url = protocol.getActionImageURL(styles);
        if (protocol.supportsImageButtons) {
View Full Code Here

TOP

Related Classes of com.volantis.styling.Styles

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.