Updating of a Tree when the label changes

From: Deborah K. Charan (dcharan_at_atcorp.com)
Date: 10/28/04


Date: 28 Oct 2004 06:11:42 -0700

I have seen postings about similar problems, and have tried
duplicating what others have tried, but my tree never updates with the
new values. In the code below, I have stepped through and see the new
nodes with the correct values, but it never redraws. The reason that
I am removing and reinserting the node is that just calling
node.setUserObject(newVal) does not change the length of the label.
Atleast it updates the label to ... :)

Here is the code snipet. If I don't actually expand the tree until
later in the game, I do get the current value for SysUpTime and
numPktsRecvd, but it never updates it from there.

                if (label == "SysUpTime")
                        node = _sysUpTime;
                else if (label == "Packets Received")
                        node = _numPktsRecvd;

                DefaultMutableTreeNode newNode;
                TreeNode parent = node.getParent();
                int index = parent.getIndex(node);
                _localModel.removeNodeFromParent(node);
                newNode = new DefaultMutableTreeNode(
                                new String(label + ": " + value), false);
                _localModel.insertNodeInto((MutableTreeNode) newNode,
                                (MutableTreeNode) parent, index);
                if (label == "SysUpTime")
                        _sysUpTime = newNode;
                else if (label == "Packets Received")
                        _numPktsRecvd = newNode;
                _localModel.reload();

Any information would be appreciated.

Thanks
Debbie Charan



Relevant Pages

  • 2.6.17-rc4-mm1
    ... See the `hot-fixes' directory for any important updates to this patchset. ... To fetch an -mm tree using git, ... Updates and fixes against acpi-dock-driver.patch ... Fix them. ...
    (Linux-Kernel)
  • 2.6.24-rc2-mm1
    ... In response to various people needing to get at the mm tree in a timely ... See the `hot-fixes' directory for any important updates to this patchset. ... Variosu fixes and updates to the driver tree ... DVB cleanup ...
    (Linux-Kernel)
  • 2.6.24-mm1
    ... The x86 git tree has been dropped due to runtime failure on one of my test ... See the `hot-fixes' directory for any important updates to this patchset. ... Make a USB driver play nicer with my workflow. ... Fix rejects in git-audit-master.patch ...
    (Linux-Kernel)
  • 2.6.24-rc3-mm1
    ... Added new git tree git-lblnet.patch: ... See the `hot-fixes' directory for any important updates to this patchset. ... If you hit a bug in -mm and it is not obvious which patch caused it, ... Fix git-acpi versus driver tree ...
    (Linux-Kernel)
  • 2.6.19-rc4-mm2
    ... Mainly to test the updates to the driver ... Lots of fbdev updates. ... To fetch an -mm tree using git, ... ACPi fix ...
    (Linux-Kernel)