public FocusPanel() { super(impl.createFocusable()); }
ClickDelegatePanel(Widget child) { focusablePanel = new SimplePanel(FocusPanel.impl.createFocusable()); focusablePanel.setWidget(child); SimplePanel wrapperWidget = createTabTextWrapper(); if (wrapperWidget == null) { initWidget(focusablePanel); } else { wrapperWidget.setWidget(focusablePanel); initWidget(wrapperWidget); } sinkEvents(Event.ONCLICK | Event.ONKEYDOWN); }
/** * Constructor for <code>CustomButton</code>. */ protected CustomButton() { // Use FocusPanel.impl rather than FocusWidget because only FocusPanel.impl // works across browsers to create a focusable element. super(FocusPanel.impl.createFocusable()); sinkEvents(Event.ONCLICK | Event.MOUSEEVENTS | Event.FOCUSEVENTS | Event.KEYEVENTS); setUpFace(createFace(null, "up", UP)); setStyleName(STYLENAME_DEFAULT); // Add a11y role "button" Roles.getButtonRole().set(getElement()); }
public FocusPanel() { super(impl.createFocusable()); }
public FocusPanel() { super(impl.createFocusable()); }
private void init(ImageAdapter images, boolean useLeafImages) { setImages(images, useLeafImages); setElement(DOM.createDiv()); getElement().getStyle().setProperty("position", "relative"); // Fix rendering problem with relatively-positioned elements and their // children by // forcing the element that is positioned relatively to 'have layout' getElement().getStyle().setProperty("zoom", "1"); focusable = FocusPanel.impl.createFocusable(); focusable.getStyle().setProperty("fontSize", "0"); focusable.getStyle().setProperty("position", "absolute"); // Hide focus outline in Mozilla/Webkit focusable.getStyle().setProperty("outline", "0px"); // Hide focus outline in IE 6/7 focusable.setAttribute("hideFocus", "true"); DOM.setIntStyleAttribute(focusable, "zIndex", -1); DOM.appendChild(getElement(), focusable); sinkEvents(Event.ONMOUSEDOWN | Event.ONCLICK | Event.KEYEVENTS); DOM.sinkEvents(focusable, Event.FOCUSEVENTS); // The 'root' item is invisible and serves only as a container // for all top-level items. root = new TreeItem(true); root.setTree(this); setStyleName("gwt-Tree"); // Add a11y role "tree" Roles.getTreeRole().set(focusable); }
Element outer = FocusPanel.impl.createFocusable(); DOM.appendChild(outer, table); setElement(outer);
ClickDelegatePanel(Widget child) { focusablePanel = new SimplePanel(FocusPanel.impl.createFocusable()); focusablePanel.setWidget(child); SimplePanel wrapperWidget = createTabTextWrapper(); if (wrapperWidget == null) { initWidget(focusablePanel); } else { wrapperWidget.setWidget(focusablePanel); initWidget(wrapperWidget); } sinkEvents(Event.ONCLICK | Event.ONKEYDOWN); }
ClickDelegatePanel(Widget child) { focusablePanel = new SimplePanel(FocusPanel.impl.createFocusable()); focusablePanel.setWidget(child); SimplePanel wrapperWidget = createTabTextWrapper(); if (wrapperWidget == null) { initWidget(focusablePanel); } else { wrapperWidget.setWidget(focusablePanel); initWidget(wrapperWidget); } sinkEvents(Event.ONCLICK | Event.ONKEYDOWN); }
/** * Constructor for <code>CustomButton</code>. */ protected CustomButton() { // Use FocusPanel.impl rather than FocusWidget because only FocusPanel.impl // works across browsers to create a focusable element. super(FocusPanel.impl.createFocusable()); sinkEvents(Event.ONCLICK | Event.MOUSEEVENTS | Event.FOCUSEVENTS | Event.KEYEVENTS); setUpFace(createFace(null, "up", UP)); setStyleName(STYLENAME_DEFAULT); // Add a11y role "button" Roles.getButtonRole().set(getElement()); }
/** * Constructor for <code>CustomButton</code>. */ protected CustomButton() { // Use FocusPanel.impl rather than FocusWidget because only FocusPanel.impl // works across browsers to create a focusable element. super(FocusPanel.impl.createFocusable()); sinkEvents(Event.ONCLICK | Event.MOUSEEVENTS | Event.FOCUSEVENTS | Event.KEYEVENTS); setUpFace(createFace(null, "up", UP)); setStyleName(STYLENAME_DEFAULT); // Add a11y role "button" Roles.getButtonRole().set(getElement()); }
public SuggestionsContainer(CubaSuggestionFieldWidget suggestionFieldWidget) { this.suggestionFieldWidget = suggestionFieldWidget; container = DOM.createDiv(); final Element outer = FocusImpl.getFocusImplForPanel().createFocusable(); DOM.appendChild(outer, container); setElement(outer); sinkEvents(Event.ONCLICK | Event.ONMOUSEDOWN | Event.ONMOUSEOVER | Event.ONMOUSEOUT | Event.ONFOCUS | Event.ONKEYDOWN); addDomHandler(event -> selectItem(null), BlurEvent.getType()); setStylePrimaryName(STYLENAME); }
/** * Constructor for <code>CustomButton</code>. */ protected GCustomButton() { // Use FocusPanel.impl rather than FocusWidget because only // FocusPanel.impl // works across browsers to create a focusable element. super(focusImpl.createFocusable()); sinkEvents(Event.ONCLICK | Event.MOUSEEVENTS | Event.FOCUSEVENTS | Event.KEYEVENTS); sinkBitlessEvent("touchstart"); sinkBitlessEvent("touchend"); setUpFace(createFace(null, "up", UP)); setStyleName(STYLENAME_DEFAULT); // Add a11y role "button" Roles.getButtonRole().set(getElement()); }
private void ensureFocusElement() { if (focusEl != null) { focusEl.removeFromParent(); } focusEl = new El(focusImpl.createFocusable()); focusEl.dom.getStyle().setProperty("outline", "none"); getElement().appendChild(focusEl.dom); if (focusEl.dom.hasChildNodes()) { focusEl.dom.getFirstChildElement().getStyle().setProperty("outline", "none"); com.google.gwt.dom.client.Style focusElStyle = focusEl.dom.getFirstChildElement().getStyle(); focusElStyle.setProperty("borderWidth", "0px"); focusElStyle.setProperty("fontSize", "1px"); focusElStyle.setPropertyPx("lineHeight", 1); } focusEl.setLeft(0); focusEl.setTop(0); focusEl.makePositionable(true); focusEl.addEventsSunk(Event.FOCUSEVENTS); }
private void init(ImageAdapter images, boolean useLeafImages) { setImages(images, useLeafImages); setElement(DOM.createDiv()); getElement().getStyle().setProperty("position", "relative"); // Fix rendering problem with relatively-positioned elements and their // children by // forcing the element that is positioned relatively to 'have layout' getElement().getStyle().setProperty("zoom", "1"); focusable = FocusPanel.impl.createFocusable(); focusable.getStyle().setProperty("fontSize", "0"); focusable.getStyle().setProperty("position", "absolute"); // Hide focus outline in Mozilla/Webkit focusable.getStyle().setProperty("outline", "0px"); // Hide focus outline in IE 6/7 focusable.setAttribute("hideFocus", "true"); DOM.setIntStyleAttribute(focusable, "zIndex", -1); DOM.appendChild(getElement(), focusable); sinkEvents(Event.ONMOUSEDOWN | Event.ONCLICK | Event.KEYEVENTS); DOM.sinkEvents(focusable, Event.FOCUSEVENTS); // The 'root' item is invisible and serves only as a container // for all top-level items. root = new TreeItem(true); root.setTree(this); setStyleName("gwt-Tree"); // Add a11y role "tree" Roles.getTreeRole().set(focusable); }
private void init(ImageAdapter images, boolean useLeafImages) { setImages(images, useLeafImages); setElement(DOM.createDiv()); getElement().getStyle().setProperty("position", "relative"); // Fix rendering problem with relatively-positioned elements and their // children by // forcing the element that is positioned relatively to 'have layout' getElement().getStyle().setProperty("zoom", "1"); focusable = FocusPanel.impl.createFocusable(); focusable.getStyle().setProperty("fontSize", "0"); focusable.getStyle().setProperty("position", "absolute"); // Hide focus outline in Mozilla/Webkit focusable.getStyle().setProperty("outline", "0px"); // Hide focus outline in IE 6/7 focusable.setAttribute("hideFocus", "true"); DOM.setIntStyleAttribute(focusable, "zIndex", -1); DOM.appendChild(getElement(), focusable); sinkEvents(Event.ONMOUSEDOWN | Event.ONCLICK | Event.KEYEVENTS); DOM.sinkEvents(focusable, Event.FOCUSEVENTS); // The 'root' item is invisible and serves only as a container // for all top-level items. root = new TreeItem(true); root.setTree(this); setStyleName("gwt-Tree"); // Add a11y role "tree" Roles.getTreeRole().set(focusable); }
Element outer = FocusPanel.impl.createFocusable(); DOM.appendChild(outer, table); setElement(outer);
Element outer = FocusPanel.impl.createFocusable(); DOM.appendChild(outer, table); setElement(outer);
private void ensureFocusElement() { if (focusEl != null) { focusEl.removeFromParent(); } focusEl = getElement().appendChild(focusImpl.createFocusable()); focusEl.addClassName(treeStyles.treeStylesCss().noFocusOutline()); if (focusEl.hasChildNodes()) { focusEl.getFirstChildElement().addClassName(treeStyles.treeStylesCss().noFocusOutline()); Style focusElStyle = focusEl.getFirstChildElement().getStyle(); focusElStyle.setBorderWidth(0, Style.Unit.PX); focusElStyle.setFontSize(1, Style.Unit.PX); focusElStyle.setPropertyPx("lineHeight", 1); } focusEl.getStyle().setLeft(0, Style.Unit.PX); focusEl.getStyle().setTop(0, Style.Unit.PX); focusEl.getStyle().setPosition(Style.Position.ABSOLUTE); // subscribe for Event.FOCUSEVENTS int bits = DOM.getEventsSunk( (Element) focusEl.cast()); // do not remove redundant cast, GWT tests will fail DOM.sinkEvents((Element) focusEl.cast(), bits | Event.FOCUSEVENTS); }