Support of composite editors for comboboxes

This commit is contained in:
Denis Fokin
2016-09-26 20:10:18 +03:00
parent c57dd8556a
commit 4e1141c7db
2 changed files with 17 additions and 1 deletions
@@ -17,6 +17,7 @@ package com.intellij.ide.ui.laf.darcula.ui;
import com.intellij.ide.ui.laf.darcula.DarculaUIUtil;
import com.intellij.openapi.ui.GraphicsConfig;
import com.intellij.openapi.util.registry.Registry;
import com.intellij.ui.Gray;
import com.intellij.ui.JBColor;
import com.intellij.util.ui.JBInsets;
@@ -419,4 +420,18 @@ public class DarculaComboBoxUI extends BasicComboBoxUI implements Border {
public boolean isBorderOpaque() {
return false;
}
@Override
protected void configureEditor() {
super.configureEditor();
if (Registry.is("ide.ui.composite.editor.for.combobox")) {
// BasicComboboxUI sets focusability depending on the combobox focusability.
// JPanel usually is unfocusable and uneditable.
// It could be set as an editor when people want to have a composite component as an editor.
// In such cases we should restore unfocusable state for panels.
if (editor instanceof JPanel) {
editor.setFocusable(false);
}
}
}
}
@@ -857,4 +857,5 @@ low.memory.watcher.sync.description=Whether LowMemoryWatcher runnables should be
typing.freeze.report.dumps=false
typing.freeze.report.dumps.description=Automatically reports thread dumps to our statistics server
store.basedir.parent.detection=true
store.basedir.parent.detection=true
ide.ui.composite.editor.for.combobox=false