Class IFrame

All Implemented Interfaces:
AttachNotifier, DetachNotifier, HasElement, HasSize, HasStyle, Serializable

@Tag("iframe") public class IFrame extends HtmlComponent
Component representing a <iframe> element.
Since:
1.3
Author:
Vaadin Ltd
See Also:
  • Constructor Details

    • IFrame

      public IFrame()
      Creates a new iframe.
    • IFrame

      public IFrame(String src)
      Creates a new iframe with a source URL.
      Parameters:
      src - Source URL
  • Method Details

    • setSrc

      public void setSrc(String src)
      Sets the source of the iframe. If the contents at the src of the IFrame has changed and you want to refresh it in the user's browser, the src does not to be reset. In this case use the #reload() method.
      Parameters:
      src - Source URL.
    • getSrc

      public String getSrc()
      Gets the source of the iframe.
      Returns:
      the source of the iframe.
    • setSrcdoc

      public void setSrcdoc(String srcdoc)
      Sets the srcdoc of the iframe.
      Parameters:
      srcdoc - srcdoc URL.
    • getSrcdoc

      public Optional<String> getSrcdoc()
      Gets the srcdoc of the iframe.
      Returns:
      the srcdoc of the iframe.
    • setAllow

      public void setAllow(String allow)
      Sets the allow property to specify a feature policy.
      Parameters:
      allow - the allow attribute value.
      See Also:
    • getAllow

      public Optional<String> getAllow()
      Gets the value of allow attribute.
      Returns:
      the currently applied allow value.
    • setName

      public void setName(String name)
      Sets the name attribute.
      Parameters:
      name - the value for the name attribute.
    • getName

      public Optional<String> getName()
      Gets the name attribute.
      Returns:
      the name attribute.
    • setImportance

      public void setImportance(IFrame.ImportanceType importance)
      Sets the importance attribute to the specified IFrame.ImportanceType value.
      Parameters:
      importance - IFrame.ImportanceType value.
      See Also:
    • getImportance

      public Optional<IFrame.ImportanceType> getImportance()
      Gets the importance attribute value.
      Returns:
      the importance value.
      See Also:
    • setSandbox

      public void setSandbox(IFrame.SandboxType... types)
      Sets the sandbox attribute to the given IFrame.SandboxTypes.
      Parameters:
      types - IFrame.SandboxTypes.
    • getSandbox

      public Optional<IFrame.SandboxType[]> getSandbox()
      Gets the list of sandbox attribute values.
      Returns:
      the current IFrame.SandboxTypes.
    • reload

      public void reload()
      Reloads the IFrame.