1 /******************************************************************************* 2 * Copyright (c) 2006 IBM Corporation and others. 3 * All rights reserved. This program and the accompanying materials 4 * are made available under the terms of the Eclipse Public License v1.0 5 * which accompanies this distribution, and is available at 6 * http://www.eclipse.org/legal/epl-v10.html 7 * 8 * Contributors: 9 * IBM Corporation - initial API and implementation 10 ******************************************************************************/ 11 package org.eclipse.ui.navigator; 12 13 import org.eclipse.core.runtime.IAdaptable; 14 import org.eclipse.jface.viewers.ISelectionProvider; 15 import org.eclipse.swt.widgets.Shell; 16 17 /** 18 * 19 * Provides context for extensions including a valid shell, a selection 20 * provider, and a unique identifer corresponding to the abstract viewer behind 21 * the viewer site. 22 * 23 * <p> 24 * This interface is not intended to be implemented by clients. 25 * </p> 26 * 27 * @since 3.2 28 */ 29 public interface ICommonViewerSite extends IAdaptable { 30 31 /** 32 * 33 * @return The unique identifier associated with the defined abstract 34 * viewer. In general, this will be the id of the 35 * <b>org.eclipse.ui.views</b> extension that defines the view 36 * part. 37 */ 38 String getId(); 39 40 41 /** 42 * 43 * @return A valid shell corresponding to the shell of the 44 * {@link CommonViewer} 45 */ 46 Shell getShell(); 47 48 /** 49 * 50 * @return The selection provider that can provide a current, valid 51 * selection. The default selection provider is the 52 * {@link CommonViewer}. 53 */ 54 ISelectionProvider getSelectionProvider(); 55 56 /** 57 * Sets the selection provider for this common viewer site. 58 * 59 * @param provider 60 * the selection provider, or <code>null</code> to clear it 61 */ 62 public void setSelectionProvider(ISelectionProvider provider); 63 64 } 65