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();
}
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();
}
*/
}
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);
}
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;
}
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());
}
Aggregations