@Override
public List<PresentableProperty> getPresentableProperties() {
List<PresentableProperty> properties = super.getPresentableProperties();
switch (constraintType) {
case CHECK:
properties.add(0, new SimplePresentableProperty("Check condition", checkCondition));
properties.add(0, new SimplePresentableProperty("Constraint type", "Check"));
break;
case PRIMARY_KEY: properties.add(0, new SimplePresentableProperty("Constraint type", "Primary Key")); break;
case FOREIGN_KEY:
DBConstraint foreignKeyConstraint = getForeignKeyConstraint();
properties.add(0, new DBObjectPresentableProperty(foreignKeyConstraint));
properties.add(0, new SimplePresentableProperty("Constraint type", "Foreign Key"));
break;
case UNIQUE_KEY: properties.add(0, new SimplePresentableProperty("Constraint type", "Unique")); break;
}
return properties;
}