Package com.google.gwt.user.client.ui

Examples of com.google.gwt.user.client.ui.Label


  }

  @Override
  public void publish(String message, Level level, String category, Throwable e) {
    String output = category == null ? message : category + ": " + message;
    Label l = new Label(output);
    l.setStyleName("." + level.toString().toLowerCase());
    l.setTitle("level: " + level);
    contents.add(l);
    if (e != null) {
      Label eLabel = new Label("    " + e.getMessage());
      contents.add(eLabel);
    }
  }
View Full Code Here


    private Label refreshRateLabel;
   
    private long startTime = -1;
   
    public ParticleDemoControls() {
      refreshRateLabel = new Label("");
      averageLabel = new Label("");
     
      VerticalPanel layout = new VerticalPanel();
      layout.add(refreshRateLabel);
      layout.add(averageLabel);
     
View Full Code Here

  public DivLogHandler() {
    debugTable.addStyleName(STYLE_LOG_PANEL);
    logTextArea.addStyleName(STYLE_LOG_TEXT_AREA);
    scrollPanel.addStyleName(STYLE_LOG_SCROLL_PANEL);

    final Label header = new Label("LOG PANEL");
    header.addStyleName(STYLE_LOG_HEADER);
    debugTable.setWidget(0, 0, header);
    debugTable.setWidget(1, 0, scrollPanel);
    debugTable.getCellFormatter().setHorizontalAlignment(0, 0,
        HasHorizontalAlignment.ALIGN_CENTER);

    scrollPanel.setWidget(logTextArea);

    header.addMouseListener(new MouseListenerAdapter() {
      private boolean dragging = false;
      private int dragStartX;
      private int dragStartY;

      public void onMouseDown(Widget sender, int x, int y) {
        dragging = true;
        DOM.setCapture(header.getElement());
        dragStartX = x;
        dragStartY = y;
      }

      public void onMouseMove(Widget sender, int x, int y) {
        if (dragging) {
          int absX = x + debugTable.getAbsoluteLeft();
          int absY = y + debugTable.getAbsoluteTop();
          RootPanel.get().setWidgetPosition(debugTable, absX - dragStartX,
              absY - dragStartY);
        }
      }

      public void onMouseUp(Widget sender, int x, int y) {
        dragging = false;
        DOM.releaseCapture(header.getElement());
      }
    });

    debugTable.setVisible(false);
    RootPanel.get().add(debugTable, 0, 0);
View Full Code Here

*/
public class CurrencyWidgetDemo implements EntryPoint {
  public void onModuleLoad() {
    RootPanel rootPanel = RootPanel.get();

    final Label currencyInputWidgetLabel = new Label("Currency Input Widget:");
    rootPanel.add(currencyInputWidgetLabel, 50, 32);

    final CurrencyWidget currencyWidget = new CurrencyWidget("EUR");
    rootPanel.add(currencyWidget, 50, 56);
   
    final Button clickMeButton = new Button();
    rootPanel.add(clickMeButton, 250, 56);
    clickMeButton.setText("See what you got!");
    clickMeButton.addClickListener(new ClickListener() {
      public void onClick(Widget sender) {
        Window.alert("You entered: " + Double.toString(currencyWidget.getAmount()));
      }
    });


    final Label currencyWidgetWithPreviewLabel = new Label("Currency Widget With Preview");
    rootPanel.add(currencyWidgetWithPreviewLabel, 50, 108);

    final CurrencyWidgetWithPreview currencyWidgetWithPreview = new CurrencyWidgetWithPreview("EUR");
    rootPanel.add(currencyWidgetWithPreview, 50, 132);
    currencyWidgetWithPreview.setSize("156px", "18px");

    final Button seeWhatYouButton = new Button();
    rootPanel.add(seeWhatYouButton, 250, 132);
    seeWhatYouButton.setSize("157px", "24px");
    seeWhatYouButton.setText("See what you got!");
    seeWhatYouButton.addClickListener(new ClickListener() {
      public void onClick(Widget sender) {
        Window.alert("You entered: " + Double.toString(currencyWidgetWithPreview.getAmount()));
      }
    });

   
    final Label aNaiveTextLabel = new Label("A Naive Text Widget:");
    rootPanel.add(aNaiveTextLabel, 50, 180);
    final TextBox textBox = new TextBox();
    rootPanel.add(textBox, 50, 204);
  }
View Full Code Here

    });

    start.showDate(new Date());

    p.add(start);
    Label l = new Label(" - ");
    l.setStyleName("filler");
    p.add(l);
    p.add(end);
    HorizontalPanel h2 = new HorizontalPanel();
    v.add(h2);
    h2.add(new Button("Short format", new ClickListener() {
View Full Code Here

    wrapper.setHeight("250px");

    final FastTree contents = new FastTree();
    wrapper.add(contents, "<b>People</b>", true);

    wrapper.add(new Label("None"), "<b>Academics</b>", true);
    navBar.add(wrapper);

    FastTreeItem students = contents.addItem("Students");
    students.addItem("Jill");
    students.addItem("Jack");
View Full Code Here

  public void onModuleLoad() {
    panel = new VerticalPanel();
    RootPanel.get().add(panel);
    panel.add(new HTML(
        "<h2>A very boring demo showing the speed difference of using bulk loading tables.</h2>"));
    panel.add(new Label("Number of rows"));
    final TextBox rows = new TextBox();
    panel.add(rows);
    rows.setText(numRows + "");
    rows.addChangeListener(new ChangeListener() {
      public void onChange(Widget sender) {
        numRows = Integer.parseInt(rows.getText().trim());
      }
    });

    panel.add(new Label("Number of columns"));
    final TextBox columns = new TextBox();
    panel.add(columns);
    columns.addChangeListener(new ChangeListener() {

      public void onChange(Widget sender) {
View Full Code Here

    HorizontalPanel masterPanel = new HorizontalPanel();
    masterPanel.setWidth("100%");
    header.add(masterPanel);
    header.addStyleName(STYLE_LOG_HEADER);

    final Label titleLabel = new Label("gwt-log", false);
    titleLabel.setStylePrimaryName("log-title");

    HorizontalPanel buttonPanel = new HorizontalPanel();
    levelButtons = new Button[levels.length];
    for (int i = 0; i < levels.length; i++) {
      final int level = levels[i];
      levelButtons[i] = new Button(LogUtil.levelToString(level));
      buttonPanel.add(levelButtons[i]);
      levelButtons[i].addClickListener(new ClickListener() {
        public void onClick(Widget sender) {
          ((FocusWidget) sender).setFocus(false);
          Log.setCurrentLogLevel(level);
        }
      });
    }

    Button clearButton = new Button("Clear");
    clearButton.addStyleName("log-clear-button");
    DOM.setStyleAttribute(clearButton.getElement(), "color", "#00c");
    clearButton.addClickListener(new ClickListener() {
      public void onClick(Widget sender) {
        ((FocusWidget) sender).setFocus(false);
        Log.clear();
      }
    });
    buttonPanel.add(clearButton);

    Button aboutButton = new Button("About");
    aboutButton.addStyleName("log-clear-about");
    aboutButton.addClickListener(new ClickListener() {
      public void onClick(Widget sender) {
        ((FocusWidget) sender).setFocus(false);

        // TODO Add GWT.getVersion() after 1.5
        Log.diagnostic("\n" //
            + "gwt-log-" + Log.getVersion() //
            + " - Runtime logging for your Google Web Toolkit projects\n" + //
            "Copyright 2007-2008 Fred Sauer\n" + //
            "The original software is available from:\n" + //
            "\u00a0\u00a0\u00a0\u00a0http://allen-sauer.com/gwt/\n", null);
      }
    });

    masterPanel.add(titleLabel);
    masterPanel.add(buttonPanel);
    masterPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_RIGHT);
    masterPanel.add(aboutButton);

    masterPanel.setCellHeight(titleLabel, "100%");
    masterPanel.setCellWidth(titleLabel, "50%");
    masterPanel.setCellWidth(aboutButton, "50%");

    titleLabel.addMouseListener(new MouseListenerAdapter() {
      private boolean dragging = false;
      private int dragStartX;
      private int dragStartY;

      public void onMouseDown(Widget sender, int x, int y) {
        dragging = true;
        DOM.setCapture(titleLabel.getElement());
        dragStartX = x;
        dragStartY = y;
      }

      public void onMouseMove(Widget sender, int x, int y) {
        if (dragging) {
          int absX = x + debugDockPanel.getAbsoluteLeft();
          int absY = y + debugDockPanel.getAbsoluteTop();
          RootPanel.get().setWidgetPosition(debugDockPanel, absX - dragStartX, absY - dragStartY);
        }
      }

      public void onMouseUp(Widget sender, int x, int y) {
        dragging = false;
        DOM.releaseCapture(titleLabel.getElement());
      }
    });

    return header;
  }
View Full Code Here

  private void addLevelControls(final FlexTable control) {
    final TextBox box = new TextBox();
    box.setText("message 0");
    VerticalPanel loggingMessage = new VerticalPanel();
    loggingMessage.add(new Label("Logging message"));
    loggingMessage.add(box);
    control.setWidget(0, 1, loggingMessage);
    Iterator levels = Log.levelIterator();
    int pos = 0;

    while (levels.hasNext()) {
      final Level level = (Level) levels.next();
      VerticalPanel p = new VerticalPanel();
      p.add(new Label((level.getName().toLowerCase())));
      control.setWidget(pos, 2, p);
      p.setStyleName("level-control");
      if (!level.isControl()) {
        Button b1 = new Button("log ", new ClickListener() {
          public void onClick(Widget sender) {
View Full Code Here

   * Constructs a CurrencyWidget object with specified currency.
   *
   * @param currencyCode International currency code (ISO 4217).
   */
  public CurrencyWidget(String currencyCode) {
    currencySymbol = new Label(getCurrencySymbol(currencyCode));
    initWidget(horizontalPanel);
    horizontalPanel.setSpacing(2);
    if (isLeadingSymbol()) {
      horizontalPanel.add(currencySymbol);
      horizontalPanel.add(amountBox);
View Full Code Here

TOP

Related Classes of com.google.gwt.user.client.ui.Label

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.