com.google.gwt.dom.client.Element.setTabIndex()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(5.1k)|赞(0)|评价(0)|浏览(264)

本文整理了Java中com.google.gwt.dom.client.Element.setTabIndex()方法的一些代码示例,展示了Element.setTabIndex()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Element.setTabIndex()方法的具体详情如下:
包路径:com.google.gwt.dom.client.Element
类名称:Element
方法名:setTabIndex

Element.setTabIndex介绍

[英]The index that represents the element's position in the tabbing order.
[中]表示元素在选项卡顺序中的位置的索引。

代码示例

代码示例来源:origin: com.google.gwt/gwt-servlet

  1. public void setTabIndex(Element elem, int index) {
  2. elem.setTabIndex(index);
  3. }
  4. }

代码示例来源:origin: com.google.gwt/gwt-servlet

  1. @Override
  2. public R tabIndex(int tabIndex) {
  3. assertCanAddAttribute().setTabIndex(tabIndex);
  4. return getReturnBuilder();
  5. }

代码示例来源:origin: com.google.gwt/gwt-servlet

  1. public Element createFocusable() {
  2. Element e = Document.get().createDivElement().cast();
  3. e.setTabIndex(0);
  4. return e;
  5. }

代码示例来源:origin: com.google.gwt/gwt-servlet

  1. /**
  2. * Make an element focusable or not.
  3. *
  4. * @param elem the element
  5. * @param focusable true to make focusable, false to make unfocusable
  6. */
  7. protected void setFocusable(Element elem, boolean focusable) {
  8. if (focusable) {
  9. FocusImpl focusImpl = FocusImpl.getFocusImplForWidget();
  10. focusImpl.setTabIndex(elem, getTabIndex());
  11. if (accessKey != 0) {
  12. focusImpl.setAccessKey(elem, accessKey);
  13. }
  14. } else {
  15. // Chrome: Elements remain focusable after removing the tabIndex, so set
  16. // it to -1 first.
  17. elem.setTabIndex(-1);
  18. elem.removeAttribute("tabIndex");
  19. elem.removeAttribute("accessKey");
  20. }
  21. }

代码示例来源:origin: com.vaadin.external.gwt/gwt-user

  1. public void setTabIndex(Element elem, int index) {
  2. elem.setTabIndex(index);
  3. }
  4. }

代码示例来源:origin: net.wetheinter/gwt-user

  1. public void setTabIndex(Element elem, int index) {
  2. elem.setTabIndex(index);
  3. }
  4. }

代码示例来源:origin: com.haulmont.cuba/cuba-web-toolkit

  1. protected void updateTabIndex() {
  2. if (editor != null) {
  3. Element textAreaElement = getTextAreaElement();
  4. if (enabled && !readOnly) {
  5. textAreaElement.setTabIndex(tabIndex);
  6. } else {
  7. textAreaElement.setTabIndex(-1);
  8. }
  9. }
  10. }

代码示例来源:origin: com.google.gwt/gwt-servlet

  1. cellParent.setTabIndex(-1);
  2. cellParent.removeAttribute("tabIndex");
  3. cellParent.removeAttribute("accessKey");

代码示例来源:origin: com.haulmont.cuba/cuba-web-toolkit

  1. @Override
  2. public void setTabIndex(int index) {
  3. getFileInputElement().setTabIndex(index);
  4. }

代码示例来源:origin: net.wetheinter/gwt-user

  1. @Override
  2. public R tabIndex(int tabIndex) {
  3. assertCanAddAttribute().setTabIndex(tabIndex);
  4. return getReturnBuilder();
  5. }

代码示例来源:origin: com.vaadin.external.gwt/gwt-user

  1. @Override
  2. public R tabIndex(int tabIndex) {
  3. assertCanAddAttribute().setTabIndex(tabIndex);
  4. return getReturnBuilder();
  5. }

代码示例来源:origin: net.wetheinter/gwt-user

  1. public Element createFocusable() {
  2. Element e = Document.get().createDivElement().cast();
  3. e.setTabIndex(0);
  4. return e;
  5. }

代码示例来源:origin: com.vaadin.external.gwt/gwt-user

  1. public Element createFocusable() {
  2. Element e = Document.get().createDivElement().cast();
  3. e.setTabIndex(0);
  4. return e;
  5. }

