1 11 package org.eclipse.ui.internal.views.properties.tabbed.view; 12 13 import org.eclipse.jface.util.Assert; 14 import org.eclipse.jface.viewers.ISelection; 15 import org.eclipse.jface.viewers.IStructuredContentProvider; 16 import org.eclipse.jface.viewers.Viewer; 17 import org.eclipse.ui.IWorkbenchPart; 18 19 20 26 public class TabListContentProvider 27 implements IStructuredContentProvider { 28 29 private TabbedPropertyRegistry registry; 30 31 private IWorkbenchPart currentPart; 32 33 36 public TabListContentProvider(TabbedPropertyRegistry registry) { 37 this.registry = registry; 38 } 39 40 43 public Object [] getElements(Object inputElement) { 44 Assert.isTrue(inputElement instanceof ISelection); 45 return registry 46 .getTabDescriptors(currentPart, (ISelection) inputElement); 47 } 48 49 52 public void dispose() { 53 54 } 55 56 59 public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { 60 this.currentPart = ((TabbedPropertyViewer)viewer).getWorkbenchPart(); 61 } 62 } 63 | Popular Tags |