当前位置: 首页>>代码示例>>Java>>正文


Java HasRows类代码示例

本文整理汇总了Java中com.google.gwt.view.client.HasRows的典型用法代码示例。如果您正苦于以下问题:Java HasRows类的具体用法?Java HasRows怎么用?Java HasRows使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


HasRows类属于com.google.gwt.view.client包,在下文中一共展示了HasRows类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: ShowMorePagerPanel

import com.google.gwt.view.client.HasRows; //导入依赖的package包/类
/**
 * Construct a new {@link ShowMorePagerPanel}.
 */
public ShowMorePagerPanel() {
  initWidget(scrollable);

  // Do not let the scrollable take tab focus.
  scrollable.getElement().setTabIndex(-1);

  // Handle scroll events.
  scrollable.addScrollHandler(new ScrollHandler() {
    public void onScroll(ScrollEvent event) {
      // If scrolling up, ignore the event.
      int oldScrollPos = lastScrollPos;
      lastScrollPos = scrollable.getVerticalScrollPosition();
      if (oldScrollPos >= lastScrollPos) {
        return;
      }

      HasRows display = getDisplay();
      if (display == null) {
        return;
      }
      int maxScrollTop = scrollable.getWidget().getOffsetHeight()
          - scrollable.getOffsetHeight();
      if (lastScrollPos >= maxScrollTop) {
        // We are near the end, so increase the page size.
        int newPageSize = Math.min(
            display.getVisibleRange().getLength() + incrementSize,
            display.getRowCount());
        display.setVisibleRange(0, newPageSize);
      }
    }
  });
}
 
开发者ID:Peergos,项目名称:Peergos,代码行数:36,代码来源:ShowMorePagerPanel.java

示例2: 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);
}
 
开发者ID:Novartis,项目名称:ontobrowser,代码行数:33,代码来源:ControlledVocabularyTermLinksView.java

示例3: setDisplay

import com.google.gwt.view.client.HasRows; //导入依赖的package包/类
@Override
public void setDisplay( HasRows display ) {
    // Enable or disable all buttons.
    boolean disableButtons = ( display == null );
    setFastForwardDisabled( disableButtons );
    setNextPageButtonsDisabled( disableButtons );
    setPrevPageButtonsDisabled( disableButtons );
    super.setDisplay( display );
}
 
开发者ID:Teiid-Designer,项目名称:teiid-webui,代码行数:10,代码来源:TeiidSimplePager.java

示例4: 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 );
}
 
开发者ID:Teiid-Designer,项目名称:teiid-webui,代码行数:28,代码来源:TeiidSimplePager.java

示例5: 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() ) );
    }
}
 
开发者ID:Teiid-Designer,项目名称:teiid-webui,代码行数:15,代码来源:TeiidSimplePager.java

示例6: setDisplay

import com.google.gwt.view.client.HasRows; //导入依赖的package包/类
@Override
public void setDisplay (HasRows display) {
	// Enable or disable all buttons.
	boolean disableButtons = (display == null);

	setFastForwardDisabled(disableButtons);
	setNextPageButtonsDisabled(disableButtons);
	setPrevPageButtonsDisabled(disableButtons);

	super.setDisplay(display);
}
 
开发者ID:billy1380,项目名称:blogwt,代码行数:12,代码来源:SimplePager.java

示例7: 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);
}
 
开发者ID:billy1380,项目名称:blogwt,代码行数:20,代码来源:SimplePager.java

示例8: 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()));
	}
}
 
开发者ID:billy1380,项目名称:blogwt,代码行数:15,代码来源:SimplePager.java

示例9: setDisplay

import com.google.gwt.view.client.HasRows; //导入依赖的package包/类
@Override
public void setDisplay(HasRows display) {
    // Enable or disable all buttons.
    boolean disableButtons = (display == null);
    setFastForwardDisabled(disableButtons);
    setNextPageButtonsDisabled(disableButtons);
    setPrevPageButtonsDisabled(disableButtons);
    super.setDisplay(display);
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:10,代码来源:UberfireSimplePager.java

示例10: 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);
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:28,代码来源:UberfireSimplePager.java

示例11: 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()));
    }
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:15,代码来源:UberfireSimplePager.java

示例12: onRangeOrRowCountChanged

import com.google.gwt.view.client.HasRows; //导入依赖的package包/类
@Override
protected void onRangeOrRowCountChanged() {
    HasRows display = getDisplay();
    Range range = display.getVisibleRange();
    int start = range.getStart();
    int end = start + range.getLength();
    label.setText(start + 1 + " - " + end + " : " + display.getRowCount());
}
 
开发者ID:arteezy,项目名称:infinite-scroll-gwt,代码行数:9,代码来源:RangeLabelPager.java

示例13: 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);
}
 
开发者ID:rkfg,项目名称:gwtutil,代码行数:15,代码来源:RuSimplePager.java

示例14: setDisplay

import com.google.gwt.view.client.HasRows; //导入依赖的package包/类
@Override
public void setDisplay(HasRows display) {
	if (display instanceof Widget)
		scrollable.setWidget((Widget) display);

	super.setDisplay(display);
}
 
开发者ID:burakince,项目名称:open-course-organizer,代码行数:8,代码来源:EventPager.java

示例15: onRangeOrRowCountChanged

import com.google.gwt.view.client.HasRows; //导入依赖的package包/类
@Override
protected void onRangeOrRowCountChanged() {
  HasRows display = getDisplay();
  Range range = display.getVisibleRange();
  int start = range.getStart();
  int end = start + range.getLength();
  label.setText(start + " - " + end + " : " + display.getRowCount(),
      HasDirection.Direction.LTR);
}
 
开发者ID:Peergos,项目名称:Peergos,代码行数:10,代码来源:RangeLabelPager.java


注:本文中的com.google.gwt.view.client.HasRows类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。