本文整理汇总了Java中com.google.gwt.user.client.Event.ONCLICK属性的典型用法代码示例。如果您正苦于以下问题:Java Event.ONCLICK属性的具体用法?Java Event.ONCLICK怎么用?Java Event.ONCLICK使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类com.google.gwt.user.client.Event
的用法示例。
在下文中一共展示了Event.ONCLICK属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onBrowserEvent
public void onBrowserEvent(Event event) {
EventTarget related = event.getRelatedEventTarget();
switch (DOM.eventGetType(event)) {
case Event.ONCLICK:
if (getCell().hasId() && getCell().getType() == TimetableGridCell.Type.Class) {
UniTimeFrameDialog.openDialog(MESSAGES.dialogSuggestions(), "suggestions.do?id=" + getCell().getId() + "&op=Reset","900","90%");
select(false);
}
break;
case Event.ONMOUSEOVER:
if (related == null || !getElement().isOrHasChild((Element)related.cast())) {
select(true);
}
break;
case Event.ONMOUSEOUT:
if (related == null || !getElement().isOrHasChild((Element)related.cast())) {
select(false);
}
break;
}
super.onBrowserEvent(event);
}
示例2: onBrowserEvent
/**
* Invoked by GWT whenever a browser event is dispatched to this component.
*/
@Override
public final void onBrowserEvent(Event event) {
switch (event.getTypeInt()) {
case Event.ONMOUSEDOWN:
case Event.ONMOUSEUP:
case Event.ONMOUSEMOVE:
case Event.ONMOUSEOVER:
case Event.ONMOUSEOUT:
cancelBrowserEvent(event);
mouseListeners.fireMouseEvent(this, event);
break;
case Event.ONCLICK:
cancelBrowserEvent(event);
select();
break;
default:
// Ignore unexpected events
break;
}
}
示例3: onBrowserEvent
@Override
public void onBrowserEvent(Event event) {
debug("VComboBoxMultiselect.SP: onBrowserEvent()");
if (event.getTypeInt() == Event.ONCLICK) {
final Element target = DOM.eventGetTarget(event);
if (target == this.up || target == DOM.getChild(this.up, 0)) {
this.lazyPageScroller.scrollUp();
} else if (target == this.down || target == DOM.getChild(this.down, 0)) {
this.lazyPageScroller.scrollDown();
}
}
/*
* Prevent the keyboard focus from leaving the textfield by
* preventing the default behaviour of the browser. Fixes #4285.
*/
handleMouseDownEvent(event);
}
示例4: onBrowserEvent
@Override
public void onBrowserEvent(Event event) {
if (contextMenuHandler != null && event.getTypeInt() == Event.ONCONTEXTMENU) {
contextMenuHandler.onContextMenu(event);
return;
}
if ((event.getTypeInt() == Event.ONCLICK
|| event.getTypeInt() == Event.ONMOUSEDOWN)
&& event.getButton() != NativeEvent.BUTTON_LEFT) {
event.preventDefault();
event.stopPropagation();
return;
}
super.onBrowserEvent(event);
}
示例5: onPreviewNativeEvent
@Override
protected void onPreviewNativeEvent(Event.NativePreviewEvent event) {
super.onPreviewNativeEvent(event);
NativeEvent nativeEvent = event.getNativeEvent();
Element target = Element.as(nativeEvent.getEventTarget());
if (Event.ONCLICK == event.getTypeInt()) {
final Widget hoveredButton = WidgetUtil.findWidget(target, null);
if (getElement().isOrHasChild(target)) {
Scheduler.get().scheduleDeferred(new Scheduler.ScheduledCommand() {
@Override
public void execute() {
hide();
if (BrowserInfo.get().isIE9()) {
if (hoveredButton instanceof CubaButtonWidget) {
hoveredButton.removeStyleName("ie9-hover");
}
}
}
});
}
}
}
示例6: onEventPreview
@Override
public boolean onEventPreview(Event event) {
int type = DOM.eventGetType(event);
if ((type == Event.ONCLICK || type == Event.ONTOUCHEND)
&& event.getEventTarget() != null) {
Element target = Element.as(event.getEventTarget());
if (target.getClassName() != null && target.getClassName().contains(CUBA_NOTIFICATION_MODALITY_CURTAIN)) {
hide();
return false;
}
}
if (type == Event.ONKEYDOWN && event.getKeyCode() == KeyCodes.KEY_ESCAPE) {
if (!getElement().getClassName().contains(TRAY_STYLE)) {
hide();
return false;
}
}
return super.onEventPreview(event);
}
示例7: onBrowserEvent
/**
* Overridden to send ValueChangeEvents only when appropriate.
*/
@Override
public void onBrowserEvent(Event event) {
switch (DOM.eventGetType(event)) {
case Event.ONMOUSEUP:
case Event.ONBLUR:
case Event.ONKEYDOWN:
// Note the old value for onValueChange purposes (in ONCLICK case)
oldValue = getValue();
break;
case Event.ONCLICK:
EventTarget target = event.getEventTarget();
if (Element.is(target) && labelElem.isOrHasChild(Element.as(target))) {
// They clicked the label. Note our pre-click value, and
// short circuit event routing so that other click handlers
// don't hear about it
oldValue = getValue();
return;
}
// It's not the label. Let our handlers hear about the
// click...
super.onBrowserEvent(event);
// ...and now maybe tell them about the change
ValueChangeEvent.fireIfNotEqual(AccessibleRadioButton.this, oldValue, getValue());
return;
}
super.onBrowserEvent(event);
}
示例8: onBrowserEvent
public void onBrowserEvent(Event event) {
Element td = getEventTargetCell(event);
if (td==null) return;
Element tr = DOM.getParent(td);
Element body = DOM.getParent(tr);
final int row = DOM.getChildIndex(body, tr);
final ChainedCommand command = iRowClicks.get(row);
switch (DOM.eventGetType(event)) {
case Event.ONMOUSEOVER:
getRowFormatter().setStyleName(row, "unitime-TableRowHover");
if (command == null) getRowFormatter().getElement(row).getStyle().setCursor(Cursor.AUTO);
break;
case Event.ONMOUSEOUT:
getRowFormatter().setStyleName(row, null);
break;
case Event.ONCLICK:
if (command == null) break;
if (command.getLoadingMessage() != null)
LoadingWidget.getInstance().show(command.getLoadingMessage());
getRowFormatter().setStyleName(row, "unitime-TableRowSelected");
iSelectedRow = row;
command.execute(new ConditionalCommand() {
@Override
public void executeOnSuccess() {
//getRowFormatter().setStyleName(row, null);
if (command.getLoadingMessage() != null)
LoadingWidget.getInstance().hide();
}
@Override
public void executeOnFailure() {
getRowFormatter().setStyleName(row, "unitime-TableRowHover");
if (command.getLoadingMessage() != null)
LoadingWidget.getInstance().hide();
}
});
break;
}
}
示例9: onBrowserEvent
@Override
public void onBrowserEvent(Event event) {
if (event.getTypeInt() == Event.ONKEYUP && event.getKeyCode() == KeyCodes.KEY_SPACE) {
onClick();
}
if (event.getTypeInt() == Event.ONCLICK) {
setValue(!getValue());
}
super.onBrowserEvent(event);
}
示例10: onBrowserEvent
@Override
public void onBrowserEvent(Event event) {
if(event.getTypeInt() == Event.ONCLICK) {
event.stopPropagation();
}
super.onBrowserEvent(event);
}
示例11: onBrowserEvent
@Override
public void onBrowserEvent(Event event) {
if (DOM.eventGetType(event) == Event.ONCLICK && handler != null) {
if (DOM.eventGetTarget(event) == closeDiv && editable) {
handler.remove();
}
}
}
示例12: onBrowserEvent
@Override
public void onBrowserEvent(Event event) {
if (DOM.eventGetType(event) == Event.ONCLICK) {
Element target = Element.as(event.getEventTarget());
ComponentConnector componentConnector = Util.findConnectorFor(getWidget());
if (target == contextHelpIndicatorElement
&& componentConnector instanceof HasContextHelpConnector) {
HasContextHelpConnector connector = (HasContextHelpConnector) componentConnector;
if (hasContextHelpIconListeners(componentConnector.getState())) {
connector.contextHelpIconClick(event);
}
}
}
}
示例13: onBrowserEvent
@Override
public void onBrowserEvent(Event event) {
final Element targetElement = DOM.eventGetTarget(event);
switch (DOM.eventGetType(event)) {
case Event.ONCLICK:
if (BrowserInfo.get().getWebkitVersion() > 0
&& targetElement.getPropertyBoolean("__cell")) {
scrollBodyPanel.setFocus(true);
}
setRowFocus(this);
if ((event.getCtrlKey() || event.getMetaKey())
&& !event.getAltKey() && !event.getShiftKey()) {
handleRowCtrlClick(event);
} else {
if (event.getEventTarget().cast() != expander || isSingleSelectMode()) {
deselectAll();
sendSelectedRows(false);
}
handleRowClick(event);
}
break;
default:
break;
}
}
示例14: onBrowserEvent
@Override
public void onBrowserEvent(Event event) {
if (collapsable && DOM.eventGetType(event) == Event.ONCLICK && isEnabled()
&& (DOM.eventGetTarget(event) == expander || DOM.eventGetTarget(event) == captionNode.getChild(1))) {
toggleExpanded(event);
} else {
super.onBrowserEvent(event);
}
}
示例15: asString
public static String asString(Event event) {
// Start with the event type string
String string = DOM.eventGetTypeString(event);
// Next type-specific fields
switch (event.getTypeInt()) {
case Event.ONKEYPRESS:
case Event.ONKEYUP:
case Event.ONKEYDOWN:
string += key(event) + modifiers(event);
break;
case Event.ONCLICK:
case Event.ONDBLCLICK:
case Event.ONMOUSEMOVE:
string += mousePoint(event) + modifiers(event);
break;
case Event.ONMOUSEDOWN:
case Event.ONMOUSEUP:
string += mousePoint(event) + mouseButtons(event) + modifiers(event);
break;
case Event.ONMOUSEOUT:
string += mousePoint(event) + modifiers(event) + " to: " + getToElement(event);
break;
case Event.ONMOUSEOVER:
string += mousePoint(event) + modifiers(event) + " from: " + getFromElement(event);
break;
case Event.ONMOUSEWHEEL:
string += " " + getMouseWheelVelocityY(event) + mousePoint(event) + modifiers(event);
break;
case Event.ONFOCUS:
case Event.ONBLUR:
case Event.ONCHANGE:
case Event.ONERROR:
case Event.ONLOAD:
case Event.ONLOSECAPTURE:
case Event.ONSCROLL:
break;
}
return string;
}