Tabnine Logo
HasRows.isRowCountExact
Code IndexAdd Tabnine to your IDE (free)

How to use
isRowCountExact
method
in
com.google.gwt.view.client.HasRows

Best Java code snippets using com.google.gwt.view.client.HasRows.isRowCountExact (Showing top 20 results out of 315)

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

/**
 * Go to a specific page.
 *
 * @param index the page index
 * @see #getPage()
 */
protected void setPage(int index) {
 if (display != null
   && (!isRangeLimited || !display.isRowCountExact() || hasPage(index))) {
  // We don't use the local version of setPageStart because it would
  // constrain the index, but the user probably wants to use absolute page
  // indexes.
  int pageSize = getPageSize();
  display.setVisibleRange(pageSize * index, pageSize);
 }
}
origin: com.google.gwt/gwt-servlet

/**
 * Set the page start index.
 *
 * @param index the index
 * @see #getPageStart()
 */
protected void setPageStart(int index) {
 if (display != null) {
  Range range = display.getVisibleRange();
  int pageSize = range.getLength();
  if (isRangeLimited && display.isRowCountExact()) {
   index = Math.min(index, display.getRowCount() - pageSize);
  }
  index = Math.max(0, index);
  if (index != range.getStart()) {
   display.setVisibleRange(index, pageSize);
  }
 }
}
origin: com.google.gwt/gwt-servlet

 public void onClick(ClickEvent event) {
  // Display should be non-null, but we check defensively.
  HasRows display = getDisplay();
  if (display != null) {
   Range range = display.getVisibleRange();
   int pageSize = Math.min(range.getLength() + increment,
     display.getRowCount()
       + (display.isRowCountExact() ? 0 : increment));
   display.setVisibleRange(range.getStart(), pageSize);
  }
 }
});
origin: com.google.gwt/gwt-servlet

/**
 * Returns true if there is enough data such that a call to
 * {@link #nextPage()} will succeed in moving the starting point of the table
 * forward.
 *
 * @return true if there is a next page
 */
protected boolean hasNextPage() {
 if (display == null || display.getRowCount() == 0) {
  return false;
 } else if (!display.isRowCountExact()) {
  return true;
 }
 Range range = display.getVisibleRange();
 return range.getStart() + range.getLength() < display.getRowCount();
}
origin: com.google.gwt/gwt-servlet

/**
 * 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);
}
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

@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()));
 }
}
origin: com.vaadin.external.gwt/gwt-user

/**
 * Go to a specific page.
 *
 * @param index the page index
 * @see #getPage()
 */
protected void setPage(int index) {
 if (display != null
   && (!isRangeLimited || !display.isRowCountExact() || hasPage(index))) {
  // We don't use the local version of setPageStart because it would
  // constrain the index, but the user probably wants to use absolute page
  // indexes.
  int pageSize = getPageSize();
  display.setVisibleRange(pageSize * index, pageSize);
 }
}
origin: net.wetheinter/gwt-user

 public void onClick(ClickEvent event) {
  // Display should be non-null, but we check defensively.
  HasRows display = getDisplay();
  if (display != null) {
   Range range = display.getVisibleRange();
   int pageSize = Math.min(range.getLength() + increment,
     display.getRowCount()
       + (display.isRowCountExact() ? 0 : increment));
   display.setVisibleRange(range.getStart(), pageSize);
  }
 }
});
origin: com.vaadin.external.gwt/gwt-user

 public void onClick(ClickEvent event) {
  // Display should be non-null, but we check defensively.
  HasRows display = getDisplay();
  if (display != null) {
   Range range = display.getVisibleRange();
   int pageSize = Math.min(range.getLength() + increment,
     display.getRowCount()
       + (display.isRowCountExact() ? 0 : increment));
   display.setVisibleRange(range.getStart(), pageSize);
  }
 }
});
origin: org.jboss.ballroom/widgets

@Override
public void setPageStart(int index) {
  HasRows display = getDisplay();
  if (display != null) {
    Range range = display.getVisibleRange();
    int pageSize = range.getLength();
    if ((!isRangeLimited() || display.getRowCount() <= pageSize) && display.isRowCountExact()) {
      index = Math.min(index, display.getRowCount() - pageSize);
    }
    index = Math.max(0, index);
    if (index != range.getStart()) {
      display.setVisibleRange(index, pageSize);
    }
  }
}
origin: net.wetheinter/gwt-user

@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.vaadin.external.gwt/gwt-user

@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: kiegroup/appformer

@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()));
  }
}
origin: gwtbootstrap/gwt-bootstrap

@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()));
  }
}
origin: org.kie.guvnor/guvnor-commons-ui

@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() ) );
  }
}
origin: com.vaadin.external.gwt/gwt-user

@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()));
 }
}
origin: org.uberfire/uberfire-widgets-table

@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()));
  }
}
origin: net.wetheinter/gwt-user

@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()));
 }
}
com.google.gwt.view.clientHasRowsisRowCountExact

Javadoc

Check if the total row count is exact, or an estimate.

Popular methods of HasRows

  • getVisibleRange
    Get the range of visible rows.
  • setVisibleRange
    Set the visible range or rows.
  • getRowCount
    Get the total count of all rows.
  • setRowCount
    Set the total count of all rows, specifying whether the count is exact or an estimate.
  • addRangeChangeHandler
    Add a RangeChangeEvent.Handler.
  • addRowCountChangeHandler
    Add a RowCountChangeEvent.Handler.
  • fireEvent

Popular in Java

  • Making http requests using okhttp
  • getContentResolver (Context)
  • findViewById (Activity)
  • getSupportFragmentManager (FragmentActivity)
  • Color (java.awt)
    The Color class is used to encapsulate colors in the default sRGB color space or colors in arbitrary
  • String (java.lang)
  • SocketTimeoutException (java.net)
    This exception is thrown when a timeout expired on a socket read or accept operation.
  • Stack (java.util)
    Stack is a Last-In/First-Out(LIFO) data structure which represents a stack of objects. It enables u
  • JarFile (java.util.jar)
    JarFile is used to read jar entries and their associated data from jar files.
  • Collectors (java.util.stream)
  • CodeWhisperer alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now