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


Java Element類代碼示例

本文整理匯總了Java中com.google.gwt.dom.client.Element的典型用法代碼示例。如果您正苦於以下問題:Java Element類的具體用法?Java Element怎麽用?Java Element使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


Element類屬於com.google.gwt.dom.client包,在下文中一共展示了Element類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: scrollToSelectedRow

import com.google.gwt.dom.client.Element; //導入依賴的package包/類
private void scrollToSelectedRow() {
	int row = iTable.getSelectedRow();
	if (row < 0) return;
	
	Element scroll = iScroll.getElement();
	
	Element item = iTable.getRowFormatter().getElement(iTable.getSelectedRow());
	if (item==null) return;
	
	int realOffset = 0;
	while (item !=null && !item.equals(scroll)) {
		realOffset += item.getOffsetTop();
		item = item.getOffsetParent();
	}
	
	scroll.setScrollTop(realOffset - scroll.getOffsetHeight() / 2);
}
 
開發者ID:Jenner4S,項目名稱:unitimes,代碼行數:18,代碼來源:Lookup.java

示例2: getSubmitCompleteHandler

import com.google.gwt.dom.client.Element; //導入依賴的package包/類
private SubmitCompleteHandler getSubmitCompleteHandler() {
	return new SubmitCompleteHandler() {
		public void onSubmitComplete(final SubmitCompleteEvent event) {

			final Element label = DOM.createLabel();
			label.setInnerHTML(event.getResults());

			final String csvData = label.getInnerText();
			if (hasError(csvData)) {
				showAlert("Error: " + csvData);
			} else {
				parseCsvData(csvData);
				autoMessageBox.hide();
			}
		}

		private boolean hasError(final String contentFile) {
			return contentFile.startsWith("413")
					|| contentFile.startsWith("500");
		}
	};
}
 
開發者ID:geowe,項目名稱:sig-seguimiento-vehiculos,代碼行數:23,代碼來源:JoinDataTool.java

示例3: scrollToSelectedRow

import com.google.gwt.dom.client.Element; //導入依賴的package包/類
protected void scrollToSelectedRow() {
	if (iCourses.getSelectedRow() < 0) return;
	
	Element scroll = iCoursesPanel.getElement();
	
	com.google.gwt.dom.client.Element item = iCourses.getRowFormatter().getElement(iCourses.getSelectedRow());
	if (item==null) return;
	
	int realOffset = 0;
	while (item !=null && !item.equals(scroll)) {
		realOffset += item.getOffsetTop();
		item = item.getOffsetParent();
	}
	
	scroll.setScrollTop(realOffset - scroll.getOffsetHeight() / 2);
}
 
開發者ID:Jenner4S,項目名稱:unitimes,代碼行數:17,代碼來源:CourseFinderCourses.java

示例4: scrollToSelectedRow

import com.google.gwt.dom.client.Element; //導入依賴的package包/類
protected void scrollToSelectedRow() {
	if (iDegreePlanTable.getSelectedRow() < 0) return;
	
	Element scroll = iDegreePlanPanel.getElement();
	
	com.google.gwt.dom.client.Element item = iDegreePlanTable.getRowFormatter().getElement(iDegreePlanTable.getSelectedRow());
	if (item == null) return;
	
	int realOffset = 0;
	while (item !=null && !item.equals(scroll)) {
		realOffset += item.getOffsetTop();
		item = item.getOffsetParent();
	}
	
	scroll.setScrollTop(realOffset - scroll.getOffsetHeight() / 2);
}
 
開發者ID:Jenner4S,項目名稱:unitimes,代碼行數:17,代碼來源:DegreePlanDialog.java

示例5: getAssessmentHeaderViewSocket

import com.google.gwt.dom.client.Element; //導入依賴的package包/類
@Override
public ViewSocket getAssessmentHeaderViewSocket() {
    Element element = getViewJs(extensionJsObject);
    Widget widget = null;
    if (element != null) {
        widget = new ElementWrapperWidget(element);
    }

    final Widget widget2 = widget;

    return new ViewSocket() {
        @Override
        public Widget getView() {
            return widget2;
        }
    };
}
 
