如何向复合组件的属性添加文档

Ali*_*ito 3 documentation jsf composite-component jsf-2

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

<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>
Run Code Online (Sandbox Code Playgroud)

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

有没有办法以eclipse自动完成中显示的方式将属性描述添加到复合组件?

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

Bal*_*usC 7

为此,shortDescription应使用该属性.例如

<composite:attribute name="confirmUnload" type="java.lang.Boolean" default="false" 
    shortDescription="Set to true to enable the confirm unload message. Defaults to false." />
Run Code Online (Sandbox Code Playgroud)