void (@NotNull EditorSchemeAttributeDescriptor descriptor) { JComponent oldPanel = myActive == null ? null : myActive.getPanel(); myActive = getPanelForDescriptor(descriptor); JComponent newPanel = myActive == null ? null : myActive.getPanel(); if (oldPanel != newPanel) { final PaintLocker locker = new PaintLocker(this); try { if (oldPanel != null) { remove(oldPanel); } if (newPanel != null) { setPreferredSize(null);// make [this] resizable add(newPanel); } } finally { locker.release(); } } if (myActive != null) { myActive.reset(descriptor); } }