Example usage for com.google.gwt.view.client RowCountChangeEvent isNewRowCountExact

List of usage examples for com.google.gwt.view.client RowCountChangeEvent isNewRowCountExact

Introduction

In this page you can find the example usage for com.google.gwt.view.client RowCountChangeEvent isNewRowCountExact.

Prototype

public boolean isNewRowCountExact() 

Source Link

Document

Check if the new row count is exact.

Usage

From source file:org.jboss.as.console.client.shared.viewframework.EntityEditor.java

License:Open Source License

/**
 * Create a new Entity./*from   w w w.j  a  va2  s.  co  m*/
 *
 * @param entitiesName The display name (plural) of the entities.
 * @param window The window used for creating a new entity.
 * @param table The table that holds the entities.
 * @param entityDetails  The EntityDetails that manages CRUD for the selected entity.
 */
public EntityEditor(FrameworkPresenter presenter, String entitiesName, EntityPopupWindow<T> window,
        DefaultCellTable<T> table, EntityDetails<T> entityDetails, EnumSet<FrameworkButton> hideButtons) {

    this.presenter = presenter;
    this.entitiesName = entitiesName;
    this.window = window;
    this.table = table;
    this.details = entityDetails;
    this.hideButtons = hideButtons;

    // cleanup before editing
    table.addRowCountChangeHandler(new RowCountChangeEvent.Handler() {
        @Override
        public void onRowCountChange(RowCountChangeEvent event) {
            if (event.getNewRowCount() == 0 && event.isNewRowCountExact())
                details.clearValues();

        }
    });
}