View Javadoc

1   package org.appfuse.webapp.client.application.base.view;
2   
3   import javax.validation.ConstraintViolation;
4   
5   import com.google.gwt.editor.client.EditorDriver;
6   import com.google.gwt.user.cellview.client.ColumnSortEvent.Handler;
7   import com.google.gwt.user.cellview.client.ColumnSortList;
8   import com.google.gwt.user.client.ui.IsWidget;
9   import com.google.gwt.view.client.HasData;
10  import com.google.web.bindery.requestfactory.shared.BaseProxy;
11  import com.google.web.bindery.requestfactory.shared.EntityProxy;
12  
13  /**
14   * A view of a list of {@link EntityProxy}s, which declares which properties it
15   * is able to display.
16   * <p/>
17   * It is expected that such views will typically (eventually) be defined largely
18   * in ui.xml files which declare the properties of interest, which is why the
19   * view is a source of a property set rather than a receiver of one.
20   *
21   * @param <P>
22   *            the type of the records to display
23   */
24  public interface ProxySearchView<P extends EntityProxy, S> extends IsWidget {
25  
26      /**
27       * Implemented by the owner of a RecordTableView.
28       *
29       * @param <P>
30       *            the type of the records to display
31       */
32      interface Delegate<P> {
33  
34          void addClicked();
35  
36          void searchClicked();
37  
38          void cancelClicked();
39  
40          void showDetails(Class<? extends EntityProxy> proxyClass, String entityId);
41  
42          void deleteClicked(Class<? extends EntityProxy> proxyClass, String entityId);
43      }
44  
45      /**
46       * Sets the delegate.
47       */
48      void setDelegate(Delegate<P> delegate);
49  
50      void setSearchCriteria(S searchCriteria);
51  
52      S getSearchCriteria();
53  
54      boolean setConstraintViolations(Iterable<ConstraintViolation<S>> violations);
55  
56      HasData<P> asHasData();
57  
58      ColumnSortList getColumnSortList();
59  
60      void addColumnSortHandler(Handler clientSideSortHandler);
61  
62      /**
63       * @return the set of properties this view displays
64       */
65      String[] getPaths();
66  
67      /**
68       * 
69       * @param pageSize
70       */
71      void setPageSize(Integer pageSize);
72  }