提交 47202fd6 编写于 作者: A Anastasiya Volkova

#9013 interval type field column visibility settings changed


Former-commit-id: b1722d59
上级 cbdffe3a
......@@ -30,6 +30,7 @@ import org.jkiss.dbeaver.model.impl.jdbc.struct.JDBCDataType;
import org.jkiss.dbeaver.model.impl.jdbc.struct.JDBCTableColumn;
import org.jkiss.dbeaver.model.meta.IPropertyValueListProvider;
import org.jkiss.dbeaver.model.meta.IPropertyValueTransformer;
import org.jkiss.dbeaver.model.meta.IPropertyValueValidator;
import org.jkiss.dbeaver.model.meta.Property;
import org.jkiss.dbeaver.model.runtime.DBRProgressMonitor;
import org.jkiss.dbeaver.model.runtime.VoidProgressMonitor;
......@@ -297,7 +298,7 @@ public abstract class PostgreAttribute<OWNER extends DBSEntity & PostgreObject>
return super.getDefaultValue();
}
@Property(viewable = true, order = 31)
@Property(viewable = true, order = 31, visibleIf = PostgreTableHasIntervalTypeValidator.class)
public String getIntervalTypeField() {
if (typeId == PostgreOid.INTERVAL) {
return PostgreUtils.getIntervalField(typeMod);
......@@ -305,6 +306,14 @@ public abstract class PostgreAttribute<OWNER extends DBSEntity & PostgreObject>
return null;
}
public long getTypeId() {
return typeId;
}
public int getTypeMod() {
return typeMod;
}
@Nullable
@Override
@Property(viewable = true, editable = true, updatable = true, multiline = true, order = 100)
......@@ -403,4 +412,12 @@ public abstract class PostgreAttribute<OWNER extends DBSEntity & PostgreObject>
}
}
}
public static class PostgreTableHasIntervalTypeValidator implements IPropertyValueValidator<PostgreAttribute, Object> {
@Override
public boolean isValidValue(PostgreAttribute object, Object value) throws IllegalArgumentException {
return object.getTypeId() == PostgreOid.INTERVAL;
}
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册