代码示例来源:origin: jqm4gwt/jqm4gwt

  1. @Override
  2. public void setEnabled(boolean value) {
  3. boolean prevEnabled = isEnabled();
  4. super.setEnabled(value);
  5. if (prevEnabled == value) return;
  6. if (isAttached()) {
  7. Element inputElt = getInputElt();
  8. if (value) {
  9. if (savedTabIndex != null) {
  10. inputElt.setTabIndex(savedTabIndex);
  11. savedTabIndex = null;
  12. }
  13. } else {
  14. savedTabIndex = inputElt.getTabIndex();
  15. inputElt.setTabIndex(-1);
  16. }
  17. }
  18. }

代码示例来源:origin: jqm4gwt/jqm4gwt

  1. @Override
  2. public void setEnabled(boolean value) {
  3. boolean prevEnabled = isEnabled();
  4. super.setEnabled(value);
  5. if (prevEnabled == value) return;
  6. if (isAttached()) {
  7. Element inputElt = getInputElt();
  8. if (value) {
  9. if (savedTabIndex != null) {
  10. inputElt.setTabIndex(savedTabIndex);
  11. savedTabIndex = null;
  12. }
  13. } else {
  14. savedTabIndex = inputElt.getTabIndex();
  15. inputElt.setTabIndex(-1);
  16. }
  17. }
  18. }

代码示例来源:origin: jqm4gwt/jqm4gwt

  1. @Override
  2. protected void onLoad() {
  3. super.onLoad();
  4. if (!isEnabled()) {
  5. Element inputElt = getInputElt();
  6. if (savedTabIndex == null) savedTabIndex = inputElt.getTabIndex();
  7. inputElt.setTabIndex(-1);
  8. }
  9. }

代码示例来源:origin: jqm4gwt/jqm4gwt

  1. @Override
  2. public void setTabIndex(int value) {
  3. if (isAttached()) {
  4. if (isEnabled()) {
  5. getInputElt().setTabIndex(value);
  6. savedTabIndex = null;
  7. } else {
  8. savedTabIndex = value;
  9. }
  10. } else {
  11. input.setTabIndex(value);
  12. JQMCommon.setAttribute(getInputElt(), "tabindex", String.valueOf(value));
  13. }
  14. }

代码示例来源:origin: jqm4gwt/jqm4gwt

  1. @Override
  2. public void setTabIndex(int value) {
  3. if (isAttached()) {
  4. if (isEnabled()) {
  5. getInputElt().setTabIndex(value);
  6. savedTabIndex = null;
  7. } else {
  8. savedTabIndex = value;
  9. }
  10. } else {
  11. input.setTabIndex(value);
  12. JQMCommon.setAttribute(getInputElt(), "tabindex", String.valueOf(value));
  13. }
  14. }

代码示例来源:origin: jqm4gwt/jqm4gwt

  1. @Override
  2. protected void onLoad() {
  3. super.onLoad();
  4. Element inputElt = getInputElt();
  5. bindCreated(inputElt, this);
  6. if (!isEnabled()) {
  7. if (savedTabIndex == null) savedTabIndex = inputElt.getTabIndex();
  8. inputElt.setTabIndex(-1);
  9. }
  10. }

代码示例来源:origin: net.wetheinter/gwt-user

  1. /**
  2. * Make an element focusable or not.
  3. *
  4. * @param elem the element
  5. * @param focusable true to make focusable, false to make unfocusable
  6. */
  7. protected void setFocusable(Element elem, boolean focusable) {
  8. if (focusable) {
  9. FocusImpl focusImpl = FocusImpl.getFocusImplForWidget();
  10. focusImpl.setTabIndex(elem, getTabIndex());
  11. if (accessKey != 0) {
  12. focusImpl.setAccessKey(elem, accessKey);
  13. }
  14. } else {
  15. // Chrome: Elements remain focusable after removing the tabIndex, so set
  16. // it to -1 first.
  17. elem.setTabIndex(-1);
  18. elem.removeAttribute("tabIndex");
  19. elem.removeAttribute("accessKey");
  20. }
  21. }

相关文章

Element类方法