protected static boolean isIgnore(Widget w) { if (w instanceof Component) { Component c = (Component) w; if (c.getFocusSupport().isIgnore()) { return true; } } return false; }
protected int lastActive(Container<?> c) { for (int i = c.getItemCount() - 1; i >= 0; i--) { Component comp = c.getItem(i); if (!comp.isEnabled() || comp.getFocusSupport().isIgnore()) { continue; } return i; } return -1; }
protected int firstActive(Container<?> c) { for (int i = 0; i < c.getItemCount(); i++) { Component comp = c.getItem(i); if (!comp.isEnabled() || comp.getFocusSupport().isIgnore()) { continue; } return i; } return -1; }
protected void onFocus(ComponentEvent ce) { if (GXT.isFocusManagerEnabled() && FocusManager.get().isManaged()) { if (getFocusSupport().isIgnore()) { for (int i = 0; i < getItemCount(); i++) { Component c = getItem(i); if (!c.getFocusSupport().isIgnore()) { c.focus(); break; } } } else { FocusFrame.get().frame(this); } } }
protected void onFocus(ComponentEvent ce) { if (GXT.isFocusManagerEnabled() && FocusManager.get().isManaged()) { if (getFocusSupport().isIgnore()) { for (int i = 0; i < getItemCount(); i++) { Component c = getItem(i); if (!c.getFocusSupport().isIgnore()) { c.focus(); break; } } } else { FocusFrame.get().frame(this); } } }
@Override public void onEscape(Component component, PreviewEvent pe) { if (!isManaged()) return; ToolTip tip = component.getToolTip(); if (tip != null && tip.isVisible()) { return; } if (component.getFocusSupport().isIgnore()) { component.getFocusSupport().setIgnore(false); return; } stepOut(component); }
protected void onRender(Element parent, int index) { super.onRender(parent, index); if (el() == null) { setElement(DOM.createDiv(), parent, index); } if (GXT.isFocusManagerEnabled() && !getFocusSupport().isIgnore()) { el().setTabIndex(0); el().setElementAttribute("hideFocus", "true"); sinkEvents(Event.FOCUSEVENTS); } }
public static boolean focusWidget(Widget w, boolean forward) { if (w instanceof Component) { Component c = (Component) w; if (c instanceof Field<?>) { c.focus(); return true; } if (c.getFocusSupport().isIgnore()) { if (isContainer(c)) { stepInto(c, null, forward); } else { if (forward) { return focusNextWidget(c); } else { return focusPreviousWidget(c); } } } else { c.focus(); return true; } } else { El.fly(w.getElement()).focus(); return true; } return false; }
protected void onFocus(ComponentEvent ce) { if (GXT.isFocusManagerEnabled() && !FocusManager.get().isManaged()) { FocusFrame.get().frame(this); return; } FocusFrame.get().unframe(); ce.stopEvent(); for (int i = 0; i < getItemCount(); i++) { Component c = getItem(i); if (c.isEnabled() && !c.getFocusSupport().isIgnore()) { c.focus(); break; } } }
@Override protected void onRender(Element target, int index) { if (elem != null) { setElement(elem); renderAll(); } else { setElement(DOM.createElement(tagName), target, index); if (html != null) { setHtml(html); } else if ((url != null || requestBuilder != null) && deferDownload) { requestData(); } } if (GXT.isFocusManagerEnabled() && !getFocusSupport().isIgnore()) { el().setTabIndex(0); el().setElementAttribute("hideFocus", "true"); sinkEvents(Event.FOCUSEVENTS); } }
protected void stepOut(Widget w) { Widget p = w.getParent(); if (p != null) { if (p instanceof TabItem) { ((TabItem) p).getTabPanel().focus(); } else if (p instanceof Component) { Component c = (Component) p; while (c.getFocusSupport().isIgnore()) { p = c.getParent(); if (p != null) { if (p instanceof Component) { c = (Component) p; } else { El.fly(p.getElement()).focus(); return; } } } focusWidget(c); } else { El.fly(p.getElement()).focus(); FocusFrame.get().unframe(); } } }
@Override protected void onLayout(Container<?> container, El target) { currentColumn = 0; currentRow = 0; cells = null; target.removeChildren(); table = DOM.createTable().cast(); if (container.getFocusSupport().isIgnore()) { Accessibility.setRole((Element)table.cast(), "presentation"); } if (tableStyle != null) { El.fly((Element) table.cast()).applyStyles(tableStyle); } if (cellSpacing != -1) { table.setCellSpacing(cellSpacing); } if (border > 0) { table.setBorder(border); } if (width != null) { table.setWidth(width); } if (height != null) { table.setAttribute("height", height); } tbody = DOM.createTBody(); table.appendChild(tbody); target.dom.appendChild(table); renderAll(container, target); }
if (GXT.isFocusManagerEnabled() && !getFocusSupport().isIgnore()) { el().setTabIndex(0); el().setElementAttribute("hideFocus", "true");