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

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

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

origin: com.google.gwt/gwt-servlet

/**
 * Get the number of pages based on the data size.
 *
 * @return the page count, or -1 if the display is not set
 */
protected int getPageCount() {
 if (display == null) {
  return -1;
 }
 int pageSize = getPageSize();
 return (display.getRowCount() + pageSize - 1) / pageSize;
}
origin: com.google.gwt/gwt-servlet

/**
 * Returns true if there is enough data such that the specified page is within
 * range.
 *
 * @param index the page index
 * @return true if the specified page is in range
 */
protected boolean hasPage(int index) {
 return display == null ? false : getPageSize() * index
   < display.getRowCount();
}
origin: com.google.gwt/gwt-servlet

/**
 * Returns true if there is enough data such that a call to
 * {@link #previousPage()} will succeed in moving the starting point of the
 * table backward.
 *
 * @return true if there is a previous page
 */
protected boolean hasPreviousPage() {
 return display == null ? false : getPageStart() > 0
   && display.getRowCount() > 0;
}
origin: com.google.gwt/gwt-servlet

/**
 * Set the page start to the last index that will still show a full page.
 */
protected void lastPageStart() {
 if (display != null) {
  setPageStart(display.getRowCount() - getPageSize());
 }
}
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

/**
 * 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

/**
 * Returns true if there is enough data to display a given number of
 * additional pages.
 *
 * @param pages the number of pages to query
 * @return true if there are {@code pages} next pages
 */
protected boolean hasNextPages(int pages) {
 if (display == null) {
  return false;
 }
 Range range = display.getVisibleRange();
 return range.getStart() + pages * range.getLength() < display.getRowCount();
}
origin: com.google.gwt/gwt-servlet

 /**
  * Called when the row count changes. Only called if display is non-null.
  *
  * @param rowCount the new row count
  * @param isExact true if the row count is exact
  */
 private void handleRowCountChange(int rowCount, boolean isExact) {
  int oldRowCount = lastRowCount;
  lastRowCount = display.getRowCount();

  // If the row count has changed, limit the range.
  if (isRangeLimited && oldRowCount != lastRowCount) {
   setPageStart(getPageStart());
  }

  // Call user methods.
  onRangeOrRowCountChanged();
 }
}
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

@Override
public void setDisplay(HasRows display) {
 // Enable or disable all buttons.
 boolean disableButtons = (display == null || display.getRowCount() == 0);
 setFastForwardDisabled(disableButtons);
 setNextPageButtonsDisabled(disableButtons);
 setPrevPageButtonsDisabled(disableButtons);
 super.setDisplay(display);
}
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

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

/**
 * Returns true if there is enough data such that the specified page is within
 * range.
 *
 * @param index the page index
 * @return true if the specified page is in range
 */
protected boolean hasPage(int index) {
 return display == null ? false : getPageSize() * index
   < display.getRowCount();
}
origin: net.wetheinter/gwt-user

/**
 * Get the number of pages based on the data size.
 *
 * @return the page count, or -1 if the display is not set
 */
protected int getPageCount() {
 if (display == null) {
  return -1;
 }
 int pageSize = getPageSize();
 return (display.getRowCount() + pageSize - 1) / pageSize;
}
origin: net.wetheinter/gwt-user

/**
 * Returns true if there is enough data such that the specified page is within
 * range.
 *
 * @param index the page index
 * @return true if the specified page is in range
 */
protected boolean hasPage(int index) {
 return display == null ? false : getPageSize() * index
   < display.getRowCount();
}
origin: net.wetheinter/gwt-user

/**
 * Returns true if there is enough data such that a call to
 * {@link #previousPage()} will succeed in moving the starting point of the
 * table backward.
 *
 * @return true if there is a previous page
 */
protected boolean hasPreviousPage() {
 return display == null ? false : getPageStart() > 0
   && display.getRowCount() > 0;
}
origin: com.vaadin.external.gwt/gwt-user

/**
 * Set the page start to the last index that will still show a full page.
 */
protected void lastPageStart() {
 if (display != null) {
  setPageStart(display.getRowCount() - getPageSize());
 }
}
origin: net.wetheinter/gwt-user

@Override
public void setDisplay(HasRows display) {
 // Enable or disable all buttons.
 boolean disableButtons = (display == null || display.getRowCount() == 0);
 setFastForwardDisabled(disableButtons);
 setNextPageButtonsDisabled(disableButtons);
 setPrevPageButtonsDisabled(disableButtons);
 super.setDisplay(display);
}
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);
  }
 }
});
com.google.gwt.view.clientHasRowsgetRowCount

Javadoc

Get the total count of all rows.

Popular methods of HasRows

  • getVisibleRange
    Get the range of visible rows.
  • setVisibleRange
    Set the visible range or rows.
  • isRowCountExact
    Check if the total row count is exact, or an estimate.
  • 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 post requests using okhttp
  • getApplicationContext (Context)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • getResourceAsStream (ClassLoader)
  • System (java.lang)
    Provides access to system-related information and resources including standard input and output. Ena
  • Time (java.sql)
    Java representation of an SQL TIME value. Provides utilities to format and parse the time's represen
  • BitSet (java.util)
    The BitSet class implements abit array [http://en.wikipedia.org/wiki/Bit_array]. Each element is eit
  • Collections (java.util)
    This class consists exclusively of static methods that operate on or return collections. It contains
  • BlockingQueue (java.util.concurrent)
    A java.util.Queue that additionally supports operations that wait for the queue to become non-empty
  • Stream (java.util.stream)
    A sequence of elements supporting sequential and parallel aggregate operations. The following exampl
  • Best IntelliJ plugins
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