org.eclipse.pde.core_3.7.1.v20120103_r372

    }
        if (providerName != null) {
          element.setAttribute(ATTR_PROVIDER, providerName);
        }
        if (name != null) {
          element.setAttribute(ATTR_NAME, name);
        }
        if (hasExtensibleAPI) {
          element.setAttribute(ATTR_EXTENSIBLE_API, "true");
        }
        if (isPatchFragment) {
          element.setAttribute(ATTR_PATCH, "true");
        }
        if (!hasBundleStructure) {
          element.setAttribute(ATTR_BUNDLE_STRUCTURE, "false");
        }
        if (localization != null) {
          element.setAttribute(ATTR_LOCALIZATION, localization);
        }
        if (bundleSourceEntry != null) {
          element.setAttribute(ATTR_BUNDLE_SOURCE, bundleSourceEntry);
        }
        if (libraries != null) {
          for (int i = 0; i < libraries.length; i++)
          {
            Element lib = doc.createElement(ELEMENT_LIB);
            lib.setAttribute(ATTR_NAME, libraries[i]);
            element.appendChild(lib);
          }
        }
        root.appendChild(element);
      }
      doc.appendChild(root);
      XMLPrintHandler.writeFile(doc, new File(dir, CACHE_EXTENSION));
    }
    catch (Exception e)
    {
      PDECore.log(e);
    }
  }
  
  protected boolean readPluginInfoCache(File dir)
  {
    File file = new File(dir, CACHE_EXTENSION);
    if ((file.exists()) && (file.isFile())) {
      try
      {
        DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
        DocumentBuilder documentBuilder = factory.newDocumentBuilder();
        documentBuilder.setErrorHandler(new DefaultHandler());
        Document doc = documentBuilder.parse(file);
        Element root = doc.getDocumentElement();
        if (root != null)
        {
          NodeList list = root.getChildNodes();
          for (int i = 0; i < list.getLength(); i++) {
            if (list.item(i).getNodeType() == 1) {
              createPluginInfo((Element)list.item(i));
            }
          }
        }
        return true;
      }
      catch (SAXException e)
      {
        PDECore.log(e);
      }
      catch (IOException e)
      {
        PDECore.log(e);
      }
      catch (ParserConfigurationException e)
      {
        PDECore.log(e);
      }
    }
    return false;
  }
  
  protected boolean exists(File dir)
  {
    File file = new File(dir, CACHE_EXTENSION);
    return (file.exists()) && (file.isFile());
  }
  
  public static void writePluginInfo(IPluginModelBase[] models, File destination)
  {
    try
    {
      DocumentBuilder builder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
      Document doc = builder.newDocument();
      
      Element root = doc.createElement(ELEMENT_ROOT);
      doc.appendChild(root);
      for (int i = 0; i < models.length; i++)
      {
        IPluginBase plugin = models[i].getPluginBase();
        BundleDescription desc = models[i].getBundleDescription();
        if (desc != null)
        {
          Element element = doc.createElement(ELEMENT_BUNDLE);
          element.setAttribute(ATTR_BUNDLE_ID, Long.toString(desc.getBundleId()));
          element.setAttribute(ATTR_PROJECT, models[i].getUnderlyingResource().getProject().getName());
          if (((plugin instanceof IPlugin)) && (((IPlugin)plugin).getClassName() != null)) {
            element.setAttribute(ATTR_CLASS, ((IPlugin)plugin).getClassName());
          }
          if (plugin.getProviderName() != null) {
            element.setAttribute(ATTR_PROVIDER, plugin.getProviderName());
          }
          if (plugin.getName() != null) {
            element.setAttribute(ATTR_NAME, plugin.getName());
          }
          if (ClasspathUtilCore.hasExtensibleAPI(models[i])) {
            element.setAttribute(ATTR_EXTENSIBLE_API, "true");
          } else if (ClasspathUtilCore.isPatchFragment(models[i])) {
            element.setAttribute(ATTR_PATCH, "true");
          }
          if (!(models[i] instanceof IBundlePluginModelBase)) {
            element.setAttribute(ATTR_BUNDLE_STRUCTURE, "false");
          }
          if ((models[i] instanceof IBundlePluginModelBase))
          {
            String localization = ((IBundlePluginModelBase)models[i]).getBundleLocalization();
            if (localization != null) {
              element.setAttribute(ATTR_LOCALIZATION, localization);
            }
          }
          if ((models[i] instanceof IBundlePluginModelBase))
          {
            IBundleModel bundleModel = ((IBundlePluginModelBase)models[i]).getBundleModel();
            if (bundleModel != null)
            {
              String bundleSourceEntry = bundleModel.getBundle().getHeader("Eclipse-SourceBundle");
              if (bundleSourceEntry != null) {
                element.setAttribute(ATTR_BUNDLE_SOURCE, bundleSourceEntry);
              }
            }
          }
          IPluginLibrary[] libraries = plugin.getLibraries();
          for (int j = 0; j < libraries.length; j++)
          {
            Element lib = doc.createElement(ELEMENT_LIB);
            lib.setAttribute(ATTR_NAME, libraries[j].getName());
            if (!libraries[j].isExported()) {
              lib.setAttribute(ATTR_EXPORTED, "false");
            }
            element.appendChild(lib);
          }
          root.appendChild(element);
        }
      }
      XMLPrintHandler.writeFile(doc, new File(destination, CACHE_EXTENSION));
    }
    catch (ParserConfigurationException localParserConfigurationException) {}catch (FactoryConfigurationError localFactoryConfigurationError) {}catch (IOException localIOException) {}
  }
  
  protected void addAuxiliaryData(BundleDescription desc, Dictionary manifest, boolean hasBundleStructure)
  {
    PluginInfo info = new PluginInfo();
    name = ((String)manifest.get("Bundle-Name"));
    providerName = ((String)manifest.get("Bundle-Vendor"));
    
    String className = (String)manifest.get("Plugin-Class");
    className = (className != null ? className : (String)manifest.get("Bundle-Activator"));
    libraries = getClasspath(manifest);
    hasExtensibleAPI = "true".equals(manifest.get("Eclipse-ExtensibleAPI"));
    isPatchFragment = "true".equals(manifest.get("Eclipse-PatchFragment"));
    localization = ((String)manifest.get("Bundle-Localization"));
    hasBundleStructure = hasBundleStructure;
    bundleSourceEntry = ((String)manifest.get("Eclipse-SourceBundle"));
    fPluginInfos.put(Long.toString(desc.getBundleId()), info);
  }
  
  protected String[] getClasspath(Dictionary manifest)
  {
    String fullClasspath = (String)manifest.get("Bundle-ClassPath");
    String[] result = new String[0];
    try
    {
      if (fullClasspath != null)
      {
        ManifestElement[] classpathEntries = ManifestElement.parseHeader("Bundle-ClassPath", fullClasspath);
        result = new String[classpathEntries.length];
        for (int i = 0; i < classpathEntries.length; i++) {
          result[i] = classpathEntries[i].getValue();
        }
      }
    }
    catch (BundleException localBundleException) {}
    return result;
  }
  
  protected void clear()
  {
    fPluginInfos.clear();
  }
  
  class PluginInfo
  {
    String name;
    String providerName;
    String className;
    boolean hasExtensibleAPI;
    boolean isPatchFragment;
    boolean hasBundleStructure;
    String[] libraries;
    String project;
    String localization;
    String bundleSourceEntry;
    
    PluginInfo() {}
  }
}

