com.vaadin.ui.
Class Embedded
java.lang.Object
com.vaadin.ui.AbstractComponent
com.vaadin.ui.Embedded
All Implemented Interfaces:
MethodEventSource, Paintable, Sizeable, VariableOwner, Component, Serializable, EventListener
- extends AbstractComponent
public class Embedded
Component for embedding external objects.
Since:
3.0
Version:
6.8.18
Author:
Vaadin Ltd.
See Also:
Nested Class Summary |
---|
Nested classes/interfaces inherited from class com.vaadin.ui.AbstractComponent |
---|
AbstractComponent.ComponentErrorEvent, AbstractComponent.ComponentErrorHandler |
Nested classes/interfaces inherited from interface com.vaadin.ui.Component |
---|
Component.ErrorEvent, Component.ErrorListener, Component.Event, Component.Focusable, Component.Listener |
Nested classes/interfaces inherited from interface com.vaadin.terminal.Paintable |
---|
Paintable.RepaintRequestEvent, Paintable.RepaintRequestListener |
Field Summary | |
---|---|
static int |
TYPE_BROWSER
Browser ("iframe") type. |
static int |
TYPE_IMAGE
Image types. |
static int |
TYPE_OBJECT
General object type. |
Fields inherited from interface com.vaadin.terminal.Sizeable |
---|
SIZE_UNDEFINED, UNIT_SYMBOLS, UNITS_CM, UNITS_EM, UNITS_EX, UNITS_INCH, UNITS_MM, UNITS_PERCENTAGE, UNITS_PICAS, UNITS_PIXELS, UNITS_POINTS |
Constructor Summary | |
---|---|
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. |
Method Summary | |
---|---|
void |
addListener(MouseEvents.ClickListener listener)
Add a click listener to the component. |
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 |
removeListener(MouseEvents.ClickListener listener)
Remove a click listener from the component. |
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
TYPE_OBJECT
public static final int TYPE_OBJECT
- See Also:
- Constant Field Values
General object type.
TYPE_IMAGE
public static final int TYPE_IMAGE
- See Also:
- Constant Field Values
Image types.
TYPE_BROWSER
public static final int TYPE_BROWSER
- See Also:
- Constant Field Values
Browser ("iframe") type.
Constructor Detail |
---|
Embedded
public Embedded()
Creates a new empty Embedded object.
Embedded
public Embedded(String caption)
- Parameters:
caption
-
Creates a new empty Embedded object with caption.
Embedded
public Embedded(String caption,
Resource source)
- Parameters:
caption
-source
- the Source of the embedded object.
Creates a new Embedded object whose contents is loaded from given resource. The dimensions are assumed if possible. The type is guessed from resource.
Method Detail |
---|
paintContent
public void paintContent(PaintTarget target)
throws PaintException
- Overrides:
paintContent
in classAbstractComponent
- Parameters:
target
- the target UIDL stream where the component should paint itself to- Throws:
PaintException
- if the paint operation failed.
Invoked when the component state should be painted.
setAlternateText
public void setAlternateText(String altText)
- Parameters:
altText
- A short, human-readable description of this component's content.- Since:
- 6.8
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
.
getAlternateText
public String getAlternateText()
- See Also:
setAlternateText(String)
Gets this component's "alt-text".
setParameter
public void setParameter(String name,
String value)
- Parameters:
name
- the name of the parameter.value
- the value of the parameter.
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.
getParameter
public String getParameter(String name)
- Returns:
- the Value of parameter or null if not found.
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.
removeParameter
public void removeParameter(String name)
- Parameters:
name
- the name of the parameter to remove.
Removes an object parameter from the list.
getParameterNames
public Iterator<String> getParameterNames()
- Returns:
- the Iterator of parameters names.
Gets the embedded object parameter names.
getCodebase
public String getCodebase()
- Returns:
- the code base.
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.
getCodetype
public String getCodetype()
- Returns:
- the MIME-Type of the code.
Gets the MIME-Type of the code.
getMimeType
public String getMimeType()
- Returns:
- the MIME-Type of the object.
Gets the MIME-Type of the object.
getStandby
public String getStandby()
- Returns:
- The text displayed when loading
This attribute specifies a message that a user agent may render while loading the object's implementation and data.
setCodebase
public void setCodebase(String codebase)
- Parameters:
codebase
- The base path
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.
setCodetype
public void setCodetype(String codetype)
- Parameters:
codetype
- the codetype to set.
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.
setMimeType
public void setMimeType(String mimeType)
- Parameters:
mimeType
- the mimeType to set.
Sets the mimeType, the MIME-Type of the object.
setStandby
public void setStandby(String standby)
- Parameters:
standby
- The text to display while loading
This attribute specifies a message that a user agent may render while loading the object's implementation and data.
getClassId
public String getClassId()
- Returns:
- the classid.
This attribute may be used to specify the location of an object's implementation via a URI.
setClassId
public void setClassId(String classId)
- Parameters:
classId
- the classId to set.
This attribute may be used to specify the location of an object's implementation via a URI.
getSource
public Resource getSource()
- Returns:
- the Resource
Gets the resource contained in the embedded object.
getType
public int getType()
- TYPE_OBJECT (This is the default)
- TYPE_IMAGE
- Returns:
- the type.
Gets the type of the embedded object.
This can be one of the following:
setSource
public void setSource(Resource source)
- Parameters:
source
- the source to set.
Sets the object source resource. The dimensions are assumed if possible. The type is guessed from resource.
setType
public void setType(int type)
- TYPE_OBJECT (This is the default)
- TYPE_IMAGE
- TYPE_BROWSER
- Parameters:
type
- the type to set.
Sets the object type.
This can be one of the following:
getArchive
public String getArchive()
- Returns:
- Space-separated list of URIs with resources relevant to the object
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.
setArchive
public void setArchive(String archive)
- Parameters:
archive
- Space-separated list of URIs with resources relevant to the object
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.
addListener
public void addListener(MouseEvents.ClickListener listener)
- Parameters:
listener
- The listener to add
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.
Use #removeListener(ClickListener)
to remove the listener.
removeListener
public void removeListener(MouseEvents.ClickListener listener)
- Parameters:
listener
- The listener to remove
Remove a click listener from the component. The listener should earlier
have been added using #addListener(ClickListener)
.
changeVariables
public void changeVariables(Object source,
Map<String,Object> variables)
- Specified by:
changeVariables
in interfaceVariableOwner
- Overrides:
changeVariables
in classAbstractComponent
- Parameters:
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.
Description copied from interface: VariableOwner
Called when one or more variables handled by the implementing class are changed.