public class Embedded extends AbstractComponent implements LegacyComponent
The Embedded
component is used to display various types of multimedia
content using the HTML <object>
element. This includes PDF documents,
Java applets, and QuickTime videos. Installing a browser plug-in is usually
required to actually view the embedded content.
Note that before Vaadin 7, Embedded
was also used to display images,
Adobe Flash objects, and embedded web pages. This use of the component is
deprecated in Vaadin 7; the Image
, Flash
, and
BrowserFrame
components should be used instead, respectively.
Video
,
Audio
,
Serialized FormComponent.ErrorEvent, Component.Event, Component.Focusable, Component.Listener
ClientConnector.AttachEvent, ClientConnector.AttachListener, ClientConnector.ConnectorErrorEvent, ClientConnector.DetachEvent, ClientConnector.DetachListener
Sizeable.Unit
Modifier and Type | Field and Description |
---|---|
static int |
TYPE_BROWSER
Deprecated.
As of 7.0, use the
BrowserFrame component instead. |
static int |
TYPE_IMAGE
Deprecated.
As of 7.0, use the
Image component instead. |
static int |
TYPE_OBJECT
General object type.
|
DESIGN_ATTR_PLAIN_TEXT
SIZE_UNDEFINED, UNITS_CM, UNITS_EM, UNITS_EX, UNITS_INCH, UNITS_MM, UNITS_PERCENTAGE, UNITS_PICAS, UNITS_PIXELS, UNITS_POINTS
Constructor and Description |
---|
Embedded()
Creates a new empty Embedded object.
|
Embedded(String caption)
Creates a new empty Embedded object with caption.
|
Embedded(String caption,
Resource source)
Creates a new Embedded object whose contents is loaded from given
resource.
|
Modifier and Type | Method and Description |
---|---|
void |
addClickListener(MouseEvents.ClickListener listener)
Add a click listener to the component.
|
void |
addListener(MouseEvents.ClickListener listener)
Deprecated.
As of 7.0, replaced by
#addClickListener(ClickListener) |
void |
changeVariables(Object source,
Map<String,Object> variables)
Called when one or more variables handled by the implementing class are
changed.
|
String |
getAlternateText()
Gets this component's "alt-text".
|
String |
getArchive()
This attribute may be used to specify a space-separated list of URIs for
archives containing resources relevant to the object, which may include
the resources specified by the classid and data attributes.
|
String |
getClassId()
This attribute may be used to specify the location of an object's
implementation via a URI.
|
String |
getCodebase()
This attribute specifies the base path used to resolve relative URIs
specified by the classid, data, and archive attributes.
|
String |
getCodetype()
Gets the MIME-Type of the code.
|
String |
getMimeType()
Gets the MIME-Type of the object.
|
String |
getParameter(String name)
Gets the value of an object parameter.
|
Iterator<String> |
getParameterNames()
Gets the embedded object parameter names.
|
Resource |
getSource()
Gets the resource contained in the embedded object.
|
String |
getStandby()
This attribute specifies a message that a user agent may render while
loading the object's implementation and data.
|
int |
getType()
Gets the type of the embedded object.
|
void |
paintContent(PaintTarget target)
Invoked when the component state should be painted.
|
void |
removeClickListener(MouseEvents.ClickListener listener)
Remove a click listener from the component.
|
void |
removeListener(MouseEvents.ClickListener listener)
Deprecated.
As of 7.0, replaced by
#removeClickListener(ClickListener) |
void |
removeParameter(String name)
Removes an object parameter from the list.
|
void |
setAlternateText(String altText)
Sets this component's "alt-text", that is, an alternate text that can be
presented instead of this component's normal content, for accessibility
purposes.
|
void |
setArchive(String archive)
This attribute may be used to specify a space-separated list of URIs for
archives containing resources relevant to the object, which may include
the resources specified by the classid and data attributes.
|
void |
setClassId(String classId)
This attribute may be used to specify the location of an object's
implementation via a URI.
|
void |
setCodebase(String codebase)
This attribute specifies the base path used to resolve relative URIs
specified by the classid, data, and archive attributes.
|
void |
setCodetype(String codetype)
This attribute specifies the content type of data expected when
downloading the object specified by classid.
|
void |
setMimeType(String mimeType)
Sets the mimeType, the MIME-Type of the object.
|
void |
setParameter(String name,
String value)
Sets an object parameter.
|
void |
setSource(Resource source)
Sets the object source resource.
|
void |
setStandby(String standby)
This attribute specifies a message that a user agent may render while
loading the object's implementation and data.
|
void |
setType(int type)
Sets the object type.
|
addContextClickListener, addListener, addShortcutListener, addStyleName, attach, beforeClientResponse, detach, findAncestor, fireComponentErrorEvent, fireComponentEvent, focus, getActionManager, getCaption, getComponentError, getCustomAttributes, getData, getDebugId, getDescription, getErrorMessage, getExplicitImmediateValue, getHeight, getHeightUnits, getIcon, getId, getLocale, getParent, getPrimaryStyleName, getState, getState, getStyleName, getWidth, getWidthUnits, isCaptionAsHtml, isConnectorEnabled, isEnabled, isImmediate, isOrHasAncestor, isReadOnly, isResponsive, isVisible, readDesign, removeContextClickListener, removeListener, removeShortcutListener, removeStyleName, setCaption, setCaptionAsHtml, setComponentError, setData, setDebugId, setDescription, setEnabled, setHeight, setHeight, setHeightUndefined, setIcon, setId, setImmediate, setLocale, setParent, setPrimaryStyleName, setReadOnly, setResponsive, setSizeFull, setSizeUndefined, setStyleName, setStyleName, setVisible, setWidth, setWidth, setWidthUndefined, writeDesign
addAttachListener, addDetachListener, addExtension, addListener, addListener, addListener, addMethodInvocationToQueue, createState, encodeState, equals, fireEvent, getAllChildrenIterable, getConnectorId, getErrorHandler, getExtensions, getListeners, getResource, getRpcManager, getRpcProxy, getSession, getStateType, getUI, handleConnectorRequest, hashCode, hasListeners, isAttached, isThis, markAsDirty, markAsDirtyRecursive, registerRpc, registerRpc, removeAttachListener, removeDetachListener, removeExtension, removeListener, removeListener, removeListener, removeListener, requestRepaint, requestRepaintAll, retrievePendingRpcCalls, setErrorHandler, setResource
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
markAsDirty
isEnabled, isImmediate
addListener, addStyleName, attach, getCaption, getDescription, getIcon, getId, getLocale, getParent, getPrimaryStyleName, getStyleName, getUI, isEnabled, isReadOnly, isVisible, readDesign, removeListener, removeStyleName, setCaption, setEnabled, setIcon, setId, setParent, setPrimaryStyleName, setReadOnly, setStyleName, setVisible, writeDesign
addAttachListener, addDetachListener, beforeClientResponse, detach, encodeState, getErrorHandler, getExtensions, getRpcManager, getStateType, handleConnectorRequest, isAttached, isConnectorEnabled, markAsDirtyRecursive, removeAttachListener, removeDetachListener, removeExtension, requestRepaint, requestRepaintAll, retrievePendingRpcCalls, setErrorHandler
getConnectorId
getHeight, getHeightUnits, getWidth, getWidthUnits, setHeight, setHeight, setHeightUndefined, setSizeFull, setSizeUndefined, setWidth, setWidth, setWidthUndefined
public static final int TYPE_OBJECT
@Deprecated public static final int TYPE_IMAGE
Image
component instead.@Deprecated public static final int TYPE_BROWSER
BrowserFrame
component instead.public Embedded()
public Embedded(String caption)
caption
- public void paintContent(PaintTarget target) throws PaintException
paintContent
in interface LegacyComponent
target
- the target UIDL stream where the component should paint itself
to.PaintException
- if the paint operation failed.public void setAlternateText(String altText)
setType(int)
has been called with
TYPE_BROWSER
.altText
- A short, human-readable description of this component's
content.public String getAlternateText()
setAlternateText(String)
public void setParameter(String name, String value)
name
- the name of the parameter.value
- the value of the parameter.public String getParameter(String name)
public void removeParameter(String name)
name
- the name of the parameter to remove.public Iterator<String> getParameterNames()
public String getCodebase()
public String getCodetype()
public String getMimeType()
public String getStandby()
public void setCodebase(String codebase)
codebase
- The base pathpublic void setCodetype(String codetype)
codetype
- the codetype to set.public void setMimeType(String mimeType)
mimeType
- the mimeType to set.public void setStandby(String standby)
standby
- The text to display while loadingpublic String getClassId()
public void setClassId(String classId)
classId
- the classId to set.public Resource getSource()
public int getType()
This can be one of the following:
public void setSource(Resource source)
source
- the source to set.public void setType(int type)
This can be one of the following:
TYPE_OBJECT
(This is the default)
TYPE_IMAGE
(Deprecated)
TYPE_BROWSER
(Deprecated)
type
- the type to set.public String getArchive()
public void setArchive(String archive)
archive
- Space-separated list of URIs with resources relevant to the
objectpublic void addClickListener(MouseEvents.ClickListener listener)
#removeListener(ClickListener)
to remove the listener.listener
- The listener to add@Deprecated public void addListener(MouseEvents.ClickListener listener)
#addClickListener(ClickListener)
public void removeClickListener(MouseEvents.ClickListener listener)
#addListener(ClickListener)
.listener
- The listener to remove@Deprecated public void removeListener(MouseEvents.ClickListener listener)
#removeClickListener(ClickListener)
public void changeVariables(Object source, Map<String,Object> variables)
VariableOwner
changeVariables
in interface VariableOwner
source
- the Source of the variable change. This is the origin of the
event. For example in Web Adapter this is the request.variables
- the Mapping from variable names to new variable values.Copyright © 2019 Vaadin Ltd. All rights reserved.