01: /*******************************************************************************
02: * Copyright (c) 2006, 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.navigator;
11:
12: import java.util.Set;
13:
14: /**
15: *
16: * Indicates how a shape modification should be transformed when applied to the
17: * tree. Clients use {@link PipelinedShapeModification} as the input and return
18: * type from intercept methods on {@link IPipelinedTreeContentProvider}.
19: *
20: * <p>
21: * Overridding extensions should use these to map attempts to directly modify
22: * the tree down to the overridden model. A shape modification can either be an
23: * <i>add</i> or <i>remove</i> shape modification, and the type is determined
24: * by the context of its use. If supplied to an <code>interceptRemove</code>
25: * method, then it is a remove shape modification, otherwise if supplied to an
26: * <code>interceptAdd</code> method, then it is an add shape modification.
27: * </p>
28: *
29: *
30: * @since 3.2
31: *
32: */
33: public final class PipelinedShapeModification {
34:
35: private Object parent;
36:
37: private final Set children;
38:
39: /**
40: * Create a shape modification. The given parent and children will be set as
41: * the initial values for the shape modification.
42: *
43: * @param aParent
44: * The parent for the add or remove call to the tree.
45: * @param theChildren
46: * The children that should be added or removed from the tree.
47: */
48: public PipelinedShapeModification(Object aParent, Set theChildren) {
49: parent = aParent;
50: children = theChildren;
51: }
52:
53: /**
54: *
55: * @return The parent to use for the shape modification.
56: */
57: public final Object getParent() {
58: return parent;
59: }
60:
61: /**
62: *
63: * @param aParent
64: * The parent to use for the shape modification.
65: */
66: public final void setParent(Object aParent) {
67: parent = aParent;
68: }
69:
70: /**
71: *
72: * @return The current set of children. Clients may add or remove elements
73: * directly to this set.
74: */
75: public final Set getChildren() {
76: return children;
77: }
78:
79: }
|