1373 */
1374 protected Container findTitlePane() {
1375 return (Container) iDriver.getTitlePane(this);
1376 }
1377
1378 /**
1379 * Initialize icon operator
1380 */
1381 protected void initIconOperator() {
1382 iconOperator = new JDesktopIconOperator(((JInternalFrame) getSource()).getDesktopIcon());
1383 iconOperator.copyEnvironment(this);
1384 }
1385
1386 /**
1387 * Initiaites suboperators.
1388 */
1389 protected void initOperators() {
1390 initIconOperator();
1391 if(Platform.isOSX()) {
1392 throw new UnsupportedOperationException(
1393 "Jemmy doesn't support getting or intializing title"
1394 + " related operators on Mac OSx");
1395 } else {
1396 Container titlePane = findTitlePane();
1397 if (!isIcon() && titlePane != null) {
1398 if (titleOperator == null) {
1399 titleOperator = new ContainerOperator<>(titlePane);
1400 if (getContainer(new ComponentChooser() {
1401 @Override
1402 public boolean checkComponent(Component comp) {
1403 return comp instanceof JDesktopPane;
1404 }
1405
1406 @Override
1407 public String getDescription() {
1408 return "Desktop pane";
1409 }
1410
1411 @Override
1412 public String toString() {
1413 return "JInternalFrameOperator.initOperators.ComponentChooser{description = " + getDescription() + '}';
|
1373 */
1374 protected Container findTitlePane() {
1375 return (Container) iDriver.getTitlePane(this);
1376 }
1377
1378 /**
1379 * Initialize icon operator
1380 */
1381 protected void initIconOperator() {
1382 iconOperator = new JDesktopIconOperator(((JInternalFrame) getSource()).getDesktopIcon());
1383 iconOperator.copyEnvironment(this);
1384 }
1385
1386 /**
1387 * Initiaites suboperators.
1388 */
1389 protected void initOperators() {
1390 initIconOperator();
1391 if(Platform.isOSX()) {
1392 throw new UnsupportedOperationException(
1393 "Jemmy doesn't support getting or initializing title"
1394 + " related operators on Mac OSx");
1395 } else {
1396 Container titlePane = findTitlePane();
1397 if (!isIcon() && titlePane != null) {
1398 if (titleOperator == null) {
1399 titleOperator = new ContainerOperator<>(titlePane);
1400 if (getContainer(new ComponentChooser() {
1401 @Override
1402 public boolean checkComponent(Component comp) {
1403 return comp instanceof JDesktopPane;
1404 }
1405
1406 @Override
1407 public String getDescription() {
1408 return "Desktop pane";
1409 }
1410
1411 @Override
1412 public String toString() {
1413 return "JInternalFrameOperator.initOperators.ComponentChooser{description = " + getDescription() + '}';
|