org.eclipse.jface.viewers.AbstractListViewer Java Examples

The following examples show how to use org.eclipse.jface.viewers.AbstractListViewer. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ListContentProvider.java    From depan with Apache License 2.0 4 votes vote down vote up
public ListContentProvider(AbstractListViewer viewer) {
  this.viewer = viewer;
}
 
Example #2
Source File: PageLoaderStrategyHelper.java    From nebula with Eclipse Public License 2.0 3 votes vote down vote up
/**
 * This method loads the paginated list by using the given page loader
 * {@link IPageLoader} and information about pagination from the given
 * controller {@link PageableController}. After loading paginated list
 * returned in a pagination structure {@link PageResult}, this method :
 * 
 * <ul>
 * <li>update the total elements of the given controller
 * {@link PageableController}</li>
 * <li>refresh the given {@link Viewer} by replacing data with the new
 * paginated list.</li>
 * </ul>
 * 
 * @param controller
 *            the controller to use to load paginated list and update the
 *            total elements.
 * @param viewer
 *            the viewer to refresh with new paginated list.
 * @param pageLoader
 *            the page loader used to load paginated list.
 * @pageContentProvider the page content provider to retrieves total
 *                      elements+paginated list from the page result
 *                      structure returned by the pageLoader.
 * @param handler
 *            the page loader handler to observe before/after page loading
 *            process. If null no observation is done.
 */
public static void loadPageAndAddItems(final PageableController controller,
		final AbstractListViewer viewer, final IPageLoader<?> pageLoader,
		final IPageContentProvider pageContentProvider,
		final IPageLoaderHandler<PageableController> handler) {
	Object page = loadPageAndUpdateTotalElements(controller, pageLoader,
			pageContentProvider, handler);
	List<?> content = pageContentProvider.getPaginatedList(page);
	if (content != null && !content.isEmpty()) {
		viewer.add(content.toArray());
	}
}