public void setCanGroupByChangeList(final boolean canGroupByChangeList) {
   myCanGroupByChangeList = canGroupByChangeList;
   if (myCanGroupByChangeList) {
     myLoadingChangeListsLabel = new JLabel(VcsBundle.message("update.info.loading.changelists"));
     add(myLoadingChangeListsLabel, BorderLayout.SOUTH);
     myGroupByChangeList = VcsConfiguration.getInstance(myProject).UPDATE_GROUP_BY_CHANGELIST;
     if (myGroupByChangeList) {
       final CardLayout cardLayout = (CardLayout) myCenterPanel.getLayout();
       cardLayout.show(myCenterPanel, CARD_CHANGES);
     }
   }
 }
    public static Image createImage(final JTree tree) {
      final TreeSelectionModel model = tree.getSelectionModel();
      final TreePath[] paths = model.getSelectionPaths();

      int count = 0;
      final List<ChangesBrowserNode> nodes = new ArrayList<ChangesBrowserNode>();
      for (final TreePath path : paths) {
        final ChangesBrowserNode node = (ChangesBrowserNode) path.getLastPathComponent();
        if (!node.isLeaf()) {
          nodes.add(node);
          count += node.getCount();
        }
      }

      for (TreePath path : paths) {
        final ChangesBrowserNode element = (ChangesBrowserNode) path.getLastPathComponent();
        boolean child = false;
        for (final ChangesBrowserNode node : nodes) {
          if (node.isNodeChild(element)) {
            child = true;
            break;
          }
        }

        if (!child) {
          if (element.isLeaf()) count++;
        } else if (!element.isLeaf()) {
          count -= element.getCount();
        }
      }

      final JLabel label = new JLabel(VcsBundle.message("changes.view.dnd.label", count));
      label.setOpaque(true);
      label.setForeground(tree.getForeground());
      label.setBackground(tree.getBackground());
      label.setFont(tree.getFont());
      label.setSize(label.getPreferredSize());
      final BufferedImage image =
          new BufferedImage(label.getWidth(), label.getHeight(), BufferedImage.TYPE_INT_ARGB);

      Graphics2D g2 = (Graphics2D) image.getGraphics();
      g2.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.7f));
      label.paint(g2);
      g2.dispose();

      return image;
    }
 public GroupByChangeListAction() {
   super(
       VcsBundle.message("update.info.group.by.changelist"),
       null,
       AllIcons.ObjectBrowser.Browser);
 }
 public MyGroupByPackagesAction() {
   super(
       VcsBundle.message("action.name.group.by.packages"),
       null,
       PlatformIcons.GROUP_BY_PACKAGES);
 }