本文整理了Java中com.google.gwt.dom.client.Element.getScrollHeight()
方法的一些代码示例,展示了Element.getScrollHeight()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Element.getScrollHeight()
方法的具体详情如下:
包路径:com.google.gwt.dom.client.Element
类名称:Element
方法名:getScrollHeight
[英]The height of the scroll view of an element.
[中]元素滚动视图的高度。
代码示例来源:origin: com.google.gwt/gwt-servlet
/**
* The height of the scrollable area of the document.
*
* @return the height of the document's scrollable area
*/
public final int getScrollHeight() {
// TODO(dramaix): Use document.scrollingElement when its available. See getScrollLeft().
return getViewportElement().getScrollHeight();
}
代码示例来源:origin: com.google.gwt/gwt-servlet
@Override
protected void onStart() {
scrollHeight = 0;
// If the TreeItem is already open, we can get its scrollHeight
// immediately.
if (!opening) {
scrollHeight = curItem.childSpanElem.getScrollHeight();
}
curItem.childSpanElem.getStyle().setProperty("overflow", "hidden");
// If the TreeItem is already open, onStart will set its height to its
// natural height. If the TreeItem is currently closed, onStart will set
// its height to 1px (see onUpdate below), and then we make the TreeItem
// visible so we can get its correct scrollHeight.
super.onStart();
// If the TreeItem is currently closed, we need to make it visible before
// we can get its height.
if (opening) {
UIObject.setVisible(curItem.childSpanElem, true);
scrollHeight = curItem.childSpanElem.getScrollHeight();
}
}
代码示例来源:origin: com.google.gwt/gwt-servlet
public int getMaximumVerticalScrollPosition() {
return getScrollableElement().getScrollHeight() - getElement().getClientHeight();
}
代码示例来源:origin: com.google.gwt/gwt-servlet
@Override
protected void onStart() {
if (opening) {
animFrame.getStyle().setHeight(1.0, Unit.PX);
animFrame.getStyle().setPosition(Position.RELATIVE);
animFrame.getStyle().clearDisplay();
height = contentContainer.getScrollHeight();
} else {
height = contentContainer.getOffsetHeight();
}
}
代码示例来源:origin: stephenh/tessell
@Override
public int getScrollHeight() {
return element.getScrollHeight();
}
代码示例来源:origin: com.google.gwt/gwt-servlet
collapsible.setScrollTop(collapsible.getScrollHeight() + 100);
collapsible.setScrollLeft(collapsible.getScrollWidth() + 100);
代码示例来源:origin: net.wetheinter/gwt-user
/**
* The height of the scrollable area of the document.
*
* @return the height of the document's scrollable area
*/
public final int getScrollHeight() {
return getViewportElement().getScrollHeight();
}
代码示例来源:origin: com.vaadin.external.gwt/gwt-user
/**
* The height of the scrollable area of the document.
*
* @return the height of the document's scrollable area
*/
public final int getScrollHeight() {
// TODO(dramaix): Use document.scrollingElement when its available. See getScrollLeft().
return getViewportElement().getScrollHeight();
}
代码示例来源:origin: oVirt/ovirt-engine
/**
* Uses scrollHeight to detect vertical overflow.
*/
public static boolean detectVerticalOverflow(Element element) {
int scrollHeight = element.getScrollHeight();
int clientHeight = element.getClientHeight();
return scrollHeight > clientHeight;
}
代码示例来源:origin: net.wetheinter/gwt-user
@Override
protected void onStart() {
scrollHeight = 0;
// If the TreeItem is already open, we can get its scrollHeight
// immediately.
if (!opening) {
scrollHeight = curItem.childSpanElem.getScrollHeight();
}
curItem.childSpanElem.getStyle().setProperty("overflow", "hidden");
// If the TreeItem is already open, onStart will set its height to its
// natural height. If the TreeItem is currently closed, onStart will set
// its height to 1px (see onUpdate below), and then we make the TreeItem
// visible so we can get its correct scrollHeight.
super.onStart();
// If the TreeItem is currently closed, we need to make it visible before
// we can get its height.
if (opening) {
UIObject.setVisible(curItem.childSpanElem, true);
scrollHeight = curItem.childSpanElem.getScrollHeight();
}
}
代码示例来源:origin: com.vaadin.external.gwt/gwt-user
@Override
protected void onStart() {
scrollHeight = 0;
// If the TreeItem is already open, we can get its scrollHeight
// immediately.
if (!opening) {
scrollHeight = curItem.childSpanElem.getScrollHeight();
}
curItem.childSpanElem.getStyle().setProperty("overflow", "hidden");
// If the TreeItem is already open, onStart will set its height to its
// natural height. If the TreeItem is currently closed, onStart will set
// its height to 1px (see onUpdate below), and then we make the TreeItem
// visible so we can get its correct scrollHeight.
super.onStart();
// If the TreeItem is currently closed, we need to make it visible before
// we can get its height.
if (opening) {
UIObject.setVisible(curItem.childSpanElem, true);
scrollHeight = curItem.childSpanElem.getScrollHeight();
}
}
代码示例来源:origin: net.wetheinter/gwt-user
public int getMaximumVerticalScrollPosition() {
return getScrollableElement().getScrollHeight() - getElement().getClientHeight();
}
代码示例来源:origin: com.vaadin.external.gwt/gwt-user
public int getMaximumVerticalScrollPosition() {
return getScrollableElement().getScrollHeight() - getElement().getClientHeight();
}
代码示例来源:origin: com.github.gwtmaterialdesign/gwt-material-addins
/**
* Determine if scroll bar is present in the scroll panel
*/
public boolean hasScrollBar() {
return $(getElement()).get(0).getScrollHeight() > $(getElement()).outerHeight();
}
代码示例来源:origin: net.wetheinter/gwt-user
@Override
protected void onStart() {
if (opening) {
animFrame.getStyle().setHeight(1.0, Unit.PX);
animFrame.getStyle().setPosition(Position.RELATIVE);
animFrame.getStyle().clearDisplay();
height = contentContainer.getScrollHeight();
} else {
height = contentContainer.getOffsetHeight();
}
}
代码示例来源:origin: com.vaadin.external.gwt/gwt-user
@Override
protected void onStart() {
if (opening) {
animFrame.getStyle().setHeight(1.0, Unit.PX);
animFrame.getStyle().setPosition(Position.RELATIVE);
animFrame.getStyle().clearDisplay();
height = contentContainer.getScrollHeight();
} else {
height = contentContainer.getOffsetHeight();
}
}
代码示例来源:origin: com.vaadin.addon/vaadin-touchkit-agpl
private void scrollToWidget() {
try {
com.google.gwt.dom.client.Element e;
if (element == null) {
e = w.getElement().getParentElement();
while (e != null && !isScrollable(e)) {
e = e.getParentElement();
}
} else {
e = element;
}
e.setScrollTop(e.getScrollHeight());
} catch (Exception e) {
}
// Sanity check
w.getElement().scrollIntoView();
}
}
代码示例来源:origin: org.vaadin.addons/dragdroplayouts
private boolean isEventOnScrollBar(NativeEvent event) {
Element element = Element.as(event.getEventTarget());
;
if (WidgetUtil.mayHaveScrollBars(element)) {
final int nativeScrollbarSize = WidgetUtil.getNativeScrollbarSize();
int x = WidgetUtil.getTouchOrMouseClientX(event)
- element.getAbsoluteLeft();
int y = WidgetUtil.getTouchOrMouseClientY(event)
- element.getAbsoluteTop();
// Hopefully we have horizontal scroll.
final int scrollWidth = element.getScrollWidth();
final int clientWidth = element.getClientWidth();
if (scrollWidth > clientWidth
&& clientWidth - nativeScrollbarSize < x) {
return true;
}
// Hopefully we have vertical scroll.
final int scrollHeight = element.getScrollHeight();
final int clientHeight = element.getClientHeight();
if (scrollHeight > clientHeight
&& clientHeight - nativeScrollbarSize < y) {
return true;
}
}
return false;
}
代码示例来源:origin: com.haulmont.cuba/cuba-web-toolkit
private boolean isEventOnScrollBar(NativeEvent event) {
Element element = Element.as(event.getEventTarget());
;
if (WidgetUtil.mayHaveScrollBars(element)) {
final int nativeScrollbarSize = WidgetUtil.getNativeScrollbarSize();
int x = WidgetUtil.getTouchOrMouseClientX(event)
- element.getAbsoluteLeft();
int y = WidgetUtil.getTouchOrMouseClientY(event)
- element.getAbsoluteTop();
// Hopefully we have horizontal scroll.
final int scrollWidth = element.getScrollWidth();
final int clientWidth = element.getClientWidth();
if (scrollWidth > clientWidth
&& clientWidth - nativeScrollbarSize < x) {
return true;
}
// Hopefully we have vertical scroll.
final int scrollHeight = element.getScrollHeight();
final int clientHeight = element.getClientHeight();
if (scrollHeight > clientHeight
&& clientHeight - nativeScrollbarSize < y) {
return true;
}
}
return false;
}
代码示例来源:origin: Putnami/putnami-web-toolkit
public void doCollapse(final boolean collapse) {
if (collapse != this.collapsed) {
EventBus.get().fireEventFromSource(new CollapseEvent(CollapseHelper.this, collapse), CollapseHelper.this);
this.collapsableElement.getStyle().setHeight(this.collapsableElement.getOffsetHeight(), Unit.PX);
StyleUtils.removeStyle(this.collapsableElement, CollapseHelper.STYLE_COLLAPSE);
StyleUtils.removeStyle(this.collapsableElement, CollapseHelper.STYLE_VISIBLE);
StyleUtils.addStyle(this.collapsableElement, CollapseHelper.STYLE_COLLAPSING);
final int endHeight = collapse ? 0 : this.collapsableElement.getScrollHeight();
Scheduler.get().scheduleDeferred(new ScheduledCommand() {
@Override
public void execute() {
CollapseHelper.this.collapsableElement.getStyle().setHeight(endHeight, Unit.PX);
}
});
Scheduler.get().scheduleFixedDelay(new RepeatingCommand() {
@Override
public boolean execute() {
CollapseHelper.this.collapsableElement.getStyle().clearHeight();
StyleUtils.removeStyle(CollapseHelper.this.collapsableElement, CollapseHelper.STYLE_COLLAPSING);
StyleUtils.addStyle(CollapseHelper.this.collapsableElement, CollapseHelper.STYLE_COLLAPSE);
StyleUtils.toggleStyle(CollapseHelper.this.collapsableElement, CollapseHelper.STYLE_VISIBLE, !collapse);
return false;
}
}, 350);
this.collapsed = collapse;
}
}
内容来源于网络,如有侵权,请联系作者删除!