當前位置: 首頁>>代碼示例>>Java>>正文


Java Event.ONCLICK屬性代碼示例

本文整理匯總了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);
}
 
開發者ID:Jenner4S,項目名稱:unitimes,代碼行數:23,代碼來源:TimetableGrid.java

示例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;
  }
}
 
開發者ID:mit-cml,項目名稱:appinventor-extensions,代碼行數:25,代碼來源:MockComponent.java

示例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);
}
 
開發者ID:bonprix,項目名稱:vaadin-combobox-multiselect,代碼行數:20,代碼來源:VComboBoxMultiselect.java

示例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);
}
 
開發者ID:cuba-platform,項目名稱:cuba,代碼行數:17,代碼來源:CubaWindowWidget.java

示例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");
                        }
                    }
                }
            });
        }
    }
}
 
開發者ID:cuba-platform,項目名稱:cuba,代碼行數:25,代碼來源:Tools.java

示例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);
}
 
開發者ID:cuba-platform,項目名稱:cuba,代碼行數:22,代碼來源:CubaNotification.java

示例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);
}
 
開發者ID:YoungDigitalPlanet,項目名稱:empiria.player,代碼行數:34,代碼來源:AccessibleRadioButton.java

示例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;
	}
}
 
開發者ID:Jenner4S,項目名稱:unitimes,代碼行數:40,代碼來源:CourseCurriculaTable.java

示例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);
}
 
開發者ID:Jenner4S,項目名稱:unitimes,代碼行數:10,代碼來源:AriaToggleButton.java

示例10: onBrowserEvent

@Override
public void onBrowserEvent(Event event) { 
    if(event.getTypeInt() == Event.ONCLICK) {
    	event.stopPropagation(); 
    } 
    super.onBrowserEvent(event); 
}
 
開發者ID:Jenner4S,項目名稱:unitimes,代碼行數:7,代碼來源:RoomsTable.java

示例11: onBrowserEvent

@Override
public void onBrowserEvent(Event event) {
    if (DOM.eventGetType(event) == Event.ONCLICK && handler != null) {
        if (DOM.eventGetTarget(event) == closeDiv && editable) {
            handler.remove();
        }
    }
}
 
開發者ID:cuba-platform,項目名稱:cuba,代碼行數:8,代碼來源:CubaTokenListLabelWidget.java

示例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);
            }
        }
    }
}
 
開發者ID:cuba-platform,項目名稱:cuba,代碼行數:14,代碼來源:CubaFieldGroupLayoutComponentSlot.java

示例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;
    }
}
 
開發者ID:cuba-platform,項目名稱:cuba,代碼行數:27,代碼來源:CubaGroupTableWidget.java

示例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);
    }
}
 
開發者ID:cuba-platform,項目名稱:cuba,代碼行數:9,代碼來源:CubaGroupBoxWidget.java

示例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;
}
 
開發者ID:jorkey,項目名稱:Wiab.pro,代碼行數:39,代碼來源:EventWrapper.java


注:本文中的com.google.gwt.user.client.Event.ONCLICK屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。