01: /*******************************************************************************
02: * Copyright (c) 2000, 2007 IBM Corporation and others.
03: * All rights reserved. This program and the accompanying materials
04: * are made available under the terms of the Eclipse Public License v1.0
05: * which accompanies this distribution, and is available at
06: * http://www.eclipse.org/legal/epl-v10.html
07: *
08: * Contributors:
09: * IBM Corporation - initial API and implementation
10: *******************************************************************************/package org.eclipse.ui;
11:
12: import java.util.EventListener;
13:
14: import org.eclipse.jface.viewers.ISelection;
15:
16: /**
17: * Interface for listening to selection changes.
18: * <p>
19: * This interface may be implemented by clients.
20: * </p>
21: *
22: * @see ISelectionService#addSelectionListener(ISelectionListener)
23: * @see ISelectionService#addSelectionListener(String, ISelectionListener)
24: * @see org.eclipse.ui.INullSelectionListener
25: */
26: public interface ISelectionListener extends EventListener {
27: /**
28: * Notifies this listener that the selection has changed.
29: * <p>
30: * This method is called when the selection changes from one to a
31: * <code>non-null</code> value, but not when the selection changes to
32: * <code>null</code>. If there is a requirement to be notified in the latter
33: * scenario, implement <code>INullSelectionListener</code>. The event will
34: * be posted through this method.
35: * </p>
36: *
37: * @param part the workbench part containing the selection
38: * @param selection the current selection. This may be <code>null</code>
39: * if <code>INullSelectionListener</code> is implemented.
40: */
41: public void selectionChanged(IWorkbenchPart part,
42: ISelection selection);
43: }
|