String () { if (myHierarchyTree.hasFocus()) { if (!myComponents.isEmpty()) { return myComponents.get(0).getClass().getName(); } else { TreePath path = myHierarchyTree.getSelectionPath(); if (path != null) { Object obj = path.getLastPathComponent(); if (obj instanceof HierarchyTree.ComponentNode) { Component comp = ((HierarchyTree.ComponentNode)obj).getComponent(); if (comp != null) { return comp.getClass().getName(); } } } } } else if (myInspectorTable.getTable().hasFocus()) { int row = myInspectorTable.getTable().getSelectedRow(); String value = myInspectorTable.getCellTextValue(row, 1); // remove hashcode, properties description, take first from enumeration String[] parts = value.split("[@,\\[]"); return parts[0]; } return null; }