use of org.eclipse.ui.themes.ITheme in project dbeaver by serge-rider.
the class ERDGraphicalViewer method applyThemeSettings.
private void applyThemeSettings() {
ITheme currentTheme = themeManager.getCurrentTheme();
Font erdFont = currentTheme.getFontRegistry().get("org.jkiss.dbeaver.erd.diagram.font");
if (erdFont != null) {
this.getControl().setFont(erdFont);
}
editor.refreshDiagram(true);
/*
DiagramPart diagramPart = editor.getDiagramPart();
if (diagramPart != null) {
diagramPart.resetFonts();
diagramPart.refresh();
}
*/
}
use of org.eclipse.ui.themes.ITheme in project dbeaver by serge-rider.
the class SQLRuleManager method getColor.
public Color getColor(String colorKey, int colorDefault) {
ITheme currentTheme = themeManager.getCurrentTheme();
Color color = currentTheme.getColorRegistry().get(colorKey);
if (color == null) {
color = Display.getDefault().getSystemColor(colorDefault);
}
return color;
}
use of org.eclipse.ui.themes.ITheme in project dbeaver by dbeaver.
the class PlainTextPresentation method applyThemeSettings.
@Override
protected void applyThemeSettings() {
IThemeManager themeManager = controller.getSite().getWorkbenchWindow().getWorkbench().getThemeManager();
curLineColor = themeManager.getCurrentTheme().getColorRegistry().get(ThemeConstants.COLOR_SQL_RESULT_CELL_ODD_BACK);
ITheme currentTheme = themeManager.getCurrentTheme();
Font rsFont = currentTheme.getFontRegistry().get(ThemeConstants.FONT_SQL_RESULT_SET);
if (rsFont != null) {
int fontHeight = rsFont.getFontData()[0].getHeight();
Font font = JFaceResources.getFont(JFaceResources.TEXT_FONT);
FontData[] fontData = font.getFontData();
fontData[0].setHeight(fontHeight);
Font newFont = new Font(font.getDevice(), fontData[0]);
this.text.setFont(newFont);
if (monoFont != null) {
UIUtils.dispose(monoFont);
}
monoFont = newFont;
}
}
use of org.eclipse.ui.themes.ITheme in project dbeaver by dbeaver.
the class SpreadsheetPresentation method applyThemeSettings.
// /////////////////////////////////////////////
// Themes
@Override
protected void applyThemeSettings() {
ITheme currentTheme = themeManager.getCurrentTheme();
Font rsFont = currentTheme.getFontRegistry().get(ThemeConstants.FONT_SQL_RESULT_SET);
if (rsFont != null) {
this.spreadsheet.setFont(rsFont);
}
final ColorRegistry colorRegistry = currentTheme.getColorRegistry();
Color previewBack = colorRegistry.get(ThemeConstants.COLOR_SQL_RESULT_SET_PREVIEW_BACK);
if (previewBack != null) {
// this.previewPane.getViewPlaceholder().setBackground(previewBack);
// for (Control control : this.previewPane.getViewPlaceholder().getChildren()) {
// control.setBackground(previewBack);
// }
}
// this.foregroundDefault = currentTheme.getColorRegistry().get(ThemeConstants.COLOR_SQL_RESULT_CELL_FORE);
this.backgroundAdded = colorRegistry.get(ThemeConstants.COLOR_SQL_RESULT_CELL_NEW_BACK);
this.backgroundDeleted = colorRegistry.get(ThemeConstants.COLOR_SQL_RESULT_CELL_DELETED_BACK);
this.backgroundModified = colorRegistry.get(ThemeConstants.COLOR_SQL_RESULT_CELL_MODIFIED_BACK);
this.backgroundOdd = colorRegistry.get(ThemeConstants.COLOR_SQL_RESULT_CELL_ODD_BACK);
this.backgroundReadOnly = colorRegistry.get(ThemeConstants.COLOR_SQL_RESULT_CELL_READ_ONLY);
this.foregroundSelected = colorRegistry.get(ThemeConstants.COLOR_SQL_RESULT_SET_SELECTION_FORE);
this.backgroundSelected = colorRegistry.get(ThemeConstants.COLOR_SQL_RESULT_SET_SELECTION_BACK);
this.backgroundMatched = colorRegistry.get(ThemeConstants.COLOR_SQL_RESULT_CELL_MATCHED);
this.cellHeaderForeground = colorRegistry.get(ThemeConstants.COLOR_SQL_RESULT_HEADER_FOREGROUND);
this.cellHeaderBackground = colorRegistry.get(ThemeConstants.COLOR_SQL_RESULT_HEADER_BACKGROUND);
{
if (this.cellHeaderSelectionBackground != null) {
UIUtils.dispose(this.cellHeaderSelectionBackground);
this.cellHeaderSelectionBackground = null;
}
Color headerSelectionBackground = colorRegistry.get(ThemeConstants.COLOR_SQL_RESULT_HEADER_SELECTED_BACKGROUND);
RGB cellSel = UIUtils.blend(headerSelectionBackground.getRGB(), new RGB(255, 255, 255), 50);
this.cellHeaderSelectionBackground = new Color(getSpreadsheet().getDisplay(), cellSel);
}
this.foregroundNull = colorRegistry.get(ThemeConstants.COLOR_SQL_RESULT_NULL_FOREGROUND);
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.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));
this.spreadsheet.setLineSelectedColor(colorRegistry.get(ThemeConstants.COLOR_SQL_RESULT_LINES_SELECTED));
this.spreadsheet.recalculateSizes();
}
use of org.eclipse.ui.themes.ITheme in project dbeaver by dbeaver.
the class ERDGraphicalViewer method applyThemeSettings.
private void applyThemeSettings() {
ITheme currentTheme = themeManager.getCurrentTheme();
Font erdFont = currentTheme.getFontRegistry().get(ERDUIConstants.PROP_DIAGRAM_FONT);
if (erdFont != null) {
this.getControl().setFont(erdFont);
}
editor.refreshDiagram(true, false);
/*
DiagramPart diagramPart = editor.getDiagramPart();
if (diagramPart != null) {
diagramPart.resetFonts();
diagramPart.refresh();
}
*/
}
Aggregations