org.eclipse.jst.common.frameworks_1.1.501.v201201190400

16:45:40.365 INFO  jd.cli.Main - Decompiling org.eclipse.jst.common.frameworks_1.1.501.v201201190400.jar
package org.eclipse.jst.common.frameworks;

import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.ILog;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.Status;
import org.eclipse.wst.common.frameworks.internal.WTPPlugin;

public final class CommonFrameworksPlugin
  extends WTPPlugin
{
  public static final String PLUGIN_ID = "org.eclipse.jst.common.frameworks";
  public static final String DEFAULT_SOURCE_FOLDER = "defaultSource";
  public static final String OUTPUT_FOLDER = "outputFolder";
  private static CommonFrameworksPlugin inst;
  
  public static CommonFrameworksPlugin getDefault()
  {
    return inst;
  }
  
  public CommonFrameworksPlugin()
  {
    if (inst == null) {
      inst = this;
    }
  }
  
  public String getPluginID()
  {
    return "org.eclipse.jst.common.frameworks";
  }
  
  public static void log(Exception e)
  {
    ILog log = getDefault().getLog();
    
    log.log(new Status(4, "org.eclipse.jst.common.frameworks", 0, "Encountered an unexpected exception.", e));
  }
  
  public static IStatus createStatus(int severity, String message, Throwable exception)
  {
    return new Status(severity, "org.eclipse.jst.common.frameworks", message, exception);
  }
  
  public static IStatus createStatus(int severity, String message)
  {
    return createStatus(severity, message, null);
  }
  
  public static void logError(Throwable exception)
  {
    Platform.getLog(Platform.getBundle("org.eclipse.jst.common.frameworks")).log(createStatus(4, exception.getMessage(), exception));
  }
  
  public static void logError(CoreException exception)
  {
    Platform.getLog(Platform.getBundle("org.eclipse.jst.common.frameworks")).log(exception.getStatus());
  }
}

