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

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

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 11
    • None
    • client-libs
    • None
    • b14
    • generic
    • generic

        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.

              akolarkunnu Abdul Kolarkunnu (Inactive)
              akolarkunnu Abdul Kolarkunnu (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: