1 /*******************************************************************************
2 * Copyright (c) 2000, 2003 IBM Corporation and others.
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Common Public License v1.0
5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/cpl-v10.html
9 * IBM Corporation - initial API and implementation
10 *******************************************************************************/
11 package net.sourceforge.phpdt.internal.core;
13 import net.sourceforge.phpdt.core.JavaModelException;
15 import org.eclipse.core.resources.IContainer;
16 import org.eclipse.core.resources.IResource;
20 * Element info for PackageFragments.
22 class PackageFragmentInfo extends OpenableElementInfo {
25 * A array with all the non-java resources contained by this PackageFragment
27 protected Object[] fNonJavaResources;
30 * Create and initialize a new instance of the receiver
32 public PackageFragmentInfo() {
33 fNonJavaResources = null;
37 boolean containsJavaResources() {
38 return fChildren.length != 0;
41 * Returns an array of non-java resources contained in the receiver.
43 Object[] getNonJavaResources(IResource underlyingResource, PackageFragmentRoot rootHandle) {
44 Object[] nonJavaResources = fNonJavaResources;
45 if (nonJavaResources == null) {
48 PackageFragmentRootInfo.computeFolderNonJavaResources(
49 (JavaProject)rootHandle.getJavaProject(),
50 (IContainer)underlyingResource,
51 rootHandle.fullExclusionPatternChars());
52 } catch (JavaModelException e) {
54 fNonJavaResources = nonJavaResources;
56 return nonJavaResources;
59 * Set the fNonJavaResources to res value
61 synchronized void setNonJavaResources(Object[] resources) {
62 fNonJavaResources = resources;