1 /******************************************************************************* 2 * Copyright (c) 2000, 2005 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; 12 13 import org.eclipse.jface.viewers.ISelection; 14 15 /** 16 * Interface for listening to selection changes. 17 * <p> 18 * This interface may be implemented by clients. 19 * </p> 20 * 21 * @see ISelectionService#addSelectionListener(ISelectionListener) 22 * @see ISelectionService#addSelectionListener(String, ISelectionListener) 23 * @see org.eclipse.ui.INullSelectionListener 24 */ 25 public interface ISelectionListener { 26 /** 27 * Notifies this listener that the selection has changed. 28 * <p> 29 * This method is called when the selection changes from one to a 30 * <code>non-null</code> value, but not when the selection changes to 31 * <code>null</code>. If there is a requirement to be notified in the latter 32 * scenario, implement <code>INullSelectionListener</code>. The event will 33 * be posted through this method. 34 * </p> 35 * 36 * @param part the workbench part containing the selection 37 * @param selection the current selection. This may be <code>null</code> 38 * if <code>INullSelectionListener</code> is implemented. 39 */ 40 public void selectionChanged(IWorkbenchPart part, ISelection selection); 41 } 42