【问题标题】:How to add documentation to attribute of composite component如何将文档添加到复合组件的属性
【发布时间】:2013-01-26 03:32:17
【问题描述】:

我有一个看起来像这样的复合组件:

<composite:interface>           
    <composite:attribute name="confirmUnload" type="java.lang.Boolean" default="false" />
    <composite:attribute name="showLoader" type="java.lang.Boolean" default="true" />
    <composite:attribute title="test test" name="menuFormIds" type="java.lang.String" default="menuForm" />
    <composite:attribute name="unloadMessage" type="java.lang.String" default="You have unsaved data" />            
</composite:interface>

<composite:implementation>
    <div title="unloadEventComponent">...</div>
</composite:implementation>

在页面中使用此组件时,eclipse 自动完成功能将帮助处理属性。但是,有时不看代码很难理解属性的作用,这对用户体验没有帮助。

是否有任何方法可以将属性描述添加到复合组件中,使其显示在 eclipse 自动完成中?

PrimeFaces 组件通常在选择属性时有描述,但它们使用自定义组件而不是复合组件。

【问题讨论】:

    标签: jsf jsf-2 documentation composite-component


    【解决方案1】:

    为此,应使用shortDescription 属性。例如

    <composite:attribute name="confirmUnload" type="java.lang.Boolean" default="false" 
        shortDescription="Set to true to enable the confirm unload message. Defaults to false." />
    

    【讨论】:

    • 正是我想要的。谢谢!
    猜你喜欢
    • 1970-01-01
    • 2012-07-18
    • 1970-01-01
    • 2021-04-06
    • 2019-06-03
    • 2011-04-04
    • 2020-01-05
    • 2018-08-25
    • 1970-01-01
    相关资源
    最近更新 更多