org.eclipse.help_3.6.0.v20120912-134126

16:44:57.969 INFO  jd.cli.Main - Decompiling org.eclipse.help_3.6.0.v20120912-134126.jar
package org.eclipse.help;

import org.eclipse.help.internal.HelpPlugin;
import org.eclipse.help.internal.extension.ContentExtensionManager;

public abstract class AbstractContentExtensionProvider
{
  public abstract IContentExtension[] getContentExtensions(String paramString);
  
  protected void contentChanged()
  {
    HelpPlugin.getContentExtensionManager().clearCache();
  }
}

/* Location:
 * Qualified Name:     org.eclipse.help.AbstractContentExtensionProvider
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.help;

public abstract class AbstractContextProvider
{
  public abstract IContext getContext(String paramString1, String paramString2);
  
  public abstract String[] getPlugins();
}

/* Location:
 * Qualified Name:     org.eclipse.help.AbstractContextProvider
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.help;

public abstract class AbstractCriteriaDefinitionProvider
{
  public abstract ICriteriaDefinitionContribution[] getCriteriaDefinitionContributions(String paramString);
}

/* Location:
 * Qualified Name:     org.eclipse.help.AbstractCriteriaDefinitionProvider
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.help;

public abstract class AbstractCriteriaProvider
{
  public abstract ICriteria[] getCriteria(ITopic paramITopic);
  
  public abstract ICriteria[] getCriteria(IToc paramIToc);
}

/* Location:
 * Qualified Name:     org.eclipse.help.AbstractCriteriaProvider
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.help;

import org.eclipse.help.internal.HelpPlugin;
import org.eclipse.help.internal.index.IndexManager;

public abstract class AbstractIndexProvider
{
  public abstract IIndexContribution[] getIndexContributions(String paramString);
  
  protected void contentChanged()
  {
    HelpPlugin.getIndexManager().clearCache();
  }
}

/* Location:
 * Qualified Name:     org.eclipse.help.AbstractIndexProvider
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.help;

import org.eclipse.help.internal.HelpPlugin;
import org.eclipse.help.internal.toc.TocManager;

public abstract class AbstractTocProvider
{
  public static final int DEFAULT_PRIORITY = 10;
  public static final int TOC_FILE_PRIORITY = 20;
  
  public abstract ITocContribution[] getTocContributions(String paramString);
  
  protected void contentChanged()
  {
    HelpPlugin.getTocManager().clearCache();
  }
  
  public int getPriority()
  {
    return 10;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.help.AbstractTocProvider
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.help;

import java.io.InputStream;
import org.eclipse.core.runtime.Platform;
import org.eclipse.help.internal.HelpPlugin;
import org.eclipse.help.internal.HelpPlugin.IHelpProvider;
import org.eclipse.help.internal.context.ContextManager;
import org.eclipse.help.internal.index.IndexManager;
import org.eclipse.help.internal.toc.TocManager;

public final class HelpSystem
{
  private static boolean fShared;
  
  public static IContext getContext(String contextId)
  {
    return HelpPlugin.getContextManager().getContext(contextId, Platform.getNL());
  }
  
  public static IContext getContext(String contextId, String locale)
  {
    return HelpPlugin.getContextManager().getContext(contextId, locale);
  }
  
  public static IToc[] getTocs()
  {
    return HelpPlugin.getTocManager().getTocs(Platform.getNL());
  }
  
  public static IIndex getIndex()
  {
    return HelpPlugin.getIndexManager().getIndex(Platform.getNL());
  }
  
  public static InputStream getHelpContent(String href)
  {
    return getHelpContent(href, Platform.getNL());
  }
  
  public static InputStream getHelpContent(String href, String locale)
  {
    HelpPlugin.IHelpProvider provider = HelpPlugin.getDefault().getHelpProvider();
    if (provider != null) {
      return provider.getHelpContent(href, locale);
    }
    return null;
  }
  
  public static boolean isShared()
  {
    return fShared;
  }
  
  public static void setShared(boolean shared)
  {
    fShared = shared;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.help.HelpSystem
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.help;

public abstract interface IAnchor
  extends IUAElement
{
  public abstract String getId();
}

/* Location:
 * Qualified Name:     org.eclipse.help.IAnchor
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.help;

public abstract interface ICommandLink
  extends IUAElement
{
  public abstract String getLabel();
  
  public abstract String getSerialization();
}

/* Location:
 * Qualified Name:     org.eclipse.help.ICommandLink
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.help;

public abstract interface IContentExtension
  extends IUAElement
{
  public static final int CONTRIBUTION = 0;
  public static final int REPLACEMENT = 1;
  
  public abstract String getContent();
  
  public abstract String getPath();
  
  public abstract int getType();
}

/* Location:
 * Qualified Name:     org.eclipse.help.IContentExtension
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.help;

public abstract interface IContext
{
  public abstract IHelpResource[] getRelatedTopics();
  
  public abstract String getText();
}

/* Location:
 * Qualified Name:     org.eclipse.help.IContext
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.help;

public abstract interface IContext2
  extends IContext
{
  public abstract String getTitle();
  
  public abstract String getStyledText();
  
  public abstract String getCategory(IHelpResource paramIHelpResource);
}

/* Location:
 * Qualified Name:     org.eclipse.help.IContext2
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.help;

public abstract interface IContext3
  extends IContext2
{
  public abstract ICommandLink[] getRelatedCommands();
}

/* Location:
 * Qualified Name:     org.eclipse.help.IContext3
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.help;

public abstract interface IContextProvider
{
  public static final int NONE = 0;
  public static final int SELECTION = 1;
  
  public abstract int getContextChangeMask();
  
  public abstract IContext getContext(Object paramObject);
  
  public abstract String getSearchExpression(Object paramObject);
}

/* Location:
 * Qualified Name:     org.eclipse.help.IContextProvider
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.help;

public abstract interface ICriteria
  extends IUAElement
{
  public abstract String getName();
  
  public abstract String getValue();
}

/* Location:
 * Qualified Name:     org.eclipse.help.ICriteria
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.help;

public abstract interface ICriteriaDefinition
  extends IUAElement
{
  public abstract ICriterionDefinition[] getCriterionDefinitions();
}

/* Location:
 * Qualified Name:     org.eclipse.help.ICriteriaDefinition
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.help;

public abstract interface ICriteriaDefinitionContribution
{
  public abstract String getId();
  
  public abstract ICriteriaDefinition getCriteriaDefinition();
  
  public abstract String getLocale();
}

/* Location:
 * Qualified Name:     org.eclipse.help.ICriteriaDefinitionContribution
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.help;

public abstract interface ICriterionDefinition
  extends IUAElement
{
  public abstract String getId();
  
  public abstract String getName();
  
  public abstract ICriterionValueDefinition[] getCriterionValueDefinitions();
}

/* Location:
 * Qualified Name:     org.eclipse.help.ICriterionDefinition
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.help;

public abstract interface ICriterionValueDefinition
  extends IUAElement
{
  public abstract String getId();
  
  public abstract String getName();
}

/* Location:
 * Qualified Name:     org.eclipse.help.ICriterionValueDefinition
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.help;

/**
 * @deprecated
 */
