swingx
  1. swingx
  2. SWINGX-1379

JXTreeTable.TreeTableModelAdapter: support access to underlying TreeTableModel

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.6.2
    • Fix Version/s: 1.6.3
    • Component/s: TreeTable
    • Labels:
      None
    • Environment:

      Operating System: All
      Platform: All

    • Issuezilla Id:
      1,379

      Description

      There is no way to get the original model put on a JXTreeTable without using
      reflection. To have a method to get it from the TreeTableCellRenderer would be
      useful when you don't have it (in the ColumnFactory for exemple). The only way I
      achieve it, was by doing this:
      @Override
      public void configureTableColumn(TableModel model, TableColumnExt columnExt) {
      super.configureTableColumn(model, columnExt);
      if
      (model.getClass().getName().startsWith("org.jdesktop.swingx.JXTreeTable$TreeTableModelAdapter"))
      {
      try

      { Field f = model.getClass().getDeclaredField("tree"); f.setAccessible(true); JTree tree = (JTree) f.get(model); TreeModel tm = tree.getModel(); //do something with the model on the column }

      catch (SecurityException e) {
      } catch (IllegalArgumentException e) {
      } catch (NoSuchFieldException e) {
      } catch (IllegalAccessException e) {
      }
      }
      }

        Activity

        klbsjpolp created issue -
        kenaiadmin made changes -
        Field Original Value New Value
        issue.field.bugzillaimportkey 1379 85639

          People

          • Assignee:
            kleopatra
            Reporter:
            klbsjpolp
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: