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

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

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

Element.focus介绍

暂无

代码示例

代码示例来源:origin: org.eclipse.che.core/che-core-ide-app

@Override
 protected void focusView() {
  scrollPanel.getElement().focus();
 }
}

代码示例来源:origin: com.vaadin.addon/vaadin-touchkit-agpl

@Override
public void onTouchStart(TouchStartEvent event) {
  touchStarted = true;
  fastClickAt = null;
  getElement().focus();
}

代码示例来源:origin: org.eclipse.che.core/che-core-ide-app

@Override
 protected void focusView() {
  frame.getElement().focus();
 }
}

代码示例来源:origin: org.eclipse.che.core/che-core-ide-api

/**
 * Override this method to set focus to necessary element inside the view. Method is called when
 * focusing the part view.
 */
protected void focusView() {
 getElement().focus();
}

代码示例来源:origin: com.vaadin.addon/vaadin-touchkit-agpl

@Override
public void onClick(ClickEvent event) {
  if (enabled) {
    if (fastClickAt != null
        && (new Date().getTime() - fastClickAt.getTime()) < IGNORE_SIMULATED_CLICKS_THRESHOLD) {
      // VConsole.log("Ignored simulated event fired by old ios or android "
      // + (new Date().getTime() - fastClickAt.getTime()));
      fastClickAt = null;
      return;
    }
    getElement().focus();
  }
}

代码示例来源:origin: org.opennms.features.topology/ssh

public void focus() {
  fPanel.getElement().focus();
}

代码示例来源:origin: GwtMaterialDesign/gwt-material

@Override
  public void setFocus(final boolean focused) {
    if (focused) {
      uiObject.getElement().focus();
    } else {
      uiObject.getElement().blur();
    }
  }
}

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

@Override
  public void setFocus(final boolean focused) {
    if (focused) {
      uiObject.getElement().focus();
    } else {
      uiObject.getElement().blur();
    }
  }
}

代码示例来源:origin: info.magnolia.ui/magnolia-ui-vaadin-common-widgets

@Override
  public void onKeyPress(KeyPressEvent event) {
    int code = event.getNativeEvent().getKeyCode();
    if (code == KeyCodes.KEY_ESCAPE) {
      blurHelper.getElement().focus();
    }
  }
};

代码示例来源:origin: org.gwtbootstrap3/gwtbootstrap3

@Override
  public void setFocus(final boolean focused) {
    if (focused) {
      uiObject.getElement().focus();
    } else {
      uiObject.getElement().blur();
    }
  }
}

代码示例来源:origin: com.github.gwtmaterialdesign/gwt-material

@Override
  public void setFocus(final boolean focused) {
    if (focused) {
      uiObject.getElement().focus();
    } else {
      uiObject.getElement().blur();
    }
  }
}

代码示例来源:origin: com.vaadin.addon/vaadin-touchkit-agpl

private void prepareForAnimation() {
  // ensure focus is removed from possibly focused fields
  getElement().focus();
  if (needsIos6ScrollingWorkaround && !preparedForTranslation3d) {
    prepareForAnimation(prevView);
    prepareForAnimation(nextView);
    preparedForTranslation3d = true;
  }
}

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

/**
 * Make sure the HTML element has focus and update to render cursor
 */
protected void onFocusTimer() {
  BlurHandler oldBlur = this.onTextfieldBlur;
  onTextfieldBlur = null;
  mathFieldInternal.update();
  // first focus canvas to get the scrolling right
  html.getElement().focus();
  if (focusHandler != null) {
    focusHandler.onFocus(null);
  }
  // after set focus to the keyboard listening element
  focusTextArea();
  onTextfieldBlur = oldBlur;
}

代码示例来源:origin: org.eclipse.che.plugin/che-plugin-git-ext-git

@UiHandler("revisionsPanel")
 public void onPanelScrolled(ScrollEvent ignored) {
  // We cannot rely on exact equality of scroll positions because GWT sometimes round such values
  // and it is possible that the actual max scroll position is a pixel less then declared.
  if (revisionsPanel.getMaximumVerticalScrollPosition()
      - revisionsPanel.getVerticalScrollPosition()
    <= 1) {
   // to avoid autoscrolling to selected item
   revisionsPanel.getElement().focus();

   delegate.onScrolledToButton();
  }
 }
}

代码示例来源:origin: org.eclipse.che.plugin/che-plugin-git-ext-git

@UiHandler("revisionsPanel")
 public void onPanelScrolled(ScrollEvent ignored) {
  // We cannot rely on exact equality of scroll positions because GWT sometimes round such values
  // and it is possible that the actual max scroll position is a pixel less then declared.
  if (revisionsPanel.getMaximumVerticalScrollPosition()
      - revisionsPanel.getVerticalScrollPosition()
    <= 1) {
   // to avoid autoscrolling to selected item
   revisionsPanel.getElement().focus();

   delegate.onScrolledToBottom();
  }
 }
}

代码示例来源:origin: org.eclipse.che.plugin/che-plugin-git-ext-git

@UiHandler("revisionsPanel")
 public void onPanelScrolled(ScrollEvent ignored) {
  // We cannot rely on exact equality of scroll positions because GWT sometimes round such values
  // and it is possible that the actual max scroll position is a pixel less then declared.
  if (revisionsPanel.getMaximumVerticalScrollPosition()
      - revisionsPanel.getVerticalScrollPosition()
    <= 1) {
   // to avoid autoscrolling to selected item
   revisionsPanel.getElement().focus();

   delegate.onScrolledToBottom();
  }
 }
}

代码示例来源:origin: org.eclipse.che.core/che-core-ide-ui

@Override
 public void onClick(ClickEvent clickEvent) {
  widgetsPanel.getElement().focus();
  delegate.onWidgetFocused(widgetsPanel.getVisibleWidget());
  Scheduler.get()
    .scheduleDeferred(
      new Scheduler.ScheduledCommand() {
       @Override
       public void execute() {
        delegate.onAddTabButtonClicked(
          getAbsoluteLeft(plusPanel.getElement()) + POPUP_OFFSET,
          getAbsoluteTop(plusPanel.getElement()) + POPUP_OFFSET);
       }
      });
 }
},

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

private void focusTextArea() {
  wrap.getElement().focus();
  if (html.getElement().getParentElement() != null) {
    html.getElement().getParentElement().setScrollTop(0);
  }
}

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

/**
 * Actually repaint the content (repaint() is ignored in Web
 * implementation).
 */
public void repaintWeb() {
  if (lastIcon == null) {
    return;
  }
  if (!active(wrap.getElement()) && this.enabled) {
    wrap.getElement().focus();
  }
  final double height = computeHeight(lastIcon);
  final double width = roundUp(lastIcon.getIconWidth() + 30);
  ctx.getCanvas().setHeight(((int) Math.ceil(height * ratio)));
  ctx.getCanvas().setWidth((int) Math.ceil(width * ratio));
  ctx.setFillStyle("rgb(255,255,255)");
  ctx.fillRect(0, 0, ctx.getCanvas().getWidth(), height);
  JlmLib.draw(lastIcon, ctx, 0, getMargin(lastIcon), new ColorW(0, 0, 0),
      "#FFFFFF", null, ratio);
}

代码示例来源:origin: fjfd/microscope

@Override
public void onMouseDown(final MouseDownEvent event) {
  event.preventDefault();
  // Check if the zoom selection is active, if so, it's possible that the
  // mouse left the browser mid-selection and got stuck enabled even
  // though the mouse isn't still pressed. If that's the case, do a similar
  // operation to the onMouseUp event.
  if (zoom_selection_active) {
    endSelection(event);
    return;
  }
  final Element image = graph.getElement();
  zoom_selection_active = true;
  start_x = event.getRelativeX(image);
  start_y = event.getRelativeY(image);
  end_x = 0;
  end_y = 0;
  graphbox.setWidgetPosition(this, start_x, start_y);
  super.setWidth("0px");
  super.setHeight("0px");
  super.setVisible(true);
  // Workaround to steal the focus from whatever had it previously,
  // which may cause the graph to reload as a side effect.
  super.getElement().focus();
  graph_move_handler = graph.addMouseMoveHandler(this);
  box_move_handler = super.addMouseMoveHandler(this);
}

相关文章

微信公众号

最新文章

更多

Element类方法