KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > ant > internal > ui > preferences > GlobalClasspathEntries


1 /*******************************************************************************
2  * Copyright (c) 2000, 2005 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.ant.internal.ui.preferences;
13
14 import java.util.List JavaDoc;
15
16 public class GlobalClasspathEntries extends AbstractClasspathEntry {
17     private String JavaDoc fName;
18     private int fType;
19     private boolean fCanBeRemoved= true;
20     
21     public GlobalClasspathEntries(String JavaDoc name, IClasspathEntry parent, boolean canBeRemoved, int type) {
22         fParent= parent;
23         fName= name;
24         fCanBeRemoved= canBeRemoved;
25         fType= type;
26     }
27         
28     public void addEntry(ClasspathEntry entry) {
29         fChildEntries.add(entry);
30     }
31     
32     public void removeEntry(ClasspathEntry entry) {
33         fChildEntries.remove(entry);
34     }
35     
36     public boolean contains(ClasspathEntry entry) {
37         return fChildEntries.contains(entry);
38     }
39     
40     public String JavaDoc toString() {
41         return fName;
42     }
43
44     public void removeAll() {
45         fChildEntries.clear();
46     }
47     
48     public boolean canBeRemoved() {
49         return fCanBeRemoved;
50     }
51
52     /**
53      * Set the child entries of this classpath entry.
54      * @param entries The child entries.
55      */

56     public void setEntries(List JavaDoc entries) {
57         fChildEntries= entries;
58     }
59     /**
60      * @return Returns the type of this global classpath entry.
61      * @see ClasspathModel#ANT_HOME
62      * @see ClasspathModel#GLOBAL_USER
63      * @see ClasspathModel#CONTRIBUTED
64      */

65     public int getType() {
66         return fType;
67     }
68 }
69
Popular Tags