01: /*******************************************************************************
02: * Copyright (c) 2006 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.internal;
11:
12: import org.eclipse.jface.viewers.IStructuredSelection;
13:
14: /**
15: * <p>
16: * A service that is capable of converting a selection into resources.
17: * </p>
18: * <p>
19: * This interface is only intended for use within the
20: * <code>org.eclipse.ui.workbench</code> and <code>org.eclipse.ui.ide</code>
21: * plug-ins.
22: * </p>
23: *
24: * @since 3.2
25: */
26: public interface ISelectionConversionService {
27:
28: /**
29: * Attempt to convert the elements in the passed selection into resources by
30: * asking each for its IResource property (iff it isn't already a resource).
31: * If all elements in the initial selection can be converted to resources
32: * then answer a new selection containing these resources; otherwise answer
33: * an empty selection.
34: *
35: * @param originalSelection
36: * the original selection; must not be <code>null</code>.
37: * @return the converted selection or an empty selection; never
38: * <code>null</code>.
39: */
40: public IStructuredSelection convertToResources(
41: IStructuredSelection originalSelection);
42:
43: }
|