本文整理了Java中com.google.gwt.user.client.Event.getTypeInt()
方法的一些代码示例,展示了Event.getTypeInt()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Event.getTypeInt()
方法的具体详情如下:
包路径:com.google.gwt.user.client.Event
类名称:Event
方法名:getTypeInt
[英]Gets the enumerated type of this event, as defined by #ONCLICK, #ONMOUSEDOWN, and so forth.
[中]获取此事件的枚举类型,如#ONCLICK、#ONMOUSEDOWN等所定义。
代码示例来源:origin: com.google.gwt/gwt-servlet
/**
* Get the event bits to sink for an event type.
*
* @param widget the {@link Widget} that will handle the events
* @param typeName the name of the event to sink
* @return the event bits to sink, or -1 if no events to sink
*/
protected int sinkEvent(Widget widget, String typeName) {
return Event.getTypeInt(typeName);
}
}
代码示例来源:origin: com.google.gwt/gwt-servlet
/**
* Gets the type int corresponding to the native event that triggered this
* preview.
*
* @return the type int associated with this native event
*/
public final int getTypeInt() {
return Event.as(getNativeEvent()).getTypeInt();
}
代码示例来源:origin: com.google.gwt/gwt-servlet
@Override
public void onBrowserEvent(Event event) {
// If we're not yet dragging, only trigger mouse events if the event occurs
// in the caption wrapper
switch (event.getTypeInt()) {
case Event.ONMOUSEDOWN:
case Event.ONMOUSEUP:
case Event.ONMOUSEMOVE:
case Event.ONMOUSEOVER:
case Event.ONMOUSEOUT:
if (!dragging && !isCaptionEvent(event)) {
return;
}
}
super.onBrowserEvent(event);
}
代码示例来源:origin: com.google.gwt/gwt-servlet
@Override
public void onBrowserEvent(Event event) {
// We have to clear the unhandled event before firing handlers because the
// handlers could trigger onLoad, which would refire the event.
if (event.getTypeInt() == Event.ONLOAD) {
clearUnhandledEvent();
state.onLoadEvent(this);
}
super.onBrowserEvent(event);
}
代码示例来源:origin: com.google.gwt/gwt-servlet
@Override
public void onBrowserEvent(Event event) {
// Align the scrollbars with the content.
if (Event.ONSCROLL == event.getTypeInt()) {
double curTime = Duration.currentTimeMillis();
if (curTime > ignoreContentUntil) {
ignoreScrollbarsUntil = curTime + IGNORE_SCROLL_TIMEOUT;
maybeUpdateScrollbarPositions();
}
}
super.onBrowserEvent(event);
}
代码示例来源:origin: com.google.gwt/gwt-servlet
public void onBrowserEvent(Event event) {
if (!resettingScrollables && Event.ONSCROLL == event.getTypeInt()) {
EventTarget eventTarget = event.getEventTarget();
if (!Element.is(eventTarget)) {
return;
}
Element target = eventTarget.cast();
if (target == collapsible || target == expandable) {
handleResize();
}
}
}
代码示例来源:origin: com.google.gwt/gwt-servlet
/**
* Sink events on the widget.
*
* @param widget the {@link Widget} that will handle the events
* @param typeNames the names of the events to sink
*/
public final void sinkEvents(Widget widget, Set<String> typeNames) {
if (typeNames == null) {
return;
}
int eventsToSink = 0;
for (String typeName : typeNames) {
int typeInt = Event.getTypeInt(typeName);
if (typeInt < 0) {
widget.sinkBitlessEvent(typeName);
} else {
typeInt = sinkEvent(widget, typeName);
if (typeInt > 0) {
eventsToSink |= typeInt;
}
}
}
if (eventsToSink > 0) {
widget.sinkEvents(eventsToSink);
}
}
代码示例来源:origin: com.google.gwt/gwt-servlet
eventsToSink |= Event.getTypeInt(trigger);
代码示例来源:origin: com.google.gwt/gwt-servlet
/**
* Adds a native event handler to the widget and sinks the corresponding
* native event. If you do not want to sink the native event, use the generic
* addHandler method instead.
*
* @param <H> the type of handler to add
* @param type the event key
* @param handler the handler
* @return {@link HandlerRegistration} used to remove the handler
*/
public final <H extends EventHandler> HandlerRegistration addDomHandler(
final H handler, DomEvent.Type<H> type) {
assert handler != null : "handler must not be null";
assert type != null : "type must not be null";
int typeInt = Event.getTypeInt(type.getName());
if (typeInt == -1) {
sinkBitlessEvent(type.getName());
} else {
sinkEvents(typeInt);
}
return ensureHandlers().addHandler(type, handler);
}
代码示例来源:origin: OpenNMS/opennms
@Override
public void onBrowserEvent(Event event) {
if(Event.ONLOAD == event.getTypeInt()) {
callHandlers();
m_loadComplete = true;
}
}
代码示例来源:origin: com.googlecode.mgwt/mgwt
@Override
public void onBrowserEvent(Event event) {
switch (event.getTypeInt()) {
case Event.ONCLICK:
cleanUp(overlayDiv, dialog, onButton, offButton, closeButton);
break;
default:
break;
}
}
});
代码示例来源:origin: com.vaadin.addon/vaadin-touchkit-agpl
@Override
public void onBrowserEvent(Event event) {
if (((event.getTypeInt() & Event.MOUSEEVENTS) != 0)) {
// Vaadin button has some huge hacks (although it is just a button
// :-( ) that are broken on some Window touch devices. E.g. on Lumia
// 820 one gets double click on each click. Ignore the
// hacks and just listen to the actual click events.
return;
}
super.onBrowserEvent(event);
}
代码示例来源:origin: net.wetheinter/gwt-user
/**
* Gets the type int corresponding to the native event that triggered this
* preview.
*
* @return the type int associated with this native event
*/
public final int getTypeInt() {
return Event.as(getNativeEvent()).getTypeInt();
}
代码示例来源:origin: com.google.gwt/gwt-servlet
@Override
public void onBrowserEvent(Event event) {
switch (event.getTypeInt()) {
case Event.ONMOUSEDOWN:
mouseDown = true;
代码示例来源:origin: com.googlecode.gwtquery/gwtquery
public void unbind(String events, Function f) {
for (EventName ev : EventName.split(events)) {
SpecialEvent hook = special.get(ev.eventName);
boolean unbind = hook == null || hook.tearDown(element) == false;
if (unbind) {
unbind(Event.getTypeInt(ev.eventName), ev.nameSpace, ev.eventName, f);
}
if (hook != null) {
hook.remove(element, ev.eventName, ev.nameSpace, f);
}
}
}
代码示例来源:origin: net.wetheinter/gwt-user
public void onBrowserEvent(Event event) {
if (!resettingScrollables && Event.ONSCROLL == event.getTypeInt()) {
EventTarget eventTarget = event.getEventTarget();
if (!Element.is(eventTarget)) {
return;
}
Element target = eventTarget.cast();
if (target == collapsible || target == expandable) {
handleResize();
}
}
}
代码示例来源:origin: info.magnolia.ui/magnolia-ui-vaadin-common-widgets
@Override
public void onBrowserEvent(Event event) {
super.onBrowserEvent(event);
int eventCode = event.getTypeInt();
if (eventCode == Event.ONTOUCHEND) {
final Element target = event.getEventTarget().cast();
if (target == closeEl) {
close();
}
}
}
代码示例来源:origin: info.magnolia.ui/magnolia-ui-vaadin-common-widgets
@Override
public void onBrowserEvent(Event event) {
if (event.getEventTarget().cast() == treeSpacer
&& treeSpacer.getClassName().contains("node")) {
if (event.getTypeInt() == Event.ONMOUSEUP) {
sendToggleCollapsedUpdate(getKey());
}
return;
}
super.onBrowserEvent(event);
}
代码示例来源:origin: com.google.gwt/gwt-servlet
int type = nativeEvent.getTypeInt();
switch (type) {
case Event.ONKEYDOWN: {
代码示例来源:origin: com.google.gwt/gwt-servlet
if ((event.getTypeInt() & Event.KEYEVENTS) != 0) {
char keyCode = (char) event.getKeyCode();
switch (type) {
内容来源于网络,如有侵权,请联系作者删除!