本文整理了Java中com.google.gwt.view.client.Range
类的一些代码示例,展示了Range
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Range
类的具体详情如下:
包路径:com.google.gwt.view.client.Range
类名称:Range
[英]The range of interest for a single handler.
[中]单个处理程序的兴趣范围。
代码示例来源:origin: kaaproject/kaa
@Override
protected String createText() {
Range range = getDisplay().getVisibleRange();
int currentPage = range.getStart() / (range.getLength() != 0 ? range.getLength() : 1) + 1;
return Utils.messages.pagerText(currentPage + "");
}
代码示例来源:origin: kaaproject/kaa
/**
* Updates endpoint profile data.
*/
public void update() {
reset();
dataGrid.getDataGrid().setVisibleRangeAndClearData(
new Range(0, dataGrid.getPageSize()), true);
}
代码示例来源:origin: kaaproject/kaa
@Override
protected void onRangeChanged(HasData<EndpointProfileDto> display) {
if ((endpointKeyHash != null && !endpointKeyHash.isEmpty())
|| (groupId != null && !groupId.isEmpty())) {
int start = display.getVisibleRange().getStart();
if (previousStart < start) {
previousStart = start;
setLoaded(false);
}
super.onRangeChanged(display);
}
}
代码示例来源:origin: com.google.gwt/gwt-servlet
/**
* Get the page size.
*
* @return the page size, or -1 if the display is not set
* @see #setPageSize(int)
*/
public int getPageSize() {
return display == null ? -1 : display.getVisibleRange().getLength();
}
代码示例来源:origin: com.google.gwt/gwt-servlet
int pageStart = display.getVisibleRange().getStart();
if (selectRange && pageStart == lastPageStart && lastSelectedIndex > -1
&& shiftAnchor > -1 && display == lastDisplay) {
setRangeSelection(selectionModel, display, new Range(lastSelectedIndex,
start - lastSelectedIndex), !shiftAdditive, false);
} else if (lastSelectedIndex > end) {
setRangeSelection(selectionModel, display, new Range(end + 1,
lastSelectedIndex - end), !shiftAdditive, false);
} else {
setRangeSelection(selectionModel, display, new Range(start, end - start
+ 1), shiftAdditive, clearOthers);
} else {
代码示例来源:origin: com.google.gwt/gwt-servlet
/**
* Return the range start.
*
* @return the start of the range as an int
*
* @see #getVisibleRange()
* @see #setPageStart(int)
*/
public final int getPageStart() {
return getVisibleRange().getStart();
}
代码示例来源:origin: com.google.gwt/gwt-servlet
/**
* Return the range size.
*
* @return the size of the range as an int
*
* @see #getVisibleRange()
* @see #setPageSize(int)
*/
public final int getPageSize() {
return getVisibleRange().getLength();
}
代码示例来源:origin: kaaproject/kaa
@Override
public void setPageStart(int index) {
if (getDisplay() != null) {
Range range = getDisplay().getVisibleRange();
int pageSize = range.getLength();
index = Math.max(0, index);
if (index != range.getStart()) {
getDisplay().setVisibleRange(index, pageSize);
}
}
}
};
代码示例来源:origin: com.google.gwt/gwt-servlet
/**
* Update the range of replaced data.
*
* @param start the start index
* @param end the end index
*/
public void replaceRange(int start, int end) {
replacedRanges.add(new Range(start, end - start));
}
}
代码示例来源:origin: com.google.gwt/gwt-servlet
/**
* Get the page start index.
*
* @return the page start index, or -1 if the display is not set
* @see #setPageStart(int)
*/
public int getPageStart() {
return display == null ? -1 : display.getVisibleRange().getStart();
}
代码示例来源:origin: com.google.gwt/gwt-servlet
@Override
public AbstractPager create(HasRows display) {
return new PageSizePager(display.getVisibleRange().getLength());
}
}
代码示例来源:origin: com.google.gwt/gwt-servlet
/**
* Return true if this ranges's start end length are equal to those of
* the given object.
*/
@Override
public boolean equals(Object o) {
if (!(o instanceof Range)) {
return false;
}
Range r = (Range) o;
return start == r.getStart() && length == r.getLength();
}
代码示例来源:origin: com.google.gwt/gwt-servlet
@Override
public final void setVisibleRange(int start, int length) {
setVisibleRange(new Range(start, length));
}
代码示例来源:origin: com.google.gwt/gwt-servlet
/**
* Set the page size of the display.
*
* @param pageSize the new page size
* @see #getPageSize()
*/
protected void setPageSize(int pageSize) {
if (display != null) {
Range range = display.getVisibleRange();
int pageStart = range.getStart();
if (isRangeLimited && display.isRowCountExact()) {
pageStart = Math.min(pageStart, display.getRowCount() - pageSize);
}
pageStart = Math.max(0, pageStart);
display.setVisibleRange(pageStart, pageSize);
}
}
代码示例来源:origin: com.google.gwt/gwt-servlet
@Override
public void onRowCountChange(RowCountChangeEvent event) {
int rowCount = event.getNewRowCount();
boolean isExact = event.isNewRowCountExact();
int pageSize = getVisibleRange().getLength();
showOrHide(nodeView.showMoreElem, isExact && rowCount > pageSize);
}
});
代码示例来源:origin: stackoverflow.com
@Override
public void onRangeChange(RangeChangeEvent event)
{
Range range = cellTable.getVisibleRange();
int start = range.getStart();
int length = range.getLength();
List<ForumMessage> toSet = new ArrayList<ForumMessage>(length);
for (int i = start; i < start + length && i < AllMessages.size(); i++)
toSet.add((ForumMessage) AllMessages.get(i));
cellTable.setRowData(start, toSet);
}
代码示例来源:origin: com.google.gwt/gwt-servlet
@Override
public final void setVisibleRange(int start, int length) {
setVisibleRange(new Range(start, length));
}
代码示例来源:origin: com.vaadin.external.gwt/gwt-user
/**
* Get the page start index.
*
* @return the page start index, or -1 if the display is not set
* @see #setPageStart(int)
*/
public int getPageStart() {
return display == null ? -1 : display.getVisibleRange().getStart();
}
代码示例来源:origin: com.google.gwt/gwt-servlet
@Override
protected void onRangeOrRowCountChanged() {
// Assumes a page start index of 0.
HasRows display = getDisplay();
int pageSize = display.getVisibleRange().getLength();
boolean hasLess = pageSize > increment;
boolean hasMore = !display.isRowCountExact()
|| pageSize < display.getRowCount();
showLessButton.setVisible(hasLess);
showMoreButton.setVisible(hasMore);
layout.setText(0, 1, (hasLess && hasMore) ? " | " : "");
}
代码示例来源:origin: com.google.gwt/gwt-servlet
/**
* Returns true if there is enough data to display a given number of previous
* pages.
*
* @param pages the number of previous pages to query
* @return true if there are {@code pages} previous pages
*/
protected boolean hasPreviousPages(int pages) {
if (display == null) {
return false;
}
Range range = display.getVisibleRange();
return (pages - 1) * range.getLength() < range.getStart();
}
内容来源于网络,如有侵权,请联系作者删除!