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


Java DOM.getChildIndex方法代码示例

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


在下文中一共展示了DOM.getChildIndex方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: getCellForWidget

import com.google.gwt.user.client.DOM; //导入方法依赖的package包/类
public int getCellForWidget(Widget w) {
	for (Element e = w.getElement(); e != null; e = DOM.getParent(e)) {
		if (e.getPropertyString("tagName").equalsIgnoreCase("span")) {
			if (DOM.getParent(e) == getElement())
				return DOM.getChildIndex(getElement(), e);
		}
		if (e == getElement()) { return -1; }
	}
	return -1;
}
 
开发者ID:Jenner4S,项目名称:unitimes,代码行数:11,代码来源:FlowForm.java

示例3: 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

示例4: getRowForWidget

import com.google.gwt.user.client.DOM; //导入方法依赖的package包/类
public int getRowForWidget(Widget w) {
	for (Element td = w.getElement(); td != null; td = DOM.getParent(td)) {
		if (td.getPropertyString("tagName").equalsIgnoreCase("td")) {
			Element tr = DOM.getParent(td);
			Element body = DOM.getParent(tr);
			if (body == getBodyElement())
				return DOM.getChildIndex(body, tr);
		}
		if (td == getBodyElement()) { return -1; }
	}
	return -1;
}
 
开发者ID:Jenner4S,项目名称:unitimes,代码行数:13,代码来源:UniTimeTable.java

示例5: 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);
    int row = DOM.getChildIndex(body, tr);
    int col = DOM.getChildIndex(tr, td);
    if (row == 0 || col ==0) return;
    processMouseEvent(DOM.eventGetType(event), row - 1, col - 1);
}
 
开发者ID:Jenner4S,项目名称:unitimes,代码行数:11,代码来源:FreeTimePicker.java

示例6: CurriculaCourses

import com.google.gwt.user.client.DOM; //导入方法依赖的package包/类
public CurriculaCourses() {
	iTable = new UniTimeTable<String>();
	iTable.addStyleName("unitime-CurriculaCourseProjections");
	initWidget(iTable);
	iCourseChangedHandler = new CourseSelectionHandler() {
		
		@Override
		public void onCourseSelection(CourseSelectionEvent event) {
			CurriculumStudentsInterface[] c = (iLastCourses == null ? null : iLastCourses.get(event.getCourse()));
			for (int col = 0; col < iClassifications.getClassifications().size(); col ++) {
				setEnrollmentAndLastLike(event.getCourse(), col,
						c == null || c[col] == null ? null : c[col].getEnrollment(), 
						c == null || c[col] == null ? null : c[col].getLastLike(),
						c == null || c[col] == null ? null : c[col].getProjection(),
						c == null || c[col] == null ? null : c[col].getRequested(),
						c == null || c[col] == null ? null : (!c[col].isSessionHasSnapshotData() ? null : c[col].getSnapshotProjection()));
			}
			Element td = ((Widget)event.getSource()).getElement();
			while (td != null && !td.getPropertyString("tagName").equalsIgnoreCase("td")) {
				td = DOM.getParent(td);
			}
			Element tr = DOM.getParent(td);
		    Element body = DOM.getParent(tr);
		    int row = DOM.getChildIndex(body, tr);
		    if (event.getCourse().isEmpty()) {
				iTable.getRowFormatter().addStyleName(row, "unitime-NoPrint");
		    } else {
				iTable.getRowFormatter().removeStyleName(row, "unitime-NoPrint");
		    }
		    if (row + 1 == iTable.getRowCount() && !event.getCourse().isEmpty())
				addBlankLine();
		}
	};
	
	iNewGroupDialog = new GroupDialogBox();
	
	iTable.setHintProvider(new HintProvider<String>() {
		@Override
		public Widget getHint(TableEvent<String> event) {
			if (!canShowStudentsTable(event.getRow())) return null;
			StudentsTable studentsTable = new StudentsTable(event.getRow());
			if (studentsTable.canShow()) return studentsTable;
			return null;
		}
	});
}
 
开发者ID:Jenner4S,项目名称:unitimes,代码行数:47,代码来源:CurriculaCourses.java


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