Package elemental.html

Examples of elemental.html.IFrameElement


    elem.setType("text");
    return elem;
  }

  public static IFrameElement createIFrameElement(String... classNames) {
    IFrameElement elem = getDocument().createIFrameElement();
    addClassesToElement(elem, classNames);
    return elem;
  }
View Full Code Here


        + BootstrapSession.getBootstrapSession().getActiveClientId();
    source = source + "&" + FrontendConstants.FILE_PARAM_NAME + "=" + path;

    // we're going to download the zip into a hidden iframe, which because
    // it's a zip the browser should offer to save on disk.
    final IFrameElement iframe = Elements.createIFrameElement();
    iframe.setId(DOWNLOAD_FRAME_ID);
    iframe.getStyle().setDisplay("none");
    iframe.setOnLoad(new EventListener() {
      @Override
      public void handleEvent(Event event) {
        iframe.removeFromParent();
      }
    });

    iframe.setSrc(source);
    Elements.getBody().appendChild(iframe);
  }
View Full Code Here

        + BootstrapSession.getBootstrapSession().getActiveClientId();
    source = source + "&" + FrontendConstants.FILE_PARAM_NAME + "=" + path;

    // we're going to download the zip into a hidden iframe, which because
    // it's a zip the browser should offer to save on disk.
    final IFrameElement iframe = Elements.createIFrameElement();
    iframe.setId(DOWNLOAD_FRAME_ID);
    iframe.getStyle().setDisplay("none");
    iframe.setOnload(new EventListener() {
      @Override
      public void handleEvent(Event event) {
        iframe.removeFromParent();
      }
    });

    iframe.setSrc(source);
    Elements.getBody().appendChild(iframe);
  }
View Full Code Here

  private GwtCompilerShell gwt;
 
  public RemovalHandler openIframe(final String id, final String url) {
   
    final GwtCompileState gwtc = getCompileState(id);
    IFrameElement iframe = gwtc.el;
    if (iframe == null) {
      DivElement sizer = Elements.createDivElement();
      sizer.getStyle().setPosition("absolute");
      sizer.getStyle().setLeft("0px");
      sizer.getStyle().setRight("10px");
      sizer.getStyle().setTop("50px");
      sizer.getStyle().setBottom("20px");

      gwtc.el = iframe = Browser.getDocument().createIFrameElement();
      iframe.getStyle().setWidth("100%");
      iframe.getStyle().setHeight("100%");

      iframe.setAttribute("sandbox", "allow-same-origin allow-scripts");
      iframe.setSrc(url);
      sizer.appendChild(iframe);
     
      final RemovalHandler[] remover = new RemovalHandler[1];
      gwtc.header = GwtcModuleControlView.create(new GwtcController() {
        @Override
        public void onReloadClicked() {
          GwtCompilePlace.PLACE.fireRecompile(id);
        }
        @Override
        public void onCloseClicked() {
          if (remover[0] != null) {
            removeCompileState(id);
            remover[0].remove();
            remover[0] = null;
          }
        }
        @Override
        public void onRefreshClicked() {
          gwtc.el.setSrc(url);
        }
      });
     
      Element wrapper = gwtc.header.getElement();
      gwtc.header.setHeader(id);
      wrapper.appendChild(sizer);
      wrapper.getStyle().setOverflow("hidden");
      remover[0] = middleBar.addChild(wrapper, 450, 2);
    } else {
      iframe.setSrc("about:blank");
      iframe.setSrc(url);
    }
    iframe.scrollIntoViewIfNeeded(true);
    return new RemovalHandler() {
      @Override
      public void remove() {
        removeCompileState(id);
      }
View Full Code Here

    elem.setType("text");
    return elem;
  }

  public static IFrameElement createIFrameElement(String... classNames) {
    IFrameElement elem = getDocument().createIFrameElement();
    addClassesToElement(elem, classNames);
    return elem;
  }
View Full Code Here

TOP

Related Classes of elemental.html.IFrameElement

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.