@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)); }
@Override public boolean equals(Object o) { if (!(o instanceof ChangedProperty)) return (false); return (property.getName().equals(((ChangedProperty) o).property.getName())); }
@Override public int hashCode() { return (property.getName().hashCode()); }
public void resetValue() { property.setValue(oldValue); }