1 11 package org.eclipse.pde.internal.ui.view; 12 13 import org.eclipse.jface.viewers.IContentProvider; 14 import org.eclipse.jface.viewers.StructuredViewer; 15 import org.eclipse.jface.viewers.TableViewer; 16 import org.eclipse.pde.internal.ui.wizards.ListUtil; 17 import org.eclipse.swt.SWT; 18 import org.eclipse.swt.events.DisposeEvent; 19 import org.eclipse.swt.events.DisposeListener; 20 import org.eclipse.swt.widgets.Composite; 21 import org.eclipse.swt.widgets.Table; 22 23 public class DependenciesViewListPage extends DependenciesViewPage { 24 private IContentProvider fContentProvider; 25 26 29 public DependenciesViewListPage(DependenciesView view, 30 IContentProvider contentProvider) { 31 super(view); 32 fContentProvider = contentProvider; 33 } 34 35 40 protected StructuredViewer createViewer(Composite parent) { 41 Table table = new Table(parent, SWT.MULTI | SWT.V_SCROLL | SWT.H_SCROLL); 42 43 fViewer = new TableViewer(table); 44 fViewer.setContentProvider(fContentProvider); 45 final DependenciesLabelProvider labelProvider = new DependenciesLabelProvider( 46 false); 47 fViewer.setLabelProvider(labelProvider); 48 fViewer.getControl().addDisposeListener(new DisposeListener() { 49 public void widgetDisposed(DisposeEvent e) { 50 labelProvider.dispose(); 51 } 52 }); 53 fViewer.setSorter(ListUtil.PLUGIN_SORTER); 54 55 return fViewer; 56 } 57 } 58 | Popular Tags |