private static void assignDefaultIcon(final Project project, final ComponentItem itemToBeAdded) {
    Palette palette = Palette.getInstance(project);
    if (itemToBeAdded.getIconPath() == null || itemToBeAdded.getIconPath().isEmpty()) {
      PsiClass aClass =
        JavaPsiFacade.getInstance(project).findClass(itemToBeAdded.getClassName().replace('$', '.'), ProjectScope.getAllScope(project));
      while (aClass != null) {
        String name = aClass.getQualifiedName();
        ComponentItem item = name == null ? null : palette.getItem(name);
        if (item != null) {
          String iconPath = item.getIconPath();
          if (iconPath != null && !iconPath.isEmpty()) {
            itemToBeAdded.setIconPath(iconPath);
            return;
          }
        }
        aClass = aClass.getSuperClass();
      }
    }
  }
private static void assignDefaultIcon(final Project project, final ComponentItem itemToBeAdded)