本文整理了Java中com.google.gwt.user.client.Element.getScrollWidth()
方法的一些代码示例,展示了Element.getScrollWidth()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Element.getScrollWidth()
方法的具体详情如下:
包路径:com.google.gwt.user.client.Element
类名称:Element
方法名:getScrollWidth
暂无
代码示例来源:origin: com.google.gwt/gwt-servlet
private void startResizingFrom(int x, int y) {
isResizing = true;
onSplitterResizeStarted(x, y);
// Resize glassElem to take up the entire scrollable window area
int height = RootPanel.getBodyElement().getScrollHeight() - 1;
int width = RootPanel.getBodyElement().getScrollWidth() - 1;
glassElem.getStyle().setProperty("height", height + "px");
glassElem.getStyle().setProperty("width", width + "px");
RootPanel.getBodyElement().appendChild(glassElem);
}
代码示例来源:origin: com.extjs/gxt
/**
* Returns whether the element is scrollable on the x-axis.
*
* @return true if scrollable on the x-axis
*/
public boolean isScrollableX() {
return dom.getScrollWidth() > dom.getClientWidth();
}
代码示例来源:origin: sk.seges.acris/acris-widgets-beantable
@Override
public int getTableWidth(FixedWidthFlexTable table, boolean includeSpacer) {
return table.getElement().getScrollWidth();
}
代码示例来源:origin: sk.seges.acris/acris-widgets-beantable
/**
* Returns the width of a table, minus any padding, in pixels.
*
* @param table the table
* @param includeSpacer true to include the spacer width
* @return the width
*/
public int getTableWidth(FixedWidthFlexTable table, boolean includeSpacer) {
int scrollWidth = table.getElement().getScrollWidth();
if (!includeSpacer) {
int spacerWidth = getSpacerWidth(table);
if (spacerWidth > 0) {
scrollWidth -= spacerWidth;
}
}
return scrollWidth;
}
代码示例来源:origin: oVirt/ovirt-engine
protected boolean isHorizontalScrollbarVisible() {
int tableScrollWidth = this.getTableBodyElement().getScrollWidth();
return tableScrollWidth != this.getElement().getScrollWidth() && tableScrollWidth != 0;
}
代码示例来源:origin: sk.seges.acris/acris-widgets-beantable
/**
* Construct a new {@link TableWidthInfo}.
*
* @param includeSpacer true to include spacer in calculations
*/
public TableWidthInfo(boolean includeSpacer) {
availableWidth = getAvailableWidth();
headerTableWidth = impl.getTableWidth(headerTable, includeSpacer);
dataTableWidth = dataTable.getElement().getScrollWidth();
if (footerTable != null) {
footerTableWidth = impl.getTableWidth(footerTable, includeSpacer);
}
}
}
代码示例来源:origin: org.uberfire/uberfire-wires-core-grids
private Panel scrollPanel() {
final Panel panel = mock(AbsolutePanel.class);
final Element element = mock(Element.class);
doReturn(SCROLL_LEFT).when(element).getScrollLeft();
doReturn(SCROLL_TOP).when(element).getScrollTop();
doReturn(SCROLL_WIDTH).when(element).getScrollWidth();
doReturn(SCROLL_HEIGHT).when(element).getScrollHeight();
doReturn(CLIENT_WIDTH).when(element).getClientWidth();
doReturn(CLIENT_HEIGHT).when(element).getClientHeight();
doReturn(element).when(panel).getElement();
return panel;
}
代码示例来源:origin: kiegroup/appformer
private Panel scrollPanel() {
final Panel panel = mock(AbsolutePanel.class);
final Element element = mock(Element.class);
doReturn(SCROLL_LEFT).when(element).getScrollLeft();
doReturn(SCROLL_TOP).when(element).getScrollTop();
doReturn(SCROLL_WIDTH).when(element).getScrollWidth();
doReturn(SCROLL_HEIGHT).when(element).getScrollHeight();
doReturn(CLIENT_WIDTH).when(element).getClientWidth();
doReturn(CLIENT_HEIGHT).when(element).getClientHeight();
doReturn(element).when(panel).getElement();
return panel;
}
代码示例来源:origin: org.uberfire/uberfire-wires-core-grids
private Panel emptyPanel() {
final Panel panel = mock(AbsolutePanel.class);
final Element element = mock(Element.class);
doReturn(0).when(element).getScrollLeft();
doReturn(0).when(element).getScrollTop();
doReturn(0).when(element).getScrollWidth();
doReturn(0).when(element).getScrollHeight();
doReturn(0).when(element).getClientWidth();
doReturn(0).when(element).getClientHeight();
doReturn(element).when(panel).getElement();
return panel;
}
}
代码示例来源:origin: kiegroup/appformer
private Panel emptyPanel() {
final Panel panel = mock(AbsolutePanel.class);
final Element element = mock(Element.class);
doReturn(0).when(element).getScrollLeft();
doReturn(0).when(element).getScrollTop();
doReturn(0).when(element).getScrollWidth();
doReturn(0).when(element).getScrollHeight();
doReturn(0).when(element).getClientWidth();
doReturn(0).when(element).getClientHeight();
doReturn(element).when(panel).getElement();
return panel;
}
}
代码示例来源:origin: org.uberfire/uberfire-wires-core-grids
void setHorizontalScrollPosition(final Double percentage) {
final Integer scrollWidth = scrollPanel().getElement().getScrollWidth();
final Integer clientWidth = scrollPanel().getElement().getClientWidth();
final Integer max = scrollWidth - clientWidth;
setScrollLeft((int) ((max * percentage) / 100));
}
代码示例来源:origin: kiegroup/appformer
void setHorizontalScrollPosition(final Double percentage) {
final Integer scrollWidth = scrollPanel().getElement().getScrollWidth();
final Integer clientWidth = scrollPanel().getElement().getClientWidth();
final Integer max = scrollWidth - clientWidth;
setScrollLeft((int) ((max * percentage) / 100));
}
代码示例来源:origin: org.uberfire/uberfire-wires-core-grids
Double getHorizontalScrollPosition() {
final Integer scrollLeft = scrollPanel().getElement().getScrollLeft();
final Integer scrollWidth = scrollPanel().getElement().getScrollWidth();
final Integer clientWidth = scrollPanel().getElement().getClientWidth();
final Integer level = scrollWidth - clientWidth;
return level == 0 ? 0d : 100d * scrollLeft / level;
}
代码示例来源:origin: kiegroup/appformer
Double getHorizontalScrollPosition() {
final Integer scrollLeft = scrollPanel().getElement().getScrollLeft();
final Integer scrollWidth = scrollPanel().getElement().getScrollWidth();
final Integer clientWidth = scrollPanel().getElement().getClientWidth();
final Integer level = scrollWidth - clientWidth;
return level == 0 ? 0d : 100d * scrollLeft / level;
}
代码示例来源:origin: ltearno/hexa.tools
@Override
public void execute()
{
// try to fit to the content size
int maxWidth = Window.getClientWidth() - 20; // 20 pixels of
// margin
int w = Math.max( ResizablePanelBad.this.getOffsetWidth(), Math.max( contentWidget.getElement().getScrollWidth(), contentWidget.getElement().getOffsetWidth() ) ) + resizeHandlerSize * 2;
if( w > maxWidth )
w = maxWidth;
int maxHeight = Window.getClientHeight() - 20;
int h = Math.max( ResizablePanelBad.this.getOffsetHeight(), Math.max( contentWidget.getElement().getScrollHeight(), contentWidget.getElement().getOffsetHeight() ) ) + resizeHandlerSize * 2 + titleSize;
if( h > maxHeight )
h = maxHeight;
PositionAndSize posSize = new PositionAndSize( (Window.getClientWidth() - w) / 2, (Window.getClientHeight() - h) / 2, w, h );
posSize.limit();
RootLayoutPanel.get().setWidgetLeftWidth( ResizablePanelBad.this, posSize.left, Unit.PX, posSize.width, Unit.PX );
RootLayoutPanel.get().setWidgetTopHeight( ResizablePanelBad.this, posSize.top, Unit.PX, posSize.height, Unit.PX );
RootLayoutPanel.get().animate( 300 );
}
} );
代码示例来源:origin: fr.lteconsulting/hexa.core
@Override
public void execute()
{
// try to fit to the content size
int maxWidth = Window.getClientWidth() - 20; // 20 pixels of
// margin
int w = Math.max( ResizablePanelBad.this.getOffsetWidth(), Math.max( contentWidget.getElement().getScrollWidth(), contentWidget.getElement().getOffsetWidth() ) ) + resizeHandlerSize * 2;
if( w > maxWidth )
w = maxWidth;
int maxHeight = Window.getClientHeight() - 20;
int h = Math.max( ResizablePanelBad.this.getOffsetHeight(), Math.max( contentWidget.getElement().getScrollHeight(), contentWidget.getElement().getOffsetHeight() ) ) + resizeHandlerSize * 2 + titleSize;
if( h > maxHeight )
h = maxHeight;
PositionAndSize posSize = new PositionAndSize( (Window.getClientWidth() - w) / 2, (Window.getClientHeight() - h) / 2, w, h );
posSize.limit();
RootLayoutPanel.get().setWidgetLeftWidth( ResizablePanelBad.this, posSize.left, Unit.PX, posSize.width, Unit.PX );
RootLayoutPanel.get().setWidgetTopHeight( ResizablePanelBad.this, posSize.top, Unit.PX, posSize.height, Unit.PX );
RootLayoutPanel.get().animate( 300 );
}
} );
代码示例来源:origin: net.wetheinter/gwt-user
private void startResizingFrom(int x, int y) {
isResizing = true;
onSplitterResizeStarted(x, y);
// Resize glassElem to take up the entire scrollable window area
int height = RootPanel.getBodyElement().getScrollHeight() - 1;
int width = RootPanel.getBodyElement().getScrollWidth() - 1;
glassElem.getStyle().setProperty("height", height + "px");
glassElem.getStyle().setProperty("width", width + "px");
RootPanel.getBodyElement().appendChild(glassElem);
}
代码示例来源:origin: com.vaadin.external.gwt/gwt-user
private void startResizingFrom(int x, int y) {
isResizing = true;
onSplitterResizeStarted(x, y);
// Resize glassElem to take up the entire scrollable window area
int height = RootPanel.getBodyElement().getScrollHeight() - 1;
int width = RootPanel.getBodyElement().getScrollWidth() - 1;
glassElem.getStyle().setProperty("height", height + "px");
glassElem.getStyle().setProperty("width", width + "px");
RootPanel.getBodyElement().appendChild(glassElem);
}
代码示例来源:origin: org.kie.uberfire/kie-uberfire-wires-core-trees
final int scrollWidth = getElement().getScrollWidth();
final int scrollHeight = getElement().getScrollHeight();
if ( cx > scrollWidth || cy > scrollHeight ) {
代码示例来源:origin: org.uberfire/uberfire-wires-core-trees
final int scrollWidth = getElement().getScrollWidth();
final int scrollHeight = getElement().getScrollHeight();
if (cx > scrollWidth || cy > scrollHeight) {
内容来源于网络,如有侵权,请联系作者删除!