< prev index next >

src/org/netbeans/jemmy/operators/JInternalFrameOperator.java

Print this page

        

@@ -55,10 +55,11 @@
 import org.netbeans.jemmy.drivers.DriverManager;
 import org.netbeans.jemmy.drivers.FrameDriver;
 import org.netbeans.jemmy.drivers.InternalFrameDriver;
 import org.netbeans.jemmy.drivers.WindowDriver;
 import org.netbeans.jemmy.util.EmptyVisualizer;
+import org.netbeans.jemmy.util.Platform;
 
 /**
  * Class provides necessary functionality to operate with
  * javax.swing.JInternalFrame component.
  *

@@ -680,11 +681,15 @@
      * Creates an operator for an desktop icon.
      *
      * @return an icon operator.
      */
     public JDesktopIconOperator getIconOperator() {
+        if(Platform.isOSX()) {
+            initIconOperator();
+        } else {
         initOperators();
+        }
         return iconOperator;
     }
 
     /**
      * Waits for the frame to be iconified or deiconified.

@@ -1369,15 +1374,27 @@
     protected Container findTitlePane() {
         return (Container) iDriver.getTitlePane(this);
     }
 
     /**
-     * Initiaites suboperators.
+     * Initialize icon operator
      */
-    protected void initOperators() {
+    protected void initIconOperator() {
         iconOperator = new JDesktopIconOperator(((JInternalFrame) getSource()).getDesktopIcon());
         iconOperator.copyEnvironment(this);
+    }
+
+    /**
+     * Initiaites suboperators.
+     */
+    protected void initOperators() {
+        initIconOperator();
+        if(Platform.isOSX()) {
+            throw new UnsupportedOperationException(
+                    "Jemmy doesn't support getting or intializing title"
+                    + " related operators on Mac OSx");
+        } else {
         Container titlePane = findTitlePane();
         if (!isIcon() && titlePane != null) {
             if (titleOperator == null) {
                 titleOperator = new ContainerOperator<>(titlePane);
                 if (getContainer(new ComponentChooser() {

@@ -1420,10 +1437,11 @@
             minOper = null;
             maxOper = null;
             closeOper = null;
         }
     }
+    }
 
     //throw exception if state is wrong
     private void checkIconified(boolean shouldBeIconified) {
         if (shouldBeIconified && !isIcon()
                 || !shouldBeIconified && isIcon()) {
< prev index next >