protected void processCategories(Document doc) { CategoryExplorerTree tree = _monitor.getCategoryExplorerTree(); CategoryExplorerModel model = tree.getExplorerModel(); NodeList nodeList = doc.getElementsByTagName(CATEGORY); // determine where the starting node is NamedNodeMap map = nodeList.item(0).getAttributes(); int j = (getValue(map, NAME).equalsIgnoreCase(FIRST_CATEGORY_NAME)) ? 1 : 0; // iterate backwards throught the nodeList so that expansion of the // list can occur for (int i = nodeList.getLength() - 1; i >= j; i--) { Node n = nodeList.item(i); map = n.getAttributes(); CategoryNode chnode = model.addCategory(new CategoryPath(getValue(map, PATH))); chnode.setSelected((getValue(map, SELECTED).equalsIgnoreCase("true")) ? true : false); if (getValue(map, EXPANDED).equalsIgnoreCase("true")) ; tree.expandPath(model.getTreePathToRoot(chnode)); } }
protected LogRecordFilter createNDCLogRecordFilter(String text) { _NDCTextFilter = text; LogRecordFilter result = new LogRecordFilter() { public boolean passes(LogRecord record) { String NDC = record.getNDC(); CategoryPath path = new CategoryPath(record.getCategory()); if (NDC == null || _NDCTextFilter == null) { return false; } else if (NDC.toLowerCase().indexOf(_NDCTextFilter.toLowerCase()) == -1) { return false; } else { return getMenuItem(record.getLevel()).isSelected() && _categoryExplorerTree.getExplorerModel().isCategoryPathActive(path); } } }; return result; }
protected LogRecordFilter createLogRecordFilter() { LogRecordFilter result = new LogRecordFilter() { public boolean passes(LogRecord record) { CategoryPath path = new CategoryPath(record.getCategory()); return getMenuItem(record.getLevel()).isSelected() && _categoryExplorerTree.getExplorerModel().isCategoryPathActive(path); } }; return result; }