開發者ID:YoungDigitalPlanet,項目名稱:empiria.player,代碼行數:18,代碼來源:JsAssessmentHeaderViewExtension.java

示例6: getElementByVaadinWidget

import com.google.gwt.dom.client.Element; //導入依賴的package包/類
public static Element getElementByVaadinWidget(Widget widget, VaadinWidgetType widgetType) {
    if (widgetType == null) {
        return widget.getElement();
    }

    switch (widgetType) {
        case TEXTFIELD:
            return widget.getElement();
        case DATEFIELD:
            return ((VAbstractTextualDate) widget).text.getElement();
        case COMBOBOX:
            return ((VComboBox) widget).tb.getElement();
        case CHECKBOXGROUP:
            // returning the outer div for styling purpose
            return widget.getElement();
        case CHECKBOX:
            // returning the outer div for styling purpose
            return widget.getElement();
        case NATIVESELECT:
            return ((VNativeSelect) widget).getListBox().getElement();
        default:
            return widget.getElement();
    }
}
 
開發者ID:knoobie,項目名稱:bootstrap-formgroup,代碼行數:25,代碼來源:VaadinWidgetUtils.java

示例7: getAssessmentFooterViewSocket

import com.google.gwt.dom.client.Element; //導入依賴的package包/類
@Override
public ViewSocket getAssessmentFooterViewSocket() {
    Element e = getViewJs(extensionJsObject);
    Widget w = null;
    if (e != null)
        w = new ElementWrapperWidget(e);

    final Widget w2 = w;

    return new ViewSocket() {
        @Override
        public Widget getView() {
            return w2;
        }
    };
}
 
開發者ID:YoungDigitalPlanet,項目名稱:empiria.player,代碼行數:17,代碼來源:JsAssessmentFooterViewExtension.java

示例8: registerTouchEvents

import com.google.gwt.dom.client.Element; //導入依賴的package包/類
private native void registerTouchEvents(Element element)/*-{
    var instance = this;
    element.ontouchstart = function (e) {
        e.preventDefault();
        if (e.touches.length == 1) {
            var touch = e.touches[0];
            [email protected]::processOnTouchStartEvent(II)(touch.pageX, touch.pageY);
        }
    }

    element.ontouchmove = function (e) {
        e.preventDefault();
        if (e.touches.length == 1) {
            var touch = e.touches[0];
            [email protected]::processOnTouchMoveEvent(II)(touch.pageX, touch.pageY);
        }
    }

    element.ontouchend = function (e) {
        e.preventDefault();
        [email protected]::processOnTouchEndEvent()();
    }

}-*/;
 
開發者ID:YoungDigitalPlanet,項目名稱:empiria.player,代碼行數:25,代碼來源:TouchablePanel.java

示例9: showHintForExam

import com.google.gwt.dom.client.Element; //導入依賴的package包/類
public static void showHintForExam(final Element relativeObject, final Long examId, final Long periodId) {
	sLastLocationId = examId;
	sShowHint = true;
	RPC.execute(RoomInterface.PeriodPreferenceRequest.loadForExam(examId, null), new AsyncCallback<RoomInterface.PeriodPreferenceModel>() {
		@Override
		public void onFailure(Throwable caught) {
		}
		
		@Override
		public void onSuccess(RoomInterface.PeriodPreferenceModel result) {
			if (examId.equals(sLastLocationId) && sShowHint && result != null) {
				if (periodId != null) result.setAssignedPeriodId(periodId);
				GwtHint.showHint(relativeObject, content(result));
			}
		}
	});
}
 
開發者ID:Jenner4S,項目名稱:unitimes,代碼行數:18,代碼來源:PeriodPreferencesHint.java

示例10: setPropertyTest

