Пример #1
0
  @Override
  protected void prepareComponent(
      JPanel component,
      HierarchicalTable<Property> table,
      Property property,
      Object value,
      boolean isSelected,
      boolean hasFocus,
      int row,
      int column,
      boolean forEditor) {
    super.prepareComponent(
        component, table, property, value, isSelected, hasFocus, row, column, forEditor);

    if (property.getButtonText() == null) {
      button.setVisible(false);
    } else {
      button.setVisible(true);
      button.setText(property.getButtonText());
      button.setToolTipText(property.getButtonTooltip());
    }

    if (isSelected && !forEditor) {
      textfield.setBackground(table.getSelectionBackground());
      textfield.setForeground(table.getSelectionForeground());
    } else {
      textfield.setBackground(table.getBackground());
      textfield.setForeground(table.getStyle().getValueCellFontColor());
    }
    panel.setBackground(textfield.getBackground());
    textfield.setFont(table.getStyle().getValueCellFont());
    textfield.setBorder(null);

    textfield.setText(FORMAT.format(value));
  }
Пример #2
0
  @Override
  public boolean equals(Object o) {
    if (!(o instanceof ChangedProperty)) return (false);

    return (property.getName().equals(((ChangedProperty) o).property.getName()));
  }
Пример #3
0
 @Override
 public int hashCode() {
   return (property.getName().hashCode());
 }
Пример #4
0
 public void resetValue() {
   property.setValue(oldValue);
 }