@Override public void onComponentEvent(ComponentEvent ce) { super.onComponentEvent(ce); ButtonEvent be = (ButtonEvent) ce; switch (ce.getEventTypeInt()) { case Event.ONMOUSEOVER: onMouseOver(ce); break; case Event.ONMOUSEOUT: onMouseOut(ce); break; case Event.ONMOUSEDOWN: ce.stopEvent(); onMouseDown(ce); break; case Event.ONMOUSEUP: ce.stopEvent(); onMouseUp(ce); break; case Event.ONCLICK: ce.stopEvent(); onClick(ce); break; case Event.ONFOCUS: onFocus(ce); break; case Event.ONBLUR: onBlur(be); } }
public void handleEvent(GridEvent<Rule> be) { for (int i = 0; i < be.getGrid().getStore().getCount(); i++) { final Widget wid = be.getGrid().getView().getWidget(i, be.getColIndex()); if ((wid != null) && (wid instanceof BoxComponent)) { ((BoxComponent) wid).setWidth(be.getWidth() - offset); } } }
@Override protected void afterRender() { super.afterRender(); setTabIndex(tabIndex); setIcon(icon); autoWidth(); }
protected void onRender(Element target, int index) { if (template == null) { if (buttonTemplate == null) { StringBuffer sb = new StringBuffer(); sb.append( "<table cellspacing=\"0\" class=\"x-btn\" role=\"presentation\"><tbody class=\"{2}\" >"); sb.append( "<tr><td class=\"x-btn-tl\"><i> </i></td><td class=\"x-btn-tc\"></td><td class=\"x-btn-tr\"><i> </i></td></tr>"); sb.append( "<tr><td class=\"x-btn-ml\"><i> </i></td><td class=\"x-btn-mc\"><em class=\"{3}\" unselectable=\"on\"><button class=\"x-btn-text\" type=\"{1}\">{0}</button></em></td><td class=\"x-btn-mr\"><i> </i></td></tr>"); sb.append( "<tr><td class=\"x-btn-bl\"><i> </i></td><td class=\"x-btn-bc\"></td><td class=\"x-btn-br\"><i> </i></td></tr>"); sb.append("</tbody></table>"); buttonTemplate = new Template(sb.toString()); } template = buttonTemplate; } setElement( template.create( (text != null && text.length() > 0) ? text : " ", getType(), "x-btn-" + scale.name().toLowerCase() + " x-btn-icon-" + scale.name().toLowerCase() + "-" + iconAlign.name().toLowerCase(), getMenuClass()), target, index); super.onRender(target, index); buttonEl = el().selectNode(buttonSelector); buttonEl.makePositionable(); if (getFocusEl() != null) { getFocusEl().addEventsSunk(Event.FOCUSEVENTS); } preview.getIgnoreList().add(getElement()); buttonEl.setTabIndex(0); if (GXT.isAriaEnabled()) { Accessibility.setRole(buttonEl.dom, Accessibility.ROLE_BUTTON); if (menu != null) { Accessibility.setState(buttonEl.dom, "aria-haspopup", "true"); } } sinkEvents(Event.ONCLICK | Event.MOUSEEVENTS | Event.FOCUSEVENTS); }
protected void onRender(Element target, int index) { setElement(DOM.createDiv(), target, index); addStyleName("x-icon-btn"); addStyleName("x-nodrag"); addStyleName(style); sinkEvents(Event.ONCLICK | Event.MOUSEEVENTS | Event.FOCUSEVENTS | Event.ONKEYUP); super.onRender(target, index); if (GXT.isHighContrastMode) { getElement().setInnerHTML("<i> </i>"); } if (GXT.isFocusManagerEnabled()) { el().setTabIndex(0); Accessibility.setRole(getElement(), Accessibility.ROLE_BUTTON); } }
@Override protected void onEnable() { super.onEnable(); el().enable(); }
@Override protected void onDetach() { super.onDetach(); preview.remove(); }