Details

    • Type: New Feature New Feature
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.0
    • Component/s: wtk
    • Labels:
      None

      Description

      These would provide support for CSS-like classes (though dynamic updates to the style would most likely not be reflected in components that refer to them).

        Activity

        Hide
        Greg Brown added a comment -

        The solution described above was not sufficient. It did not support the definition of styles that should be applied to all instances of a type, nor did it support the application of both named styles as well as instance-specific styles. An updated solution has been committed that adds support for these features.

        Show
        Greg Brown added a comment - The solution described above was not sufficient. It did not support the definition of styles that should be applied to all instances of a type, nor did it support the application of both named styles as well as instance-specific styles. An updated solution has been committed that adds support for these features.
        Hide
        Greg Brown added a comment - - edited

        Note that this update enables the use of CSS to define named styles in the future, via a possible (but as yet unimplemented) CSSSerializer class:

        boldGreenLabel:

        { font: Verdana BOLD 11; color: #00aa00; background-color: #eeeeee; }
        Show
        Greg Brown added a comment - - edited Note that this update enables the use of CSS to define named styles in the future, via a possible (but as yet unimplemented) CSSSerializer class: boldGreenLabel: { font: Verdana BOLD 11; color: #00aa00; background-color: #eeeeee; }
        Greg Brown made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Hide
        Greg Brown added a comment -

        Named style support has been added via enhanced include support in BXMLSerializer. It is now possible to include a JSON source file containing style definitions and reference those styles in BXML:

        <Window title="Named Styles Test" maximized="true"
        xmlns:bxml="http://pivot.apache.org/bxml"
        xmlns="org.apache.pivot.wtk">
        <bxml:define>
        <bxml:include bxml:id="testStyles" src="test_styles.json"/>
        </bxml:define>

        <Label text="Bold Green Label" styles="$testStyles.boldGreenLabel"/>
        </Window>

        test_styles.json:

        { boldGreenLabel: {
        font:

        {bold: true}

        ,
        color: "#00aa00"
        }
        }

        Show
        Greg Brown added a comment - Named style support has been added via enhanced include support in BXMLSerializer. It is now possible to include a JSON source file containing style definitions and reference those styles in BXML: <Window title="Named Styles Test" maximized="true" xmlns:bxml="http://pivot.apache.org/bxml" xmlns="org.apache.pivot.wtk"> <bxml:define> <bxml:include bxml:id="testStyles" src="test_styles.json"/> </bxml:define> <Label text="Bold Green Label" styles="$testStyles.boldGreenLabel"/> </Window> test_styles.json: { boldGreenLabel: { font: {bold: true} , color: "#00aa00" } }
        Greg Brown made changes -
        Field Original Value New Value
        Assignee Greg Brown [ gbrown ]
        Greg Brown created issue -

          People

          • Assignee:
            Greg Brown
            Reporter:
            Greg Brown
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development