@Tag(value="iframe") public class IFrame extends HtmlComponent
<iframe> element.| Modifier and Type | Class and Description |
|---|---|
static class |
IFrame.ImportanceType
Importance types.
|
static class |
IFrame.SandboxType
Sandbox types.
|
| Constructor and Description |
|---|
IFrame()
Creates a new iframe.
|
IFrame(String src)
Creates a new iframe with a source URL.
|
| Modifier and Type | Method and Description |
|---|---|
Optional<String> |
getAllow()
Gets the value of allow attribute.
|
Optional<IFrame.ImportanceType> |
getImportance()
Gets the importance attribute value.
|
Optional<String> |
getName()
Gets the name attribute.
|
Optional<IFrame.SandboxType[]> |
getSandbox()
Gets the list of sandbox attribute values.
|
String |
getSrc()
Gets the source of the iframe.
|
Optional<String> |
getSrcdoc()
Gets the srcdoc of the iframe.
|
void |
setAllow(String allow)
Sets the allow property to specify a feature policy.
|
void |
setImportance(IFrame.ImportanceType importance)
Sets the importance attribute to the specified
IFrame.ImportanceType
value. |
void |
setName(String name)
Sets the name attribute.
|
void |
setSandbox(IFrame.SandboxType... types)
Sets the sandbox attribute to the given
IFrame.SandboxTypes. |
void |
setSrc(String src)
Sets the source of the iframe.
|
void |
setSrcdoc(String srcdoc)
Sets the srcdoc of the iframe.
|
void |
setUnsafeSrc(String src)
Sets the source of the iframe without validating its scheme.
|
getTitle, setTitleaddListener, fireEvent, from, get, getChildren, getElement, getEventBus, getId, getLocale, getParent, getTranslation, getTranslation, getTranslation, getTranslation, getUI, hasListener, isAttached, isTemplateMapped, isVisible, onAttach, onDetach, onEnabledStateChanged, set, setElement, setId, setVisibleclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetCssSize, getHeight, getHeightUnit, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getWidth, getWidthUnit, setHeight, setHeight, setHeightFull, setMaxHeight, setMaxHeight, setMaxWidth, setMaxWidth, setMinHeight, setMinHeight, setMinWidth, setMinWidth, setSizeFull, setSizeUndefined, setWidth, setWidth, setWidthFulladdClassName, addClassNames, getClassName, getClassNames, getStyle, hasClassName, removeClassName, removeClassNames, setClassName, setClassNamegetElementaddAttachListeneraddDetachListenerpublic IFrame()
public IFrame(String src)
src - Source URLIllegalArgumentException - if src uses a scheme that is not considered safe
according to
DeploymentConfiguration.getUrlSafeSchemes(); see
setUnsafeSrc(String) and the
configuration
propertypublic void setSrc(String src)
src - Source URL.IllegalArgumentException - if the URL uses a scheme that is not considered safe
according to
DeploymentConfiguration.getUrlSafeSchemes(); see
setUnsafeSrc(String) and the
configuration
propertypublic void setUnsafeSrc(String src)
Unlike setSrc(String), this method does not reject URLs based on
the configuration. Use it only
for URLs that are fully under your control and known to be safe, such as
a hard-coded javascript: or data: URL. Passing untrusted
input here can expose the application to cross-site scripting (XSS)
attacks.
src - Source URL.setSrc(String)public String getSrc()
public void setSrcdoc(String srcdoc)
srcdoc - srcdoc URL.public Optional<String> getSrcdoc()
public void setAllow(String allow)
allow - the allow attribute value.public Optional<String> getAllow()
public void setName(String name)
name - the value for the name attribute.public void setImportance(IFrame.ImportanceType importance)
IFrame.ImportanceType
value.importance - IFrame.ImportanceType value.IFrame.ImportanceTypepublic Optional<IFrame.ImportanceType> getImportance()
IFrame.ImportanceTypepublic void setSandbox(IFrame.SandboxType... types)
IFrame.SandboxTypes.types - IFrame.SandboxTypes.public Optional<IFrame.SandboxType[]> getSandbox()
IFrame.SandboxTypes.Copyright © 2000–2026 Vaadin Ltd. All rights reserved.