/* Location:
 * Qualified Name:     org.eclipse.jst.common.frameworks.CommonFrameworksPlugin
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.jst.common.internal.modulecore;

import java.util.List;
import org.eclipse.core.resources.IContainer;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.wst.common.componentcore.internal.flat.AbstractFlattenParticipant;
import org.eclipse.wst.common.componentcore.internal.flat.FlatVirtualComponent.FlatComponentTaskModel;
import org.eclipse.wst.common.componentcore.internal.flat.IFlatResource;
import org.eclipse.wst.common.componentcore.internal.flat.VirtualComponentFlattenUtility;
import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
import org.eclipse.wst.common.componentcore.resources.IVirtualReference;

public class AddClasspathFoldersParticipant
  extends AbstractFlattenParticipant
{
  private List<IFlatResource> list;
  
  public boolean shouldIgnoreReference(IVirtualComponent rootComponent, IVirtualReference referenced, FlatVirtualComponent.FlatComponentTaskModel dataModel)
  {
    if (((rootComponent instanceof IClasspathDependencyProvider)) && 
      ((referenced.getReferencedComponent() instanceof IClasspathDependencyComponent)) && 
      (((IClasspathDependencyComponent)referenced.getReferencedComponent()).isClassFolder())) {
      return true;
    }
    return false;
  }
  
  public void finalize(IVirtualComponent component, FlatVirtualComponent.FlatComponentTaskModel dataModel, List<IFlatResource> resources)
  {
    list = resources;
    if (!(component instanceof IClasspathDependencyProvider)) {
      return;
    }
    try
    {
      addClassFolderDependencies((IClasspathDependencyProvider)component);
    }
    catch (CoreException localCoreException) {}
  }
  
  private void addClassFolderDependencies(IClasspathDependencyProvider component)
    throws CoreException
  {
    if (!component.isBinary())
    {
      IVirtualReference[] cpRefs = component.getJavaClasspathReferences();
      for (int i = 0; i < cpRefs.length; i++)
      {
        IVirtualReference cpRef = cpRefs[i];
        IPath runtimePath = cpRef.getRuntimePath();
        IVirtualComponent comp = cpRef.getReferencedComponent();
        if ((comp instanceof IClasspathDependencyComponent))
        {
          IClasspathDependencyComponent cpComp = (IClasspathDependencyComponent)comp;
          if ((cpComp.isClassFolder()) && (cpComp.getClassFolder() != null))
          {
            IPath targetPath = null;
            targetPath = runtimePath.makeRelative();
            IContainer container = cpComp.getClassFolder();
            new VirtualComponentFlattenUtility(list, null).addContainer(container, targetPath);
          }
        }
      }
    }
  }
}

/* Location:
 * Qualified Name:     org.eclipse.jst.common.internal.modulecore.AddClasspathFoldersParticipant
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.jst.common.internal.modulecore;

import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
import org.eclipse.wst.common.componentcore.resources.IVirtualReference;

class AddClasspathLibReferencesParticipant$ClasspathLibVirtualReference
  implements IVirtualReference
{
  private IVirtualReference ref;
  
  AddClasspathLibReferencesParticipant$ClasspathLibVirtualReference(IVirtualReference ref)
  {
    this.ref = ref;
  }
  
  public void create(int updateFlags, IProgressMonitor aMonitor)
  {
    ref.create(updateFlags, aMonitor);
  }
  
  public boolean exists()
  {
    return ref.exists();
  }
  
  public String getArchiveName()
  {
    return ref.getArchiveName();
  }
  
  public int getDependencyType()
  {
    return ref.getDependencyType();
  }
  
  public IVirtualComponent getEnclosingComponent()
  {
    return ref.getEnclosingComponent();
  }
  
  public IVirtualComponent getReferencedComponent()
  {
    return ref.getReferencedComponent();
  }
  
  public IPath getRuntimePath()
  {
    return ref.getRuntimePath().removeFirstSegments(1);
  }
  
  public boolean isDerived()
  {
    return ref.isDerived();
  }
  
  public void setArchiveName(String archiveName)
  {
    ref.setArchiveName(archiveName);
  }
  
  public void setDependencyType(int aDependencyType)
  {
    ref.setDependencyType(aDependencyType);
  }
  
  public void setReferencedComponent(IVirtualComponent referencedComponent, EObject dependentObject)
  {
    ref.setReferencedComponent(referencedComponent, dependentObject);
  }
  
  public void setRuntimePath(IPath aRuntimePath)
  {
    ref.setRuntimePath(aRuntimePath);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.jst.common.internal.modulecore.AddClasspathLibReferencesParticipant.ClasspathLibVirtualReference
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.jst.common.internal.modulecore;

import java.util.ArrayList;
import java.util.List;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.wst.common.componentcore.internal.flat.AbstractFlattenParticipant;
import org.eclipse.wst.common.componentcore.internal.flat.FlatVirtualComponent.FlatComponentTaskModel;
import org.eclipse.wst.common.componentcore.internal.flat.IFlatResource;
import org.eclipse.wst.common.componentcore.internal.flat.VirtualComponentFlattenUtility;
import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
import org.eclipse.wst.common.componentcore.resources.IVirtualReference;

public class AddClasspathLibReferencesParticipant
  extends AbstractFlattenParticipant
{
  private List<IFlatResource> list;
  
  public boolean shouldIgnoreReference(IVirtualComponent rootComponent, IVirtualReference referenced, FlatVirtualComponent.FlatComponentTaskModel dataModel)
  {
    if (referenced.getRuntimePath().toString().startsWith("../")) {
      return true;
    }
    return false;
  }
  
  public void finalize(IVirtualComponent component, FlatVirtualComponent.FlatComponentTaskModel dataModel, List<IFlatResource> resources)
  {
    list = resources;
    if (!(component instanceof IClasspathDependencyReceiver)) {
      return;
    }
    if (((IClasspathDependencyReceiver)component).canReceiveClasspathDependencies()) {
      addReferencedComponentClasspathDependencies((IClasspathDependencyReceiver)component);
    }
  }
  
  private void addReferencedComponentClasspathDependencies(IClasspathDependencyReceiver component)
  {
    IVirtualReference[] refs = component.getReferences();
    for (int i = 0; i < refs.length; i++)
    {
      IVirtualReference reference = refs[i];
      IPath runtimePath = reference.getRuntimePath();
      IVirtualComponent referencedComponent = reference.getReferencedComponent();
      if ((referencedComponent instanceof IClasspathDependencyProvider)) {
        if ((!referencedComponent.isBinary()) && ((referencedComponent instanceof IClasspathDependencyProvider)))
        {
          IVirtualReference[] cpRefs = ((IClasspathDependencyProvider)referencedComponent).getJavaClasspathReferences();
          for (int j = 0; j < cpRefs.length; j++)
          {
            IVirtualReference cpRef = cpRefs[j];
            IPath cpRefRuntimePath = cpRef.getRuntimePath();
            if ((cpRef.getReferencedComponent() instanceof IClasspathDependencyComponent))
            {
              IClasspathDependencyComponent cpComp = (IClasspathDependencyComponent)cpRef.getReferencedComponent();
              if (!cpComp.isClassFolder()) {
                if (cpRefRuntimePath.toString().startsWith("../"))
                {
                  cpRefRuntimePath = runtimePath.append(cpRefRuntimePath.removeFirstSegments(1));
                  new VirtualComponentFlattenUtility(list, null).addFile(cpComp, cpRefRuntimePath, cpComp);
                }
              }
            }
          }
        }
      }
    }
  }
  
  private List<IVirtualReference> getReferencedProjectComponentClasspathDependencies(IClasspathDependencyReceiver component, FlatVirtualComponent.FlatComponentTaskModel dataModel)
  {
    IVirtualReference[] refs = component.getReferences();
    List<IVirtualReference> validReferences = new ArrayList();
    for (int i = 0; i < refs.length; i++)
    {
      IVirtualReference reference = refs[i];
      IVirtualComponent referencedComponent = reference.getReferencedComponent();
      if ((referencedComponent instanceof IClasspathDependencyProvider)) {
        if ((!referencedComponent.isBinary()) && ((referencedComponent instanceof IClasspathDependencyProvider)))
        {
          IVirtualReference[] cpRefs = ((IClasspathDependencyProvider)referencedComponent).getJavaClasspathReferences();
          for (int j = 0; j < cpRefs.length; j++)
          {
            IVirtualReference cpRef = cpRefs[j];
            IPath cpRefRuntimePath = cpRef.getRuntimePath();
            if (!(cpRef.getReferencedComponent() instanceof IClasspathDependencyComponent)) {
              if (cpRefRuntimePath.toString().startsWith("../")) {
                validReferences.add(new ClasspathLibVirtualReference(cpRef));
              }
            }
          }
        }
      }
    }
    return validReferences;
  }
  
  public List<IVirtualReference> getChildModules(IVirtualComponent component, FlatVirtualComponent.FlatComponentTaskModel dataModel)
  {
    List<IVirtualReference> result = null;
    if (!(component instanceof IClasspathDependencyReceiver)) {
      return null;
    }
    if (((IClasspathDependencyReceiver)component).canReceiveClasspathDependencies()) {
      result = getReferencedProjectComponentClasspathDependencies((IClasspathDependencyReceiver)component, dataModel);
    }
    return result;
  }
  
  private static class ClasspathLibVirtualReference
    implements IVirtualReference
  {
    private IVirtualReference ref;
    
    ClasspathLibVirtualReference(IVirtualReference ref)
    {
      this.ref = ref;
    }
    
    public void create(int updateFlags, IProgressMonitor aMonitor)
    {
      ref.create(updateFlags, aMonitor);
    }
    
    public boolean exists()
    {
      return ref.exists();
    }
    
    public String getArchiveName()
    {
      return ref.getArchiveName();
    }
    
    public int getDependencyType()
    {
      return ref.getDependencyType();
    }
    
    public IVirtualComponent getEnclosingComponent()
    {
      return ref.getEnclosingComponent();
    }
    
    public IVirtualComponent getReferencedComponent()
    {
      return ref.getReferencedComponent();
    }
    
    public IPath getRuntimePath()
    {
      return ref.getRuntimePath().removeFirstSegments(1);
    }
    
    public boolean isDerived()
    {
      return ref.isDerived();
    }
    
    public void setArchiveName(String archiveName)
    {
      ref.setArchiveName(archiveName);
    }
    
    public void setDependencyType(int aDependencyType)
    {
      ref.setDependencyType(aDependencyType);
    }
    
    public void setReferencedComponent(IVirtualComponent referencedComponent, EObject dependentObject)
    {
      ref.setReferencedComponent(referencedComponent, dependentObject);
    }
    
    public void setRuntimePath(IPath aRuntimePath)
    {
      ref.setRuntimePath(aRuntimePath);
    }
  }
}

/* Location:
 * Qualified Name:     org.eclipse.jst.common.internal.modulecore.AddClasspathLibReferencesParticipant
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.jst.common.internal.modulecore;

import java.util.List;
import org.eclipse.core.runtime.IPath;
import org.eclipse.wst.common.componentcore.internal.flat.AbstractFlattenParticipant;
import org.eclipse.wst.common.componentcore.internal.flat.FlatVirtualComponent.FlatComponentTaskModel;
import org.eclipse.wst.common.componentcore.internal.flat.IFlatResource;
import org.eclipse.wst.common.componentcore.internal.flat.VirtualComponentFlattenUtility;
import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
import org.eclipse.wst.common.componentcore.resources.IVirtualReference;

public class AddClasspathLibRefsProviderParticipant
  extends AbstractFlattenParticipant
{
  private List<IFlatResource> list;
  
  public void finalize(IVirtualComponent component, FlatVirtualComponent.FlatComponentTaskModel dataModel, List<IFlatResource> resources)
  {
    list = resources;
    if (!(component instanceof IClasspathDependencyProvider)) {
      return;
    }
    addReferencedComponentClasspathDependencies((IClasspathDependencyProvider)component);
  }
  
  private void addReferencedComponentClasspathDependencies(IClasspathDependencyProvider component)
  {
    IVirtualReference[] cpRefs = component.getJavaClasspathReferences();
    for (int j = 0; j < cpRefs.length; j++)
    {
      IVirtualReference cpRef = cpRefs[j];
      IPath cpRefRuntimePath = cpRef.getRuntimePath();
      if ((cpRef.getReferencedComponent() instanceof IClasspathDependencyComponent))
      {
        IClasspathDependencyComponent cpComp = (IClasspathDependencyComponent)cpRef.getReferencedComponent();
        if (!cpComp.isClassFolder()) {
          if (!cpRefRuntimePath.toString().startsWith("../")) {
            new VirtualComponentFlattenUtility(list, null).addFile(cpComp, cpRefRuntimePath, cpComp);
          }
        }
      }
    }
  }
}

/* Location:
 * Qualified Name:     org.eclipse.jst.common.internal.modulecore.AddClasspathLibRefsProviderParticipant
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.jst.common.internal.modulecore;

import org.eclipse.core.runtime.IPath;

public class AddMappedOutputFoldersParticipant$ComponentResourceProxy
{
  public IPath source;
  public IPath runtimePath;
  
  public AddMappedOutputFoldersParticipant$ComponentResourceProxy(IPath source, IPath runtimePath)
  {
    this.source = source;
    this.runtimePath = runtimePath;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.jst.common.internal.modulecore.AddMappedOutputFoldersParticipant.ComponentResourceProxy
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.jst.common.internal.modulecore;

import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Set;
import org.eclipse.core.resources.IContainer;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Path;
import org.eclipse.emf.common.util.EList;
import org.eclipse.jdt.core.IClasspathEntry;
import org.eclipse.jst.common.jdt.internal.javalite.IJavaProjectLite;
import org.eclipse.jst.common.jdt.internal.javalite.JavaCoreLite;
import org.eclipse.jst.common.jdt.internal.javalite.JavaLiteUtilities;
import org.eclipse.wst.common.componentcore.internal.ComponentResource;
import org.eclipse.wst.common.componentcore.internal.StructureEdit;
import org.eclipse.wst.common.componentcore.internal.WorkbenchComponent;
import org.eclipse.wst.common.componentcore.internal.flat.AbstractFlattenParticipant;
import org.eclipse.wst.common.componentcore.internal.flat.FilterResourceParticipant;
import org.eclipse.wst.common.componentcore.internal.flat.FlatVirtualComponent.FlatComponentTaskModel;
import org.eclipse.wst.common.componentcore.internal.flat.IFlatFile;
import org.eclipse.wst.common.componentcore.internal.flat.IFlatResource;
import org.eclipse.wst.common.componentcore.internal.flat.IFlattenParticipant;
import org.eclipse.wst.common.componentcore.internal.flat.VirtualComponentFlattenUtility;
import org.eclipse.wst.common.componentcore.internal.flat.VirtualComponentFlattenUtility.ShouldIncludeUtilityCallback;
import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;

public class AddMappedOutputFoldersParticipant
  extends AbstractFlattenParticipant
  implements VirtualComponentFlattenUtility.ShouldIncludeUtilityCallback
{
  private List<IFlatResource> list;
  private String[] filteredSuffixes = new String[0];
  
  public AddMappedOutputFoldersParticipant() {}
  
  public AddMappedOutputFoldersParticipant(String[] filtered)
  {
    filteredSuffixes = filtered;
  }
  
  public boolean shouldAddComponentFile(IVirtualComponent component, IFlatFile file)
  {
    IFlattenParticipant[] delegates = getDelegateParticipants();
    for (int i = 0; i < delegates.length; i++) {
      if (!delegates[i].shouldAddExportableFile(null, component, null, file)) {
        return false;
      }
    }
    return true;
  }
  
  public IFlattenParticipant[] getDelegateParticipants()
  {
    return new IFlattenParticipant[] {
      FilterResourceParticipant.createSuffixFilterParticipant(filteredSuffixes) };
  }
  
  public void finalize(IVirtualComponent component, FlatVirtualComponent.FlatComponentTaskModel dataModel, List<IFlatResource> resources)
  {
    list = resources;
    list.getClass();
    if (!isApprovedComponent(component)) {
      return;
    }
    HashMap<IContainer, IPath> mapped = getMappedJavaOutputContainers(component.getProject());
    Iterator<IContainer> i = mapped.keySet().iterator();
    while (i.hasNext())
    {
      IContainer next = (IContainer)i.next();
      try
      {
        new VirtualComponentFlattenUtility(list, this).addContainer(next, (IPath)mapped.get(next));
      }
      catch (CoreException localCoreException) {}
    }
  }
  
  protected boolean isApprovedComponent(IVirtualComponent vc)
  {
    return true;
  }
  
  public static final HashMap<IContainer, IPath> getMappedJavaOutputContainers(IProject project)
  {
    ComponentResourceProxy[] proxies = findAllMappingProxies(project);
    IJavaProjectLite javaProjectLite = JavaCoreLite.create(project);
    
    HashMap<IContainer, IPath> map = new HashMap();
    IFile classpathFile = project.getFile(".classpath");
    if ((javaProjectLite.exists()) && (classpathFile.exists()))
    {
      IClasspathEntry[] entries = javaProjectLite.readRawClasspath();
      IClasspathEntry[] arrayOfIClasspathEntry1;
      int j = (arrayOfIClasspathEntry1 = entries).length;
      for (int i = 0; i < j; i++)
      {
        IClasspathEntry entry = arrayOfIClasspathEntry1[i];
        if (entry.getEntryKind() == 3)
        {
          IPath cpePath = entry.getPath();
          for (int i = 0; i < proxies.length; i++) {
            if (cpePath.equals(new Path(project.getName()).append(source).makeAbsolute()))
            {
              IContainer outputContainer = JavaLiteUtilities.getJavaOutputContainer(javaProjectLite, entry);
              if (!map.containsKey(outputContainer)) {
                map.put(outputContainer, runtimePath);
              }
            }
          }
        }
      }
    }
    return map;
  }
  
  public static ComponentResourceProxy[] findAllMappingProxies(IProject project)
  {
    ComponentResource[] allMappings = findAllMappings(project);
    ComponentResourceProxy[] proxies = new ComponentResourceProxy[allMappings.length];
    for (int i = 0; i < allMappings.length; i++) {
      proxies[i] = new ComponentResourceProxy(
        allMappings[i].getSourcePath(), 
        allMappings[i].getRuntimePath());
    }
    return proxies;
  }
  
  protected static ComponentResource[] findAllMappings(IProject project)
  {
    StructureEdit structureEdit = null;
    try
    {
      structureEdit = StructureEdit.getStructureEditForRead(project);
      WorkbenchComponent component = structureEdit.getComponent();
      Object[] arr = component.getResources().toArray();
      ComponentResource[] result = new ComponentResource[arr.length];
      for (int i = 0; i < arr.length; i++) {
        result[i] = ((ComponentResource)arr[i]);
      }
      return result;
    }
    catch (Exception localException) {}finally
    {
      if (structureEdit != null) {
        structureEdit.dispose();
      }
    }
    return new ComponentResource[0];
  }
  
  public static class ComponentResourceProxy
  {
    public IPath source;
    public IPath runtimePath;
    
    public ComponentResourceProxy(IPath source, IPath runtimePath)
    {
      this.source = source;
      this.runtimePath = runtimePath;
    }
  }
}

/* Location:
 * Qualified Name:     org.eclipse.jst.common.internal.modulecore.AddMappedOutputFoldersParticipant
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.jst.common.internal.modulecore;

import org.eclipse.emf.common.util.URI;
import org.eclipse.wst.common.componentcore.internal.ComponentcoreFactory;
import org.eclipse.wst.common.componentcore.internal.ComponentcorePackage;
import org.eclipse.wst.common.componentcore.internal.DependencyType;
import org.eclipse.wst.common.componentcore.internal.ReferencedComponent;
import org.eclipse.wst.common.componentcore.internal.resources.VirtualReference;
import org.eclipse.wst.common.componentcore.resolvers.IReferenceResolver;
import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
import org.eclipse.wst.common.componentcore.resources.IVirtualReference;

public class ClasspathContainerReferenceResolver
  implements IReferenceResolver
{
  public static final String PROTOCOL = "module:/classpath/con/";
  
  public boolean canResolve(IVirtualComponent context, ReferencedComponent referencedComponent)
  {
    URI uri = referencedComponent.getHandle();
    if ((uri.segmentCount() > 2) && (uri.segment(0).equals("classpath")) && 
      (uri.segment(1).equals("con"))) {
      return true;
    }
    return false;
  }
  
  public IVirtualReference resolve(IVirtualComponent context, ReferencedComponent referencedComponent)
  {
    URI uri = referencedComponent.getHandle();
    if ((uri.segmentCount() > 2) && (uri.segment(0).equals("classpath")) && 
      (uri.segment(1).equals("con")))
    {
      String path = uri.toString().substring("module:/classpath/con/".length());
      IVirtualReference ref = new VirtualReference(context, 
        new ClasspathContainerVirtualComponent(context.getProject(), context, path));
      ref.setArchiveName(referencedComponent.getArchiveName());
      ref.setRuntimePath(referencedComponent.getRuntimePath());
      ref.setDependencyType(referencedComponent.getDependencyType().getValue());
      return ref;
    }
    return null;
  }
  
  public boolean canResolve(IVirtualReference reference)
  {
    if ((reference.getReferencedComponent() instanceof ClasspathContainerVirtualComponent)) {
      return true;
    }
    return false;
  }
  
  public ReferencedComponent resolve(IVirtualReference reference)
  {
    ClasspathContainerVirtualComponent vc = (ClasspathContainerVirtualComponent)reference.getReferencedComponent();
    ReferencedComponent rc = ComponentcorePackage.eINSTANCE.getComponentcoreFactory().createReferencedComponent();
    rc.setArchiveName(reference.getArchiveName());
    rc.setRuntimePath(reference.getRuntimePath());
    rc.setHandle(URI.createURI("module:/classpath/con/" + vc.getClasspathContainerPath()));
    rc.setDependencyType(DependencyType.CONSUMES_LITERAL);
    return rc;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.jst.common.internal.modulecore.ClasspathContainerReferenceResolver
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.jst.common.internal.modulecore;

import java.io.File;
import java.util.ArrayList;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Path;
import org.eclipse.jdt.core.IClasspathEntry;
import org.eclipse.wst.common.componentcore.internal.resources.VirtualFolder;
import org.eclipse.wst.common.componentcore.resources.IVirtualFile;
import org.eclipse.wst.common.componentcore.resources.IVirtualResource;

class ClasspathContainerVirtualComponent$1
  extends VirtualFolder
{
  ClasspathContainerVirtualComponent$1(ClasspathContainerVirtualComponent paramClasspathContainerVirtualComponent, IProject $anonymous0, IPath $anonymous1)
  {
    super($anonymous0, $anonymous1);
  }
  
  public IVirtualResource[] members(int memberFlags)
    throws CoreException
  {
    IClasspathEntry[] entries = ClasspathContainerVirtualComponent.access$0(this$0);
    ArrayList<IVirtualFile> jars = new ArrayList();
    IClasspathEntry[] arrayOfIClasspathEntry1;
    int j = (arrayOfIClasspathEntry1 = entries).length;
    for (int i = 0; i < j; i++)
    {
      IClasspathEntry entry = arrayOfIClasspathEntry1[i];
      if (entry.getEntryKind() == 1)
      {
        File f = entry.getPath().toFile();
        jars.add(new ClasspathContainerVirtualComponent.AbsoluteVirtualFile(this$0, getProject(), new Path("/"), f));
      }
    }
    return (IVirtualResource[])jars.toArray(new IVirtualFile[jars.size()]);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.jst.common.internal.modulecore.ClasspathContainerVirtualComponent.1
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.jst.common.internal.modulecore;

import java.io.File;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.IPath;
import org.eclipse.wst.common.componentcore.internal.resources.VirtualFile;

public class ClasspathContainerVirtualComponent$AbsoluteVirtualFile
  extends VirtualFile
{
  private File file;
  
  public ClasspathContainerVirtualComponent$AbsoluteVirtualFile(ClasspathContainerVirtualComponent paramClasspathContainerVirtualComponent, IProject aComponentProject, IPath aRuntimePath, File absoluteFile)
  {
    super(aComponentProject, aRuntimePath, null);
    file = absoluteFile;
  }
  
  public Object getAdapter(Class adapter)
  {
    if (File.class.equals(adapter)) {
      return file;
    }
    return null;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.jst.common.internal.modulecore.ClasspathContainerVirtualComponent.AbsoluteVirtualFile
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.jst.common.internal.modulecore;

import java.io.File;
import java.util.ArrayList;
import org.eclipse.core.resources.IContainer;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Path;
import org.eclipse.jdt.core.IClasspathContainer;
import org.eclipse.jdt.core.IClasspathEntry;
import org.eclipse.jdt.core.JavaCore;
import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.wst.common.componentcore.internal.resources.AbstractResourceListVirtualComponent;
import org.eclipse.wst.common.componentcore.internal.resources.VirtualFile;
import org.eclipse.wst.common.componentcore.internal.resources.VirtualFolder;
import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
import org.eclipse.wst.common.componentcore.resources.IVirtualFile;
import org.eclipse.wst.common.componentcore.resources.IVirtualFolder;
import org.eclipse.wst.common.componentcore.resources.IVirtualResource;

public class ClasspathContainerVirtualComponent
  extends AbstractResourceListVirtualComponent
{
  public static final String CLASSPATH = "classpath";
  public static final String CON = "con";
  public static final String CLASSPATH_CON = "classpath/con";
  private String containerPath;
  private IClasspathEntry[] containerEntries;
  private IClasspathContainer container;
  private boolean initialized = false;
  private Object initLock = new Object();
  
  public ClasspathContainerVirtualComponent(IProject p, IVirtualComponent referencingComponent, String containerPath)
  {
    super(p, referencingComponent);
    this.containerPath = containerPath;
  }
  
  private void init()
  {
    synchronized (initLock)
    {
      if (initialized) {
        return;
      }
    }
    try
    {
      IClasspathContainer localContainer = JavaCore.getClasspathContainer(new Path(containerPath), JavaCore.create(project));
      IClasspathEntry[] localcontainerEntries = (IClasspathEntry[])null;
      if (localContainer != null) {
        localcontainerEntries = localContainer.getClasspathEntries();
      } else {
        localcontainerEntries = new IClasspathEntry[0];
      }
      synchronized (initLock)
      {
        if (initialized) {
          return;
        }
        IClasspathEntry[] localcontainerEntries;
        IClasspathContainer localContainer;
        container = localContainer;
        containerEntries = localcontainerEntries;
      }
    }
    catch (JavaModelException localJavaModelException) {}finally
    {
      synchronized (initLock)
      {
        initialized = true;
      }
    }
  }
  
  public boolean equals(Object o)
  {
    if (this == o) {
      return true;
    }
    if (!super.equals(o)) {
      return false;
    }
    ClasspathContainerVirtualComponent other = (ClasspathContainerVirtualComponent)o;
    return containerPath == null ? false : containerPath == null ? true : containerPath.equals(containerPath);
  }
  
  public int hashCode()
  {
    return super.hashCode() + (containerPath == null ? 0 : containerPath.hashCode());
  }
  
  public String getContainerPath()
  {
    return containerPath;
  }
  
  public String getId()
  {
    return "classpath/con/" + containerPath;
  }
  
  protected String getFirstIdSegment()
  {
    return null;
  }
  
  public IClasspathContainer getClasspathContainer()
  {
    init();
    return container;
  }
  
  private IClasspathEntry[] getEntries()
  {
    init();
    return containerEntries;
  }
  
  public String getClasspathContainerPath()
  {
    return containerPath;
  }
  
  public IVirtualFolder getRootFolder()
  {
    IVirtualFolder folder = new VirtualFolder(project, new Path("/"))
    {
      public IVirtualResource[] members(int memberFlags)
        throws CoreException
      {
        IClasspathEntry[] entries = ClasspathContainerVirtualComponent.this.getEntries();
        ArrayList<IVirtualFile> jars = new ArrayList();
        IClasspathEntry[] arrayOfIClasspathEntry1;
        int j = (arrayOfIClasspathEntry1 = entries).length;
        for (int i = 0; i < j; i++)
        {
          IClasspathEntry entry = arrayOfIClasspathEntry1[i];
          if (entry.getEntryKind() == 1)
          {
            File f = entry.getPath().toFile();
            jars.add(new ClasspathContainerVirtualComponent.AbsoluteVirtualFile(ClasspathContainerVirtualComponent.this, getProject(), new Path("/"), f));
          }
        }
        return (IVirtualResource[])jars.toArray(new IVirtualFile[jars.size()]);
      }
    };
    return folder;
  }
  
  protected class AbsoluteVirtualFile
    extends VirtualFile
  {
    private File file;
    
    public AbsoluteVirtualFile(IProject aComponentProject, IPath aRuntimePath, File absoluteFile)
    {
      super(aRuntimePath, null);
      file = absoluteFile;
    }
    
    public Object getAdapter(Class adapter)
    {
      if (File.class.equals(adapter)) {
        return file;
      }
      return null;
    }
  }
  
  protected IContainer[] getUnderlyingContainers()
  {
    return new IContainer[0];
  }
  
  protected IResource[] getLooseResources()
  {
    return new IResource[0];
  }
}

/* Location:
 * Qualified Name:     org.eclipse.jst.common.internal.modulecore.ClasspathContainerVirtualComponent
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.jst.common.internal.modulecore;

import org.eclipse.core.resources.IContainer;
import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
import org.eclipse.wst.common.componentcore.resources.IVirtualReference;

public abstract interface IClasspathDependencyComponent
  extends IVirtualComponent
{
  public abstract boolean isClassFolder();
  
  public abstract IContainer getClassFolder();
  
  public abstract IVirtualReference[] getReferences();
  
  public abstract String[] getManifestClasspath();
}

/* Location:
 * Qualified Name:     org.eclipse.jst.common.internal.modulecore.IClasspathDependencyComponent
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.jst.common.internal.modulecore;

import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
import org.eclipse.wst.common.componentcore.resources.IVirtualReference;

public abstract interface IClasspathDependencyProvider
  extends IVirtualComponent
{
  public abstract IVirtualReference[] getJavaClasspathReferences();
}

/* Location:
 * Qualified Name:     org.eclipse.jst.common.internal.modulecore.IClasspathDependencyProvider
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.jst.common.internal.modulecore;

import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Path;
import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;

public abstract interface IClasspathDependencyReceiver
  extends IVirtualComponent
{
  public static final String RUNTIME_MAPPING_INTO_CONTAINER = "../";
  public static final IPath RUNTIME_MAPPING_INTO_CONTAINER_PATH = new Path("../");
  
  public abstract boolean canReceiveClasspathDependencies();
  
  public abstract IPath getClasspathFolderPath(IClasspathDependencyComponent paramIClasspathDependencyComponent);
}

/* Location:
 * Qualified Name:     org.eclipse.jst.common.internal.modulecore.IClasspathDependencyReceiver
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.jst.common.internal.modulecore;

import org.eclipse.core.resources.IContainer;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IStatus;

public abstract interface ISingleRootStatus
  extends IStatus
{
  public static final int SINGLE_ROOT_CONTAINER_FOUND = 1;
  public static final int SINGLE_ROOT_FORCED = 2;
  public static final int SOURCE_PATH_NOT_FOUND = 33;
  public static final int NO_COMPONENT_FOUND = 129;
  public static final int EXPLICITLY_DISABLED = 130;
  public static final int CONSUMABLE_REFERENCES_FOUND = 131;
  public static final int LINKED_RESOURCES_FOUND = 132;
  public static final int NO_RESOURCE_MAPS_FOUND = 133;
  public static final int JAVA_OUTPUT_NOT_A_CONTENT_ROOT = 134;
  public static final int JAVA_OUTPUT_GREATER_THAN_1 = 135;
  public static final int RUNTIME_PATH_NOT_ROOT = 136;
  public static final int SOURCE_NOT_JAVA_CONTAINER = 137;
  public static final int BINARY_COMPONENT_FOUND = 138;
  
  public abstract IPath getPath();
  
  public abstract IContainer getSingleRoot();
}

/* Location:
 * Qualified Name:     org.eclipse.jst.common.internal.modulecore.ISingleRootStatus
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.jst.common.internal.modulecore;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import org.eclipse.core.resources.IContainer;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.jst.common.jdt.internal.javalite.IJavaProjectLite;
import org.eclipse.jst.common.jdt.internal.javalite.JavaCoreLite;
import org.eclipse.jst.common.jdt.internal.javalite.JavaLiteUtilities;
import org.eclipse.wst.common.componentcore.internal.flat.AbstractFlattenParticipant;
import org.eclipse.wst.common.componentcore.internal.flat.FlatVirtualComponent.FlatComponentTaskModel;
import org.eclipse.wst.common.componentcore.internal.flat.IFlatFile;
import org.eclipse.wst.common.componentcore.internal.flat.IFlatResource;
import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;

public class IgnoreJavaInSourceFolderParticipant
  extends AbstractFlattenParticipant
{
  IJavaProjectLite liteProj = null;
  List<IPath> containers = new ArrayList();
  
  public void initialize(IVirtualComponent component, FlatVirtualComponent.FlatComponentTaskModel dataModel, List<IFlatResource> resources)
  {
    if (hasJava(component))
    {
      liteProj = JavaCoreLite.create(component.getProject());
      if ((liteProj != null) && (JavaLiteUtilities.getJavaOutputContainers(liteProj).size() > 0))
      {
        List<IContainer> temp = JavaLiteUtilities.getJavaSourceContainers(liteProj);
        Iterator<IContainer> i = temp.iterator();
        while (i.hasNext()) {
          containers.add(((IContainer)i.next()).getFullPath());
        }
      }
    }
  }
  
  public boolean shouldAddExportableFile(IVirtualComponent rootComponent, IVirtualComponent currentComponent, FlatVirtualComponent.FlatComponentTaskModel dataModel, IFlatFile file)
  {
    if ((rootComponent == currentComponent) && 
      (hasJava(rootComponent)))
    {
      IFile t = (IFile)file.getAdapter(IFile.class);
      if (t != null)
      {
        Iterator<IPath> i = containers.iterator();
        while (i.hasNext()) {
          if ((((IPath)i.next()).isPrefixOf(t.getFullPath())) && (t.getName().endsWith(".java"))) {
            return false;
          }
        }
      }
    }
    return true;
  }
  
  protected boolean hasJava(IVirtualComponent component)
  {
    try
    {
      return component.getProject().isNatureEnabled("org.eclipse.jdt.core.javanature");
    }
    catch (CoreException localCoreException) {}
    return false;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.jst.common.internal.modulecore.IgnoreJavaInSourceFolderParticipant
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.jst.common.internal.modulecore;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.IPath;
import org.eclipse.jst.common.internal.modulecore.util.ManifestUtilities;
import org.eclipse.wst.common.componentcore.internal.flat.AbstractFlattenParticipant;
import org.eclipse.wst.common.componentcore.internal.flat.FlatFile;
import org.ecl
1 2 3 4 5 6 7

Further reading...

For more information on Java 1.5 Tiger, you may find Java 1.5 Tiger, A developer's Notebook by D. Flanagan and B. McLaughlin from O'Reilly of interest.

New!JAR listings


Copyright 2006-2017. Infinite Loop Ltd