Java 在addRow()函数中使用树中的数据

Java 在addRow()函数中使用树中的数据,java,gwt,flextable,Java,Gwt,Flextable,因此,我有一个flextable,我正在尝试添加一行。我要输入到单元格中的数据位于树中。我似乎找不到办法把数据带到我的等式中去。有什么帮助吗 这是保存一些示例信息的树 private Node root = buildTree(); private Node buildTree() { Node root = new Node(); root.id = "Main Component"; root.data = new String[]{ "example", "exa

因此,我有一个flextable,我正在尝试添加一行。我要输入到单元格中的数据位于树中。我似乎找不到办法把数据带到我的等式中去。有什么帮助吗

这是保存一些示例信息的树

private Node root = buildTree();

private Node buildTree()
{
    Node root = new Node();
    root.id = "Main Component";
    root.data = new String[]{ "example", "example", "example", "example", "example", "example", "example"};

    Node child1 = new Node();
    child1.id = "Part 1";
    child1.data = new String[]{ "example", "example", "example", "example", "example", "example", "example"};
    root.children.add(child1);

    Node child11 = new Node();
    child11.id = "Part 1-1";
    child11.data = new String[]{ "example", "example", "example", "example", "example", "example", "example"};
    child1.children.add(child11);
我希望能够调用addRow()将一行添加到我的表中,我只是被困在如何在节点的数组中获取信息的问题上

private void addRow(Node nde)
{
    //add first row of data, pull information from the tree
}

非常感谢您提供的任何帮助

因此,该行应该包含来自完整树的数据,还是仅包含来自传递给addRow的一个节点的数据?该行将仅包含传递给addRow的节点中的数据。我就是找不到一种方法来访问那个字符串。我想这是一个如此简单的解决方案,但我还没有找到答案。我正在调用“addRow(root)”,现在在addRow中我正在尝试提取字符串。因此尝试访问
nde.data
不起作用?非常感谢,就这么简单。谢谢你的时间!