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