提交 958b3513 编写于 作者: S serge-rider

#3574 Grouping panel default colors fix


Former-commit-id: 199bfbf0
上级 14234a05
......@@ -22,6 +22,7 @@ import org.eclipse.core.runtime.jobs.JobChangeAdapter;
import org.eclipse.jface.action.*;
import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.jface.dialogs.IDialogSettings;
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.resource.StringConverter;
import org.eclipse.jface.text.IFindReplaceTarget;
......@@ -29,7 +30,10 @@ import org.eclipse.jface.viewers.*;
import org.eclipse.osgi.util.NLS;
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.*;
import org.eclipse.swt.events.*;
import org.eclipse.swt.events.FocusEvent;
import org.eclipse.swt.events.FocusListener;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.graphics.RGB;
......@@ -79,6 +83,7 @@ import org.jkiss.dbeaver.ui.controls.resultset.view.EmptyPresentation;
import org.jkiss.dbeaver.ui.controls.resultset.view.StatisticsPresentation;
import org.jkiss.dbeaver.ui.data.IValueController;
import org.jkiss.dbeaver.ui.dialogs.ConfirmationDialog;
import org.jkiss.dbeaver.ui.editors.EditorUtils;
import org.jkiss.dbeaver.ui.editors.object.struct.EditConstraintPage;
import org.jkiss.dbeaver.ui.editors.object.struct.EditDictionaryPage;
import org.jkiss.dbeaver.ui.preferences.PrefPageDataFormat;
......@@ -209,8 +214,9 @@ public class ResultSetViewer extends Viewer
this.viewerPanel.setRedraw(false);
{
String bgRGB = getPreferenceStore().getString(AbstractTextEditor.PREFERENCE_COLOR_BACKGROUND);
String fgRGB = getPreferenceStore().getString(AbstractTextEditor.PREFERENCE_COLOR_FOREGROUND);
IPreferenceStore preferenceStore = EditorUtils.getEditorsPreferenceStore();
String bgRGB = preferenceStore.getString(AbstractTextEditor.PREFERENCE_COLOR_BACKGROUND);
String fgRGB = preferenceStore.getString(AbstractTextEditor.PREFERENCE_COLOR_FOREGROUND);
defaultBackground = CommonUtils.isEmpty(bgRGB) ? viewerPanel.getDisplay().getSystemColor(SWT.COLOR_LIST_BACKGROUND) : UIUtils.getSharedColor(bgRGB);
defaultForeground = CommonUtils.isEmpty(fgRGB) ? viewerPanel.getDisplay().getSystemColor(SWT.COLOR_LIST_FOREGROUND) : UIUtils.getSharedColor(fgRGB);
}
......@@ -3694,9 +3700,10 @@ public class ResultSetViewer extends Viewer
if (dataSource == null) {
return;
}
DBPPreferenceStore preferenceStore = DBeaverCore.getGlobalPreferenceStore();
boolean curValue = preferenceStore.getBoolean(DBeaverPreferences.RESULT_SET_COLORIZE_DATA_TYPES);
preferenceStore.setValue(DBeaverPreferences.RESULT_SET_COLORIZE_DATA_TYPES, !curValue);
DBPPreferenceStore dsStore = dataSource.getContainer().getPreferenceStore();
boolean curValue = dsStore.getBoolean(DBeaverPreferences.RESULT_SET_COLORIZE_DATA_TYPES);
// Set local setting to default
dsStore.setValue(DBeaverPreferences.RESULT_SET_COLORIZE_DATA_TYPES, !curValue);
refreshData(null);
}
......
......@@ -26,9 +26,12 @@ import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.QualifiedName;
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.core.runtime.preferences.InstanceScope;
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.ui.*;
import org.eclipse.ui.ide.FileStoreEditorInput;
import org.eclipse.ui.ide.IDE;
import org.eclipse.ui.preferences.ScopedPreferenceStore;
import org.jkiss.code.NotNull;
import org.jkiss.code.Nullable;
import org.jkiss.dbeaver.Log;
......@@ -255,4 +258,9 @@ public class EditorUtils {
}
return "Auto save all editors".equals(currentJob.getName());
}
public static IPreferenceStore getEditorsPreferenceStore() {
return new ScopedPreferenceStore(InstanceScope.INSTANCE, "org.eclipse.ui.editors");
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册