/** {@inheritDoc} */ @Override public void onBrowserEvent(Event event) { switch (DOM.eventGetType(event)) { case Event.ONCLICK: if (isEnabled()) { super.onBrowserEvent(event); } break; default: super.onBrowserEvent(event); break; } }
@Override protected void onAttach() { super.onAttach(); // Accessibility: setting tab index to be 0 by default, ensuring element // appears in tab sequence. We must ensure that the element doesn't already // have a tabIndex set. This is not a problem for normal widgets, but when // a widget is used to wrap an existing static element, it can already have // a tabIndex. int tabIndex = getTabIndex(); if (-1 == tabIndex) { setTabIndex(0); } }
/** * Shows or hides the caret. * * @param visible <code>true</code> if the caret should be shown. */ public void setCaret(boolean visible) { if (visible) super.add(caret); else super.remove(caret); }