Search in sources :

Example 21 with ITheme

use of org.eclipse.ui.themes.ITheme in project dbeaver by serge-rider.

the class UIStyles method getDefaultWidgetBackground.

public static Color getDefaultWidgetBackground() {
    ITheme theme = PlatformUI.getWorkbench().getThemeManager().getCurrentTheme();
    Color color = theme.getColorRegistry().get("org.eclipse.ui.workbench.INACTIVE_TAB_BG_START");
    if (color == null) {
        color = Display.getCurrent().getSystemColor(SWT.COLOR_WIDGET_BACKGROUND);
    }
    return color;
}
Also used : ITheme(org.eclipse.ui.themes.ITheme) Color(org.eclipse.swt.graphics.Color)

Example 22 with ITheme

use of org.eclipse.ui.themes.ITheme in project dbeaver by serge-rider.

the class HexEditControl method loadSettings.

private void loadSettings() {
    ITheme currentTheme = PlatformUI.getWorkbench().getThemeManager().getCurrentTheme();
    this.colorCaretLine = currentTheme.getColorRegistry().get("org.jkiss.dbeaver.hex.editor.color.caret");
    this.colorText = currentTheme.getColorRegistry().get("org.jkiss.dbeaver.hex.editor.color.text");
    this.colorHighlightText = UIUtils.getSharedColor(UIUtils.blend(this.colorText.getRGB(), this.colorCaretLine.getRGB(), 50));
    this.fontDefault = currentTheme.getFontRegistry().get("org.jkiss.dbeaver.hex.editor.font.output");
}
Also used : ITheme(org.eclipse.ui.themes.ITheme)

Example 23 with ITheme

use of org.eclipse.ui.themes.ITheme in project dbeaver by serge-rider.

the class SQLEditorOutputViewer method refreshStyles.

void refreshStyles() {
    ITheme currentTheme = PlatformUI.getWorkbench().getThemeManager().getCurrentTheme();
    Font outputFont = currentTheme.getFontRegistry().get(SQLConstants.CONFIG_FONT_OUTPUT);
    if (outputFont != null) {
        this.text.setFont(outputFont);
    }
    this.text.setForeground(currentTheme.getColorRegistry().get(SQLConstants.CONFIG_COLOR_TEXT));
    this.text.setBackground(currentTheme.getColorRegistry().get(SQLConstants.CONFIG_COLOR_BACKGROUND));
}
Also used : ITheme(org.eclipse.ui.themes.ITheme) Font(org.eclipse.swt.graphics.Font)

Example 24 with ITheme

use of org.eclipse.ui.themes.ITheme in project dbeaver by dbeaver.

the class HexEditControl method loadSettings.

private void loadSettings() {
    ITheme currentTheme = PlatformUI.getWorkbench().getThemeManager().getCurrentTheme();
    this.colorCaretLine = currentTheme.getColorRegistry().get("org.jkiss.dbeaver.hex.editor.color.caret");
    this.colorText = currentTheme.getColorRegistry().get("org.jkiss.dbeaver.hex.editor.color.text");
    this.colorHighlightText = UIUtils.getSharedColor(UIUtils.blend(this.colorText.getRGB(), this.colorCaretLine.getRGB(), 50));
    this.fontDefault = currentTheme.getFontRegistry().get("org.jkiss.dbeaver.hex.editor.font.output");
}
Also used : ITheme(org.eclipse.ui.themes.ITheme)

Example 25 with ITheme

use of org.eclipse.ui.themes.ITheme in project dbeaver by dbeaver.

the class BaseValueEditor method initInlineControl.

protected void initInlineControl(final Control inlineControl) {
    boolean isInline = (valueController.getEditType() == IValueController.EditType.INLINE);
    if (isInline && UIUtils.isInDialog(inlineControl)) {
    // isInline = false;
    }
    TextEditorUtils.enableHostEditorKeyBindingsSupport(valueController.getValueSite(), inlineControl);
    if (isInline) {
        EditorUtils.trackControlContext(valueController.getValueSite(), inlineControl, RESULTS_EDIT_CONTEXT_ID);
        if (valueController instanceof IMultiController) {
            // In dialog it also should handle all standard stuff because we have params dialog
            inlineControl.addTraverseListener(e -> {
                if (e.detail == SWT.TRAVERSE_RETURN) {
                    if (!valueController.isReadOnly()) {
                        saveValue();
                    }
                    ((IMultiController) valueController).closeInlineEditor();
                    e.doit = false;
                    e.detail = SWT.TRAVERSE_NONE;
                } else if (e.detail == SWT.TRAVERSE_ESCAPE) {
                    ((IMultiController) valueController).closeInlineEditor();
                    e.doit = false;
                    e.detail = SWT.TRAVERSE_NONE;
                } else if (e.detail == SWT.TRAVERSE_TAB_NEXT || e.detail == SWT.TRAVERSE_TAB_PREVIOUS) {
                    saveValue();
                    ((IMultiController) valueController).nextInlineEditor(e.detail == SWT.TRAVERSE_TAB_NEXT);
                    e.doit = false;
                    e.detail = SWT.TRAVERSE_NONE;
                }
            });
            if (!UIUtils.isInDialog(inlineControl)) {
                addAutoSaveSupport(inlineControl);
            } else {
                ((IMultiController) valueController).closeInlineEditor();
            }
        }
        if (!UIUtils.isInDialog(inlineControl)) {
            // Set control font (the same as for results viewer)
            ITheme currentTheme = valueController.getValueSite().getWorkbenchWindow().getWorkbench().getThemeManager().getCurrentTheme();
            if (currentTheme != null) {
                Font rsFont = currentTheme.getFontRegistry().get(ThemeConstants.FONT_SQL_RESULT_SET);
                if (rsFont != null) {
                    inlineControl.setFont(rsFont);
                }
            }
        }
    }
    final ControlModifyListener modifyListener = new ControlModifyListener();
    inlineControl.addListener(SWT.Modify, modifyListener);
    inlineControl.addListener(SWT.Selection, modifyListener);
}
Also used : ITheme(org.eclipse.ui.themes.ITheme) IMultiController(org.jkiss.dbeaver.ui.data.IMultiController) 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