1 11 package org.eclipse.ui.internal.navigator; 12 13 import org.eclipse.core.runtime.Assert; 14 import org.eclipse.core.runtime.Platform; 15 import org.eclipse.jface.viewers.ISelectionProvider; 16 import org.eclipse.swt.widgets.Shell; 17 import org.eclipse.ui.navigator.ICommonViewerSite; 18 19 25 public class CommonViewerSiteDelegate implements ICommonViewerSite { 26 27 28 private String id; 29 private ISelectionProvider selectionProvider; 30 private Shell shell; 31 32 38 public CommonViewerSiteDelegate(String anId, ISelectionProvider aSelectionProvider, Shell aShell) { 39 Assert.isNotNull(anId); 40 Assert.isNotNull(aSelectionProvider); 41 Assert.isNotNull(aShell); 42 id = anId; 43 selectionProvider = aSelectionProvider; 44 shell = aShell; 45 } 46 47 public String getId() { 48 return id; 49 } 50 51 public Shell getShell() { 52 return shell; 53 } 54 55 public ISelectionProvider getSelectionProvider() { 56 return selectionProvider; 57 } 58 59 60 public void setSelectionProvider(ISelectionProvider aSelectionProvider) { 61 selectionProvider = aSelectionProvider; 62 } 63 64 public Object getAdapter(Class adapter) { 65 return Platform.getAdapterManager().getAdapter(this, adapter); 66 } 67 68 } 69 | Popular Tags |