public void refreshPaletteIfChanged(@Nullable GuiEditor designer) {
    removePaletteProviderListener();
    myDesigner = designer;
    if (designer != null) {
      addPaletteProviderListener();
    }

    VirtualFile file = designer == null ? null : designer.getFile();
    Set<PaletteGroup> currentGroups = new HashSet<>(collectCurrentGroups(file));
    if (!currentGroups.equals(myGroups)) {
      refreshPalette(file);
    }
  }
public void refreshPaletteIfChanged(@Nullable GuiEditor designer)