示例#1
0
  /** Constructs a new instance of this widget. */
  public TextBox() {

    setEnabled(true);
    m_textbox.setStyleName(CSS.textBox());
    m_textbox.getElement().setId("CmsTextBox_" + (idCounter++));

    TextBoxHandler handler = new TextBoxHandler("");
    m_textbox.addMouseOverHandler(handler);
    m_textbox.addMouseOutHandler(handler);
    m_textbox.addFocusHandler(handler);
    m_textbox.addBlurHandler(handler);
    m_textbox.addValueChangeHandler(handler);
    m_textbox.addKeyPressHandler(handler);

    m_handler = handler;

    m_textboxContainer.setStyleName(CSS.textBoxPanel());
    m_textboxContainer.addStyleName(I_LayoutBundle.INSTANCE.generalCss().cornerAll());
    m_textboxContainer.addStyleName(I_LayoutBundle.INSTANCE.generalCss().textMedium());
    m_panel.add(m_textboxContainer);
    m_panel.add(m_error);
    m_textboxContainer.add(m_textbox);
    m_textboxContainer.setPaddingX(4);
    sinkEvents(Event.ONPASTE);
    initWidget(m_panel);
  }
示例#2
0
  /**
   * Constructor.
   *
   * <p>
   */
  @SuppressWarnings("unused")
  private DebugLog() {

    if (!DEBUG) {
      return;
    }
    m_html = new HTML();
    initWidget(m_html);
    Style style = getElement().getStyle();
    style.setWidth(200, Unit.PX);
    style.setHeight(500, Unit.PX);
    style.setPadding(10, Unit.PX);
    style.setOverflow(Overflow.AUTO);
    style.setBorderStyle(BorderStyle.SOLID);
    style.setBorderColor(I_LayoutBundle.INSTANCE.constants().css().borderColor());
    style.setBorderWidth(1, Unit.PX);
    style.setPosition(Position.FIXED);
    style.setTop(50, Unit.PX);
    style.setRight(50, Unit.PX);
    style.setBackgroundColor(I_LayoutBundle.INSTANCE.constants().css().backgroundColorDialog());
    style.setZIndex(10);
  }