1
|
/*******************************************************************************
|
2
|
* Copyright (c) 2006, 2010 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;
|
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
|
* Overriding extensions should use these to map attempts to directly modify the
|
24
|
* 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 by
|
26
|
* 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 parent;
|
38
|
|
39
|
private final Set 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 aParent, Set 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 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 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 getChildren() {
|
78
|
return children;
|
79
|
}
|
80
|
|
81
|
}
|