Package com.google.gwt.gen2.logging.shared

Examples of com.google.gwt.gen2.logging.shared.SmartLogHandler


    Log.config("don't log", cChild2);
    assertEquals("log", getLastMessage(handler));

    // Test handler filters.
    Log.removeLogHandler(handler);
    SmartLogHandler smart = new SmartLogHandler() {

      @Override
      protected void ensureLogHandler() {
        setLogHandler(handler);
      }

    };
    Log.severe("handler should be removed");
    assertEquals("log", getLastMessage(handler));

    Log.addLogHandler(smart);
    Log.warning("log me");
    smart.setLevel(Level.OFF);
    Log.warning("don't");
    assertEquals("log me", getLastMessage(handler));
    smart.setLevel(Level.ALL);

    // Test removing logger.
    Log.severe("hello");
    assertEquals("hello", getLastMessage(handler));
    Log.removeLogHandler(smart);
View Full Code Here


    Log.config("don't log", cChild2);
    assertEquals("log", getLastMessage(handler));

    // Test handler filters.
    Log.removeLogHandler(handler);
    SmartLogHandler smart = new SmartLogHandler() {

      @Override
      protected void ensureLogHandler() {
        setLogHandler(handler);
      }

    };
    Log.severe("handler should be removed");
    assertEquals("log", getLastMessage(handler));

    Log.addLogHandler(smart);
    Log.warning("log me");
    smart.setLevel(Level.OFF);
    Log.warning("don't");
    assertEquals("log me", getLastMessage(handler));
    smart.setLevel(Level.ALL);

    // Test removing logger.
    Log.severe("hello");
    assertEquals("hello", getLastMessage(handler));
    Log.removeLogHandler(smart);
View Full Code Here

  private void addHandlers(final FlexTable control) {
    int pos = 0;

    // 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;
View Full Code Here

    // Add button to change status
    {
      Button button = new Button("Set Resize Policy", new ClickHandler() {
        public void onClick(ClickEvent event) {
          AbstractScrollTable scrollTable = ScrollTableDemo.get().getScrollTable();
          switch (policyBox.getSelectedIndex()) {
            case 0:
              scrollTable.setColumnResizePolicy(ScrollTable.ColumnResizePolicy.DISABLED);
              break;
            case 1:
              scrollTable.setColumnResizePolicy(ScrollTable.ColumnResizePolicy.SINGLE_CELL);
              break;
            case 2:
              scrollTable.setColumnResizePolicy(ScrollTable.ColumnResizePolicy.MULTI_CELL);
              break;
          }
        }
      });
      form.addButton(button);
    }

    // Add button to reset column widths
    {
      Button button = new Button("Reset Column Widths", new ClickHandler() {
        public void onClick(ClickEvent event) {
          AbstractScrollTable scrollTable = ScrollTableDemo.get().getScrollTable();
          scrollTable.resetColumnWidths();
        }
      });
      form.addButton(button);
    }
View Full Code Here

    // Add button to change status
    {
      Button button = new Button("Set Scroll Policy", new ClickHandler() {
        public void onClick(ClickEvent event) {
          AbstractScrollTable scrollTable = ScrollTableDemo.get().getScrollTable();
          switch (scrollPolicyBox.getSelectedIndex()) {
            case 0:
              scrollTable.setScrollPolicy(ScrollTable.ScrollPolicy.BOTH);
              break;
            case 1:
              scrollTable.setScrollPolicy(ScrollTable.ScrollPolicy.HORIZONTAL);
              break;
            case 2:
              scrollTable.setScrollPolicy(ScrollTable.ScrollPolicy.DISABLED);
              break;
          }
        }
      });
      form.addButton(button);
View Full Code Here

    // Add button to change status
    {
      Button button = new Button("Set Resize Policy", new ClickHandler() {
        public void onClick(ClickEvent event) {
          AbstractScrollTable scrollTable = ScrollTableDemo.get().getScrollTable();
          switch (policyBox.getSelectedIndex()) {
            case 0:
              scrollTable.setResizePolicy(ScrollTable.ResizePolicy.UNCONSTRAINED);
              break;
            case 1:
              scrollTable.setResizePolicy(ScrollTable.ResizePolicy.FLOW);
              break;
            case 2:
              scrollTable.setResizePolicy(ScrollTable.ResizePolicy.FIXED_WIDTH);
              break;
            case 3:
              scrollTable.setResizePolicy(ScrollTable.ResizePolicy.FILL_WIDTH);
              break;
          }
        }
      });
      form.addButton(button);
View Full Code Here

    // Initialize the cell editor
    InlineCellEditor<String> editor = createCellEditor();

    // Create the edit info
    Grid grid = new Grid(1, 1);
    CellEditInfo cellEditInfo = new CellEditInfo(grid, 0, 0);

    // Create the callback
    TestCallback<String> callback = new TestCallback<String>(cellEditInfo);

    // Edit the cell
View Full Code Here

    // Initialize the cell editor
    InlineCellEditor<String> editor = createCellEditor();

    // Create the edit info
    Grid grid = new Grid(1, 1);
    CellEditInfo cellEditInfo = new CellEditInfo(grid, 0, 0);

    // Create the callback
    TestCallback<String> callback = new TestCallback<String>(cellEditInfo);

    // Edit the cell
View Full Code Here

  /**
   * Test the {@link CellEditInfo} inner class.
   */
  public void testCellEditInfo() {
    Grid grid = new Grid(1, 1);
    CellEditInfo info = new CellEditInfo(grid, 1, 2);
    assertEquals(grid, info.getTable());
    assertEquals(1, info.getRowIndex());
    assertEquals(2, info.getCellIndex());
  }
View Full Code Here

      return;
    }

    // Forward the request to the cell editor
    final RowType rowValue = getRowValue(row);
    CellEditInfo editInfo = new CellEditInfo(getDataTable(), row, column);
    cellEditor.editCell(editInfo, colDef.getCellValue(rowValue),
        new CellEditor.Callback() {
          public void onCancel(CellEditInfo cellEditInfo) {
          }
View Full Code Here

TOP

Related Classes of com.google.gwt.gen2.logging.shared.SmartLogHandler

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.