Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6745221

JInternalFrame "Restore" menu item is enabled instead of disabled

    XMLWordPrintable

    Details

      Description

      FULL PRODUCT VERSION :
      java version "1.5.0_12"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_12-b04)
      Java HotSpot(TM) Client VM (build 1.5.0_12-b04, mixed mode, sharing)

      ADDITIONAL OS VERSION INFORMATION :
      Microsoft Windows XP [Version 5.1.2600]

      A DESCRIPTION OF THE PROBLEM :
      After the following unusual code sequence for which I have no use case, the JInternalFrame's "Restore" menu item is left enabled and non-functional.

      frame.setMaximizable(false);
      frame.setIconifiable(false);
      frame.setIcon(true);

      The BasicInternalFrameTitlePane.enableActions code does not match the BasicInternalFrameTitlePane.RestoreAction.actionPerformed code. Selecting the enabled "Restore" menu item has no effect in the user's perspective.

      The fix is trivial.
      Before:
          protected void enableActions() {
              restoreAction.setEnabled(frame.isMaximum() || frame.isIcon());

      After:
          protected void enableActions() {
              restoreAction.setEnabled(frame.isMaximum() && frame.isMaximizable() || frame.isIcon() && frame.isIconifiable());

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      jInternalFrame.setMaximizable(false);
      jInternalFrame.setIconifiable(false);
      jInternalFrame.setIcon(true);

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      Iconified JInternalFrame's "Restore" menu item is disabled.
      ACTUAL -
      Iconified JInternalFrame's "Restore" menu item is enabled and non-functional.

      REPRODUCIBILITY :
      This bug can be reproduced always.

        Attachments

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            ndcosta Nelson Dcosta (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Imported:
              Indexed: