本文整理了Java中com.google.gwt.dom.client.Element.focus()
方法的一些代码示例,展示了Element.focus()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Element.focus()
方法的具体详情如下:
包路径:com.google.gwt.dom.client.Element
类名称:Element
方法名:focus
[英]Gives keyboard focus to this element.
[中]为该元素提供键盘焦点。
代码示例来源:origin: com.google.gwt/gwt-servlet
@Override
public void execute() {
focusable.focus();
}
});
代码示例来源:origin: com.google.gwt/gwt-servlet
public void focus(Element elem) {
elem.focus();
}
代码示例来源:origin: com.google.gwt/gwt-servlet
public void onClose(CloseEvent<PopupPanel> event) {
lastKey = null;
lastValue = null;
lastIndex = -1;
lastColumn = -1;
if (lastParent != null && !event.isAutoClosed()) {
// Refocus on the containing cell after the user selects a value, but
// not if the popup is auto closed.
lastParent.focus();
}
lastParent = null;
}
});
代码示例来源:origin: com.google.gwt/gwt-servlet
@Override
public void execute() {
if (!hasData.resetFocusOnCell()) {
Element elem = hasData.getKeyboardSelectedElement();
if (elem != null) {
elem.focus();
}
}
}
});
代码示例来源:origin: com.google.gwt/gwt-servlet
@Override
public boolean resetFocus(Context context, Element parent, C value) {
if (isEditing(context, parent, value)) {
getInputElement(parent).focus();
return true;
}
return false;
}
代码示例来源:origin: com.google.gwt/gwt-servlet
@Override
public void setFocus(boolean focused) {
Element elem = getKeyboardSelectedElement();
if (elem != null) {
if (focused) {
elem.focus();
} else {
elem.blur();
}
}
}
代码示例来源:origin: com.google.gwt/gwt-servlet
@Override
public void setFocus(Element parent, boolean focused) {
Element focusable = parent.getFirstChildElement().cast();
if (focused) {
focusable.focus();
} else {
focusable.blur();
}
}
}
代码示例来源:origin: com.google.gwt/gwt-servlet
@Override
protected void setKeyboardSelected(int index, boolean selected, boolean stealFocus) {
if (!isRowWithinBounds(index)) {
return;
}
Element elem = getRowElement(index);
if (!selected || isFocused || stealFocus) {
setStyleName(elem, style.cellListKeyboardSelectedItem(), selected);
}
setFocusable(elem, selected);
if (selected && stealFocus && !cellIsEditing) {
elem.focus();
onFocus();
}
}
代码示例来源:origin: com.google.gwt/gwt-servlet
@Override
protected void onEnterKeyDown(Context context, Element parent, C value,
NativeEvent event, ValueUpdater<C> valueUpdater) {
Element input = getInputElement(parent);
Element target = event.getEventTarget().cast();
Object key = context.getKey();
if (getInputElement(parent).isOrHasChild(target)) {
finishEditing(parent, value, key, valueUpdater);
} else {
focusedKey = key;
input.focus();
}
}
}
代码示例来源:origin: org.jboss.ballroom/widgets
@Override
public void execute() {
lastFocus.focus();
}
}
代码示例来源:origin: com.vaadin.external.gwt/gwt-user
@Override
public void execute() {
focusable.focus();
}
});
代码示例来源:origin: net.wetheinter/gwt-user
@Override
public void execute() {
focusable.focus();
}
});
代码示例来源:origin: com.google.gwt/gwt-servlet
cellParent.focus();
代码示例来源:origin: net.wetheinter/gwt-user
@Override
public void execute() {
if (!hasData.resetFocusOnCell()) {
Element elem = hasData.getKeyboardSelectedElement();
if (elem != null) {
elem.focus();
}
}
}
});
代码示例来源:origin: net.wetheinter/gwt-user
@Override
public boolean resetFocus(Context context, Element parent, C value) {
if (isEditing(context, parent, value)) {
getInputElement(parent).focus();
return true;
}
return false;
}
代码示例来源:origin: com.haulmont.cuba/cuba-web-toolkit
@Override
protected void queueUploadStop() {
if (progressWindow != null) {
progressWindow.hide();
progressWindow = null;
}
getFileInputElement().focus();
if (queueUploadListener != null) {
queueUploadListener.uploadFinished();
}
}
代码示例来源:origin: com.vaadin.external.gwt/gwt-user
@Override
public void setFocus(Element parent, boolean focused) {
Element focusable = parent.getFirstChildElement().cast();
if (focused) {
focusable.focus();
} else {
focusable.blur();
}
}
}
代码示例来源:origin: com.googlecode.gwtquery/gwtquery
/**
* Bind a set of functions to the focus event of each matched element. Or trigger the event and
* move the input focus to the first element if no functions are provided.
*/
public GQuery focus(Function... f) {
bindOrFire(Event.ONFOCUS, null, f);
if (!isEmpty() && f.length == 0) {
get(0).focus();
}
return this;
}
代码示例来源:origin: net.wetheinter/gwt-user
@Override
public void setFocus(Element parent, boolean focused) {
Element focusable = parent.getFirstChildElement().cast();
if (focused) {
focusable.focus();
} else {
focusable.blur();
}
}
}
代码示例来源:origin: org.kuali.student.core/ks-common-ui
private void grabFocus() {
Widget mainContent = contentPanel.getWidget();
NodeList<Element> nodeList = mainContent.getElement().getElementsByTagName("*");
for (int i = 0; i < nodeList.getLength(); i++) {
Element e = nodeList.getItem(i);
if (FOCUSABLE_TAGS.contains(e.getTagName().toUpperCase())) {
e.focus();
return;
}
}
}
内容来源于网络,如有侵权,请联系作者删除!