]> git.uio.no Git - ifi-stolz-refaktor.git/blob - case-study/jdt-before/core extension/org/eclipse/jdt/internal/corext/buildpath/BuildpathDelta.java
Case Study: adding data and statistics
[ifi-stolz-refaktor.git] / case-study / jdt-before / core extension / org / eclipse / jdt / internal / corext / buildpath / BuildpathDelta.java
1 /*******************************************************************************
2  * Copyright (c) 2000, 2011 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 package org.eclipse.jdt.internal.corext.buildpath;
12
13 import java.util.ArrayList;
14 import java.util.List;
15
16 import org.eclipse.core.runtime.IPath;
17
18 import org.eclipse.core.resources.IResource;
19
20 import org.eclipse.jdt.internal.ui.wizards.buildpaths.CPListElement;
21
22 public class BuildpathDelta {
23
24         private final String fOperationDescription;
25         private CPListElement[] fNewEntries;
26         private final List<IResource> fCreatedResources;
27         private IPath fOutputLocation;
28         private final List<IResource> fDeletedResources;
29         private final List<CPListElement> fAddedEntries;
30         private final ArrayList<CPListElement> fRemovedEntries;
31
32         public BuildpathDelta(String operationDescription) {
33                 fOperationDescription= operationDescription;
34
35                 fCreatedResources= new ArrayList<IResource>();
36                 fDeletedResources= new ArrayList<IResource>();
37                 fAddedEntries= new ArrayList<CPListElement>();
38                 fRemovedEntries= new ArrayList<CPListElement>();
39     }
40
41         public String getOperationDescription() {
42                 return fOperationDescription;
43         }
44
45         public CPListElement[] getNewEntries() {
46                 return fNewEntries;
47         }
48
49         public IResource[] getCreatedResources() {
50                 return fCreatedResources.toArray(new IResource[fCreatedResources.size()]);
51         }
52
53         public IResource[] getDeletedResources() {
54                 return fDeletedResources.toArray(new IResource[fDeletedResources.size()]);
55         }
56
57         public IPath getDefaultOutputLocation() {
58                 return fOutputLocation;
59         }
60
61         public void setNewEntries(CPListElement[] newEntries) {
62                 fNewEntries= newEntries;
63     }
64
65         public void addCreatedResource(IResource resource) {
66                 fCreatedResources.add(resource);
67     }
68
69         public void setDefaultOutputLocation(IPath outputLocation) {
70                 fOutputLocation= outputLocation;
71     }
72
73         public void addDeletedResource(IResource resource) {
74                 fDeletedResources.add(resource);
75     }
76
77     public List<CPListElement> getAddedEntries() {
78             return fAddedEntries;
79     }
80
81     public void addEntry(CPListElement entry) {
82         fAddedEntries.add(entry);
83     }
84
85     public List<CPListElement> getRemovedEntries() {
86         return fRemovedEntries;
87     }
88
89     public void removeEntry(CPListElement entry) {
90         fRemovedEntries.add(entry);
91     }
92 }