Package org.evoludo.simulator.views
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
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.-
Nested Class Summary
Nested classes/interfaces inherited from class UIObject
UIObject.DebugIdImpl, UIObject.DebugIdImplEnabledNested classes/interfaces inherited from interface HasDirection
HasDirection.DirectionNested classes/interfaces inherited from interface HasHorizontalAlignment
HasHorizontalAlignment.AutoHorizontalAlignmentConstant, HasHorizontalAlignment.HorizontalAlignmentConstant -
Field Summary
FieldsModifier and TypeFieldDescription(package private) RingBuffer<String> The buffer to store the log messages.static final intThe default capacity of the log buffer.Fields inherited from class Label
DEFAULT_DIRECTION_ESTIMATORFields inherited from class UIObject
DEBUG_ID_PREFIXFields inherited from interface HasAutoHorizontalAlignment
ALIGN_CONTENT_END, ALIGN_CONTENT_STARTFields inherited from interface HasHorizontalAlignment
ALIGN_CENTER, ALIGN_DEFAULT, ALIGN_JUSTIFY, ALIGN_LEFT, ALIGN_LOCALE_END, ALIGN_LOCALE_START, ALIGN_RIGHT -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdd a message to the log buffer.addContextMenuHandler(ContextMenuHandler handler) voidclear()Clear the log buffer and the display.voidReplace the most recent entry in the log withmsg.voidshow()Show the log buffer in the HTML widget.Methods inherited from class Label
addClickHandler, addClickListener, addDoubleClickHandler, addDragEndHandler, addDragEnterHandler, addDragHandler, addDragLeaveHandler, addDragOverHandler, addDragStartHandler, addDropHandler, addGestureChangeHandler, addGestureEndHandler, addGestureStartHandler, addMouseDownHandler, addMouseListener, addMouseMoveHandler, addMouseOutHandler, addMouseOverHandler, addMouseUpHandler, addMouseWheelHandler, addMouseWheelListener, addTouchCancelHandler, addTouchEndHandler, addTouchMoveHandler, addTouchStartHandler, asEditor, getDirection, getText, getTextDirection, removeClickListener, removeMouseListener, removeMouseWheelListener, setDirection, setText, setTextMethods inherited from class LabelBase
getAutoHorizontalAlignment, getDirectionEstimator, getHorizontalAlignment, getWordWrap, setAutoHorizontalAlignment, setDirectionEstimator, setDirectionEstimator, setHorizontalAlignment, setWordWrap, updateHorizontalAlignmentMethods inherited from class Widget
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, doAttachChildren, doDetachChildren, fireEvent, getHandlerCount, getLayoutData, getParent, isAttached, isOrWasAttached, onAttach, onBrowserEvent, onDetach, onLoad, onUnload, removeFromParent, setLayoutData, sinkEvents, unsinkEventsMethods inherited from class UIObject
addStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getElement, getOffsetHeight, getOffsetWidth, getStyleElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, getTitle, isVisible, isVisible, onEnsureDebugId, removeStyleDependentName, removeStyleName, resolvePotentialElement, setElement, setElement, setHeight, setPixelSize, setSize, setStyleDependentName, setStyleName, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setTitle, setVisible, setVisible, setWidth, sinkBitlessEvent, toStringMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface ContextMenu.Listener
getAbsoluteLeft, getAbsoluteTopMethods inherited from interface HasDirectionalText
getTextDirection, setTextMethods inherited from interface HasHandlers
fireEventMethods inherited from interface HasTouchCancelHandlers
addTouchCancelHandlerMethods inherited from interface HasTouchEndHandlers
addTouchEndHandlerMethods inherited from interface HasTouchMoveHandlers
addTouchMoveHandlerMethods inherited from interface HasTouchStartHandlers
addTouchStartHandler
-
Field Details
-
DEFAULT_CAPACITY
public static final int DEFAULT_CAPACITYThe default capacity of the log buffer.- See Also:
-
buffer
RingBuffer<String> bufferThe 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
Add a message to the log buffer.- Parameters:
msg- the message to add
-
replace
Replace the most recent entry in the log withmsg.- Parameters:
msg- the replacement entry
-
show
public void show()Show the log buffer in the HTML widget. -
addContextMenuHandler
- Specified by:
addContextMenuHandlerin interfaceHasContextMenuHandlers
-