Example usage for com.google.gwt.gen2.logging.shared LogFormatter TEXT

List of usage examples for com.google.gwt.gen2.logging.shared LogFormatter TEXT

Introduction

In this page you can find the example usage for com.google.gwt.gen2.logging.shared LogFormatter TEXT.

Prototype

LogFormatter TEXT

To view the source code for com.google.gwt.gen2.logging.shared LogFormatter TEXT.

Click Source Link

Document

Default text log formatter.

Usage

From source file:com.google.gwt.gen2.demo.logging.client.LoggingDemo.java

License:Apache License

private void addHandlers(final FlexTable control) {
    int pos = 0;//from ww w. j  av a 2s  .  co m

    // Smart text log handler.
    SmartLogHandler textHandler = new SmartLogHandler() {
        @Override
        protected void ensureLogHandler() {
            setLogHandler(asPopup(new SimpleLogHandler(LogFormatter.TEXT)));
        }
    };
    control.setWidget(pos, 0, new HandlerConfig("Text panel", textHandler));
    ++pos;

    // Smart html log handler.
    SmartLogHandler htmlHandler = new SmartLogHandler() {
        @Override
        protected void ensureLogHandler() {
            setLogHandler(asPopup(new SimpleLogHandler()));
        }
    };
    control.setWidget(pos, 0, new HandlerConfig("Html panel", htmlHandler));
    ++pos;

    // Tree based log handler.
    SmartLogHandler treeHandler = new SmartLogHandler() {
        @Override
        protected void ensureLogHandler() {
            setLogHandler(asPopup(new GroupedLogHandler()));
        }
    };
    control.setWidget(pos, 0, new HandlerConfig("Grouped panel", treeHandler));
    ++pos;

    // Remote logger.
    SmartLogHandler remoteHandler = new SmartLogHandler() {
        @Override
        protected void ensureLogHandler() {
            setLogHandler(new RemoteLogHandler());
            // Grouped panel is longer then the others.
            popupLeft += 100;
        }
    };
    control.setWidget(pos, 0, new HandlerConfig("Remote logging", remoteHandler));
    ++pos;
}