/** 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); }
protected void addListeners() { textbox.addKeyPressHandler(this); textbox.addKeyUpHandler(this); textbox.addKeyDownHandler(this); textbox.addBlurHandler(this); textbox.addFocusHandler(this); textbox.addClickHandler(this); }
@Inject public EditDocumentModelPlaceView(EventBus eventBus) { super(eventBus); initWidget(uiBinder.createAndBindUi(this)); this.setPlaceTitle("Éditeur de modèle"); this.setHelpFromFlowPanel(helpContainer); toolbar = new RichTextToolbar(new RichTextToolbarView()); toolbar.setTextArea(richTextArea); richTextArea.setHeight("100%"); toolbar.bind(); toolbarContainer.add(toolbar.getView().asWidget()); name.addStyleName(style.nameDefaultText()); name.addFocusHandler(this); name.addBlurHandler(this); resizer = new ToBottomResizer(textContainer, eventBus); }
/** * Create a new date box. * * @param date the default date. * @param picker the picker to drop down from the date box * @param format to use to parse and format dates */ public DateBox(DatePicker picker, Date date, Format format) { this.picker = picker; this.popup = new PopupPanel(true); assert format != null : "You may not construct a date box with a null format"; this.format = format; popup.addAutoHidePartner(box.getElement()); popup.setWidget(picker); popup.setStyleName("dateBoxPopup"); initWidget(box); setStyleName(DEFAULT_STYLENAME); handler = new DateBoxHandler(); picker.addValueChangeHandler(handler); box.addFocusHandler(handler); box.addBlurHandler(handler); box.addClickHandler(handler); box.addKeyDownHandler(handler); box.setDirectionEstimator(false); popup.addCloseHandler(handler); setValue(date); }
public HandlerRegistration addFocusHandler(FocusHandler handler) { return textBox.addFocusHandler(handler); }