KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > ui > navigator > PipelinedShapeModification


1 /*******************************************************************************
2  * Copyright (c) 2006, 2007 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
12 package org.eclipse.ui.navigator;
13
14 import java.util.Set JavaDoc;
15
16 /**
17  *
18  * Indicates how a shape modification should be transformed when applied to the
19  * tree. Clients use {@link PipelinedShapeModification} as the input and return
20  * type from intercept methods on {@link IPipelinedTreeContentProvider}.
21  *
22  * <p>
23  * Overridding extensions should use these to map attempts to directly modify
24  * the tree down to the overridden model. A shape modification can either be an
25  * <i>add</i> or <i>remove</i> shape modification, and the type is determined
26  * by the context of its use. If supplied to an <code>interceptRemove</code>
27  * method, then it is a remove shape modification, otherwise if supplied to an
28  * <code>interceptAdd</code> method, then it is an add shape modification.
29  * </p>
30  *
31  *
32  * @since 3.2
33  *
34  */

35 public final class PipelinedShapeModification {
36
37     private Object JavaDoc parent;
38
39     private final Set JavaDoc children;
40
41     /**
42      * Create a shape modification. The given parent and children will be set as
43      * the initial values for the shape modification.
44      *
45      * @param aParent
46      * The parent for the add or remove call to the tree.
47      * @param theChildren
48      * The children that should be added or removed from the tree.
49      */

50     public PipelinedShapeModification(Object JavaDoc aParent, Set JavaDoc theChildren) {
51         parent = aParent;
52         children = theChildren;
53     }
54
55     /**
56      *
57      * @return The parent to use for the shape modification.
58      */

59     public final Object JavaDoc getParent() {
60         return parent;
61     }
62
63     /**
64      *
65      * @param aParent
66      * The parent to use for the shape modification.
67      */

68     public final void setParent(Object JavaDoc aParent) {
69         parent = aParent;
70     }
71
72     /**
73      *
74      * @return The current set of children. Clients may add or remove elements
75      * directly to this set.
76      */

77     public final Set JavaDoc getChildren() {
78         return children;
79     }
80
81 }
82
Popular Tags