提交 fae5d675 编写于 作者: E Evgeny Fradkin

#2485 Binary data types colorizing, "Resultset Data Types" group in the prefs,...

#2485 Binary data types colorizing, "Resultset Data Types" group in the prefs, dark theme is corrected, few improvements


Former-commit-id: 46778b3e
上级 37bf0b0b
......@@ -456,6 +456,7 @@ page.org.jkiss.dbeaver.preferences.projectSettings.name = DBeaver Settings
themeElementCategory.org.jkiss.dbeaver.ui.presentation.sql.label = SQL Editor
themeElementCategory.org.jkiss.dbeaver.ui.presentation.sql.description = SQL Editor
themeElementCategory.org.jkiss.dbeaver.ui.presentation.results.label = Database Query Results
themeElementCategory.org.jkiss.dbeaver.ui.presentation.datatypes.label = Resultset Data Types
themeElementCategory.org.jkiss.dbeaver.ui.presentation.results.description = SQL Editor
fontDefinition.org.jkiss.dbeaver.sql.resultset.font.label = Results grid font
......@@ -493,6 +494,8 @@ colorDefinition.org.jkiss.dbeaver.sql.resultset.color.header.selected.background
colorDefinition.org.jkiss.dbeaver.sql.resultset.color.header.selected.background.description = Grid header background
colorDefinition.org.jkiss.dbeaver.sql.resultset.color.null.foreground.label = Grid NULL value foreground
colorDefinition.org.jkiss.dbeaver.sql.resultset.color.null.foreground.description = Grid NULL value foreground
colorDefinition.org.jkiss.dbeaver.sql.resultset.color.binary.foreground.label = Grid binary value foreground
colorDefinition.org.jkiss.dbeaver.sql.resultset.color.binary.foreground.description = Grid binary value foreground
colorDefinition.org.jkiss.dbeaver.sql.resultset.color.boolean.foreground.label = Grid boolean value foreground
colorDefinition.org.jkiss.dbeaver.sql.resultset.color.boolean.foreground.description = Grid boolean value foreground
colorDefinition.org.jkiss.dbeaver.sql.resultset.color.datetime.foreground.label = Grid date/time value foreground
......
......@@ -15,10 +15,11 @@
'org.jkiss.dbeaver.sql.resultset.color.header.foreground=255,255,255'
'org.jkiss.dbeaver.sql.resultset.color.header.selected.background=105,105,150'
'org.jkiss.dbeaver.sql.resultset.color.null.foreground=100,100,100'
'org.jkiss.dbeaver.sql.resultset.color.boolean.foreground=0,255,0'
'org.jkiss.dbeaver.sql.resultset.color.datetime.foreground=255,0,0'
'org.jkiss.dbeaver.sql.resultset.color.numeric.foreground=0,0,255'
'org.jkiss.dbeaver.sql.resultset.color.string.foreground=0,0,0'
'org.jkiss.dbeaver.sql.resultset.color.binary.foreground=100,100,100'
'org.jkiss.dbeaver.sql.resultset.color.boolean.foreground=255,0,0'
'org.jkiss.dbeaver.sql.resultset.color.datetime.foreground=0,191,0'
'org.jkiss.dbeaver.sql.resultset.color.numeric.foreground=64,64,255'
'org.jkiss.dbeaver.sql.resultset.color.string.foreground=111,111,111'
'org.jkiss.dbeaver.sql.editor.color.text.foreground=221,221,221'
'org.jkiss.dbeaver.sql.editor.color.text.background=65,70,74'
......
......@@ -2746,6 +2746,9 @@
<themeElementCategory label="%themeElementCategory.org.jkiss.dbeaver.ui.presentation.results.label" id="org.jkiss.dbeaver.ui.presentation.results">
<description>%themeElementCategory.org.jkiss.dbeaver.ui.presentation.results.description</description>
</themeElementCategory>
<themeElementCategory label="%themeElementCategory.org.jkiss.dbeaver.ui.presentation.datatypes.label" id="org.jkiss.dbeaver.ui.presentation.datatypes">
<description>%themeElementCategory.org.jkiss.dbeaver.ui.presentation.datatypes.description</description>
</themeElementCategory>
<fontDefinition id="org.jkiss.dbeaver.sql.resultset.font" categoryId="org.jkiss.dbeaver.ui.presentation.results" label="%fontDefinition.org.jkiss.dbeaver.sql.resultset.font.label">
<description>%fontDefinition.org.jkiss.dbeaver.sql.resultset.font.description</description>
</fontDefinition>
......@@ -2865,30 +2868,37 @@
</colorDefinition>
<!-- Colors for data types -->
<colorDefinition
label="%colorDefinition.org.jkiss.dbeaver.sql.resultset.color.binary.foreground.label"
categoryId="org.jkiss.dbeaver.ui.presentation.datatypes"
id="org.jkiss.dbeaver.sql.resultset.color.binary.foreground"
value="100, 100, 100">
<description>%colorDefinition.org.jkiss.dbeaver.sql.resultset.color.binary.foreground.description</description>
</colorDefinition>
<colorDefinition
label="%colorDefinition.org.jkiss.dbeaver.sql.resultset.color.boolean.foreground.label"
categoryId="org.jkiss.dbeaver.ui.presentation.results"
categoryId="org.jkiss.dbeaver.ui.presentation.datatypes"
id="org.jkiss.dbeaver.sql.resultset.color.boolean.foreground"
value="0, 255, 0">
value="255, 100, 0">
<description>%colorDefinition.org.jkiss.dbeaver.sql.resultset.color.boolean.foreground.description</description>
</colorDefinition>
<colorDefinition
label="%colorDefinition.org.jkiss.dbeaver.sql.resultset.color.datetime.foreground.label"
categoryId="org.jkiss.dbeaver.ui.presentation.results"
categoryId="org.jkiss.dbeaver.ui.presentation.datatypes"
id="org.jkiss.dbeaver.sql.resultset.color.datetime.foreground"
value="255, 100, 0">
value="0, 255, 0">
<description>%colorDefinition.org.jkiss.dbeaver.sql.resultset.color.datetime.foreground.description</description>
</colorDefinition>
<colorDefinition
label="%colorDefinition.org.jkiss.dbeaver.sql.resultset.color.numeric.foreground.label"
categoryId="org.jkiss.dbeaver.ui.presentation.results"
categoryId="org.jkiss.dbeaver.ui.presentation.datatypes"
id="org.jkiss.dbeaver.sql.resultset.color.numeric.foreground"
value="0, 0, 255">
<description>%colorDefinition.org.jkiss.dbeaver.sql.resultset.color.numeric.foreground.description</description>
</colorDefinition>
<colorDefinition
label="%colorDefinition.org.jkiss.dbeaver.sql.resultset.color.string.foreground.label"
categoryId="org.jkiss.dbeaver.ui.presentation.results"
categoryId="org.jkiss.dbeaver.ui.presentation.datatypes"
id="org.jkiss.dbeaver.sql.resultset.color.string.foreground"
value="0, 0, 0">
<description>%colorDefinition.org.jkiss.dbeaver.sql.resultset.color.string.foreground.description</description>
......
......@@ -40,6 +40,7 @@ public class ThemeConstants
public static final String COLOR_SQL_RESULT_HEADER_FOREGROUND = RESULTS_PROP_PREFIX + "color.header.foreground"; //$NON-NLS-1$
public static final String COLOR_SQL_RESULT_HEADER_SELECTED_BACKGROUND = RESULTS_PROP_PREFIX + "color.header.selected.background"; //$NON-NLS-1$
public static final String COLOR_SQL_RESULT_NULL_FOREGROUND = RESULTS_PROP_PREFIX + "color.null.foreground"; //$NON-NLS-1$
public static final String COLOR_SQL_RESULT_BINARY_FOREGROUND = RESULTS_PROP_PREFIX + "color.binary.foreground"; //$NON-NLS-1$
public static final String COLOR_SQL_RESULT_BOOLEAN_FOREGROUND = RESULTS_PROP_PREFIX + "color.boolean.foreground"; //$NON-NLS-1$
public static final String COLOR_SQL_RESULT_DATETIME_FOREGROUND = RESULTS_PROP_PREFIX + "color.datetime.foreground"; //$NON-NLS-1$
public static final String COLOR_SQL_RESULT_NUMERIC_FOREGROUND = RESULTS_PROP_PREFIX + "color.numeric.foreground"; //$NON-NLS-1$
......
......@@ -130,10 +130,7 @@ public class SpreadsheetPresentation extends AbstractPresentation implements IRe
private Color backgroundReadOnly;
private Color foregroundDefault;
private Color foregroundNull;
private Color foregroundBoolean;
private Color foregroundDatetime;
private Color foregroundNumeric;
private Color foregroundString;
private Map<DBPDataKind, Color> dataTypesForegrounds;
private Color foregroundSelected, backgroundSelected;
private Color backgroundMatched;
private Color cellHeaderForeground, cellHeaderBackground, cellHeaderSelectionBackground;
......@@ -998,10 +995,13 @@ public class SpreadsheetPresentation extends AbstractPresentation implements IRe
this.cellHeaderSelectionBackground = new Color(getSpreadsheet().getDisplay(), cellSel);
}
this.foregroundNull = colorRegistry.get(ThemeConstants.COLOR_SQL_RESULT_NULL_FOREGROUND);
this.foregroundBoolean = colorRegistry.get(ThemeConstants.COLOR_SQL_RESULT_BOOLEAN_FOREGROUND);
this.foregroundDatetime = colorRegistry.get(ThemeConstants.COLOR_SQL_RESULT_DATETIME_FOREGROUND);
this.foregroundNumeric = colorRegistry.get(ThemeConstants.COLOR_SQL_RESULT_NUMERIC_FOREGROUND);
this.foregroundString = colorRegistry.get(ThemeConstants.COLOR_SQL_RESULT_STRING_FOREGROUND);
this.dataTypesForegrounds = new HashMap<>();
this.dataTypesForegrounds.put(DBPDataKind.BINARY, colorRegistry.get(ThemeConstants.COLOR_SQL_RESULT_BINARY_FOREGROUND));
this.dataTypesForegrounds.put(DBPDataKind.BOOLEAN, colorRegistry.get(ThemeConstants.COLOR_SQL_RESULT_BOOLEAN_FOREGROUND));
this.dataTypesForegrounds.put(DBPDataKind.BOOLEAN, colorRegistry.get(ThemeConstants.COLOR_SQL_RESULT_BOOLEAN_FOREGROUND));
this.dataTypesForegrounds.put(DBPDataKind.DATETIME, colorRegistry.get(ThemeConstants.COLOR_SQL_RESULT_DATETIME_FOREGROUND));
this.dataTypesForegrounds.put(DBPDataKind.NUMERIC, colorRegistry.get(ThemeConstants.COLOR_SQL_RESULT_NUMERIC_FOREGROUND));
this.dataTypesForegrounds.put(DBPDataKind.STRING, colorRegistry.get(ThemeConstants.COLOR_SQL_RESULT_STRING_FOREGROUND));
this.spreadsheet.setLineColor(colorRegistry.get(ThemeConstants.COLOR_SQL_RESULT_LINES_NORMAL));
......@@ -1533,12 +1533,11 @@ public class SpreadsheetPresentation extends AbstractPresentation implements IRe
return foregroundNull;
} else {
if (colorizeDataTypes) {
DBDAttributeBinding attr = (DBDAttributeBinding)(rowElement instanceof DBDAttributeBinding ? rowElement : colElement);
switch (attr.getDataKind()) {
case BOOLEAN: return foregroundBoolean;
case DATETIME: return foregroundDatetime;
case NUMERIC: return foregroundNumeric;
case STRING: return foregroundString;
DBDAttributeBinding attr =
(DBDAttributeBinding)(rowElement instanceof DBDAttributeBinding ? rowElement : colElement);
Color color = dataTypesForegrounds.get(attr.getDataKind());
if (color != null) {
return color;
}
}
if (foregroundDefault == null) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册