Class Console.Log

All Implemented Interfaces:
IsEditor<LeafValueEditor<String>>, HasAllDragAndDropHandlers, HasAllGestureHandlers, HasAllMouseHandlers, HasAllTouchHandlers, HasClickHandlers, HasContextMenuHandlers, 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, HasSafeHtml, EventListener, HasAutoHorizontalAlignment, HasDirectionalHtml, HasDirectionalSafeHtml, HasDirectionalText, HasHorizontalAlignment, HasHTML, HasText, HasVisibility, HasWordWrap, IsWidget, SourcesClickEvents, SourcesMouseEvents, ContextMenu.Listener
Enclosing class:
Console

public static class Console.Log extends HTML implements ContextMenu.Listener
The console log widget. The log is implemented as a ring buffer to store a limited number of messages. Once the buffer capacity is exceeded, the oldest messages are discarded. If the buffer capacity is set to 0 the number of messsages is unlimited. The buffer is displayed in a HTML widget.
  • Field Details

    • DEFAULT_CAPACITY

      public static final int DEFAULT_CAPACITY
      The default capacity of the log buffer.
      See Also:
    • buffer

      The buffer to store the log messages.
  • Constructor Details

    • Log

      public Log()
      Constructs a new log.
  • Method Details

    • clear

      public void clear()
      Clear the log buffer and the display.
    • add

      public void add(String msg)
      Add a message to the log buffer.
      Parameters:
      msg - the message to add
    • replace

      public void replace(String msg)
      Replace the most recent entry in the log with msg.
      Parameters:
      msg - the replacement entry
    • show

      public void show()
      Show the log buffer in the HTML widget.
    • addContextMenuHandler

      public HandlerRegistration addContextMenuHandler(ContextMenuHandler handler)
      Specified by:
      addContextMenuHandler in interface HasContextMenuHandlers