示例#1
0
 @Override
 public void propertyChange(PropertyChangeEvent evt) {
   if (evt.getSource() != beanHelper.getBean()
       || evt.getPropagationId() == JBeanEditor.class) {
     return;
   }
   refresh();
 }
  //
  //  Implement the PropertyChangeListener
  //
  public void propertyChange(PropertyChangeEvent e) {
    //  When the TableModel changes we need to update the listeners
    //  and column widths

    if ("model".equals(e.getPropertyName())) {
      TableModel model = (TableModel) e.getOldValue();
      model.removeTableModelListener(this);

      model = (TableModel) e.getNewValue();
      model.addTableModelListener(this);
      adjustColumns();
    }
  }
  //
  //  Implement the PropertyChangeListener
  //
  public void propertyChange(PropertyChangeEvent e) {
    //  Keep the row table in sync with the main table

    if ("selectionModel".equals(e.getPropertyName())) {
      setSelectionModel(main.getSelectionModel());
    }

    if ("rowHeight".equals(e.getPropertyName())) {
      repaint();
    }

    if ("model".equals(e.getPropertyName())) {
      main.getModel().addTableModelListener(this);
      revalidate();
    }
  }