我正在编写一个仪表板设计器,它将基于 xml 值创建小部件。
喜欢
<dashboard>
<widget type="chart">
</widget>
</dashboard>
我想根据@type的值更改<widget>内的标签,例如如果type="chart"那么它应该允许不同的标签
<dashboard>
<widget type="chart">
<title text="Chart Title"></title>
<plotOptions>
<plotOptions>
<pie showInLegend="true" shadow="false" innerSize="50%">
<dataLabels color="#fff" distance="-20" format="{point.percentage:.0f} %" overflow="false"></dataLabels>
</pie>
</plotOptions>
<legend width="150" align="right" x="10" layout="vertical">
<navigation></navigation>
</legend>
<tooltip enabled="false"></tooltip>
<exporting enabled="true"></exporting>
</plotOptions>
</widget>
</dashboard>
如果我们有 type="table"它应该允许不同的标签
<dashboard>
<widget type="table">
<title text="Table Title"></title>
<thead>
<tr>
<th>One</th>
<th>Two</th>
<th>Three</th>
</tr>
</thead>
<tbody>
<tr>
<td>DS.One</td>
<td>DS.Two</td>
<td>DS.Three</td>
</tr>
</tbody>
</widget>
</dashboard>
它还应该在 XML 编辑器中给出自动建议,如“ECLIPSE”