public abstract interface IHelp
{
  /**
   * @deprecated
   */
  public abstract void displayHelp();
  
  /**
   * @deprecated
   */
  public abstract void displayContext(IContext paramIContext, int paramInt1, int paramInt2);
  
  /**
   * @deprecated
   */
  public abstract void displayContext(String paramString, int paramInt1, int paramInt2);
  
  /**
   * @deprecated
   */
  public abstract void displayHelpResource(String paramString);
  
  /**
   * @deprecated
   */
  public abstract void displayHelpResource(IHelpResource paramIHelpResource);
  
  /**
   * @deprecated
   */
  public abstract void displayHelp(String paramString);
  
  /**
   * @deprecated
   */
  public abstract void displayHelp(String paramString1, String paramString2);
  
  /**
   * @deprecated
   */
  public abstract void displayHelp(String paramString, int paramInt1, int paramInt2);
  
  /**
   * @deprecated
   */
  public abstract void displayHelp(IContext paramIContext, int paramInt1, int paramInt2);
  
  /**
   * @deprecated
   */
  public abstract IContext getContext(String paramString);
  
  /**
   * @deprecated
   */
  public abstract IToc[] getTocs();
  
  /**
   * @deprecated
   */
  public abstract boolean isContextHelpDisplayed();
}

