当前位置: 代码迷 >> Eclipse >> 再次,各位大神们,救救小弟我
  详细解决方案

再次,各位大神们,救救小弟我

热度:84   发布时间:2016-04-23 00:31:51.0
再次求助,各位大神们,救救我
怎么样才能读取xml文件并在tree中显示呢?
现在有一个像这样的一个xml文件
<?xml version="1.0" encoding="UTF-8"?>
<linear name="linear" type="model">
<target>属性A</target>
<input>
<fieldName>属性A</fieldName>
<fieldName>属性B</fieldName>
<input>
<fieldName>属性c</fieldName>
<input iiiii = "1">
<fieldName>属性d</fieldName>
<input iiiii = "53">
<fieldName>属性e</fieldName>

<input iiiii = "53">
<fieldName>属性f</fieldName>

</input>
</input>

</input>
</input>
<fieldName>属性C</fieldName>
</input>
<output  BCOV="true" RegEffectChart="true" ResiPlot="true"
ResiNPPlot="true" CORRELATION="true" COLINEARITY="true" PREDECT="true"
RESIDUAL="true" />
</linear>

读取的话我已经用dom4j读取了就是怎么动态的放到tree中呢?各位大神们帮助呀。也就是怎么生成像图中那样的树状图呢?

分嫌少的话我可以再加。
------解决方案--------------------
关于SWT Viewer的ContentProvider和LabelProvider需要一定时间理解,我刚接触时也是完全不知道怎么做,等我理解它的写法那是几年后了
  相关解决方案