import com.google.gwt.dom.client.Element; //導入依賴的package包/類
@Test
public void setPropertyTest() {
    // prepare
    Map<String, String> propertyStyle = new HashMap<String, String>();
    propertyStyle.put("lineWidth", "0");
    propertyStyle.put("lineCap", "miter");
    propertyStyle.put("lineJoin", "square");
    propertyStyle.put("miterLimit", "3");

    // test
    testObject.applyStyles(mock(Element.class), propertyStyle);
    verify(nativeStyleHelper, times(4)).applyProperty(any(Element.class), any(String.class), any(String.class));
    for (Map.Entry<String, String> entry : propertyStyle.entrySet()) {
        verify(nativeStyleHelper).applyProperty(any(Element.class), Matchers.eq(entry.getKey()), Matchers.eq(entry.getValue()));
    }
}
 
開發者ID:YoungDigitalPlanet,項目名稱:empiria.player,代碼行數:17,代碼來源:StyleToPropertyMappingHelperTest.java

示例11: callFunctionTest

import com.google.gwt.dom.client.Element; //導入依賴的package包/類
@Test
public void callFunctionTest() {
    // prepare
    Map<String, String> propertyStyle = new HashMap<String, String>();
    propertyStyle.put("lineWidth", "0");
    propertyStyle.put("lineCap", "miter");
    propertyStyle.put("lineJoin", "square");
    propertyStyle.put("miterLimit", "3");
    propertyStyle.put("fn-lineCap", "miter");
    propertyStyle.put("fn-lineJoin", "square");
    propertyStyle.put("fn-miterLimit", "3");
    // test
    testObject.applyStyles(mock(Element.class), propertyStyle);
    verify(nativeStyleHelper, times(0)).callFunction(any(Element.class), any(String.class), any(String.class));
    testObject.addFunctionToWhiteList("lineCap");
    testObject.addFunctionToWhiteList("miterLimit");
    testObject.applyStyles(mock(Element.class), propertyStyle);
    verify(nativeStyleHelper, times(2)).callFunction(any(Element.class), any(String.class), any(String.class));
}
 
開發者ID:YoungDigitalPlanet,項目名稱:empiria.player,代碼行數:20,代碼來源:StyleToPropertyMappingHelperTest.java

示例12: showHint

import com.google.gwt.dom.client.Element; //導入依賴的package包/類
public static void showHint(final Element relativeObject, final String instructorId, boolean includeNotAvailable, final String pattern) {
	sLastInstructorId = instructorId;
	RPC.execute(InstructorAvailabilityRequest.load(instructorId, includeNotAvailable), new AsyncCallback<InstructorAvailabilityModel>() {
		@Override
		public void onFailure(Throwable caught) {
		}

		@Override
		public void onSuccess(InstructorAvailabilityModel result) {
			if (pattern != null)
				result.setPattern(pattern);
			if (instructorId.equals(sLastInstructorId) && result != null)
				GwtHint.showHint(relativeObject, content(result));
		}
	});
}
 
開發者ID:Jenner4S,項目名稱:unitimes,代碼行數:17,代碼來源:InstructorAvailabilityHint.java

示例13: onBrowserEvent

import com.google.gwt.dom.client.Element; //導入依賴的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

示例14: getInput

import com.google.gwt.dom.client.Element; //導入依賴的package包/類
private Element getInput() {
    if (VaadinWidgetType.CHECKBOX.equals(widgetType)) {
        // we want to apply aria attributes to the input / not the styling div
        return widgetElement.getFirstChildElement();
    } else if (VaadinWidgetType.CHECKBOXGROUP.equals(widgetType)) {
        // just a reminder - CheckBoxGroup can have the describedby here because
        // the outer div has tabindex and is kinda like a fieldset for all inputs.
        return widgetElement;
    }

    // anything else
    return widgetElement;
}
 
開發者ID:knoobie,項目名稱:bootstrap-formgroup,代碼行數:14,代碼來源:ClientSideFormGroup.java

示例15: getRowForWidget

import com.google.gwt.dom.client.Element; //導入依賴的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


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