Package com.vaadin.ui

Class Embedded

  • All Implemented Interfaces:
    ContextClickEvent.ContextClickNotifier, MethodEventSource, ClientConnector, Sizeable, com.vaadin.shared.Connector, Component, java.io.Serializable

    public class Embedded
    extends AbstractComponent
    A component for embedding external objects.

    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.

    Since:
    3.0
    Author:
    Vaadin Ltd.
    See Also:
    Video, Audio, Serialized Form
    • Field Detail

      • TYPE_IMAGE

        @Deprecated
        public static final int TYPE_IMAGE
        Deprecated.
        As of 7.0, use the Image component instead.
        Image types.
        See Also:
        Constant Field Values
      • TYPE_BROWSER

        @Deprecated
        public static final int TYPE_BROWSER
        Deprecated.
        As of 7.0, use the BrowserFrame component instead.
        Browser ("iframe") type.
        See Also:
        Constant Field Values
    • Constructor Detail

      • Embedded

        public Embedded()
        Creates a new empty Embedded object.
      • Embedded

        public Embedded​(java.lang.String caption)
        Creates a new empty Embedded object with caption.
        Parameters:
        caption -
      • Embedded

        public Embedded​(java.lang.String caption,
                        Resource source)
        Creates a new Embedded object whose contents is loaded from given resource. The dimensions are assumed if possible. The type is guessed from resource.
        Parameters:
        caption -
        source - the Source of the embedded object.
    • Method Detail

      • setAlternateText

        public void setAlternateText​(java.lang.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. Does not work when setType(int) has been called with TYPE_BROWSER.
        Parameters:
        altText - A short, human-readable description of this component's content.
        Since:
        6.8
      • getAlternateText

        public java.lang.String getAlternateText()
        Gets this component's "alt-text".
        See Also:
        setAlternateText(String)
      • setParameter

        public void setParameter​(java.lang.String name,
                                 java.lang.String value)
        Sets an object parameter. Parameters are optional information, and they are passed to the instantiated object. Parameters are are stored as name value pairs. This overrides the previous value assigned to this parameter.
        Parameters:
        name - the name of the parameter.
        value - the value of the parameter.
      • getParameter

        public java.lang.String getParameter​(java.lang.String name)
        Gets the value of an object parameter. Parameters are optional information, and they are passed to the instantiated object. Parameters are are stored as name value pairs.
        Returns:
        the Value of parameter or null if not found.
      • removeParameter

        public void removeParameter​(java.lang.String name)
        Removes an object parameter from the list.
        Parameters:
        name - the name of the parameter to remove.
      • getParameterNames

        public java.util.Iterator<java.lang.String> getParameterNames()
        Gets the embedded object parameter names.
        Returns:
        the Iterator of parameters names.
      • getCodebase

        public java.lang.String getCodebase()
        This attribute specifies the base path used to resolve relative URIs specified by the classid, data, and archive attributes. When absent, its default value is the base URI of the current document.
        Returns:
        the code base.
      • getCodetype

        public java.lang.String getCodetype()
        Gets the MIME-Type of the code.
        Returns:
        the MIME-Type of the code.
      • getMimeType

        public java.lang.String getMimeType()
        Gets the MIME-Type of the object.
        Returns:
        the MIME-Type of the object.
      • getStandby

        public java.lang.String getStandby()
        This attribute specifies a message that a user agent may render while loading the object's implementation and data.
        Returns:
        The text displayed when loading
      • setCodebase

        public void setCodebase​(java.lang.String codebase)
        This attribute specifies the base path used to resolve relative URIs specified by the classid, data, and archive attributes. When absent, its default value is the base URI of the current document.
        Parameters:
        codebase - The base path
      • setCodetype

        public void setCodetype​(java.lang.String codetype)
        This attribute specifies the content type of data expected when downloading the object specified by classid. This attribute is optional but recommended when classid is specified since it allows the user agent to avoid loading information for unsupported content types. When absent, it defaults to the value of the type attribute.
        Parameters:
        codetype - the codetype to set.
      • setMimeType

        public void setMimeType​(java.lang.String mimeType)
        Sets the mimeType, the MIME-Type of the object.
        Parameters:
        mimeType - the mimeType to set.
      • setStandby

        public void setStandby​(java.lang.String standby)
        This attribute specifies a message that a user agent may render while loading the object's implementation and data.
        Parameters:
        standby - The text to display while loading
      • getClassId

        public java.lang.String getClassId()
        This attribute may be used to specify the location of an object's implementation via a URI.
        Returns:
        the classid.
      • setClassId

        public void setClassId​(java.lang.String classId)
        This attribute may be used to specify the location of an object's implementation via a URI.
        Parameters:
        classId - the classId to set.
      • getSource

        public Resource getSource()
        Gets the resource contained in the embedded object.
        Returns:
        the Resource
      • getType

        public int getType()

        Gets the type of the embedded object.

        This can be one of the following:
        • TYPE_OBJECT (This is the default)
        • TYPE_IMAGE
        Returns:
        the type.
      • setSource

        public void setSource​(Resource source)
        Sets the object source resource. The dimensions are assumed if possible. The type is guessed from resource.
        Parameters:
        source - the source to set.
      • setType

        public void setType​(int type)

        Sets the object type.

        This can be one of the following:
        Parameters:
        type - the type to set.
      • getArchive

        public java.lang.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. Preloading archives will generally result in reduced load times for objects. Archives specified as relative URIs should be interpreted relative to the codebase attribute.
        Returns:
        Space-separated list of URIs with resources relevant to the object
      • setArchive

        public void setArchive​(java.lang.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. Preloading archives will generally result in reduced load times for objects. Archives specified as relative URIs should be interpreted relative to the codebase attribute.
        Parameters:
        archive - Space-separated list of URIs with resources relevant to the object
      • addClickListener

        public com.vaadin.shared.Registration addClickListener​(MouseEvents.ClickListener listener)
        Add a click listener to the component. The listener is called whenever the user clicks inside the component. Depending on the content the event may be blocked and in that case no event is fired.
        Parameters:
        listener - The listener to add
        Returns:
        a registration object for removing the listener
        Since:
        8.0
        See Also:
        Registration
      • getState

        protected com.vaadin.shared.ui.embedded.EmbeddedState getState()
        Description copied from class: AbstractComponent
        Returns the shared state bean with information to be sent from the server to the client. Subclasses should override this method and set any relevant fields of the state returned by super.getState().
        Overrides:
        getState in class AbstractComponent
        Returns:
        updated component shared state
      • getState

        protected com.vaadin.shared.ui.embedded.EmbeddedState getState​(boolean markAsDirty)
        Description copied from class: AbstractClientConnector
        Returns the shared state for this connector.
        Overrides:
        getState in class AbstractComponent
        Parameters:
        markAsDirty - true if the connector should automatically be marked dirty, false otherwise
        Returns:
        The shared state for this connector. Never null.
        See Also:
        AbstractClientConnector.getState()