Details

    • Type: New Feature New Feature
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.3
    • Component/s: ACE-Components
    • Labels:
      None
    • Environment:
      ICEfaces 3.x ACE
    • Assignee Priority:
      P2
    • Affects:
      Documentation (User Guide, Ref. Guide, etc.), Sample App./Tutorial, Compatibility/Configuration

      Description

      Create a new ace:themeSelect component which can be used to dynamically change the currently used ACE ThemeRoller theme in the application.

      This component should render itself as a selectOneMenu style drop-down list. It will always have a theme selected, aligned with the currently selected ACE theme setting in the application.

      This component would ideally discover all available ThemeRoller ACE themes on the application classpath, and populate it's list of values accordingly.

      If this cannot be achieved, then a fallback would be to allow the application to specify the theme names and corresponding package names and use reflection to find them at runtime.

       
      1. screenshot-01.png
        222 kB
      2. screenshot-02.png
        189 kB
      3. screenshot-03.png
        171 kB
      4. screenshot-04.png
        242 kB

        Activity

        Hide
        Ken Fyten added a comment -

        Note that by default the "sam" theme is used, but the user can control this via the

        <context-param>
        		<param-name>org.icefaces.ace.theme</param-name>
        		<param-value>xxx</param-value>
        </context-param>
        

        ...config. parameter, including setting it to "none".

        See http://www.icesoft.org/wiki/display/ICE/ace.theme for details.

        Show
        Ken Fyten added a comment - Note that by default the "sam" theme is used, but the user can control this via the <context-param> <param-name>org.icefaces.ace.theme</param-name> <param-value>xxx</param-value> </context-param> ...config. parameter, including setting it to "none". See http://www.icesoft.org/wiki/display/ICE/ace.theme for details.
        Hide
        yip.ng added a comment - - edited
        1. Nothing to do with classpath or package or reflection as stipulated in the Description. These are JSF 2 resources in META-INF/resources, not anything like localization message bundles.
        2. Seems there is no magic API to get enumeration of resources. Must use low-level jar/zip file scanning? (There is only API for creating a resource from a known path, i.e. lib dir + name/path. The Mojarra implementation ultimately just does jar/zip scanning as well.)
        Show
        yip.ng added a comment - - edited Nothing to do with classpath or package or reflection as stipulated in the Description. These are JSF 2 resources in META-INF/resources, not anything like localization message bundles. Seems there is no magic API to get enumeration of resources. Must use low-level jar/zip file scanning? (There is only API for creating a resource from a known path, i.e. lib dir + name/path. The Mojarra implementation ultimately just does jar/zip scanning as well.)
        Hide
        yip.ng added a comment - - edited

        First working prototype: http://screencast.com/t/lkfN8lIRzcjJ.

        Scanning of theme CSS resources based on ideas in this article: http://bill.burkecentral.com/2008/01/14/scanning-java-annotations-at-runtime/, using class loader and JSF getResource(s) and createResource(s), plus some pattern matching. (No re-invention of my own as in the beginning, so performance can't be any worse than JSF is already doing. See also com.sun.faces.application.resource.ZipDirectoryEntryScanner#ZipDirectoryEntryScanner.)

        Theme switching based on study of some code in Super-Theme-Switcher.

        Processing of org.icefaces.ace.theme and determination of theme names same as in org.icefaces.ace.renderkit.HeadRenderer, with added checking for backing bean value.

        Show
        yip.ng added a comment - - edited First working prototype : http://screencast.com/t/lkfN8lIRzcjJ . Scanning of theme CSS resources based on ideas in this article: http://bill.burkecentral.com/2008/01/14/scanning-java-annotations-at-runtime/ , using class loader and JSF getResource(s) and createResource(s), plus some pattern matching. (No re-invention of my own as in the beginning, so performance can't be any worse than JSF is already doing. See also com.sun.faces.application.resource.ZipDirectoryEntryScanner#ZipDirectoryEntryScanner .) Theme switching based on study of some code in Super-Theme-Switcher . Processing of org.icefaces.ace.theme and determination of theme names same as in org.icefaces.ace.renderkit.HeadRenderer , with added checking for backing bean value.
        Hide
        Ken Fyten added a comment -

        Need to modify this to cache the resolved list of themes into the Application scope so it only gets loaded/resolved once per application.

        Show
        Ken Fyten added a comment - Need to modify this to cache the resolved list of themes into the Application scope so it only gets loaded/resolved once per application.
        Hide
        yip.ng added a comment - - edited

        [2013-02-28 12:14:21 PM] Mark Collette: FacesContext.getCurrentInstance().getExternalContext().getApplicationMap()
        [12:29:52 PM] Ken Fyten: Current theme will be stored in the session scope.
        [2013-02-28 12:28:38 PM] Ken Fyten: Head renderer for theme needs to be modified to check if the selected Theme has changed and use it instead of the default theme.

        Show
        yip.ng added a comment - - edited [2013-02-28 12:14:21 PM] Mark Collette: FacesContext.getCurrentInstance().getExternalContext().getApplicationMap() [12:29:52 PM] Ken Fyten: Current theme will be stored in the session scope. [2013-02-28 12:28:38 PM] Ken Fyten: Head renderer for theme needs to be modified to check if the selected Theme has changed and use it instead of the default theme.
        Hide
        yip.ng added a comment - - edited

        All requirements noted above done. Showcase build changed to include all theme jars. Theme switcher dropdown list added to Showcase: screenshot-02.png, screenshot-03.png

        M: C:\svn\ossrepo\icefaces3\trunk\icefaces\samples\showcase\showcase\src\main\java\org\icefaces\samples\showcase\view\navigation\NavigationModel.java#33730
        M: C:\svn\ossrepo\icefaces3\trunk\icefaces\samples\showcase\showcase\src\main\webapp\showcase.xhtml#33730
        M: C:\svn\ossrepo\icefaces3\trunk\icefaces\ace\component\resources\icefaces.ace\themeselect\themeselect.js#33730
        M: C:\svn\ossrepo\icefaces3\trunk\icefaces\ace\component\src\org\icefaces\ace\component\themeselect\ThemeSelectMeta.java#33730
        M: C:\svn\ossrepo\icefaces3\trunk\icefaces\ace\component\src\org\icefaces\ace\component\themeselect\ThemeSelectRenderer.java#33730

        M: C:\svn\ossrepo\icefaces3\trunk\icefaces\ace\component\resources\icefaces.ace\autocompleteentry\autocompleteentry.js#33728
        M: C:\svn\ossrepo\icefaces3\trunk\icefaces\ace\component\build.xml#33728
        M: C:\svn\ossrepo\icefaces3\trunk\icefaces\samples\build\common.xml#33728
        A: C:\svn\ossrepo\icefaces3\trunk\icefaces\ace\component\resources\icefaces.ace\fieldlabels#33728
        A: C:\svn\ossrepo\icefaces3\trunk\icefaces\ace\component\resources\icefaces.ace\fieldlabels\fieldlabels.css#33728
        M: C:\svn\ossrepo\icefaces3\trunk\icefaces\ace\component\src\org\icefaces\ace\renderkit\HeadRenderer.java#33728
        A: C:\svn\ossrepo\icefaces3\trunk\icefaces\ace\component\resources\icefaces.ace\messages#33728
        A: C:\svn\ossrepo\icefaces3\trunk\icefaces\ace\component\resources\icefaces.ace\messages\messages.css#33728
        M: C:\svn\ossrepo\icefaces3\trunk\icefaces\samples\showcase\showcase\src\main\webapp\showcase.xhtml#33728
        A: C:\svn\ossrepo\icefaces3\trunk\icefaces\ace\component\resources\icefaces.ace\textareaentry\textareaentry.css#33728
        M: C:\svn\ossrepo\icefaces3\trunk\icefaces\ace\component\resources\icefaces.ace\themes\sam\theme.css#33728
        M: C:\svn\ossrepo\icefaces3\trunk\icefaces\ace\component\resources\icefaces.ace\themes\rime\theme.css#33728
        A: C:\svn\ossrepo\icefaces3\trunk\icefaces\ace\component\resources\icefaces.ace\themeselect#33728
        A: C:\svn\ossrepo\icefaces3\trunk\icefaces\ace\component\resources\icefaces.ace\themeselect\themeselect.js#33728
        M: C:\svn\ossrepo\icefaces3\trunk\icefaces\ace\component\src\org\icefaces\ace\component\themeselect\ThemeSelectMeta.java#33728
        M: C:\svn\ossrepo\icefaces3\trunk\icefaces\ace\component\src\org\icefaces\ace\component\themeselect\ThemeSelectRenderer.java#33728

        M: C:\svn\ossrepo\icefaces3\trunk\icefaces\ace\component\src\org\icefaces\ace\component\themeselect\ThemeSelectRenderer.java#33677

        A: C:\svn\ossrepo\icefaces3\trunk\icefaces\ace\component\src\org\icefaces\ace\component\themeselect#33676
        A: C:\svn\ossrepo\icefaces3\trunk\icefaces\ace\component\src\org\icefaces\ace\component\themeselect\ThemeSelect.java#33676
        A: C:\svn\ossrepo\icefaces3\trunk\icefaces\ace\component\src\org\icefaces\ace\component\themeselect\ThemeSelectMeta.java#33676
        A: C:\svn\ossrepo\icefaces3\trunk\icefaces\ace\component\src\org\icefaces\ace\component\themeselect\ThemeSelectRenderer.java#33676

        Show
        yip.ng added a comment - - edited All requirements noted above done. Showcase build changed to include all theme jars. Theme switcher dropdown list added to Showcase: screenshot-02.png , screenshot-03.png M: C:\svn\ossrepo\icefaces3\trunk\icefaces\samples\showcase\showcase\src\main\java\org\icefaces\samples\showcase\view\navigation\NavigationModel.java#33730 M: C:\svn\ossrepo\icefaces3\trunk\icefaces\samples\showcase\showcase\src\main\webapp\showcase.xhtml#33730 M: C:\svn\ossrepo\icefaces3\trunk\icefaces\ace\component\resources\icefaces.ace\themeselect\themeselect.js#33730 M: C:\svn\ossrepo\icefaces3\trunk\icefaces\ace\component\src\org\icefaces\ace\component\themeselect\ThemeSelectMeta.java#33730 M: C:\svn\ossrepo\icefaces3\trunk\icefaces\ace\component\src\org\icefaces\ace\component\themeselect\ThemeSelectRenderer.java#33730 M: C:\svn\ossrepo\icefaces3\trunk\icefaces\ace\component\resources\icefaces.ace\autocompleteentry\autocompleteentry.js#33728 M: C:\svn\ossrepo\icefaces3\trunk\icefaces\ace\component\build.xml#33728 M: C:\svn\ossrepo\icefaces3\trunk\icefaces\samples\build\common.xml#33728 A: C:\svn\ossrepo\icefaces3\trunk\icefaces\ace\component\resources\icefaces.ace\fieldlabels#33728 A: C:\svn\ossrepo\icefaces3\trunk\icefaces\ace\component\resources\icefaces.ace\fieldlabels\fieldlabels.css#33728 M: C:\svn\ossrepo\icefaces3\trunk\icefaces\ace\component\src\org\icefaces\ace\renderkit\HeadRenderer.java#33728 A: C:\svn\ossrepo\icefaces3\trunk\icefaces\ace\component\resources\icefaces.ace\messages#33728 A: C:\svn\ossrepo\icefaces3\trunk\icefaces\ace\component\resources\icefaces.ace\messages\messages.css#33728 M: C:\svn\ossrepo\icefaces3\trunk\icefaces\samples\showcase\showcase\src\main\webapp\showcase.xhtml#33728 A: C:\svn\ossrepo\icefaces3\trunk\icefaces\ace\component\resources\icefaces.ace\textareaentry\textareaentry.css#33728 M: C:\svn\ossrepo\icefaces3\trunk\icefaces\ace\component\resources\icefaces.ace\themes\sam\theme.css#33728 M: C:\svn\ossrepo\icefaces3\trunk\icefaces\ace\component\resources\icefaces.ace\themes\rime\theme.css#33728 A: C:\svn\ossrepo\icefaces3\trunk\icefaces\ace\component\resources\icefaces.ace\themeselect#33728 A: C:\svn\ossrepo\icefaces3\trunk\icefaces\ace\component\resources\icefaces.ace\themeselect\themeselect.js#33728 M: C:\svn\ossrepo\icefaces3\trunk\icefaces\ace\component\src\org\icefaces\ace\component\themeselect\ThemeSelectMeta.java#33728 M: C:\svn\ossrepo\icefaces3\trunk\icefaces\ace\component\src\org\icefaces\ace\component\themeselect\ThemeSelectRenderer.java#33728 M: C:\svn\ossrepo\icefaces3\trunk\icefaces\ace\component\src\org\icefaces\ace\component\themeselect\ThemeSelectRenderer.java#33677 A: C:\svn\ossrepo\icefaces3\trunk\icefaces\ace\component\src\org\icefaces\ace\component\themeselect#33676 A: C:\svn\ossrepo\icefaces3\trunk\icefaces\ace\component\src\org\icefaces\ace\component\themeselect\ThemeSelect.java#33676 A: C:\svn\ossrepo\icefaces3\trunk\icefaces\ace\component\src\org\icefaces\ace\component\themeselect\ThemeSelectMeta.java#33676 A: C:\svn\ossrepo\icefaces3\trunk\icefaces\ace\component\src\org\icefaces\ace\component\themeselect\ThemeSelectRenderer.java#33676
        Hide
        yip.ng added a comment -

        [3:19:52 PM] Ken Fyten: an ace:ajax event that could be used to submit it when it changes

        Show
        yip.ng added a comment - [3:19:52 PM] Ken Fyten: an ace:ajax event that could be used to submit it when it changes
        Hide
        yip.ng added a comment - - edited

        Value change ajax event added.

        M: C:\svn\ossrepo\icefaces3\trunk\icefaces\samples\showcase\showcase\src\main\webapp\showcase.xhtml#33755
        M: C:\svn\ossrepo\icefaces3\trunk\icefaces\ace\component\resources\icefaces.ace\themeselect\themeselect.js#33755
        M: C:\svn\ossrepo\icefaces3\trunk\icefaces\ace\component\src\org\icefaces\ace\component\themeselect\ThemeSelectMeta.java#33755
        M: C:\svn\ossrepo\icefaces3\trunk\icefaces\ace\component\src\org\icefaces\ace\component\themeselect\ThemeSelectRenderer.java#33755

        M: C:\svn\ossrepo\icefaces3\trunk\icefaces\ace\component\src\org\icefaces\ace\component\themeselect\ThemeSelectMeta.java#33764

        Show
        yip.ng added a comment - - edited Value change ajax event added. M: C:\svn\ossrepo\icefaces3\trunk\icefaces\samples\showcase\showcase\src\main\webapp\showcase.xhtml#33755 M: C:\svn\ossrepo\icefaces3\trunk\icefaces\ace\component\resources\icefaces.ace\themeselect\themeselect.js#33755 M: C:\svn\ossrepo\icefaces3\trunk\icefaces\ace\component\src\org\icefaces\ace\component\themeselect\ThemeSelectMeta.java#33755 M: C:\svn\ossrepo\icefaces3\trunk\icefaces\ace\component\src\org\icefaces\ace\component\themeselect\ThemeSelectRenderer.java#33755 M: C:\svn\ossrepo\icefaces3\trunk\icefaces\ace\component\src\org\icefaces\ace\component\themeselect\ThemeSelectMeta.java#33764
        Hide
        yip.ng added a comment -

        [10:39:20 AM] Ken Fyten: themeSelector needs to respect Theme Roller styling, just like the ace:simpleSelectOneMenu does.

        Also:

        1. use div as in simpleSelectOneMenu, not span
        2. remove theme value from backing bean
        Show
        yip.ng added a comment - [10:39:20 AM] Ken Fyten: themeSelector needs to respect Theme Roller styling, just like the ace:simpleSelectOneMenu does. Also: use div as in simpleSelectOneMenu, not span remove theme value from backing bean
        Hide
        yip.ng added a comment -

        All the above done. (For styling, added exact same style classes as simpleSelectOneMenu.)

        M: C:\svn\ossrepo\icefaces3\trunk\icefaces\samples\showcase\showcase\src\main\java\org\icefaces\samples\showcase\view\navigation\NavigationModel.java#33845
        M: C:\svn\ossrepo\icefaces3\trunk\icefaces\ace\component\src\org\icefaces\ace\component\themeselect\ThemeSelectRenderer.java#33845

        Show
        yip.ng added a comment - All the above done. (For styling, added exact same style classes as simpleSelectOneMenu.) M: C:\svn\ossrepo\icefaces3\trunk\icefaces\samples\showcase\showcase\src\main\java\org\icefaces\samples\showcase\view\navigation\NavigationModel.java#33845 M: C:\svn\ossrepo\icefaces3\trunk\icefaces\ace\component\src\org\icefaces\ace\component\themeselect\ThemeSelectRenderer.java#33845
        Hide
        Jerome Ruzol added a comment -

        Command: Commit
        Modified: C:\svn\ossrepo\icefaces3\trunk\icefaces\samples\build\common.xml
        Sending content: C:\svn\ossrepo\icefaces3\trunk\icefaces\samples\build\common.xml
        Completed: At revision: 33847

        Show
        Jerome Ruzol added a comment - Command: Commit Modified: C:\svn\ossrepo\icefaces3\trunk\icefaces\samples\build\common.xml Sending content: C:\svn\ossrepo\icefaces3\trunk\icefaces\samples\build\common.xml Completed: At revision: 33847
        Hide
        yip.ng added a comment -

        Do wiki.

        Show
        yip.ng added a comment - Do wiki.
        Hide
        yip.ng added a comment -

        "Pass-thru Attributes" done. Wiki done.

        M: C:\svn\ossrepo\icefaces3\trunk\icefaces\ace\component\src\org\icefaces\ace\component\themeselect\ThemeSelectMeta.java#33881
        M: C:\svn\ossrepo\icefaces3\trunk\icefaces\ace\component\src\org\icefaces\ace\component\themeselect\ThemeSelectRenderer.java#33881

        Show
        yip.ng added a comment - "Pass-thru Attributes" done. Wiki done. M: C:\svn\ossrepo\icefaces3\trunk\icefaces\ace\component\src\org\icefaces\ace\component\themeselect\ThemeSelectMeta.java#33881 M: C:\svn\ossrepo\icefaces3\trunk\icefaces\ace\component\src\org\icefaces\ace\component\themeselect\ThemeSelectRenderer.java#33881
        Hide
        Ken Fyten added a comment -

        For styling, let's keep this rendered inside a SPAN and just not attempt to use the ThemeRoller rounded-corner styling due to negative interactions with the natively rendered drop-down button which can vary between browsers.

        Show
        Ken Fyten added a comment - For styling, let's keep this rendered inside a SPAN and just not attempt to use the ThemeRoller rounded-corner styling due to negative interactions with the natively rendered drop-down button which can vary between browsers.
        Hide
        yip.ng added a comment -

        Done.

        M: C:\svn\ossrepo\icefaces3\trunk\icefaces\ace\component\src\org\icefaces\ace\component\themeselect\ThemeSelectRenderer.java#33940

        Show
        yip.ng added a comment - Done. M: C:\svn\ossrepo\icefaces3\trunk\icefaces\ace\component\src\org\icefaces\ace\component\themeselect\ThemeSelectRenderer.java#33940
        Hide
        yip.ng added a comment -

        Introduced an ant property to flag inclusion or exclusion of theme jars in build. (Previously always included.)

        M: C:\svn\ossrepo\icefaces3\trunk\icefaces\samples\showcase\showcase\build.xml#34132
        M: C:\svn\ossrepo\icefaces3\trunk\icefaces\samples\build\common.xml#34132

        Show
        yip.ng added a comment - Introduced an ant property to flag inclusion or exclusion of theme jars in build. (Previously always included.) M: C:\svn\ossrepo\icefaces3\trunk\icefaces\samples\showcase\showcase\build.xml#34132 M: C:\svn\ossrepo\icefaces3\trunk\icefaces\samples\build\common.xml#34132
        Hide
        yip.ng added a comment - - edited

        Removed the none option from the selector, as per Ken's request. (cf. original requirement.) Note: if "none" is specified (in value attribute or (no value and set in context param.)), the default of "sam" will be used.

        M: C:\svn\ossrepo\icefaces3\trunk\icefaces\ace\component\src\org\icefaces\ace\component\themeselect\ThemeSelectRenderer.java#34341

        Show
        yip.ng added a comment - - edited Removed the none option from the selector, as per Ken's request. (cf. original requirement .) Note: if "none" is specified (in value attribute or (no value and set in context param.)), the default of "sam" will be used. M: C:\svn\ossrepo\icefaces3\trunk\icefaces\ace\component\src\org\icefaces\ace\component\themeselect\ThemeSelectRenderer.java#34341
        Hide
        yip.ng added a comment - - edited

        Theme select code drastically changed/re-arranged by Mircea: ICE-9163. See also ICE-9166.

        Show
        yip.ng added a comment - - edited Theme select code drastically changed/re-arranged by Mircea: ICE-9163 . See also ICE-9166 .

          People

          • Assignee:
            yip.ng
            Reporter:
            Ken Fyten
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: