Mercurial > projects > dwt-addons
comparison dwtx/jface/viewers/ITreeSelection.d @ 70:46a6e0e6ccd4
Merge with d-fied sources of 3.4M7
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Thu, 22 May 2008 01:36:46 +0200 |
parents | b6c35faf97c8 |
children |
comparison
equal
deleted
inserted
replaced
69:07b9d96fd764 | 70:46a6e0e6ccd4 |
---|---|
1 /******************************************************************************* | 1 /******************************************************************************* |
2 * Copyright (c) 2005, 2006 IBM Corporation and others. | 2 * Copyright (c) 2005, 2007 IBM Corporation and others. |
3 * All rights reserved. This program and the accompanying materials | 3 * All rights reserved. This program and the accompanying materials |
4 * are made available under the terms of the Eclipse Public License v1.0 | 4 * are made available under the terms of the Eclipse Public License v1.0 |
5 * which accompanies this distribution, and is available at | 5 * which accompanies this distribution, and is available at |
6 * http://www.eclipse.org/legal/epl-v10.html | 6 * http://www.eclipse.org/legal/epl-v10.html |
7 * | 7 * |
17 | 17 |
18 import dwt.dwthelper.utils; | 18 import dwt.dwthelper.utils; |
19 | 19 |
20 /** | 20 /** |
21 * A selection containing tree paths. | 21 * A selection containing tree paths. |
22 * <p> | |
23 * It is recommended that clients do not implement this interface but instead | |
24 * use the standard implementation of this interface, {@link TreeSelection}. | |
25 * <code>TreeSelection</code> adds API for getting the {@link IElementComparer} | |
26 * of a selection (if available). This is important for clients who want to | |
27 * create a slightly modified tree selection based on an existing tree selection. | |
28 * The recommended coding pattern in this case is as follows: | |
29 * <pre> | |
30 * ITreeSelection selection = (ITreeSelection)treeViewer.getSelection(); | |
31 * TreePath[] paths = selection.getPaths(); | |
32 * IElementComparer comparer = null; | |
33 * if (selection instanceof TreeSelection) { | |
34 * comparer = ((TreeSelection)selection).getElementComparer(); | |
35 * } | |
36 * TreePath[] modifiedPaths = ... // modify as required | |
37 * TreeSelection modifiedSelection = new TreeSelection(modifiedPaths, comparer); | |
38 * </pre> | |
39 * See bugs 135818 and 133375 for details. | |
40 * </p> | |
22 * | 41 * |
23 * @since 3.2 | 42 * @since 3.2 |
24 * | 43 * |
25 */ | 44 */ |
26 public interface ITreeSelection : IStructuredSelection { | 45 public interface ITreeSelection : IStructuredSelection { |