BetterBeansBinding
  1. BetterBeansBinding
  2. BETTERBEANSBINDING-32

JTableBinding.ColumnBinding: cell renderer/editor

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.3.0
    • Component/s: SwingBinding
    • Labels:
      None

      Description

      This is really very unfortunate that there are no setters for cell editor and renderer in class JTableBinding.ColumnBinding.
      This is typical usage:
      JTableBinding scheduleBinding =
      SwingBindings.createJTableBinding(UpdateStrategy.READ,
      ctr.getSchedule(), scheduleTable);
      scheduleBinding.addColumnBinding(BeanProperty.create(ScheduleEntryDTO.ORDINAL))
      .setColumnName("no");
      scheduleBinding.addColumnBinding(BeanProperty.create(ScheduleEntryDTO.PREMIUM_DUE))
      .setColumnName("premium");
      scheduleBinding.addColumnBinding(BeanProperty.create(ScheduleEntryDTO.BROKERAGE))
      .setColumnName("brokerage");
      ...more to come...

      Now the problem is I would like to apply custom renderers, but the only way to do it (I mean the only way excluding hacking) is to declare column class, like this:
      scheduleBinding.addColumnBinding(BeanProperty.create(ScheduleEntryDTO.PREMIUM_DUE))
      .setColumnName("premium")
      .setColumnClass(XYZ);

      and configure JTable like this:
      scheduleTable.setDefaultEditor(XYZ, EDITOR);
      scheduleTable.setDefaultRenderer(XYZ, RENDERER);

      The problem is I have many columns with the values of the same class but I want different renderers/editors apply to them.

      That would be extremely helpful if two methods:
      #setRenderer
      #setEditor
      would be added to ColumnBinding class.


      Witold Szczerba

        Activity

        Hide
        fabriziogiudici added a comment -
        Show
        fabriziogiudici added a comment - Integrated in BetterBeansBinding (Nightly Build) #55 Fix for

          People

          • Assignee:
            fabriziogiudici
            Reporter:
            Witold_Szczerba
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Time Tracking

              Estimated:
              Original Estimate - Not Specified
              Not Specified
              Remaining:
              Remaining Estimate - 0 minutes
              0m
              Logged:
              Time Spent - 2 hours, 30 minutes
              2h 30m