Class InlineLabel

All Implemented Interfaces:
IsEditor<LeafValueEditor<String>>, HasAllDragAndDropHandlers, HasAllGestureHandlers, HasAllMouseHandlers, HasAllTouchHandlers, HasClickHandlers, HasDoubleClickHandlers, HasDragEndHandlers, HasDragEnterHandlers, HasDragHandlers, HasDragLeaveHandlers, HasDragOverHandlers, HasDragStartHandlers, HasDropHandlers, HasGestureChangeHandlers, HasGestureEndHandlers, HasGestureStartHandlers, HasMouseDownHandlers, HasMouseMoveHandlers, HasMouseOutHandlers, HasMouseOverHandlers, HasMouseUpHandlers, HasMouseWheelHandlers, HasTouchCancelHandlers, HasTouchEndHandlers, HasTouchMoveHandlers, HasTouchStartHandlers, HasAttachHandlers, HasHandlers, HasDirection, HasDirectionEstimator, EventListener, HasAutoHorizontalAlignment, HasDirectionalText, HasHorizontalAlignment, HasText, HasVisibility, HasWordWrap, IsWidget, SourcesClickEvents, SourcesMouseEvents

public class InlineLabel extends Label
A widget that contains arbitrary text, not interpreted as HTML. This widget uses a <span> element, causing it to be displayed with inline layout.

Built-in Bidi Text Support

This widget is capable of automatically adjusting its direction according to its content. This feature is controlled by LabelBase.setDirectionEstimator(boolean) or passing a DirectionEstimator parameter to the constructor, and is off by default.

CSS Style Rules

  • .gwt-InlineLabel { }
  • Constructor Details

    • InlineLabel

      public InlineLabel()
      Creates an empty label.
    • InlineLabel

      public InlineLabel(String text)
      Creates a label with the specified text.
      Parameters:
      text - the new label's text
    • InlineLabel

      public InlineLabel(String text, HasDirection.Direction dir)
      Creates a label with the specified text and direction.
      Parameters:
      text - the new label's text
      dir - the text's direction. Note: Direction.DEFAULT means direction should be inherited from the widget's parent element.
    • InlineLabel

      public InlineLabel(String text, DirectionEstimator directionEstimator)
      Creates a label with the specified text and a default direction estimator.
      Parameters:
      text - the new label's text
      directionEstimator - A DirectionEstimator object used for automatic direction adjustment. For convenience, Label.DEFAULT_DIRECTION_ESTIMATOR can be used.
    • InlineLabel

      protected InlineLabel(Element element)
      This constructor may be used by subclasses to explicitly use an existing element. This element must be either a <div> <span> element.
      Parameters:
      element - the element to be used
  • Method Details

    • wrap

      public static InlineLabel wrap(Element element)
      Creates a InlineLabel widget that wraps an existing <div> or <span> element. This element must already be attached to the document. If the element is removed from the document, you must call Widget.removeFromParent().
      Parameters:
      element - the element to be wrapped