/** Tell every item in the tree that it's data is out of date */ private void invalidateItemTree() { Enumeration<TreeNode> e = rootNode.breadthFirstEnumeration(); DefaultMutableTreeNode node; // invalidate the root object Object nodeInfo = rootNode.getUserObject(); ((DataItem) nodeInfo).invalidateData(); // invalidate all of the root object's descendents for (; e.hasMoreElements(); ) { node = (DefaultMutableTreeNode) e.nextElement(); nodeInfo = node.getUserObject(); ((DataItem) nodeInfo).invalidateData(); } }
/* (non-Javadoc) * @see org.ribax.swing.ui.DataItem#invalidateData() */ public void invalidateData() { if (LOG.isDebugEnabled()) { LOG.debug(name + Messages.getString(BUNDLE_NAME, "Folder.24")); // $NON-NLS-1$ } loaded = false; // invalidate all the Tabs in this folder for (int i = 0; i < dataItems.size(); i++) { DataItem item = (DataItem) dataItems.elementAt(i); item.invalidateData(); } }
/** * Handle a user button click from one of the buttons on the ButtonPanel in this RootFolder. * * @see org.ribax.swing.ui.TabButtonListener#doAction(int, java.lang.String) */ public void doAction(int buttonType, String action) { if (nodeInfo == null) { return; } ArrayList params = null; if (globalParams != null) { params = globalParams.getNameValuePairs(); } // pass the action to the current selected Folder if (buttonType == TabButton.REFRESH) { ((DataItem) nodeInfo).invalidateData(); ((DataItem) nodeInfo).refresh(params, action); } else if (buttonType == TabButton.UPDATE) { ((DataItem) nodeInfo).updateData(params, action); } else if (buttonType == TabButton.RELOAD) { invalidateItemTree(); ((DataItem) nodeInfo).refresh(params, action); } }