提交 fa354614 编写于 作者: S serge-rider

#8366 Connection type color backward compatibility added

上级 6c9b5d64
......@@ -71,7 +71,7 @@ public class DBPConnectionType implements DBPDataSourcePermissionOwner {
{
this.id = id;
this.name = name;
this.color = color;
this.color = getColorValueFixed(color);
this.description = description;
this.autocommit = autocommit;
this.confirmExecute = confirmExecute;
......@@ -103,7 +103,7 @@ public class DBPConnectionType implements DBPDataSourcePermissionOwner {
}
public void setColor(String color) {
this.color = color;
this.color = getColorValueFixed(color);
}
public String getDescription() {
......@@ -161,6 +161,17 @@ public class DBPConnectionType implements DBPDataSourcePermissionOwner {
}
}
private String getColorValueFixed(String color) {
// Backward compatibility.
// In old times we had hardcoded colors now we need to change them to color constants
if (PROD != null && this.id.equals(PROD.id) && color.equals("247,159,129")) {
return PROD.color;
} else if (TEST != null && this.id.equals(TEST.id) && color.equals("196,255,181")) {
return TEST.color;
}
return color;
}
@Override
public String toString() {
return name;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册