/* Location:
 * Qualified Name:     org.eclipse.pde.internal.core.PDEAuxiliaryState
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.pde.internal.core;

import org.eclipse.core.runtime.IPath;

public class PDEClasspathContainer$Rule
{
  IPath path;
  boolean discouraged;
  final PDEClasspathContainer this$0;
  
  public PDEClasspathContainer$Rule(PDEClasspathContainer paramPDEClasspathContainer)
  {
    this$0 = paramPDEClasspathContainer;
  }
  
  public boolean equals(Object other)
  {
    if (!(other instanceof Rule)) {
      return false;
    }
    return (discouraged == discouraged) && (path.equals(path));
  }
  
  public String toString()
  {
    return discouraged ? path.toString() + " [discouraged]" : path.toString();
  }
}

/* Location:
 * Qualified Name:     org.eclipse.pde.internal.core.PDEClasspathContainer.Rule
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.pde.internal.core;

import java.io.File;
import java.util.ArrayList;
import java.util.HashMap;
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.IAccessRule;
import org.eclipse.jdt.core.IClasspathAttribute;
import org.eclipse.jdt.core.IClasspathEntry;
import org.eclipse.jdt.core.JavaCore;
import org.eclipse.osgi.service.resolver.BundleDescription;
import org.eclipse.pde.core.plugin.IPluginBase;
import org.eclipse.pde.core.plugin.IPluginLibrary;
import org.eclipse.pde.core.plugin.IPluginModelBase;
import org.eclipse.pde.core.plugin.PluginRegistry;

public class PDEClasspathContainer
{
  public class Rule
  {
    IPath path;
    boolean discouraged;
    
    public Rule() {}
    
    public boolean equals(Object other)
    {
      if (!(other instanceof Rule)) {
        return false;
      }
      return (discouraged == discouraged) && (path.equals(path));
    }
    
    public String toString()
    {
      return discouraged ? path.toString() + " [discouraged]" : path.toString();
    }
  }
  
  private static HashMap ACCESSIBLE_RULES = new HashMap();
  private static HashMap DISCOURAGED_RULES = new HashMap();
  private static final IAccessRule EXCLUDE_ALL_RULE = JavaCore.newAccessRule(new Path("**/*"), 257);
  
  protected void addProjectEntry(IProject project, Rule[] rules, ArrayList entries)
    throws CoreException
  {
    if (project.hasNature("org.eclipse.jdt.core.javanature"))
    {
      IClasspathEntry entry = null;
      if (rules != null)
      {
        IAccessRule[] accessRules = getAccessRules(rules);
        entry = JavaCore.newProjectEntry(project.getFullPath(), accessRules, true, new IClasspathAttribute[0], false);
      }
      else
      {
        entry = JavaCore.newProjectEntry(project.getFullPath());
      }
      if (!entries.contains(entry)) {
        entries.add(entry);
      }
    }
  }
  
  public static IClasspathEntry[] getExternalEntries(IPluginModelBase model)
  {
    ArrayList entries = new ArrayList();
    addExternalPlugin(model, new Rule[0], entries);
    return (IClasspathEntry[])entries.toArray(new IClasspathEntry[entries.size()]);
  }
  
  protected static void addExternalPlugin(IPluginModelBase model, Rule[] rules, ArrayList entries)
  {
    if (new File(model.getInstallLocation()).isFile())
    {
      IPath srcPath = ClasspathUtilCore.getSourceAnnotation(model, ".");
      if (srcPath == null) {
        srcPath = new Path(model.getInstallLocation());
      }
      addLibraryEntry(new Path(model.getInstallLocation()), srcPath, rules, getClasspathAttributes(model), entries);
      
      File[] extractedLibraries = PDECore.getDefault().getModelManager().getExternalModelManager().getExtractedLibraries(model);
      for (int i = 0; i < extractedLibraries.length; i++)
      {
        Path path = new Path(extractedLibraries[i].getAbsolutePath());
        addLibraryEntry(path, path, rules, getClasspathAttributes(model), entries);
      }
    }
    else
    {
      IPluginLibrary[] libraries = model.getPluginBase().getLibraries();
      for (int i = 0; i < libraries.length; i++) {
        if (!"resource".equals(libraries[i].getType()))
        {
          model = (IPluginModelBase)libraries[i].getModel();
          String name = libraries[i].getName();
          String expandedName = ClasspathUtilCore.expandLibraryName(name);
          IPath path = ClasspathUtilCore.getPath(model, expandedName);
          if ((path == null) && (!model.isFragmentModel()) && (ClasspathUtilCore.containsVariables(name)))
          {
            model = resolveLibraryInFragments(model, expandedName);
            if ((model != null) && (model.isEnabled())) {
              path = ClasspathUtilCore.getPath(model, expandedName);
            }
          }
          if (path != null) {
            addLibraryEntry(path, ClasspathUtilCore.getSourceAnnotation(model, expandedName), rules, getClasspathAttributes(model), entries);
          }
        }
      }
    }
  }
  
  protected static void addLibraryEntry(IPath path, IPath srcPath, Rule[] rules, IClasspathAttribute[] attributes, ArrayList entries)
  {
    IClasspathEntry entry = null;
    if (rules != null) {
      entry = JavaCore.newLibraryEntry(path, srcPath, null, getAccessRules(rules), attributes, false);
    } else {
      entry = JavaCore.newLibraryEntry(path, srcPath, null, new IAccessRule[0], attributes, false);
    }
    if (!entries.contains(entry)) {
      entries.add(entry);
    }
  }
  
  protected static IAccessRule[] getAccessRules(Rule[] rules)
  {
    IAccessRule[] accessRules = new IAccessRule[rules.length + 1];
    for (int i = 0; i < rules.length; i++)
    {
      Rule rule = rules[i];
      accessRules[i] = (discouraged ? getDiscouragedRule(path) : getAccessibleRule(path));
    }
    accessRules[rules.length] = EXCLUDE_ALL_RULE;
    return accessRules;
  }
  
  private static synchronized IAccessRule getAccessibleRule(IPath path)
  {
    IAccessRule rule = (IAccessRule)ACCESSIBLE_RULES.get(path);
    if (rule == null)
    {
      rule = JavaCore.newAccessRule(path, 0);
      ACCESSIBLE_RULES.put(path, rule);
    }
    return rule;
  }
  
  private static IClasspathAttribute[] getClasspathAttributes(IPluginModelBase model)
  {
    JavadocLocationManager manager = PDECore.getDefault().getJavadocLocationManager();
    String location = manager.getJavadocLocation(model);
    if (location == null) {
      return new IClasspathAttribute[0];
    }
    return new IClasspathAttribute[] { JavaCore.newClasspathAttribute("javadoc_location", location) };
  }
  
  private static synchronized IAccessRule getDiscouragedRule(IPath path)
  {
    IAccessRule rule = (IAccessRule)DISCOURAGED_RULES.get(path);
    if (rule == null)
    {
      rule = JavaCore.newAccessRule(path, 2);
      DISCOURAGED_RULES.put(path, rule);
    }
    return rule;
  }
  
  protected static IPluginModelBase resolveLibraryInFragments(IPluginModelBase model, String libraryName)
  {
    BundleDescription desc = model.getBundleDescription();
    if (desc != null)
    {
      BundleDescription[] fragments = desc.getFragments();
      for (int i = 0; i < fragments.length; i++) {
        if (new File(fragments[i].getLocation(), libraryName).exists()) {
          return PluginRegistry.findModel(fragments[i]);
        }
      }
    }
    return null;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.pde.internal.core.PDEClasspathContainer
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.pde.internal.core;

import org.eclipse.core.resources.ISaveContext;
import org.eclipse.core.resources.ISaveParticipant;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.pde.internal.core.target.P2TargetUtils;

class PDECore$1
  implements ISaveParticipant
{
  final PDECore this$0;
  
  PDECore$1(PDECore paramPDECore)
  {
    this$0 = paramPDECore;
  }
  
  public void saving(ISaveContext saveContext)
    throws CoreException
  {
    P2TargetUtils.cleanOrphanedTargetDefinitionProfiles();
    if (PDECore.access$0(this$0) != null) {
      PDECore.access$0(this$0).saving(saveContext);
    }
    PluginModelManager.saveInstance();
  }
  
  public void rollback(ISaveContext saveContext)
  {
    if (PDECore.access$0(this$0) != null) {
      PDECore.access$0(this$0).rollback(saveContext);
    }
  }
  
  public void prepareToSave(ISaveContext saveContext)
    throws CoreException
  {
    if (PDECore.access$0(this$0) != null) {
      PDECore.access$0(this$0).prepareToSave(saveContext);
    }
  }
  
  public void doneSaving(ISaveContext saveContext)
  {
    if (PDECore.access$0(this$0) != null) {
      PDECore.access$0(this$0).doneSaving(saveContext);
    }
  }
}

/* Location:
 * Qualified Name:     org.eclipse.pde.internal.core.PDECore.1
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.pde.internal.core;

import java.io.IOException;
import java.lang.reflect.InvocationTargetException;
import java.net.URL;
import java.util.Hashtable;
import org.eclipse.core.resources.ISaveContext;
import org.eclipse.core.resources.ISaveParticipant;
import org.eclipse.core.resources.IWorkspace;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.FileLocator;
import org.eclipse.core.runtime.ILog;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Plugin;
import org.eclipse.core.runtime.QualifiedName;
import org.eclipse.core.runtime.Status;
import org.eclipse.jdt.launching.JavaRuntime;
import org.eclipse.pde.core.plugin.IPluginBase;
import org.eclipse.pde.core.plugin.IPluginModelBase;
import org.eclipse.pde.core.project.IBundleProjectService;
import org.eclipse.pde.internal.core.builders.FeatureRebuilder;
import org.eclipse.pde.internal.core.builders.PluginRebuilder;
import org.eclipse.pde.internal.core.project.BundleProjectService;
import org.eclipse.pde.internal.core.schema.SchemaRegistry;
import org.eclipse.pde.internal.core.target.P2TargetUtils;
import org.eclipse.pde.internal.core.target.TargetPlatformService;
import org.eclipse.pde.internal.core.target.provisional.ITargetPlatformService;
import org.eclipse.update.configurator.ConfiguratorUtils;
import org.eclipse.update.configurator.IPlatformConfiguration;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceReference;
import org.osgi.framework.ServiceRegistration;

public class PDECore
  extends Plugin
{
  public static final String PLUGIN_ID = "org.eclipse.pde.core";
  public static final IPath REQUIRED_PLUGINS_CONTAINER_PATH = new Path("org.eclipse.pde.core.requiredPlugins");
  public static final IPath JAVA_SEARCH_CONTAINER_PATH = new Path("org.eclipse.pde.core.externalJavaSearch");
  public static final IPath JRE_CONTAINER_PATH = new Path(JavaRuntime.JRE_CONTAINER);
  public static final String BINARY_PROJECT_VALUE = "binary";
  public static final String BINARY_REPOSITORY_PROVIDER = "org.eclipse.pde.core.BinaryRepositoryProvider";
  public static final QualifiedName EXTERNAL_PROJECT_PROPERTY = new QualifiedName("org.eclipse.pde.core", "imported");
  public static final QualifiedName TOUCH_PROJECT = new QualifiedName("org.eclipse.pde.core", "TOUCH_PROJECT");
  public static final QualifiedName SCHEMA_PREVIEW_FILE = new QualifiedName("org.eclipse.pde.core", "SCHEMA_PREVIEW_FILE");
  private static PDECore inst;
  private static IPluginModelBase[] registryPlugins;
  private static PDEExtensionRegistry fExtensionRegistry = null;
  private static PDEPreferencesManager fPreferenceManager;
  private FeatureModelManager fFeatureModelManager;
  private TargetDefinitionManager fTargetProfileManager;
  private SchemaRegistry fSchemaRegistry;
  private SourceLocationManager fSourceLocationManager;
  private JavadocLocationManager fJavadocLocationManager;
  private SearchablePluginsManager fSearchablePluginsManager;
  private TracingOptionsManager fTracingOptionsManager;
  private BundleContext fBundleContext;
  private JavaElementChangeListener fJavaElementChangeListener;
  private FeatureRebuilder fFeatureRebuilder;
  private PluginRebuilder fPluginRebuilder;
  private ServiceRegistration fTargetPlatformService;
  private ServiceRegistration fBundleProjectService;
  
  public static PDECore getDefault()
  {
    return inst;
  }
  
  public synchronized PDEPreferencesManager getPreferencesManager()
  {
    if (fPreferenceManager == null) {
      fPreferenceManager = new PDEPreferencesManager("org.eclipse.pde.core");
    }
    return fPreferenceManager;
  }
  
  public static IWorkspace getWorkspace()
  {
    return ResourcesPlugin.getWorkspace();
  }
  
  public static void log(IStatus status)
  {
    if (status != null) {
      ResourcesPlugin.getPlugin().getLog().log(status);
    }
  }
  
  public static void log(Throwable e)
  {
    if ((e instanceof InvocationTargetException)) {
      e = ((InvocationTargetException)e).getTargetException();
    }
    IStatus status = null;
    if ((e instanceof CoreException)) {
      status = ((CoreException)e).getStatus();
    } else if (e.getMessage() != null) {
      status = new Status(4, "org.eclipse.pde.core", 0, e.getMessage(), e);
    }
    log(status);
  }
  
  public static void logErrorMessage(String message)
  {
    log(new Status(4, "org.eclipse.pde.core", 4, message, null));
  }
  
  public static void logException(Throwable e)
  {
    logException(e, null);
  }
  
  public static void logException(Throwable e, String message)
  {
    if ((e instanceof InvocationTargetException)) {
      e = ((InvocationTargetException)e).getTargetException();
    }
    IStatus status = null;
    if ((e instanceof CoreException))
    {
      status = ((CoreException)e).getStatus();
    }
    else
    {
      if (message == null) {
        message = e.getMessage();
      }
      if (message == null) {
        message = e.toString();
      }
      status = new Status(4, "org.eclipse.pde.core", 0, message, e);
    }
    log(status);
  }
  
  public PDECore()
  {
    inst = this;
  }
  
  public URL getInstallURL()
  {
    try
    {
      return FileLocator.resolve(getDefault().getBundle().getEntry("/"));
    }
    catch (IOException localIOException) {}
    return null;
  }
  
  public IPluginModelBase findPluginInHost(String id)
  {
    if (registryPlugins == null)
    {
      URL[] pluginPaths = ConfiguratorUtils.getCurrentPlatformConfiguration().getPluginPath();
      PDEState state = new PDEState(pluginPaths, false, new NullProgressMonitor());
      registryPlugins = state.getTargetModels();
    }
    for (int i = 0; i < registryPlugins.length; i++) {
      if (registryPlugins[i].getPluginBase().getId().equals(id)) {
        return registryPlugins[i];
      }
    }
    return null;
  }
  
  public PluginModelManager getModelManager()
  {
    return PluginModelManager.getInstance();
  }
  
  public synchronized TargetDefinitionManager getTargetProfileManager()
  {
    if (fTargetProfileManager == null) {
      fTargetProfileManager = new TargetDefinitionManager();
    }
    return fTargetProfileManager;
  }
  
  public synchronized FeatureModelManager getFeatureModelManager()
  {
    if (fFeatureModelManager == null) {
      fFeatureModelManager = new FeatureModelManager();
    }
    return fFeatureModelManager;
  }
  
  public JavaElementChangeListener getJavaElementChangeListener()
  {
    return fJavaElementChangeListener;
  }
  
  public synchronized SchemaRegistry getSchemaRegistry()
  {
    if (fSchemaRegistry == null) {
      fSchemaRegistry = new SchemaRegistry();
    }
    return fSchemaRegistry;
  }
  
  public synchronized PDEExtensionRegistry getExtensionsRegistry()
  {
    if (fExtensionRegistry == null) {
      fExtensionRegistry = new PDEExtensionRegistry();
    }
    return fExtensionRegistry;
  }
  
  public synchronized SourceLocationManager getSourceLocationManager()
  {
    if (fSourceLocationManager == null) {
      fSourceLocationManager = new SourceLocationManager();
    }
    return fSourceLocationManager;
  }
  
  public synchronized JavadocLocationManager getJavadocLocationManager()
  {
    if (fJavadocLocationManager == null) {
      fJavadocLocationManager = new JavadocLocationManager();
    }
    return fJavadocLocationManager;
  }
  
  public synchronized TracingOptionsManager getTracingOptionsManager()
  {
    if (fTracingOptionsManager == null) {
      fTracingOptionsManager = new TracingOptionsManager();
    }
    return fTracingOptionsManager;
  }
  
  public synchronized SearchablePluginsManager getSearchablePluginsManager()
  {
    if (fSearchablePluginsManager == null) {
      fSearchablePluginsManager = new SearchablePluginsManager();
    }
    return fSearchablePluginsManager;
  }
  
  public boolean areModelsInitialized()
  {
    return getModelManager().isInitialized();
  }
  
  public void start(BundleContext context)
    throws Exception
  {
    super.start(context);
    fBundleContext = context;
    
    fJavaElementChangeListener = new JavaElementChangeListener();
    fJavaElementChangeListener.start();
    fPluginRebuilder = new PluginRebuilder();
    fPluginRebuilder.start();
    fFeatureRebuilder = new FeatureRebuilder();
    fFeatureRebuilder.start();
    
    fTargetPlatformService = context.registerService(ITargetPlatformService.class.getName(), TargetPlatformService.getDefault(), new Hashtable());
    fBundleProjectService = context.registerService(IBundleProjectService.class.getName(), BundleProjectService.getDefault(), new Hashtable());
    
    ResourcesPlugin.getWorkspace().addSaveParticipant("org.eclipse.pde.core", new ISaveParticipant()
    {
      public void saving(ISaveContext saveContext)
        throws CoreException
      {
        P2TargetUtils.cleanOrphanedTargetDefinitionProfiles();
        if (fSearchablePluginsManager != null) {
          fSearchablePluginsManager.saving(saveContext);
        }
        PluginModelManager.saveInstance();
      }
      
      public void rollback(ISaveContext saveContext)
      {
        if (fSearchablePluginsManager != null) {
          fSearchablePluginsManager.rollback(saveContext);
        }
      }
      
      public void prepareToSave(ISaveContext saveContext)
        throws CoreException
      {
        if (fSearchablePluginsManager != null) {
          fSearchablePluginsManager.prepareToSave(saveContext);
        }
      }
      
      public void doneSaving(ISaveContext saveContext)
      {
        if (fSearchablePluginsManager != null) {
          fSearchablePluginsManager.doneSaving(saveContext);
        }
      }
    });
  }
  
  public BundleContext getBundleContext()
  {
    return fBundleContext;
  }
  
  public void stop(BundleContext context)
    throws CoreException
  {
    if (fPreferenceManager != null) {
      fPreferenceManager.savePluginPreferences();
    }
    fJavaElementChangeListener.shutdown();
    fPluginRebuilder.stop();
    fFeatureRebuilder.stop();
    if (fSchemaRegistry != null)
    {
      fSchemaRegistry.shutdown();
      fSchemaRegistry = null;
    }
    if (fTargetProfileManager != null)
    {
      fTargetProfileManager.shutdown();
      fTargetProfileManager = null;
    }
    if (fSearchablePluginsManager != null)
    {
      fSearchablePluginsManager.shutdown();
      fSearchablePluginsManager = null;
    }
    if (fFeatureModelManager != null)
    {
      fFeatureModelManager.shutdown();
      fFeatureModelManager = null;
    }
    if (fExtensionRegistry != null)
    {
      fExtensionRegistry.stop();
      fExtensionRegistry = null;
    }
    PluginModelManager.shutdownInstance();
    if (fTargetPlatformService != null)
    {
      fTargetPlatformService.unregister();
      fTargetPlatformService = null;
    }
    if (fBundleProjectService != null)
    {
      fBundleProjectService.unregister();
      fBundleProjectService = null;
    }
    ResourcesPlugin.getWorkspace().removeSaveParticipant("org.eclipse.pde.core");
  }
  
  public Object acquireService(String serviceName)
  {
    ServiceReference reference = fBundleContext.getServiceReference(serviceName);
    if (reference == null) {
      return null;
    }
    Object service = fBundleContext.getService(reference);
    if (service != null) {
      fBundleContext.ungetService(reference);
    }
    return service;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.pde.internal.core.PDECore
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.pde.internal.core;

import org.eclipse.osgi.util.NLS;

public class PDECoreMessages
  extends NLS
{
  private static final String BUNDLE_NAME = "org.eclipse.pde.internal.core.pderesources";
  public static String BaseExportTask_pdeExport;
  public static String BuildErrorReporter_cannotFindBundle;
  public static String BuildErrorReporter_cannotFindJar;
  public static String BundleErrorReporter_badFilter;
  public static String BundleErrorReporter_bundleActivationPolicy_unsupported;
  public static String BundleErrorReporter_localization_folder_not_exist;
  public static String BundleErrorReporter_localization_properties_file_not_exist;
  public static String BundleErrorReporter_providePackageHeaderDeprecated;
  public static String BundleErrorReporter_reqExecEnv_conflict;
  public static String BundleErrorReporter_reqExecEnv_unknown;
  public static String BundleErrorReporter_unresolvedExporter;
  public static String BundleErrorReporter_unresolvedHost;
  public static String BundleErrorReporter_unsatisfiedConstraint;
  public static String BundleErrorReporter_unsupportedSingletonDirective;
  public static String BundleErrorReporter_MissingVersion;
  public static String BundleTextChangeListener_editNames_insert;
  public static String BundleTextChangeListener_editNames_modify;
  public static String BundleTextChangeListener_editNames_newLine;
  public static String BundleTextChangeListener_editNames_remove;
  public static String ExecutionEnvironmentProfileManager_0;
  public static String ExtensionPointSchemaBuilder_0;
  public static String ExtensionsErrorReporter_maxOccurrence;
  public static String ExtensionsErrorReporter_minOccurrence;
  public static String ExtensionsErrorReporter_unknownIdentifier;
  public static String BinaryRepositoryProvider_veto;
  public static String P2Utils_UnableToAcquireP2Service;
  public static String ProductExportOperation_0;
  public static String PropertiesTextChangeListener_editNames_delete;
  public static String PropertiesTextChangeListener_editNames_insert;
  public static String PropertiesTextChangeListener_editNames_remove;
  public static String RequiredPluginsClasspathContainer_description;
  public static String ExternalJavaSearchClasspathContainer_description;
  public static String SchemaElementReference_refElementMissing;
  public static String TargetPlatform_exceptionThrown;
  public static String FeatureBasedExportOperation_ProblemDuringExport;
  public static String FeatureConsistencyChecker_0;
  public static String FeatureInfo_description;
  public static String FeatureInfo_license;
  public static String FeatureInfo_copyright;
  public static String PluginObject_readOnlyChange;
  public static String FeatureObject_readOnlyChange;
  public static String SiteBuildOperation_0;
  public static String SiteObject_readOnlyChange;
  public static String BuildObject_readOnlyException;
  public static String PluginBase_librariesNotFoundException;
  public static String PluginParent_siblingsNotFoundException;
  public static String PluginBase_importsNotFoundException;
  public static String AbstractExtensions_extensionsNotFoundException;
  public static String SchemaCompositor_all;
  public static String SchemaCompositor_choice;
  public static String SchemaCompositor_group;
  public static String SchemaCompositor_sequence;
  public static String Builders_updating;
  public static String Builders_verifying;
  public static String Builders_DependencyLoopFinder_loopName;
  public static String Builders_Feature_reference;
  public static String Builders_Feature_freference;
  public static String Builders_Feature_multiplicity;
  public static String Builders_Feature_empty;
  public static String Builders_Feature_badURL;
  public static String Builders_Feature_exclusiveAttributes;
  public static String Builders_Feature_patchPlugin;
  public static String Builders_Feature_patchedVersion;
  public static String Builders_Feature_patchedMatch;
  public static String Builders_Feature_missingUnpackFalse;
  public static String Builders_Feature_mismatchUnpackBundleShape;
  public static String Builders_Feature_mismatchPluginVersion;
  public static String Builders_Schema_compiling;
  public static String Builders_Schema_compilingSchemas;
  public static String Builders_Schema_removing;
  public static String Builders_Schema_noMatchingEndTag;
  public static String Builders_Schema_noMatchingStartTag;
  public static String Builders_Schema_forbiddenEndTag;
  public static String Builders_Schema_valueRequired;
  public static String Builders_Schema_valueNotRequired;
  public static String Builders_Schema_duplicateElement;
  public static String Builders_Schema_includeNotValid;
  public static String Builders_Schema_referencedElementNotFound;
  public static String Builders_Manifest_missingRequired;
  public static String Builders_Manifest_dependency;
  public static String Builders_Manifest_ex_point;
  public static String Builders_Manifest_child;
  public static String Builders_Manifest_illegalRoot;
  public static String Builders_Manifest_attribute;
  public static String Builders_Manifest_att_value;
  public static String Builders_Manifest_compositeID;
  public static String Builders_Manifest_simpleID;
  public static String Builders_Manifest_non_ext_attribute;
  public static String Builders_Manifest_non_ext_element;
  public static String Builders_Manifest_deprecated_attribute;
  public static String Builders_Manifest_deprecated_element;
  public static String Builders_Manifest_internal_rootElement;
  public static String Builders_Manifest_deprecated_rootElement;
  public static String Builders_Manifest_deprecated_rootElementSuggestion;
  public static String Builders_Manifest_unused_element;
  public static String Builders_Manifest_unused_attribute;
  public static String Builders_Manifest_class;
  public static String Builders_Manifest_resource;
  public static String Builders_Manifest_deprecated_3_0;
  public static String Builders_Manifest_key_not_found;
  public static String Builders_Manifest_useless_file;
  public static String Builders_Manifest_discouragedClass;
  public static String Builders_Convert_missingAttribute;
  public static String Builders_Convert_illegalValue;
  public static String BundleErrorReporter_lineTooLong;
  public static String BundleErrorReporter_noMainSection;
  public static String BundleErrorReporter_duplicateHeader;
  public static String BundleErrorReporter_noColon;
  public static String BundleErrorReporter_noSpaceValue;
  public static String BundleErrorReporter_nameHeaderInMain;
  public static String BundleErrorReporter_noNameHeader;
  public static String BundleErrorReporter_invalidHeaderName;
  public static String BundleErrorReporter_noLineTermination;
  public static String BundleErrorReporter_parseHeader;
  public static String BundleErrorReporter_att_value;
  public static String BundleErrorReporter_dir_value;
  public static String BundleErrorReporter_illegal_value;
  public static String BundleErrorReporter_deprecated_attribute_optional;
  public static String BundleErrorReporter_deprecated_attribute_reprovide;
  public static String BundleErrorReporter_deprecated_attribute_singleton;
  public static String BundleErrorReporter_deprecated_attribute_specification_version;
  public static String BundleErrorReporter_directive_hasNoEffectWith_;
  public static String BundleErrorReporter_singletonAttrRequired;
  public static String BundleErrorReporter_singletonRequired;
  public static String BundleErrorReporter_headerMissing;
  public static String BundleErrorReporter_NoSymbolicName;
  public static String BundleErrorReporter_illegalManifestVersion;
  public static String BundleErrorReporter_ClasspathNotEmpty;
  public static String BundleErrorReporter_fragmentActivator;
  public static String BundleErrorReporter_NoExist;
  public static String BundleErrorReporter_InvalidFormatInBundleVersion;
  public static String BundleErrorReporter_NotExistInProject;
  public static String BundleErrorReporter_BundleRangeInvalidInBundleVersion;
  public static String BundleErrorReporter_invalidVersionRangeFormat;
  public static String BundleErrorReporter_NotExistPDE;
  public static String BundleErrorReporter_HostNotExistPDE;
  public static String BundleErrorReporter_HostNeeded;
  public static String BundleErrorReporter_PackageNotExported;
  public static String BundleErrorReporter_InvalidSymbolicName;
  public static String BundleErrorReporter_invalidFilterSyntax;
  public static String BundleErrorReporter_importexport_servicesDeprecated;
  public static String BundleErrorReporter_unecessaryDependencyDueToFragmentHost;
  public static String BundleErrorReporter_missingPackagesInProject;
  public static String BundleErrorReporter_noExecutionEnvironmentSet;
  public static String BundleErrorReporter_startHeader_autoStartDeprecated;
  public static String BundleErrorReporter_exportNoJRE;
  public static String BundleErrorReporter_importNoJRE;
  public static String ManifestConsistencyChecker_0;
  public static String ManifestConsistencyChecker_buildDoesNotExist;
  public static String ManifestConsistencyChecker_builderTaskName;
  public static String ManifestConsistencyChecker_manifestDoesNotExist;
  public static String ManifestConsistencyChecker_manifestMisspelled;
  public static String BundleErrorReporter_lazyStart_unsupported;
  public static String BundleManifestSourceLocationManager_problemProcessBundleManifestHeaderAttributeMissing;
  public static String BundleValidationOperation_multiple_singletons;
  public static String ManifestConsistencyChecker_buildPropertiesSubtask;
  public static String BuildErrorReporter_missingEntry;
  public static String BuildErrorReporter_missingFolder;
  public static String BuildErrorReporter_emptyEntry;
  public static String BuildErrorReporter_binIncludesMissing;
  public static String BuildErrorReporter_buildEntryInvalidWhenNoProjectSettings;
  public static String BuildErrorReporter_buildEntryMissingProjectSpecificSettings;
  public static String BuildErrorReporter_buildEntryMissingValidPath;
  public static String BuildErrorReporter_buildEntryMissingValidRelativePath;
  public static String BuildErrorReporter_BuildEntryNotRequiredMatchesDefault;
  public static String BuildErrorReporter_sourceMissing;
  public static String BuildErrorReporter_srcIncludesSourceFolder;
  public static String BuildErrorReporter_srcIncludesSourceFolder1;
  public static String BuildErrorReporter_classpathEntryMissing;
  public static String BuildErrorReporter_missingFile;
  public static String BuildErrorReporter_entiresMustRefDirs;
  public static String BuildErrorReporter_dirsMustEndSlash;
  public static String BuildErrorReporter_classpathEntryMissing1;
  public static String BuildErrorReporter_CompilercomplianceLevel;
  public static String BuildErrorReporter_DisallowIdentifiers;
  public static String BuildErrorReporter_GeneratedClassFilesCompatibility;
  public static String BuildErrorReporter_ProjectSpecificJavaComplianceDifferentToken;
  public static String BuildErrorReporter_ProjectSpecificJavaComplianceMissingEntry;
  public static String BuildErrorReporter_SourceCompatibility;
  public static String ExportWizard_badDirectory;
  public static String FeatureExportJob_taskName;
  public static String FeatureExportOperation_0;
  public static String FeatureExportOperation_CompilationErrors;
  public static String FeatureExportOperation_runningAssemblyScript;
  public static String FeatureExportOperation_publishingMetadata;
  public static String FeatureExportOperation_runningBuildScript;
  public static String FeatureExportOperation_runningPackagerScript;
  public static String FeatureExportOperation_workspaceBuildErrorsFoundDuringExport;
  public static String TargetPlatformResetJob_resetTarget;
  public static String XMLErrorReporter_ExternalEntityResolution;
 
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64

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-2019. Infinite Loop Ltd