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

Jemmy JInternalFrameOperator: Dependency with orders of Minimize, Maximize and Close buttons

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 11
    • Component/s: client-libs
    • Labels:
      None
    • Subcomponent:
    • Resolved In Build:
      b14
    • CPU:
      generic
    • OS:
      generic

      Backports

        Description

        In Jemmy implementation, Minimize, Maximize and Close buttons are initializing based on index(‘bttCount’ in the implementation).

        But this button order will change based on how we apply these properties to frame. If we are applying these properties while constructing the frame, then assumption of order in the jemmy is correct.
        Order will be based on below API[icon button, maximize button, close button]:
        protected void javax.swing.plaf.basic.BasicInternalFrameTitlePane.addSubComponents()
         {
                add(menuBar);
                add(iconButton);
                add(maxButton);
                add(closeButton);
            }

        If we are applying theses properties using corresponding set APIs of particular property(say setClosable(), setMaximizable(), setIconifiable()), these button order will be different.
        Particular handler will get executed and construction order of buttons will be based on below code peice. [close button, maximize button, icon button]
        Some code piece from javax.swing.plaf.basic.BasicInternalFrameTitlePane.Handler
        if ("closable" == prop) {
                        if (evt.getNewValue() == Boolean.TRUE) {
                            add(closeButton);
                        } else {
                            remove(closeButton);
                        }
                    } else if ("maximizable" == prop) {
                        if (evt.getNewValue() == Boolean.TRUE) {
                            add(maxButton);
                        } else {
                            remove(maxButton);
                        }
                    } else if ("iconable" == prop) {
                        if (evt.getNewValue() == Boolean.TRUE) {
                            add(iconButton);
                        } else {
                            remove(iconButton);
                        }
                    }

        Ineffect the jemmy APIs getMinimizeButton(), getMaximizeButton(), getCloseButton() will return wrong buttons and maximize(), iconify() and close() APIs also will behave wrongly.

          Attachments

            Issue Links

              Activity

                People

                Assignee:
                akolarkunnu Abdul Kolarkunnu
                Reporter:
                akolarkunnu Abdul Kolarkunnu
                Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                  Dates

                  Created:
                  Updated:
                  Resolved: