本文整理汇总了Java中com.google.gwt.view.client.HasRows.isRowCountExact方法的典型用法代码示例。如果您正苦于以下问题:Java HasRows.isRowCountExact方法的具体用法?Java HasRows.isRowCountExact怎么用?Java HasRows.isRowCountExact使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.gwt.view.client.HasRows
的用法示例。
在下文中一共展示了HasRows.isRowCountExact方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addDialogWidgets
import com.google.gwt.view.client.HasRows; //导入方法依赖的package包/类
private void addDialogWidgets() {
VerticalPanel vertPanel = new VerticalPanel();
SimplePager.Resources pagerResources = GWT.create(SimplePager.Resources.class);
SimplePager pager = new SimplePager(TextLocation.CENTER, pagerResources, false, 0, true) {
@Override
public void setPageStart(int index) {
HasRows display = getDisplay();
if (display != null) {
Range range = display.getVisibleRange();
int pageSize = range.getLength();
if (isRangeLimited() && display.isRowCountExact()) {
index = Math.min(index, display.getRowCount() - 1);
}
index = Math.max(0, index);
if (index != range.getStart()) {
display.setVisibleRange(index, pageSize);
}
}
}
};
vertPanel.addStyleName("dialog-vpanel");
vertPanel.add(table);
vertPanel.add(pager);
pager.setDisplay(table);
pager.addStyleName("centered-hortz");
dialogBox.setWidget(vertPanel);
}
示例2: createText
import com.google.gwt.view.client.HasRows; //导入方法依赖的package包/类
protected String createText() {
NumberFormat formatter = NumberFormat.getFormat( "#,###" );
HasRows display = getDisplay();
Range range = display.getVisibleRange();
int pageStart = range.getStart() + 1;
int pageSize = range.getLength();
int dataSize = display.getRowCount();
int endIndex = Math.min( dataSize,
pageStart
+ pageSize
- 1 );
endIndex = Math.max( pageStart,
endIndex );
boolean exact = display.isRowCountExact();
if ( dataSize == 0 ) {
return "0 of 0";
} else if ( pageStart == endIndex ) {
return formatter.format( pageStart )
+ " of "
+ formatter.format( dataSize );
}
return formatter.format( pageStart )
+ "-"
+ formatter.format( endIndex )
+ ( exact ? " of " : " of over " )
+ formatter.format( dataSize );
}
示例3: onRangeOrRowCountChanged
import com.google.gwt.view.client.HasRows; //导入方法依赖的package包/类
@Override
protected void onRangeOrRowCountChanged() {
HasRows display = getDisplay();
label.setText( createText() );
// Update the prev and first buttons.
setPrevPageButtonsDisabled( !hasPreviousPage() );
// Update the next and last buttons.
if ( isRangeLimited() || !display.isRowCountExact() ) {
setNextPageButtonsDisabled( !hasNextPage() );
setFastForwardDisabled( !hasNextPages( getFastForwardPages() ) );
}
}
示例4: createText
import com.google.gwt.view.client.HasRows; //导入方法依赖的package包/类
/**
* Get the text to display in the pager that reflects the state of the pager.
*
* @return the text
*/
protected String createText () {
// Default text is 1 based.
NumberFormat formatter = NumberFormat.getFormat("#,###");
HasRows display = getDisplay();
Range range = display.getVisibleRange();
int pageStart = range.getStart() + 1;
int pageSize = range.getLength();
int dataSize = display.getRowCount();
int endIndex = Math.min(dataSize, pageStart + pageSize - 1);
endIndex = Math.max(pageStart, endIndex);
boolean exact = display.isRowCountExact();
return formatter.format(pageStart) + "-" + formatter.format(endIndex)
+ (exact ? " of " : " of over ") + formatter.format(dataSize);
}
示例5: onRangeOrRowCountChanged
import com.google.gwt.view.client.HasRows; //导入方法依赖的package包/类
@Override
protected void onRangeOrRowCountChanged () {
HasRows display = getDisplay();
elLabel.setInnerHTML(createText());
// Update the prev and first buttons.
setPrevPageButtonsDisabled(!hasPreviousPage());
// Update the next and last buttons.
if (isRangeLimited() || !display.isRowCountExact()) {
setNextPageButtonsDisabled(!hasNextPage());
setFastForwardDisabled(!hasNextPages(getFastForwardPages()));
}
}
示例6: createText
import com.google.gwt.view.client.HasRows; //导入方法依赖的package包/类
protected String createText() {
NumberFormat formatter = NumberFormat.getFormat("#,###");
HasRows display = getDisplay();
Range range = display.getVisibleRange();
int pageStart = range.getStart() + 1;
int pageSize = range.getLength();
int dataSize = display.getRowCount();
int endIndex = Math.min(dataSize,
pageStart
+ pageSize
- 1);
endIndex = Math.max(pageStart,
endIndex);
boolean exact = display.isRowCountExact();
if (dataSize == 0) {
return "0 " + of() + " 0";
} else if (pageStart == endIndex) {
return formatter.format(pageStart)
+ " " + of() + " "
+ formatter.format(dataSize);
}
return formatter.format(pageStart)
+ "-"
+ formatter.format(endIndex)
+ (exact ? " " + of() + " " : " " + of() + " " + over() + " ")
+ formatter.format(dataSize);
}
示例7: onRangeOrRowCountChanged
import com.google.gwt.view.client.HasRows; //导入方法依赖的package包/类
@Override
protected void onRangeOrRowCountChanged() {
HasRows display = getDisplay();
label.setText(createText());
// Update the prev and first buttons.
setPrevPageButtonsDisabled(!hasPreviousPage());
// Update the next and last buttons.
if (isRangeLimited() || !display.isRowCountExact()) {
setNextPageButtonsDisabled(!hasNextPage());
setFastForwardDisabled(!hasNextPages(getFastForwardPages()));
}
}
示例8: createText
import com.google.gwt.view.client.HasRows; //导入方法依赖的package包/类
protected String createText() {
// Default text is 1 based.
NumberFormat formatter = NumberFormat.getFormat("####");
HasRows display = getDisplay();
Range range = display.getVisibleRange();
int pageStart = range.getStart() + 1;
int pageSize = range.getLength();
int dataSize = display.getRowCount();
int endIndex = Math.min(dataSize, pageStart + pageSize - 1);
endIndex = Math.max(pageStart, endIndex);
boolean exact = display.isRowCountExact();
return formatter.format(pageStart) + "-" + formatter.format(endIndex) + (exact ? " из " : " из более ")
+ formatter.format(dataSize);
}
示例9: addDialogWidgets
import com.google.gwt.view.client.HasRows; //导入方法依赖的package包/类
private void addDialogWidgets() {
VerticalPanel vertPanel = new VerticalPanel();
HorizontalPanel filterPanel = new HorizontalPanel();
Label filterLabel = new Label("Keyword Filter:");
SimplePager.Resources pagerResources = GWT.create(SimplePager.Resources.class);
SimplePager pager = new SimplePager(TextLocation.CENTER, pagerResources, false, 0, true) {
@Override
public void setPageStart(int index) {
HasRows display = getDisplay();
if (display != null) {
Range range = display.getVisibleRange();
int pageSize = range.getLength();
if (isRangeLimited() && display.isRowCountExact()) {
index = Math.min(index, display.getRowCount() - 1);
}
index = Math.max(0, index);
if (index != range.getStart()) {
display.setVisibleRange(index, pageSize);
}
}
}
};
Button closeButton = new Button("Close");
closeButton.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
dialogBox.hide();
}
});
filterLabel.addStyleName("dialog-label");
filterPanel.addStyleName("dialog-hpanel");
filterPanel.add(filterLabel);
filterPanel.add(filterTextBox);
filterPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);
pager.addStyleName("centered-hortz");
pager.setDisplay(table);
vertPanel.addStyleName("dialog-vpanel");
vertPanel.add(filterPanel);
vertPanel.add(table);
vertPanel.add(pager);
vertPanel.add(closeButton);
vertPanel.setCellHorizontalAlignment(closeButton, HasHorizontalAlignment.ALIGN_CENTER);
dialogBox.setWidget(vertPanel);
}