当前位置: 首页>>代码示例>>Java>>正文


Java DOM.eventGetType方法代码示例

本文整理汇总了Java中com.google.gwt.user.client.DOM.eventGetType方法的典型用法代码示例。如果您正苦于以下问题:Java DOM.eventGetType方法的具体用法?Java DOM.eventGetType怎么用?Java DOM.eventGetType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.google.gwt.user.client.DOM的用法示例。


在下文中一共展示了DOM.eventGetType方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onBrowserEvent

import com.google.gwt.user.client.DOM; //导入方法依赖的package包/类
public void onBrowserEvent(final Event event) {
	Element td = getEventTargetCell(event);
	if (td==null) return;
    final Element tr = DOM.getParent(td);
	int col = DOM.getChildIndex(tr, td);
    Element body = DOM.getParent(tr);
    int row = DOM.getChildIndex(body, tr);
    
    Widget widget = getWidget(row, col);
    if (widget != null && widget instanceof UniTimeHeaderPanel) {
    	super.onBrowserEvent(event);
    	return;
    }
    
	switch (DOM.eventGetType(event)) {
	case Event.ONMOUSEOVER:
		getRowFormatter().addStyleName(row, "hover");
		break;
	case Event.ONMOUSEOUT:
		getRowFormatter().removeStyleName(row, "hover");
		break;
	}
	
	super.onBrowserEvent(event);
}
 
开发者ID:Jenner4S,项目名称:unitimes,代码行数:26,代码来源:SimpleEditPage.java

示例2: onBrowserEvent

import com.google.gwt.user.client.DOM; //导入方法依赖的package包/类
public void onBrowserEvent(Event event) {
	if (iHint.getText().isEmpty()) return;
	iX = 10 + event.getClientX() + getElement().getOwnerDocument().getScrollLeft();
	iY = 10 + event.getClientY() + getElement().getOwnerDocument().getScrollTop();
	
	switch (DOM.eventGetType(event)) {
	case Event.ONMOUSEMOVE:
		if (iInfoPanel.isShowing()) {
			int maxX = Window.getScrollLeft() + Window.getClientWidth() - iInfoPanel.getOffsetWidth() - 10;
			iInfoPanel.setPopupPosition(Math.min(iX, maxX), iY);
		} else if (iInfo.getRowCount() > 0) {
			iShowInfo.cancel();
			iShowInfo.schedule(1000);
		}
		break;
	case Event.ONMOUSEOUT:
		iShowInfo.cancel();
		if (iInfoPanel.isShowing())
			iHideInfo.schedule(1000);
		break;
	}
}
 
开发者ID:Jenner4S,项目名称:unitimes,代码行数:23,代码来源:InfoPanelImpl.java

示例3: onBrowserEvent

import com.google.gwt.user.client.DOM; //导入方法依赖的package包/类
@Override
public void onBrowserEvent(Event event) {
	if (!isEnabled()) return;

	super.onBrowserEvent(event);

    if ((event.getTypeInt() & Event.KEYEVENTS) != 0) {
    	int type = DOM.eventGetType(event);
    	char keyCode = (char) event.getKeyCode();
    	switch (type) {
    	case Event.ONKEYDOWN:
    		if (keyCode == ' ' || keyCode == '\n' || keyCode == '\r') {
    			if (iDown != null) setResource(iDown);
    		}
    		break;
        case Event.ONKEYUP:
        	if (keyCode == ' ' || keyCode == '\n' || keyCode == '\r') {
        		setResource(iUp);
        		onClick();
        	}
        	break;
    	}
    }
}
 
开发者ID:Jenner4S,项目名称:unitimes,代码行数:25,代码来源:ImageButton.java

示例4: onBrowserEvent

import com.google.gwt.user.client.DOM; //导入方法依赖的package包/类
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,代码行数:24,代码来源:TimetableGrid.java

示例5: onBrowserEvent

import com.google.gwt.user.client.DOM; //导入方法依赖的package包/类
public void onBrowserEvent(Event event) {
	int x = 10 + event.getClientX() + getElement().getOwnerDocument().getScrollLeft();
	int y = 10 + event.getClientY() + getElement().getOwnerDocument().getScrollTop();
	
	switch (DOM.eventGetType(event)) {
	case Event.ONMOUSEMOVE:
		if (iHint.isShowing()) {
			iHint.setPopupPosition(x, y);
		} else {
			iShowHint.cancel();
			iHint.setPopupPosition(x, y);
			iShowHint.schedule(1000);
		}
		break;
	case Event.ONMOUSEOUT:
		iShowHint.cancel();
		if (iHint.isShowing())
			iHideHint.schedule(1000);
		break;
	}
}
 
开发者ID:Jenner4S,项目名称:unitimes,代码行数:22,代码来源:HorizontalPanelWithHint.java

示例6: onBrowserEvent

import com.google.gwt.user.client.DOM; //导入方法依赖的package包/类
@Override
public void onBrowserEvent(Event event) {
	switch (DOM.eventGetType(event)) {
    case Event.ONMOUSEDOWN:
    	SelectionMode mode = null; 
    	for (SelectionMode m: SelectionMode.values())
    		if (hasUnselectedDays(m)) {
    			mode = m; break;
    		}
    	if (mode != null)
    		setAllSelected(true, mode);
    	else
    		setAllSelected(false, SelectionMode.All);
    	if (iCursor != null) iPanel.getWidget().setCursor(iCursor);
    	event.preventDefault();
    	break;
	}
	super.onBrowserEvent(event);
}
 
