Package com.vaadin.v7.ui
Class Label
-
- All Implemented Interfaces:
ContextClickEvent.ContextClickNotifier
,MethodEventSource
,SerializableEventListener
,ClientConnector
,Sizeable
,com.vaadin.shared.Connector
,Component
,Property<String>
,Property.ValueChangeListener
,Property.ValueChangeNotifier
,Property.Viewer
,Serializable
,Comparable<Label>
,EventListener
@Deprecated public class Label extends AbstractLegacyComponent implements Property<String>, Property.Viewer, Property.ValueChangeListener, Property.ValueChangeNotifier, Comparable<Label>
Deprecated.As of 8.0, replaced byLabel
that removes data binding supportLabel component for showing non-editable short texts.
The label content can be set to the modes specified by
The contents of the label may contain simple formatting:ContentMode
- <b> Bold
- <i> Italic
- <u> Underlined
- <br/> Linebreak
- <ul><li>item 1</li><li>item 2</li></ul> List of items
- Since:
- 3.0
- Author:
- Vaadin Ltd.
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Label.ValueChangeEvent
Deprecated.-
Nested classes/interfaces inherited from interface com.vaadin.server.ClientConnector
ClientConnector.AttachEvent, ClientConnector.AttachListener, ClientConnector.ConnectorErrorEvent, ClientConnector.DetachEvent, ClientConnector.DetachListener
-
Nested classes/interfaces inherited from interface com.vaadin.ui.Component
Component.ErrorEvent, Component.Event, Component.Focusable, Component.Listener
-
Nested classes/interfaces inherited from interface com.vaadin.v7.data.Property
Property.Editor, Property.ReadOnlyException, Property.ReadOnlyStatusChangeEvent, Property.ReadOnlyStatusChangeListener, Property.ReadOnlyStatusChangeNotifier, Property.Transactional<T>, Property.ValueChangeListener, Property.ValueChangeNotifier, Property.Viewer
-
Nested classes/interfaces inherited from interface com.vaadin.server.Sizeable
Sizeable.Unit
-
-
Field Summary
Fields Modifier and Type Field Description static ContentMode
CONTENT_DEFAULT
Deprecated.As of 7.0, useContentMode.TEXT
insteadstatic ContentMode
CONTENT_PREFORMATTED
Deprecated.As of 7.0, useContentMode.PREFORMATTED
insteadstatic ContentMode
CONTENT_RAW
Deprecated.As of 7.0, useContentMode.RAW
insteadstatic ContentMode
CONTENT_TEXT
Deprecated.As of 7.0, useContentMode.TEXT
insteadstatic ContentMode
CONTENT_XHTML
Deprecated.As of 7.0, useContentMode.HTML
insteadstatic ContentMode
CONTENT_XML
Deprecated.As of 7.0, useContentMode.XML
instead-
Fields inherited from class com.vaadin.ui.AbstractComponent
DESIGN_ATTR_PLAIN_TEXT
-
Fields inherited from interface com.vaadin.server.Sizeable
SIZE_UNDEFINED, UNITS_CM, UNITS_EM, UNITS_EX, UNITS_INCH, UNITS_MM, UNITS_PERCENTAGE, UNITS_PICAS, UNITS_PIXELS, UNITS_POINTS
-
-
Constructor Summary
Constructors Constructor Description Label()
Deprecated.Creates an empty Label.Label(Property contentSource)
Deprecated.Creates a new instance of Label with text-contents read from given datasource.Label(Property contentSource, ContentMode contentMode)
Deprecated.Creates a new instance of Label with text-contents read from given datasource.Label(String content)
Deprecated.Creates a new instance of Label with text-contents.Label(String content, ContentMode contentMode)
Deprecated.Creates a new instance of Label with text-contents.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
addListener(Property.ValueChangeListener listener)
Deprecated.As of 7.0, replaced byaddValueChangeListener(Property.ValueChangeListener)
void
addValueChangeListener(Property.ValueChangeListener listener)
Deprecated.Adds the value change listener.void
attach()
Deprecated.int
compareTo(Label other)
Deprecated.Compares the Label to other objects.protected void
fireValueChange()
Deprecated.Emits the options change event.ContentMode
getContentMode()
Deprecated.Gets the content mode of the Label.Converter<String,Object>
getConverter()
Deprecated.Gets the converter used to convert the property data source value to the label value.protected Collection<String>
getCustomAttributes()
Deprecated.Property
getPropertyDataSource()
Deprecated.Gets the viewing data-source property.protected LabelState
getState()
Deprecated.protected LabelState
getState(boolean markAsDirty)
Deprecated.Class<String>
getType()
Deprecated.Gets the type of the Property.String
getValue()
Deprecated.Gets the value of the label.void
readDesign(org.jsoup.nodes.Element design, DesignContext designContext)
Deprecated.void
removeListener(Property.ValueChangeListener listener)
Deprecated.As of 7.0, replaced byremoveValueChangeListener(Property.ValueChangeListener)
void
removeValueChangeListener(Property.ValueChangeListener listener)
Deprecated.Removes the value change listener.void
setContentMode(ContentMode contentMode)
Deprecated.Sets the content mode of the Label.void
setConverter(Converter<String,?> converter)
Deprecated.Sets the converter used to convert the label value to the property data source type.void
setLocale(Locale locale)
Deprecated.void
setPropertyDataSource(Property newDataSource)
Deprecated.Sets the property as data-source for viewing.void
setValue(String newStringValue)
Deprecated.Set the value of the label.void
valueChange(Property.ValueChangeEvent event)
Deprecated.Listens the value change events from data source.void
writeDesign(org.jsoup.nodes.Element design, DesignContext designContext)
Deprecated.-
Methods inherited from class com.vaadin.v7.ui.AbstractLegacyComponent
beforeClientResponse, getExplicitImmediateValue, isImmediate, isReadOnly, setImmediate, setReadOnly
-
Methods inherited from class com.vaadin.ui.AbstractComponent
addContextClickListener, addListener, addShortcutListener, addStyleName, detach, findAncestor, fireComponentErrorEvent, fireComponentEvent, focus, getActionManager, getCaption, getComponentError, getData, getDebugId, getDescription, getErrorMessage, getHeight, getHeightUnits, getIcon, getId, getLocale, getParent, getPrimaryStyleName, getStyleName, getWidth, getWidthUnits, isCaptionAsHtml, isConnectorEnabled, isEnabled, isOrHasAncestor, isRequiredIndicatorVisible, isResponsive, isVisible, removeContextClickListener, removeListener, removeShortcutListener, removeStyleName, setCaption, setCaptionAsHtml, setComponentError, setData, setDebugId, setDescription, setDescription, setEnabled, setHeight, setHeight, setHeightFull, setHeightUndefined, setIcon, setId, setParent, setPrimaryStyleName, setRequiredIndicatorVisible, setResponsive, setSizeFull, setSizeUndefined, setStyleName, setVisible, setWidth, setWidth, setWidthFull, setWidthUndefined
-
Methods inherited from class com.vaadin.server.AbstractClientConnector
addAttachListener, addDetachListener, addExtension, addListener, addListener, addListener, 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, removeListener, requestRepaint, requestRepaintAll, retrievePendingRpcCalls, setErrorHandler, setResource, updateDiffstate
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.vaadin.server.ClientConnector
addAttachListener, addDetachListener, encodeState, getErrorHandler, getExtensions, getRpcManager, getStateType, handleConnectorRequest, isAttached, markAsDirty, markAsDirtyRecursive, removeAttachListener, removeDetachListener, removeExtension, requestRepaint, requestRepaintAll, retrievePendingRpcCalls, setErrorHandler
-
Methods inherited from interface com.vaadin.ui.Component
addStyleNames, getUI, removeStyleNames, setStyleName
-
Methods inherited from interface com.vaadin.v7.data.Property
isReadOnly, setReadOnly
-
-
-
-
Field Detail
-
CONTENT_TEXT
@Deprecated public static final ContentMode CONTENT_TEXT
Deprecated.As of 7.0, useContentMode.TEXT
instead
-
CONTENT_PREFORMATTED
@Deprecated public static final ContentMode CONTENT_PREFORMATTED
Deprecated.As of 7.0, useContentMode.PREFORMATTED
instead
-
CONTENT_XHTML
@Deprecated public static final ContentMode CONTENT_XHTML
Deprecated.As of 7.0, useContentMode.HTML
instead
-
CONTENT_XML
@Deprecated public static final ContentMode CONTENT_XML
Deprecated.As of 7.0, useContentMode.XML
instead
-
CONTENT_RAW
@Deprecated public static final ContentMode CONTENT_RAW
Deprecated.As of 7.0, useContentMode.RAW
instead
-
CONTENT_DEFAULT
@Deprecated public static final ContentMode CONTENT_DEFAULT
Deprecated.As of 7.0, useContentMode.TEXT
instead
-
-
Constructor Detail
-
Label
public Label()
Deprecated.Creates an empty Label.
-
Label
public Label(String content)
Deprecated.Creates a new instance of Label with text-contents.- Parameters:
content
-
-
Label
public Label(Property contentSource)
Deprecated.Creates a new instance of Label with text-contents read from given datasource.- Parameters:
contentSource
-
-
Label
public Label(String content, ContentMode contentMode)
Deprecated.Creates a new instance of Label with text-contents.- Parameters:
content
-contentMode
-
-
Label
public Label(Property contentSource, ContentMode contentMode)
Deprecated.Creates a new instance of Label with text-contents read from given datasource.- Parameters:
contentSource
-contentMode
-
-
-
Method Detail
-
getState
protected LabelState getState()
Deprecated.- Overrides:
getState
in classAbstractLegacyComponent
-
getState
protected LabelState getState(boolean markAsDirty)
Deprecated.- Overrides:
getState
in classAbstractLegacyComponent
-
getValue
public String getValue()
Deprecated.Gets the value of the label.The value of the label is the text that is shown to the end user. Depending on the
ContentMode
it is plain text or markup.
-
setValue
public void setValue(String newStringValue)
Deprecated.Set the value of the label. Value of the label is the XML contents of the label. Since Vaadin 7.2, changing the value of Label instance with that method will fire ValueChangeEvent.
-
getType
public Class<String> getType()
Deprecated.Gets the type of the Property.- Specified by:
getType
in interfaceProperty<String>
- Returns:
- type of the Property
- See Also:
Property.getType()
-
getPropertyDataSource
public Property getPropertyDataSource()
Deprecated.Gets the viewing data-source property.- Specified by:
getPropertyDataSource
in interfaceProperty.Viewer
- Returns:
- the data source property.
- See Also:
Property.Viewer.getPropertyDataSource()
-
setPropertyDataSource
public void setPropertyDataSource(Property newDataSource)
Deprecated.Sets the property as data-source for viewing. Since Vaadin 7.2 a ValueChangeEvent is fired if the new value is different from previous.- Specified by:
setPropertyDataSource
in interfaceProperty.Viewer
- Parameters:
newDataSource
- the new data source Property- See Also:
Property.Viewer.setPropertyDataSource(Property)
-
getContentMode
public ContentMode getContentMode()
Deprecated.Gets the content mode of the Label.- Returns:
- the Content mode of the label.
- See Also:
ContentMode
-
setContentMode
public void setContentMode(ContentMode contentMode)
Deprecated.Sets the content mode of the Label.- Parameters:
contentMode
- the New content mode of the label.- See Also:
ContentMode
-
addValueChangeListener
public void addValueChangeListener(Property.ValueChangeListener listener)
Deprecated.Adds the value change listener.- Specified by:
addValueChangeListener
in interfaceProperty.ValueChangeNotifier
- Parameters:
listener
- the Listener to be added.- See Also:
Property.ValueChangeNotifier.addListener(Property.ValueChangeListener)
-
addListener
@Deprecated public void addListener(Property.ValueChangeListener listener)
Deprecated.As of 7.0, replaced byaddValueChangeListener(Property.ValueChangeListener)
- Specified by:
addListener
in interfaceProperty.ValueChangeNotifier
-
removeValueChangeListener
public void removeValueChangeListener(Property.ValueChangeListener listener)
Deprecated.Removes the value change listener.- Specified by:
removeValueChangeListener
in interfaceProperty.ValueChangeNotifier
- Parameters:
listener
- the Listener to be removed.- See Also:
Property.ValueChangeNotifier.removeListener(Property.ValueChangeListener)
-
removeListener
@Deprecated public void removeListener(Property.ValueChangeListener listener)
Deprecated.As of 7.0, replaced byremoveValueChangeListener(Property.ValueChangeListener)
- Specified by:
removeListener
in interfaceProperty.ValueChangeNotifier
-
fireValueChange
protected void fireValueChange()
Deprecated.Emits the options change event.
-
valueChange
public void valueChange(Property.ValueChangeEvent event)
Deprecated.Listens the value change events from data source.- Specified by:
valueChange
in interfaceProperty.ValueChangeListener
- Parameters:
event
- value change event object- See Also:
Property.ValueChangeListener.valueChange(Property.ValueChangeEvent)
-
attach
public void attach()
Deprecated.- Specified by:
attach
in interfaceClientConnector
- Specified by:
attach
in interfaceComponent
- Overrides:
attach
in classAbstractComponent
-
setLocale
public void setLocale(Locale locale)
Deprecated.- Overrides:
setLocale
in classAbstractComponent
-
compareTo
public int compareTo(Label other)
Deprecated.Compares the Label to other objects.Labels can be compared to other labels for sorting label contents. This is especially handy for sorting table columns.
In RAW, PREFORMATTED and TEXT modes, the label contents are compared as is. In XML, UIDL and HTML modes, only CDATA is compared and tags ignored. If the other object is not a Label, its toString() return value is used in comparison.
- Specified by:
compareTo
in interfaceComparable<Label>
- Parameters:
other
- the Other object to compare to.- Returns:
- a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.
- See Also:
Comparable.compareTo(java.lang.Object)
-
getConverter
public Converter<String,Object> getConverter()
Deprecated.Gets the converter used to convert the property data source value to the label value.- Returns:
- The converter or null if none is set.
-
setConverter
public void setConverter(Converter<String,?> converter)
Deprecated.Sets the converter used to convert the label value to the property data source type. The converter must have a presentation type of String.- Parameters:
converter
- The new converter to use.
-
readDesign
public void readDesign(org.jsoup.nodes.Element design, DesignContext designContext)
Deprecated.- Specified by:
readDesign
in interfaceComponent
- Overrides:
readDesign
in classAbstractLegacyComponent
-
getCustomAttributes
protected Collection<String> getCustomAttributes()
Deprecated.- Overrides:
getCustomAttributes
in classAbstractComponent
-
writeDesign
public void writeDesign(org.jsoup.nodes.Element design, DesignContext designContext)
Deprecated.- Specified by:
writeDesign
in interfaceComponent
- Overrides:
writeDesign
in classAbstractLegacyComponent
-
-