new version with WorkingCopy Management
[phpeclipse.git] / net.sourceforge.phpeclipse / src / net / sourceforge / phpdt / internal / core / PackageFragmentInfo.java
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
7  * 
8  * Contributors:
9  *     IBM Corporation - initial API and implementation
10  *******************************************************************************/
11 package net.sourceforge.phpdt.internal.core;
12
13 import net.sourceforge.phpdt.core.JavaModelException;
14
15 import org.eclipse.core.resources.IContainer;
16 import org.eclipse.core.resources.IResource;
17
18
19 /**
20  * Element info for PackageFragments.
21  */
22 class PackageFragmentInfo extends OpenableElementInfo {
23
24         /**
25          * A array with all the non-java resources contained by this PackageFragment
26          */
27         protected Object[] fNonJavaResources;
28
29 /**
30  * Create and initialize a new instance of the receiver
31  */
32 public PackageFragmentInfo() {
33         fNonJavaResources = null;
34 }
35 /**
36  */
37 boolean containsJavaResources() {
38         return fChildren.length != 0;
39 }
40 /**
41  * Returns an array of non-java resources contained in the receiver.
42  */
43 Object[] getNonJavaResources(IResource underlyingResource, PackageFragmentRoot rootHandle) {
44         Object[] nonJavaResources = fNonJavaResources;
45         if (nonJavaResources == null) {
46                 try {
47                         nonJavaResources = 
48                                 PackageFragmentRootInfo.computeFolderNonJavaResources(
49                                         (JavaProject)rootHandle.getJavaProject(), 
50                                         (IContainer)underlyingResource, 
51                                         rootHandle.fullExclusionPatternChars());
52                 } catch (JavaModelException e) {
53                 }
54                 fNonJavaResources = nonJavaResources;
55         }
56         return nonJavaResources;
57 }
58 /**
59  * Set the fNonJavaResources to res value
60  */
61 synchronized void setNonJavaResources(Object[] resources) {
62         fNonJavaResources = resources;
63 }
64 }