/* Location:
 * Qualified Name:     org.eclipse.help.IHelp
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.help;

import java.io.InputStream;
import java.util.Locale;

public abstract interface IHelpContentProducer
{
  public abstract InputStream getInputStream(String paramString1, String paramString2, Locale paramLocale);
}

/* Location:
 * Qualified Name:     org.eclipse.help.IHelpContentProducer
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.help;

public abstract interface IHelpResource
{
  public static final String HREF = "href";
  public static final String LABEL = "label";
  
  public abstract String getHref();
  
  public abstract String getLabel();
}

/* Location:
 * Qualified Name:     org.eclipse.help.IHelpResource
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.help;

public abstract interface IInclude
  extends IUAElement
{
  public abstract String getPath();
}

/* Location:
 * Qualified Name:     org.eclipse.help.IInclude
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.help;

public abstract interface IIndex
  extends IUAElement
{
  public abstract IIndexEntry[] getEntries();
}

/* Location:
 * Qualified Name:     org.eclipse.help.IIndex
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.help;

public abstract interface IIndexContribution
{
  public abstract String getId();
  
  public abstract IIndex getIndex();
  
  public abstract String getLocale();
}

/* Location:
 * Qualified Name:     org.eclipse.help.IIndexContribution
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.help;

public abstract interface IIndexEntry
  extends IUAElement
{
  public abstract String getKeyword();
  
  public abstract ITopic[] getTopics();
  
  public abstract IIndexEntry[] getSubentries();
}

/* Location:
 * Qualified Name:     org.eclipse.help.IIndexEntry
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.help;

public abstract interface IIndexEntry2
  extends IIndexEntry
{
  public abstract IIndexSee[] getSees();
}

/* Location:
 * Qualified Name:     org.eclipse.help.IIndexEntry2
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.help;

public abstract interface IIndexSee
  extends IUAElement
{
  public abstract String getKeyword();
  
  public abstract boolean isSeeAlso();
  
  public abstract IIndexSubpath[] getSubpathElements();
}

/* Location:
 * Qualified Name:     org.eclipse.help.IIndexSee
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.help;

public abstract interface IIndexSubpath
  extends IUAElement
{
  public abstract String getKeyword();
}

/* Location:
 * Qualified Name:     org.eclipse.help.IIndexSubpath
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.help;

public abstract interface ILink
  extends IUAElement
{
  public abstract String getToc();
}

/* Location:
 * Qualified Name:     org.eclipse.help.ILink
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.help;

public abstract interface ILiveHelpAction
  extends Runnable
{
  public abstract void setInitializationString(String paramString);
}

/* Location:
 * Qualified Name:     org.eclipse.help.ILiveHelpAction
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.help;

public abstract interface IToc
  extends IUAElement, IHelpResource
{
  public static final String TOC = "toc";
  public static final String TOPIC = "topic";
  
  public abstract ITopic[] getTopics();
  
  public abstract ITopic getTopic(String paramString);
}

/* Location:
 * Qualified Name:     org.eclipse.help.IToc
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.help;

public abstract interface IToc2
  extends IToc
{
  public abstract ICriteria[] getCriteria();
  
  public abstract String getIcon();
  
  public abstract boolean isSorted();
}

/* Location:
 * Qualified Name:     org.eclipse.help.IToc2
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.help;

public abstract interface ITocContribution
{
  public abstract String getCategoryId();
  
  public abstract String getContributorId();
  
  public abstract String[] getExtraDocuments();
  
  public abstract String getId();
  
  public abstract String getLocale();
  
  public abstract String getLinkTo();
  
  public abstract IToc getToc();
  
  public abstract boolean isPrimary();
}

/* Location:
 * Qualified Name:     org.eclipse.help.ITocContribution
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.help;

public abstract interface ITopic
  extends IUAElement, IHelpResource
{
  public static final String TOPIC = "topic";
  
  public abstract ITopic[] getSubtopics();
}

/* Location:
 * Qualified Name:     org.eclipse.help.ITopic
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.help;

public abstract interface ITopic2
  extends ITopic
{
  public abstract ICriteria[] getCriteria();
  
  public abstract String getIcon();
  
  public abstract boolean isSorted();
}

/* Location:
 * Qualified Name:     org.eclipse.help.ITopic2
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.help;

import org.eclipse.core.expressions.IEvaluationContext;

public abstract interface IUAElement
{
  public abstract boolean isEnabled(IEvaluationContext paramIEvaluationContext);
  
  public abstract IUAElement[] getChildren();
}

/* Location:
 * Qualified Name:     org.eclipse.help.IUAElement
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.help;

import org.eclipse.core.expressions.EvaluationContext;
import org.eclipse.core.expressions.IEvaluationContext;
import org.eclipse.core.runtime.Platform;
import org.eclipse.help.internal.HelpPlugin;

public class UAContentFilter
{
  private static final String VARIABLE_PLATFORM = "platform";
  private static IEvaluationContext defaultContext;
  
  public static boolean isFiltered(Object element)
  {
    if (defaultContext == null) {
      defaultContext = createDefaultContext();
    }
    return isFiltered(element, defaultContext);
  }
  
  private static IEvaluationContext createDefaultContext()
  {
    EvaluationContext context = new EvaluationContext(null, Platform.class);
    context.addVariable("platform", Platform.class);
    return context;
  }
  
  public static boolean isFiltered(Object element, IEvaluationContext context)
  {
    if ((element instanceof IUAElement)) {
      try
      {
        return !((IUAElement)element).isEnabled(context);
      }
      catch (Throwable t)
      {
        String msg = "Error while checking element filter";
        HelpPlugin.logError(msg, t);
      }
    }
    return false;
  }
}

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

import org.eclipse.help.IAnchor;
import org.w3c.dom.Element;

public class Anchor
  extends UAElement
  implements IAnchor
{
  public static final String NAME = "anchor";
  public static final String ATTRIBUTE_ID = "id";
  
  public Anchor(IAnchor src)
  {
    super("anchor", src);
    setId(src.getId());
  }
  
  public Anchor(Element src)
  {
    super(src);
  }
  
  public String getId()
  {
    return getAttribute("id");
  }
  
  public void setId(String id)
  {
    setAttribute("id", id);
  }
}

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

import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.StringReader;
import java.net.URL;
import java.net.URLConnection;
import org.xml.sax.EntityResolver;
import org.xml.sax.InputSource;

public class CachedEntityResolver
  implements EntityResolver
{
  public InputSource resolveEntity(String publicId, String systemId)
  {
    int index = systemId.lastIndexOf("/");
    File cachedCopy = null;
    if (index != -1)
    {
      cachedCopy = new File(HelpPlugin.getConfigurationDirectory(), "/DTDs");
      cachedCopy.mkdirs();
      cachedCopy = new File(cachedCopy, systemId.substring(index));
    }
    if (cachedCopy != null)
    {
      if (!cachedCopy.exists()) {
        try
        {
          URL system = new URL(systemId);
          URLConnection sc = system.openConnection();
          BufferedReader in = new BufferedReader(
            new InputStreamReader(
            sc.getInputStream()));
          
          BufferedWriter out = new BufferedWriter(new FileWriter(cachedCopy));
          String inputLine;
          while ((inputLine = in.readLine()) != null)
          {
            String inputLine;
            out.write(inputLine);
            out.newLine();
          }
          in.close();
          out.flush();
          out.close();
        }
        catch (IOException localIOException) {}
      }
      try
      {
        InputSource is = new InputSource(new FileReader(cachedCopy));
        is.setSystemId(systemId);
        is.setPublicId(publicId);
        return is;
      }
      catch (FileNotFoundException localFileNotFoundException) {}
    }
    return new InputSource(new StringReader(""));
  }
}

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

import org.eclipse.help.ICommandLink;
import org.w3c.dom.Element;

public class CommandLink
  extends UAElement
  implements ICommandLink
{
  public static final String NAME = "command";
  public static final String ATTRIBUTE_LABEL = "label";
  public static final String ATTRIBUTE_SERIALIZATION = "serialization";
  
  public CommandLink(ICommandLink src)
  {
    super("command", src);
    setLabel(src.getLabel());
    setSerialization(src.getSerialization());
  }
  
  public CommandLink(Element src)
  {
    super(src);
  }
  
  public String getLabel()
  {
    return getAttribute("label");
  }
  
  public String getSerialization()
  {
    return getAttribute("serialization");
  }
  
  public void setLabel(String label)
  {
    setAttribute("label", label);
  }
  
  public void setSerialization(String serialization)
  {
    setAttribute("serialization", serialization);
  }
}

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

import java.io.StringReader;
import java.util.List;
import java.util.Set;
import org.xml.sax.Attributes;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
import org.xml.sax.helpers.DefaultHandler;

class HelpData$Handler
  extends DefaultHandler
{
  private boolean inTocOrder;
  private boolean inHidden;
  final HelpData this$0;
  
  private HelpData$Handler(HelpData paramHelpData)
  {
    this$0 = paramHelpData;
  }
  
  HelpData$Handler(HelpData paramHelpData, Handler paramHandler)
  {
    this(paramHelpData);
  }
  
  public void startElement(String uri, String localName, String name, Attributes attributes)
    throws SAXException
  {
    if ("tocOrder".equals(name))
    {
      inTocOrder = true;
    }
    else if ("hidden".equals(name))
    {
      inHidden = true;
    }
    else if (("toc".equals(name)) || ("category".equals(name)))
    {
      String id = attributes.getValue("id");
      if (id != null) {
        if (inTocOrder) {
          HelpData.access$0(this$0).add(id);
        } else if (inHidden) {
          HelpData.access$1(this$0).add(id);
        }
      }
    }
    else if (("index".equals(name)) && (inHidden))
    {
      String id = attributes.getValue("id");
      if (id != null) {
        HelpData.access$2(this$0).add(id);
      }
    }
    else if ("otherTocs".equals(name))
    {
      String sortAttribute = attributes.getValue("sort");
      if (sortAttribute != null) {
        HelpData.access$3(this$0, sortAttribute.toLowerCase());
      }
    }
  }
  
  public void endElement(String uri, String localName, String name)
    throws SAXException
  {
    if ("tocOrder".equals(name)) {
      inTocOrder = false;
    } else if ("hidden".equals(name)) {
      inHidden = false;
    }
  }
  
  public InputSource resolveEntity(String publicId, String systemId)
    throws SAXException
  {
    return new InputSource(new StringReader(""));
  }
}

/* Location:
 * Qualified Name:     org.eclipse.help.internal.HelpData.Handler
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.help.internal;

import java.io.IOException;
import java.io.InputStream;
import java.io.StringReader;
import java.net.URL;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import javax.xml.parsers.SAXParser;
import javax.xml.parsers.SAXParserFactory;
import org.eclipse.core.runtime.IProduct;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.preferences.IPreferencesService;
import org.eclipse.help.internal.util.ProductPreferences;
import org.osgi.framework.Bundle;
import org.xml.sax.Attributes;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
import org.xml.sax.helpers.DefaultHandler;

public class HelpData
{
  private static final String ELEMENT_TOC_ORDER = "tocOrder";
  private static final String ELEMENT_HIDDEN = "hidden";
  private static final String ELEMENT_TOC = "toc";
  private static final String ELEMENT_CATEGORY = "category";
  private static final String ELEMENT_INDEX = "index";
  private static final String ATTRIBUTE_ID = "id";
  private static final String ELEMENT_OTHER_TOCS = "otherTocs";
  private static final String ATTRIBUTE_SORT = "sort";
  private static final String PLUGINS_ROOT_SLASH = "PLUGINS_ROOT/";
  private static HelpData productHelpData;
  private URL url;
  private List tocOrder;
  private Set hiddenTocs;
  private Set hiddenIndexes;
  private String sortMode;
  
  public static synchronized HelpData getProductHelpData()
  {
    if (productHelpData == null)
    {
      String pluginId = null;
      IProduct product = Platform.getProduct();
      if (product != null) {
        pluginId = product.getDefiningBundle().getSymbolicName();
      }
      String helpDataFile = Platform.getPreferencesService().getString("org.eclipse.help", "HELP_DATA", "", null);
      if ((helpDataFile.length() > 0) && 
        (helpDataFile.startsWith("PLUGINS_ROOT/")))
      {
        int nextSlash = helpDataFile.indexOf('/', "PLUGINS_ROOT/".length());
        if (nextSlash > 0)
        {
          pluginId = helpDataFile.substring("PLUGINS_ROOT/".length(), nextSlash);
          helpDataFile = helpDataFile.substring(nextSlash + 1);
        }
      }
      if ((helpDataFile.length() > 0) && (pluginId != null))
      {
        Bundle bundle = Platform.getBundle(pluginId);
        if (bundle != null)
        {
          URL helpDataUrl = bundle.getEntry(helpDataFile);
          productHelpData = new HelpData(helpDataUrl);
        }
      }
      if (productHelpData == null) {
        productHelpData = new HelpData(null);
      }
    }
    return productHelpData;
  }
  
  public static void clearProductHelpData()
  {
    productHelpData = null;
  }
  
  public HelpData(URL url)
  {
    this.url = url;
  }
  
  public synchronized List getTocOrder()
  {
    if (tocOrder == null) {
      loadHelpData();
    }
    return tocOrder;
  }
  
  public synchronized Set getHiddenTocs()
  {
    if (hiddenTocs == null) {
      loadHelpData();
    }
    return hiddenTocs;
  }
  
  public synchronized Set getHiddenIndexes()
  {
    if (hiddenIndexes == null) {
      loadHelpData();
    }
    return hiddenIndexes;
  }
  
  public synchronized boolean isSortOthers()
  {
    if (sortMode == null) {
      loadHelpData();
    }
    return "true".equals(sortMode);
  }
  
  public InputStream getHelpDataFile(String filePath)
    throws IOException
  {
    return Platform.getProduct().getDefiningBundle().getEntry(filePath).openStream();
  }
  
  private void loadHelpData()
  {
    tocOrder = new ArrayList();
    hiddenTocs = new HashSet();
    hiddenIndexes = new HashSet();
    sortMode = "true";
    if (url != null)
    {
      try
      {
        SAXParser parser = SAXParserFactory.newInstance().newSAXParser();
        InputStream in = url.openStream();
        parser.parse(in, new Handler(null));
      }
      catch (Throwable t)
      {
        String msg = "Error loading help data file \"" + url + "\"";
        HelpPlugin.logError(msg, t);
      }
    }
    else
    {
      IPreferencesService preferencesService = Platform.getPreferencesService();
      String baseTocs = preferencesService.getString("org.eclipse.help", "baseTOCS", "", null);
      String ignoredTocs = preferencesService.getString("org.eclipse.help", "ignoredTOCS", "", null);
      String ignoredIndexes = preferencesService.getString("org.eclipse.help", "ignoredIndexes", "", null);
      tocOrder = ProductPreferences.tokenize(baseTocs);
      hiddenTocs.addAll(ProductPreferences.tokenize(ignoredTocs));
      hiddenIndexes.addAll(ProductPreferences.tokenize(ignoredIndexes));
    }
  }
  
  private class Handler
    extends DefaultHandler
  {
    private boolean inTocOrder;
    private boolean inHidden;
    
    Handler(Handler paramHandler)
    {
      this();
    }
    
    public void startElement(String uri, String localName, String name, Attributes attributes)
      throws SAXException
    {
      if ("tocOrder".equals(name))
      {
        inTocOrder = true;
      }
      else if ("hidden".equals(name))
      {
        inHidden = true;
      }
      else if (("toc".equals(name)) || ("category".equals(name)))
      {
        String id = attributes.getValue("id");
        if (id != null) {
          if (inTocOrder) {
            tocOrder.add(id);
          } else if (inHidden) {
            hiddenTocs.add(id);
          }
        }
      }
      else if (("index".equals(name)) && (inHidden))
      {
        String id = attributes.getValue("id");
        if (id != null) {
          hiddenIndexes.add(id);
        }
      }
      else if ("otherTocs".equals(name))
      {
        String sortAttribute = attributes.getValue("sort");
        if (sortAttribute != null) {
          sortMode = sortAttribute.toLowerCase();
        }
      }
    }
    
    public void endElement(String uri, String localName, String name)
      throws SAXException
    {
      if ("tocOrder".equals(name)) {
        inTocOrder = false;
      } else if ("hidden".equals(name)) {
        inHidden = false;
      }
    }
    
    public InputSource resolveEntity(String publicId, String systemId)
      throws SAXException
    {
      return new InputSource(new StringReader(""));
    }
    
    private Handler() {}
  }
}

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

import java.io.InputStream;

public abstract interface HelpPlugin$IHelpProvider
{
  public abstract InputStream getHelpContent(String paramString1, String paramString2);
}

/* Location:
 * Qualified Name:     org.eclipse.help.internal.HelpPlugin.IHelpProvider
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.help.internal;

import java.io.File;
import java.io.InputStream;
import java.net.URL;
import org.eclipse.core.runtime.ILog;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.Plugin;
import org.eclipse.core.runtime.Status;
import org.eclipse.help.internal.context.ContextManager;
import org.eclipse.help.internal.criteria.CriteriaManager;
import org.eclipse.help.internal.extension.ContentExtensionManager;
import org.eclipse.help.internal.index.IndexManager;
import org.eclipse.help.internal.toc.TocManager;
import org.eclipse.osgi.service.datalocation.Location;
import org.osgi.framework.BundleContext;

public class HelpPlugin
  extends Plugin
{
  public static final String PLUGIN_ID = "org.eclipse.help";
  public static boolean DEBUG = false;
  public static boolean DEBUG_CONTEXT = false;
  public static boolean DEBUG_SEARCH = false;
  public static boolean DEBUG_TOC = false;
  public static boolean DEBUG_INDEX = false;
  public static boolean DEBUG_CRITERIA = false;
  public static final String HELP_DATA_KEY = "HELP_DATA";
  public static final String BASE_TOCS_KEY = "baseTOCS";
  public static final String IGNORED_TOCS_KEY = "ignoredTOCS";
  public static final String IGNORED_INDEXES_KEY = "ignoredIndexes";
  public static final String FILTER_INFOCENTER_KEY = "filterInfocenter";
  private static HelpPlugin plugin;
  private static Object tocManagerCreateLock = new Object();
  private TocManager tocManager;
  private ContextManager contextManager;
  private ContentExtensionManager contentExtensionManager;
  private IndexManager indexManager;
  private CriteriaManager criteriaManager;
  private IHelpProvider helpProvider;
  private File configurationDirectory;
  
  public static void logWarning(String message)
  {
    Status errorStatus = new Status(2, "org.eclipse.help", 0, message, null);
    logStatus(errorStatus);
  }
  
  public static void logError(String message)
  {
    Status errorStatus = new Status(4, "org.eclipse.help", 0, message, null);
    logStatus(errorStatus);
  }
  
  public static void logError(String message, Throwable ex)
  {
    if (message == null) {
      message = "";
    }
    Status errorStatus = new Status(4, "org.eclipse.help", 0, message, ex);
    logStatus(errorStatus);
  }
  
  private static synchronized void logStatus(IStatus errorStatus)
  {
    getDefault().getLog().log(errorStatus);
  }
  
  public static HelpPlugin getDefault()
  {
    return plugin;
  }
  
  public static TocManager getTocManager()
  {
    if (getDefaulttocManager == null) {
      synchronized (tocManagerCreateLock)
      {
        if (getDefaulttocManager == null) {
          getDefaulttocManager = new TocManager();
        }
      }
    }
    return getDefaulttocManager;
  }
  
  public static ContextManager getContextManager()
  {
    if (getDefaultcontextManager == null) {
      getDefaultcontextManager = new ContextManager();
    }
    return getDefaultcontextManager;
  }
  
  public static ContentExtensionManager getContentExtensionManager()
  {
    if (getDefaultcontentExtensionManager == null) {
      getDefaultcontentExtensionManager = new ContentExtensionManager();
    }
    return getDefaultcontentExtensionManager;
  }
  
  public static IndexManager getIndexManager()
  {
    if (getDefaultindexManager == null) {
      getDefaultindexManager = new IndexManager();
    }
    return getDefaultindexManager;
  }
  
  public static CriteriaManager getCriteriaManager()
  {
    if (getDefaultcriteriaManager == null) {
      getDefaultcriteriaManager = new CriteriaManager();
    }
    return getDefaultcriteriaManager;
  }
  
  public IHelpProvider getHelpProvider()
  {
    return helpProvider;
  }
  
  public void setHelpProvider(IHelpProvider helpProvider)
  {
    this.helpProvider = helpProvider;
  }
  
  public void start(BundleContext context)
    throws Exception
  {
    super.start(context);
    plugin = this;
    
    Location location = Platform.getConfigurationLocation();
    if (location != null)
    {
      URL configURL = location.getURL();
      if ((configURL != null) && (configURL.getProtocol().startsWith("file"))) {
        configurationDirectory = new File(configURL.getFile(), "org.eclipse.help");
      }
    }
    if (configurationDirectory == null) {
      configurationDirectory = getStateLocation().toFile();
    }
    DEBUG = isDebugging();
    if (DEBUG)
    {
      DEBUG_CONTEXT = "true".equalsIgnoreCase(Platform.getDebugOption("org.eclipse.help/debug/context"));
      DEBUG_SEARCH = "true".equalsIgnoreCase(Platform.getDebugOption("org.eclipse.help/debug/search"));
      DEBUG_TOC = "true".equalsIgnoreCase(Platform.getDebugOption("org.eclipse.help/debug/toc"));
      DEBUG_INDEX = "true".equalsIgnoreCase(Platform.getDebugOption("org.eclipse.help/debug/index"));
      DEBUG_CRITERIA = "true".equalsIgnoreCase(Platform.getDebugOption("org.eclipse.help/debug/criteria"));
    }
  }
  
  public static File getConfigurationDirectory()
  {
    return getDefaultconfigurationDirectory;
  }
  
  public void stop(BundleContext context)
    throws Exception
  {
    plugin = null;
    super.stop(context);
  }
  
  public static abstract interface IHelpProvider
  {
    public abstract InputStream getHelpContent(String paramString1, String paramString2);
  }
}

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

import org.eclipse.help.IInclude;
import org.w3c.dom.Element;

public class Include
  extends UAElement
  implements IInclude
{
  public static final String NAME = "include";
  public static final String ATTRIBUTE_PATH = "path";
  
  public Include(IInclude src)
  {
    super("include", src);
    setPath(src.getPath());
  }
  
  public Include(Element src)
  {
    super(src);
  }
  
  public String getPath()
  {
    return getAttribute("path");
  }
  
  public void setPath(String path)
  {
    setAttribute("path", path);
  }
}

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

import org.eclipse.help.ICriteria;
import org.eclipse.help.ITopic;
import org.eclipse.help.ITopic2;
import org.w3c.dom.Element;

public class Topic
  extends UAElement
  implements ITopic2
{
  public static final String NAME = "topic";
  public static final String ATTRIBUTE_HREF = "href";
  public static final String ATTRIBUTE_LABEL = "label";
  public static final String ATTRIBUTE_ICON = "icon";
  public static final String ATTRIBUTE_SORT = "sort";
  
  public Topic()
  {
    super("topic");
  }
  
  public Topic(ITopic src)
  {
    super("topic", src);
    setHref(src.getHref());
    setLabel(src.getLabel());
    appendChildren(src.getChildren());
  }
  
  public String getIcon()
  {
    return getAttribute("icon");
  }
  
  public boolean isSorted()
  {
    return "true".equalsIgnoreCase(getAttribute("sort"));
  }
  
  public Topic(Element src)
  {
    super(src);
  }
  
  public String getHref()
  {
    return getAttribute("href");
  }
  
  public String getLabel()
  {
    return getAttribute("label");
  }
  
  public ITopic[] getSubtopics()
  {
    return (ITopic[])getChildren(ITopic.class);
  }
  
  public ICriteria[] getCriteria()
  {
    return (ICriteria[])getChildren(ICriteria.class);
  }
  
  public void setHref(String href)
  {
    setAttribute("href", href);
  }
  
  public void setLabel(String label)
  {
    setAttribute("label", label);
  }
}

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

class UAElement$Filter
{
  String name;
  String value;
  boolean isNegated;
  final UAElement this$0;
  
  public UAElement$Filter(UAElement paramUAElement, String name, String value, boolean isNegated)
  {
    this$0 = paramUAElement;
    this.name = name;
    this.value = value;
    this.isNegated = isNegated;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.help.internal.UAElement.Filter
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.help.internal;

import java.lang.reflect.Array;
import java.util.ArrayList;
import java.util.List;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
import org.eclipse.core.expressions.EvaluationResult;
import org.eclipse.core.expressions.Expression;
import org.eclipse.core.expressions.ExpressionConverter;
import org.eclipse.core.expressions.IEvaluationContext;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.help.IUAElement;
import org.eclipse.help.internal.dynamic.FilterResolver;
import org.eclipse.help.internal.entityresolver.LocalEntityResolver;
import org.eclipse.help.internal.util.ProductPreferences;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;

public class UAElement
  implements IUAElement
{
  private static final String ELEMENT_FILTER = "filter";
  private static final String ATTRIBUTE_FILTER = "filter";
  private static final String ATTRIBUTE_NAME = "name";
  private static final String ATTRIBUTE_VALUE = "value";
  private static DocumentBuilder builder;
  private static Document document;
  private Element element;
  private UAElement parent;
  protected List children;
  private Filter[] filters;
  private Expression enablementExpression;
  private IUAElement src;
  
  private class Filter
  {
    String name;
    String value;
    boolean isNegated;
    
    public Filter(String name, String value, boolean isNegated)
    {
      this.name = name;
      this.value = value;
      this.isNegated = isNegated;
    }
  }
  
  public UAElement(Element element)
  {
    this.element = element;
  }
  
  public UAElement(String name)
  {
    element = getDocument().createElement(name);
  }
  
  public UAElement(String name, IUAElement src)
  {
    this(name);
    if ((src instanceof UAElement)) {
      copyFilters(src);
    } else {
      this.src = src;
    }
  }
  
  private void copyFilters(IUAElement src)
  {
    UAElement sourceElement = (UAElement)src;
    S
1 2 3 4 5 6 7 8

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