Search in sources :

Example 6 with ITheme

use of org.eclipse.ui.themes.ITheme in project pmd-eclipse-plugin by pmd.

the class AbstractStructureInspectorPage method colorRegistry.

private static ColorRegistry colorRegistry() {
    IThemeManager themeManager = PlatformUI.getWorkbench().getThemeManager();
    ITheme currentTheme = themeManager.getCurrentTheme();
    return currentTheme.getColorRegistry();
}
Also used : ITheme(org.eclipse.ui.themes.ITheme) IThemeManager(org.eclipse.ui.themes.IThemeManager)

Example 7 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(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)

Example 8 with ITheme

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

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)

Example 9 with ITheme

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

the class SQLRuleScanner method getColor.

private 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 10 with ITheme

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

the class SQLEditorOutputConsoleViewer method refreshStyles.

public void refreshStyles() {
    ITheme currentTheme = PlatformUI.getWorkbench().getThemeManager().getCurrentTheme();
    Font outputFont = currentTheme.getFontRegistry().get(SQLConstants.CONFIG_FONT_OUTPUT);
    if (outputFont != null) {
        getTextWidget().setFont(outputFont);
    }
    getTextWidget().setForeground(UIStyles.getDefaultTextForeground());
    getTextWidget().setBackground(UIStyles.getDefaultTextBackground());
}
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