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;
}
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");
}
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));
}
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");
}
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);
}
Aggregations