/** * The root frame is the first shown frame. * * @return a <code>SFrame</code> value */ public SFrame getRootFrame() { if (frames.isEmpty()) return null; SFrame rootFrame = frames.iterator().next(); while (rootFrame.getParent() != null) rootFrame = (SFrame) rootFrame.getParent(); return rootFrame; }
/** * Searches the current session for the root HTML frame and returns the Resource * representing this root HTML frame (i.e. for you to retrieve the externalizer id * via <code>getId()</code>-method). * @return Resource of the root HTML frame */ private Resource retrieveCurrentRootFrameResource() throws ServletException { log.debug("delivering default frame"); if (session.getFrames().size() == 0) throw new ServletException("no frame visible"); // get the first frame from the set and walk up the hierarchy. // this should work in most cases. if there are more than one // toplevel frames, the developer has to care about the resource // ids anyway .. SFrame defaultFrame = (SFrame) session.getFrames().iterator().next(); while (defaultFrame.getParent() != null) defaultFrame = (SFrame) defaultFrame.getParent(); return defaultFrame.getDynamicResource(ReloadResource.class); }
/** * Searches the current session for the root HTML frame and returns the Resource * representing this root HTML frame (i.e. for you to retrieve the externalizer id * via <code>getId()</code>-method). * @return Resource of the root HTML frame */ private Resource retrieveCurrentRootFrameResource() throws ServletException { log.debug("delivering default frame"); if (session.getFrames().size() == 0) throw new ServletException("no frame visible"); // get the first frame from the set and walk up the hierarchy. // this should work in most cases. if there are more than one // toplevel frames, the developer has to care about the resource // ids anyway .. SFrame defaultFrame = (SFrame) session.getFrames().iterator().next(); while (defaultFrame.getParent() != null) defaultFrame = (SFrame) defaultFrame.getParent(); return defaultFrame.getDynamicResource(ReloadResource.class); }