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

Reviewed-by: serb
This commit is contained in:
Abdul Kolarkunnu 2018-05-08 15:30:08 +05:30 committed by Prasanta Sadhukhan
parent ef92671424
commit 558401a842

View File

@ -33,10 +33,11 @@ import java.util.Hashtable;
import javax.swing.Icon; import javax.swing.Icon;
import javax.swing.JDesktopPane; import javax.swing.JDesktopPane;
import javax.swing.JInternalFrame; import javax.swing.JInternalFrame;
import javax.swing.JInternalFrame.JDesktopIcon;
import javax.swing.JLayeredPane; import javax.swing.JLayeredPane;
import javax.swing.JMenuBar; import javax.swing.JMenuBar;
import javax.swing.JScrollPane; import javax.swing.JScrollPane;
import javax.swing.JInternalFrame.JDesktopIcon; import javax.swing.UIManager;
import javax.swing.event.InternalFrameListener; import javax.swing.event.InternalFrameListener;
import javax.swing.plaf.InternalFrameUI; import javax.swing.plaf.InternalFrameUI;
@ -133,6 +134,24 @@ public class JInternalFrameOperator extends JComponentOperator
*/ */
public static final String IS_SELECTED_DPROP = "Selected"; public static final String IS_SELECTED_DPROP = "Selected";
/**
* Maximize button tool tip key
*/
public static final String MAXIMIZE_BUTTON_TOOLTIP =
UIManager.getString("InternalFrame.maxButtonToolTip");
/**
* Close button tool tip key
*/
public static final String CLOSE_BUTTON_TOOLTIP =
UIManager.getString("InternalFrame.closeButtonToolTip");
/**
* Minimize button tool tip key
*/
public static final String MINIMIZE_BUTTON_TOOLTIP =
UIManager.getString("InternalFrame.iconButtonToolTip");
/** /**
* A minimizing button. * A minimizing button.
*/ */
@ -1359,7 +1378,6 @@ public class JInternalFrameOperator extends JComponentOperator
if (!isIcon() && titlePane != null) { if (!isIcon() && titlePane != null) {
if (titleOperator == null) { if (titleOperator == null) {
titleOperator = new ContainerOperator<>(titlePane); titleOperator = new ContainerOperator<>(titlePane);
int bttCount = 0;
if (getContainer(new ComponentChooser() { if (getContainer(new ComponentChooser() {
@Override @Override
public boolean checkComponent(Component comp) { public boolean checkComponent(Component comp) {
@ -1368,7 +1386,7 @@ public class JInternalFrameOperator extends JComponentOperator
@Override @Override
public String getDescription() { public String getDescription() {
return "Desctop pane"; return "Desktop pane";
} }
@Override @Override
@ -1376,11 +1394,11 @@ public class JInternalFrameOperator extends JComponentOperator
return "JInternalFrameOperator.initOperators.ComponentChooser{description = " + getDescription() + '}'; return "JInternalFrameOperator.initOperators.ComponentChooser{description = " + getDescription() + '}';
} }
}) != null) { }) != null) {
minOper = new JButtonOperator(titleOperator, bttCount); minOper = new JButtonOperator(titleOperator,
bttCount++; new JComponentByTipFinder(MINIMIZE_BUTTON_TOOLTIP));
if (((JInternalFrame) getSource()).isMaximizable()) { if (((JInternalFrame) getSource()).isMaximizable()) {
maxOper = new JButtonOperator(titleOperator, bttCount); maxOper = new JButtonOperator(titleOperator,
bttCount++; new JComponentByTipFinder(MAXIMIZE_BUTTON_TOOLTIP));
} else { } else {
maxOper = null; maxOper = null;
} }
@ -1389,7 +1407,8 @@ public class JInternalFrameOperator extends JComponentOperator
maxOper = null; maxOper = null;
} }
if (isClosable()) { if (isClosable()) {
closeOper = new JButtonOperator(titleOperator, bttCount); closeOper = new JButtonOperator(titleOperator,
new JComponentByTipFinder(CLOSE_BUTTON_TOOLTIP));
} else { } else {
closeOper = null; closeOper = null;
} }