Search in sources :

Example 16 with ITheme

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();
        }
*/
}
Also used : ITheme(org.eclipse.ui.themes.ITheme) Font(org.eclipse.swt.graphics.Font)

Example 17 with ITheme

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;
}
Also used : ITheme(org.eclipse.ui.themes.ITheme) Color(org.eclipse.swt.graphics.Color)

Example 18 with ITheme

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;
    }
}
Also used : ITheme(org.eclipse.ui.themes.ITheme) FontData(org.eclipse.swt.graphics.FontData) IThemeManager(org.eclipse.ui.themes.IThemeManager) Font(org.eclipse.swt.graphics.Font)

Example 19 with ITheme

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();
}
Also used : ITheme(org.eclipse.ui.themes.ITheme) ColorRegistry(org.eclipse.jface.resource.ColorRegistry)

Example 20 with ITheme

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();
        }
*/
}
Also used : ITheme(org.eclipse.ui.themes.ITheme) Font(org.eclipse.swt.graphics.Font)

Aggregations

ITheme (org.eclipse.ui.themes.ITheme)27 Font (org.eclipse.swt.graphics.Font)12 Color (org.eclipse.swt.graphics.Color)8 IThemeManager (org.eclipse.ui.themes.IThemeManager)4 ColorRegistry (org.eclipse.jface.resource.ColorRegistry)3 GridData (org.eclipse.swt.layout.GridData)2 GridLayout (org.eclipse.swt.layout.GridLayout)2 IMultiController (org.jkiss.dbeaver.ui.data.IMultiController)2 Serial (io.sloeber.core.api.Serial)1 PlotterListener (io.sloeber.ui.monitor.internal.PlotterListener)1 SerialListener (io.sloeber.ui.monitor.internal.SerialListener)1 File (java.io.File)1 LinkedHashMap (java.util.LinkedHashMap)1 Map (java.util.Map)1 ICConfigurationDescription (org.eclipse.cdt.core.settings.model.ICConfigurationDescription)1 IProject (org.eclipse.core.resources.IProject)1 IPath (org.eclipse.core.runtime.IPath)1 FontRegistry (org.eclipse.jface.resource.FontRegistry)1 ArrayContentProvider (org.eclipse.jface.viewers.ArrayContentProvider)1 ComboViewer (org.eclipse.jface.viewers.ComboViewer)1