View Javadoc

1   /**
2    * .
3    */
4   package org.sirius.client.web.classes;
5   
6   import java.rmi.RemoteException;
7   
8   import org.sirius.client.web.WebClient;
9   import org.sirius.client.web.core.Dimension;
10  import org.sirius.client.web.core.Point;
11  
12  /**
13   * @author Myk Kolisnyk
14   * .
15   */
16  public class Frame {
17  
18      /**
19       * .
20       */
21      private WebClient client  = null;
22  
23      /**
24       * .
25       */
26      private String    locator = "";
27  
28      /**
29       * @return the client
30       */
31      public final WebClient getClient() {
32          return client;
33      }
34  
35      /**
36       * @param clientValue the client to set
37       */
38      public final void setClient(final WebClient clientValue) {
39          this.client = clientValue;
40      }
41  
42      /**
43       * @param locatorValue the locator to set
44       */
45      public final void setLocator(final String locatorValue) {
46          this.locator = locatorValue;
47      }
48  
49      /**
50       * .
51       * @param clientValue .
52       * @param locatorValue .
53       */
54      public Frame(final WebClient clientValue, final String locatorValue) {
55          this.client = clientValue;
56          this.locator = locatorValue;
57      }
58  
59      /**
60       * .
61       * @return .
62       */
63      public final boolean exists() {
64          return false;
65      }
66  
67      /**
68       * .
69       * @return .
70       * @throws RemoteException .
71       */
72      public final Point getLocation() throws RemoteException {
73          return this.client.core().getLocation(null, locator);
74      }
75  
76      /**
77       * .
78       * @return .
79       */
80      public final String getLocator() {
81          return this.locator;
82      }
83  
84      /**
85       * .
86       * @return .
87       * @throws RemoteException .
88       */
89      public final Dimension getSize() throws RemoteException {
90          return this.client.core().getSize(null, locator);
91      }
92  
93      /**
94       * .
95       * @return .
96       * @throws RemoteException .
97       */
98      public final String getURL() throws RemoteException {
99          return this.client.core().getURL();
100     }
101 
102     /**
103      * .
104      * @return .
105      * @throws RemoteException .
106      */
107     public final String innerHtml() throws RemoteException {
108         return this.client.core().getAttribute(null, locator, "innerHTML");
109     }
110 
111     /**
112      * .
113      * @param frame .
114      * @throws RemoteException .
115      */
116     public final void switchTo(final Frame frame) throws RemoteException {
117         this.client.core().selectFrameByName(frame.getLocator());
118     }
119 }