Example #1
0
  public void refresh() {
    Iterable<Property> properties = Collections.emptyList();

    if (beanHelper != null) {
      Image icon = beanHelper.getIcon(BeanInfo.ICON_COLOR_32x32);
      if (icon == null) {
        remove(top);
      } else {
        JXImageView logo = new JXImageView();
        logo.setImage(icon);
        add(logo, BorderLayout.NORTH);
      }
      properties =
          filter(
              beanHelper.getProperties(),
              new Predicate<Property>() {
                @Override
                public boolean apply(Property input) {
                  return !input.isHidden();
                }
              });
    }

    table.setModel(new MyTableModel(properties));

    // should we expose minimum row/column sizes as a user property?
    table.setRowHeight(18); // essentially the minimum row height
    table.getColumnModel().getColumn(0).setMinWidth(1);
    table.getColumnModel().getColumn(0).setMaxWidth(1);
    table.getColumnModel().getColumn(1).setMinWidth(1);

    table.packAll();
    revalidate();
  }
Example #2
0
 @Override
 public void propertyChange(PropertyChangeEvent evt) {
   if (evt.getSource() != beanHelper.getBean()
       || evt.getPropagationId() == JBeanEditor.class) {
     return;
   }
   refresh();
 }