| /******************************************************************************* |
| * Copyright (c) 2000, 2004 IBM Corporation and others. |
| * All rights reserved. This program and the accompanying materials |
| * are made available under the terms of the Common Public License v1.0 |
| * which accompanies this distribution, and is available at |
| * http://www.eclipse.org/legal/cpl-v10.html |
| * |
| * Contributors: |
| * IBM Corporation - initial API and implementation |
| *******************************************************************************/ |
| package org.eclipse.ant.internal.ui.preferences; |
| |
| import java.net.URL; |
| import java.util.ArrayList; |
| import java.util.List; |
| |
| import org.eclipse.ant.core.IAntClasspathEntry; |
| |
| public abstract class AbstractClasspathEntry implements IClasspathEntry { |
| |
| protected List childEntries = new ArrayList(); |
| protected IClasspathEntry parent = null; |
| |
| /* (non-Javadoc) |
| * @see org.eclipse.ant.internal.ui.preferences.IClasspathEntry#getEntries() |
| */ |
| public IAntClasspathEntry[] getEntries() { |
| return (IAntClasspathEntry[])childEntries.toArray(new IAntClasspathEntry[childEntries.size()]); |
| } |
| |
| /* (non-Javadoc) |
| * @see org.eclipse.ant.internal.ui.preferences.IClasspathEntry#hasEntries() |
| */ |
| public boolean hasEntries() { |
| return !childEntries.isEmpty(); |
| } |
| |
| /* (non-Javadoc) |
| * @see org.eclipse.ant.internal.ui.preferences.IClasspathEntry#getParent() |
| */ |
| public IClasspathEntry getParent() { |
| return parent; |
| } |
| |
| /** |
| * @param parent The parent to set. |
| */ |
| public void setParent(IClasspathEntry parent) { |
| this.parent = parent; |
| } |
| |
| /* (non-Javadoc) |
| * @see org.eclipse.ant.core.IAntClasspathEntry#getEntryURL() |
| */ |
| public URL getEntryURL() { |
| return null; |
| } |
| |
| /* (non-Javadoc) |
| * @see org.eclipse.ant.core.IAntClasspathEntry#getLabel() |
| */ |
| public String getLabel() { |
| return toString(); |
| } |
| |
| /* (non-Javadoc) |
| * @see org.eclipse.ant.core.IAntClasspathEntry#isEclipseRuntimeRequired() |
| */ |
| public boolean isEclipseRuntimeRequired() { |
| return true; |
| } |
| } |