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 byLabelthat 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 classLabel.ValueChangeEventDeprecated.-
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 ContentModeCONTENT_DEFAULTDeprecated.As of 7.0, useContentMode.TEXTinsteadstatic ContentModeCONTENT_PREFORMATTEDDeprecated.As of 7.0, useContentMode.PREFORMATTEDinsteadstatic ContentModeCONTENT_RAWDeprecated.As of 7.0, useContentMode.RAWinsteadstatic ContentModeCONTENT_TEXTDeprecated.As of 7.0, useContentMode.TEXTinsteadstatic ContentModeCONTENT_XHTMLDeprecated.As of 7.0, useContentMode.HTMLinsteadstatic ContentModeCONTENT_XMLDeprecated.As of 7.0, useContentMode.XMLinstead-
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 voidaddListener(Property.ValueChangeListener listener)Deprecated.As of 7.0, replaced byaddValueChangeListener(Property.ValueChangeListener)voidaddValueChangeListener(Property.ValueChangeListener listener)Deprecated.Adds the value change listener.voidattach()Deprecated.intcompareTo(Label other)Deprecated.Compares the Label to other objects.protected voidfireValueChange()Deprecated.Emits the options change event.ContentModegetContentMode()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.PropertygetPropertyDataSource()Deprecated.Gets the viewing data-source property.protected LabelStategetState()Deprecated.protected LabelStategetState(boolean markAsDirty)Deprecated.Class<String>getType()Deprecated.Gets the type of the Property.StringgetValue()Deprecated.Gets the value of the label.voidreadDesign(org.jsoup.nodes.Element design, DesignContext designContext)Deprecated.voidremoveListener(Property.ValueChangeListener listener)Deprecated.As of 7.0, replaced byremoveValueChangeListener(Property.ValueChangeListener)voidremoveValueChangeListener(Property.ValueChangeListener listener)Deprecated.Removes the value change listener.voidsetContentMode(ContentMode contentMode)Deprecated.Sets the content mode of the Label.voidsetConverter(Converter<String,?> converter)Deprecated.Sets the converter used to convert the label value to the property data source type.voidsetLocale(Locale locale)Deprecated.voidsetPropertyDataSource(Property newDataSource)Deprecated.Sets the property as data-source for viewing.voidsetValue(String newStringValue)Deprecated.Set the value of the label.voidvalueChange(Property.ValueChangeEvent event)Deprecated.Listens the value change events from data source.voidwriteDesign(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.TEXTinstead
-
CONTENT_PREFORMATTED
@Deprecated public static final ContentMode CONTENT_PREFORMATTED
Deprecated.As of 7.0, useContentMode.PREFORMATTEDinstead
-
CONTENT_XHTML
@Deprecated public static final ContentMode CONTENT_XHTML
Deprecated.As of 7.0, useContentMode.HTMLinstead
-
CONTENT_XML
@Deprecated public static final ContentMode CONTENT_XML
Deprecated.As of 7.0, useContentMode.XMLinstead
-
CONTENT_RAW
@Deprecated public static final ContentMode CONTENT_RAW
Deprecated.As of 7.0, useContentMode.RAWinstead
-
CONTENT_DEFAULT
@Deprecated public static final ContentMode CONTENT_DEFAULT
Deprecated.As of 7.0, useContentMode.TEXTinstead
-
-
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:
getStatein classAbstractLegacyComponent
-
getState
protected LabelState getState(boolean markAsDirty)
Deprecated.- Overrides:
getStatein 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
ContentModeit 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:
getTypein interfaceProperty<String>- Returns:
- type of the Property
- See Also:
Property.getType()
-
getPropertyDataSource
public Property getPropertyDataSource()
Deprecated.Gets the viewing data-source property.- Specified by:
getPropertyDataSourcein 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:
setPropertyDataSourcein 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:
addValueChangeListenerin 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:
addListenerin interfaceProperty.ValueChangeNotifier
-
removeValueChangeListener
public void removeValueChangeListener(Property.ValueChangeListener listener)
Deprecated.Removes the value change listener.- Specified by:
removeValueChangeListenerin 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:
removeListenerin 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:
valueChangein interfaceProperty.ValueChangeListener- Parameters:
event- value change event object- See Also:
Property.ValueChangeListener.valueChange(Property.ValueChangeEvent)
-
attach
public void attach()
Deprecated.- Specified by:
attachin interfaceClientConnector- Specified by:
attachin interfaceComponent- Overrides:
attachin classAbstractComponent
-
setLocale
public void setLocale(Locale locale)
Deprecated.- Overrides:
setLocalein 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:
compareToin 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:
readDesignin interfaceComponent- Overrides:
readDesignin classAbstractLegacyComponent
-
getCustomAttributes
protected Collection<String> getCustomAttributes()
Deprecated.- Overrides:
getCustomAttributesin classAbstractComponent
-
writeDesign
public void writeDesign(org.jsoup.nodes.Element design, DesignContext designContext)Deprecated.- Specified by:
writeDesignin interfaceComponent- Overrides:
writeDesignin classAbstractLegacyComponent
-
-