~ubuntu-branches/ubuntu/precise/classpath/precise

« back to all changes in this revision

Viewing changes to javax/swing/JPopupMenu.java

  • Committer: Bazaar Package Importer
  • Author(s): Michael Koch
  • Date: 2006-05-27 16:11:15 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20060527161115-h6e39eposdt5snb6
Tags: 2:0.91-3
* Install header files to /usr/include/classpath.
* debian/control: classpath: Conflict with jamvm < 1.4.3 and
  cacao < 0.96 (Closes: #368172).

Show diffs side-by-side

added added

removed removed

Lines of Context:
292
292
  public void updateUI()
293
293
  {
294
294
    setUI((PopupMenuUI) UIManager.getUI(this));
295
 
    invalidate();
296
295
  }
297
296
 
298
297
  /**
542
541
    this.visible = visible;
543
542
    if (old != isVisible())
544
543
      {
545
 
        firePropertyChange("visible", old, isVisible());
546
544
        if (visible)
547
545
          {
 
546
            if (invoker != null && !(invoker instanceof JMenu))
 
547
              {
 
548
                MenuElement[] menuEls;
 
549
                if (getSubElements().length > 0)
 
550
                  {
 
551
                    menuEls = new MenuElement[2];
 
552
                    menuEls[0] = this;
 
553
                    menuEls[1] = getSubElements()[0];
 
554
                }
 
555
                else
 
556
                  {
 
557
                    menuEls = new MenuElement[1];
 
558
                    menuEls[0] = this;
 
559
                  }
 
560
                MenuSelectionManager.defaultManager().setSelectedPath(menuEls);
 
561
              }
548
562
            firePopupMenuWillBecomeVisible();
549
 
 
550
563
            PopupFactory pf = PopupFactory.getSharedInstance();
551
564
            pack();
552
565
            popup = pf.getPopup(invoker, this, popupLocationX, popupLocationY);
554
567
          }
555
568
        else
556
569
          {
 
570
            getSelectionModel().clearSelection();
557
571
            firePopupMenuWillBecomeInvisible();
558
572
            popup.hide();
559
573
          }
 
574
        firePropertyChange("visible", old, isVisible());
560
575
      }
561
576
  }
562
577
 
866
881
 
867
882
  /* This class resizes popup menu and repaints popup menu appropriately if one
868
883
   of item's action has changed */
869
 
  protected class ActionChangeListener implements PropertyChangeListener
 
884
  private class ActionChangeListener implements PropertyChangeListener
870
885
  {
871
886
    public void propertyChange(PropertyChangeEvent evt)
872
887
    {