开发者ID:Jenner4S,项目名称:unitimes,代码行数:20,代码来源:SessionDatesSelector.java

示例7: onBrowserEvent

import com.google.gwt.user.client.DOM; //导入方法依赖的package包/类
/**
 * 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,代码行数:35,代码来源:AccessibleRadioButton.java

示例8: onBrowserEvent

import com.google.gwt.user.client.DOM; //导入方法依赖的package包/类
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,代码行数:41,代码来源:CourseCurriculaTable.java

示例9: onBrowserEvent

import com.google.gwt.user.client.DOM; //导入方法依赖的package包/类
@Override
public void onBrowserEvent(Event event) {
	switch (DOM.eventGetType(event)) {
    case Event.ONMOUSEDOWN:
    	MouseDownEvent.fireNativeEvent(event, this);
    	event.stopPropagation();
    	event.preventDefault();
    	break;
	}
}
 
开发者ID:Jenner4S,项目名称:unitimes,代码行数:11,代码来源:TravelTimes.java

示例10: onBrowserEvent

import com.google.gwt.user.client.DOM; //导入方法依赖的package包/类
@Override
public void onBrowserEvent(Event event) {
	switch (DOM.eventGetType(event)) {
    case Event.ONBLUR:
    	BlurEvent.fireNativeEvent(event, this);
    	break;
    case Event.ONFOCUS:
    	FocusEvent.fireNativeEvent(event, this);
    	break;
	}
	super.onBrowserEvent(event);
}
 
开发者ID:Jenner4S,项目名称:unitimes,代码行数:13,代码来源:TimeSelector.java

示例11: onBrowserEvent

import com.google.gwt.user.client.DOM; //导入方法依赖的package包/类
@Override
public void onBrowserEvent(Event event) {
	switch (DOM.eventGetType(event)) {
	case Event.ONKEYPRESS:
		MenuItem item = iAccessKeys.get(Character.toLowerCase((char)event.getCharCode()));
		if (item != null) {
			event.stopPropagation();
			event.preventDefault();
			item.getScheduledCommand().execute();
		}
	}
	super.onBrowserEvent(event);
	
}
 
开发者ID:Jenner4S,项目名称:unitimes,代码行数:15,代码来源:UniTimeTableHeader.java

示例12: onBrowserEvent

import com.google.gwt.user.client.DOM; //导入方法依赖的package包/类
@Override
public void onBrowserEvent(Event event) {
   	Element target = DOM.eventGetTarget(event);

    switch (DOM.eventGetType(event)) {
    case Event.ONMOUSEDOWN:
    	boolean open = iFilterOpen.getElement().equals(target);
    	boolean close = iFilterClose.getElement().equals(target);
    	boolean clear = iFilterClear.getElement().equals(target);
    	boolean filter = iFilter.getElement().equals(target);
    	if (isFilterPopupShowing() || close) {
    		hideFilterPopup();
    	} else if (open) {
    		hideSuggestions();
    		showFilterPopup();
    	}
    	if (clear) {
			iFilter.setText("");
			removeAllChips();
			setAriaLabel(toAriaString());
			ValueChangeEvent.fire(FilterBox.this, getValue());
    	}
    	if (!filter) {
			event.stopPropagation();
			event.preventDefault();
	    	Scheduler.get().scheduleDeferred(new ScheduledCommand() {
				@Override
				public void execute() {
					iFilter.setFocus(true);
				}
			});
    	}
    	break;
    }
}
 
开发者ID:Jenner4S,项目名称:unitimes,代码行数:36,代码来源:FilterBox.java

示例13: onBrowserEvent

import com.google.gwt.user.client.DOM; //导入方法依赖的package包/类
public void onBrowserEvent(Event event) {
	if (iDummy) return;
    Element target = DOM.eventGetTarget(event);
    boolean anchor = false;
    for (; target != null; target = DOM.getParent(target)) {
    	String tag = target.getPropertyString("tagName");
    	if ("a".equalsIgnoreCase(tag)) {
    		anchor = true;
    		break;
    	} else if ("div".equalsIgnoreCase(tag)) {
    		break;
    	}
    }
	EventTarget related = event.getRelatedEventTarget();
    switch (DOM.eventGetType(event)) {
	case Event.ONCLICK:
		select(false);
		if (!anchor) {
			MeetingClickEvent e = new MeetingClickEvent(Meeting.this);
			for (MeetingClickHandler h: iMeetingClickHandlers)
				h.onMeetingClick(e);
		}
		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;
	case Event.ONMOUSEMOVE:
		int relativeX = event.getClientX() - getElement().getAbsoluteLeft() + getElement().getScrollLeft() + getElement().getOwnerDocument().getScrollLeft();
		if (relativeX < iLeft - 6 - getDay() * iCellWidth || relativeX > iLeft - 2 - getDay() * iCellWidth + iWidth) {
			select(false);
		}
		break;
	}
    super.onBrowserEvent(event);
}
 
开发者ID:Jenner4S,项目名称:unitimes,代码行数:43,代码来源:TimeGrid.java


注:本文中的com.google.gwt.user.client.DOM.eventGetType方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。