KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > jdt > internal > corext > buildpath > BuildpathDelta


1 /*******************************************************************************
2  * Copyright (c) 2000, 2006 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 JavaDoc;
14 import java.util.List JavaDoc;
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 JavaDoc fOperationDescription;
25     private CPListElement[] fNewEntries;
26     private final List JavaDoc fCreatedResources;
27     private IPath fOutputLocation;
28     private final List JavaDoc fDeletedResources;
29     private final List JavaDoc fAddedEntries;
30     private final ArrayList JavaDoc fRemovedEntries;
31
32     public BuildpathDelta(String JavaDoc operationDescription) {
33         fOperationDescription= operationDescription;
34         
35         fCreatedResources= new ArrayList JavaDoc();
36         fDeletedResources= new ArrayList JavaDoc();
37         fAddedEntries= new ArrayList JavaDoc();
38         fRemovedEntries= new ArrayList JavaDoc();
39     }
40
41     public String JavaDoc getOperationDescription() {
42         return fOperationDescription;
43     }
44     
45     public CPListElement[] getNewEntries() {
46         return fNewEntries;
47     }
48     
49     public IResource[] getCreatedResources() {
50         return (IResource[])fCreatedResources.toArray(new IResource[fCreatedResources.size()]);
51     }
52     
53     public IResource[] getDeletedResources() {
54         return (IResource[])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 JavaDoc getAddedEntries() {
78         return fAddedEntries;
79     }
80
81     public void addEntry(CPListElement entry) {
82         fAddedEntries.add(entry);
83     }
84     
85     public List JavaDoc getRemovedEntries() {
86         return fRemovedEntries;
87     }
88
89     public void removeEntry(CPListElement entry) {
90         fRemovedEntries.add(entry);
91     }
92 }
93
Popular Tags