org.eclipse.jst.jsf.core_1.3.105.v201108261005

16:45:51.023 INFO  jd.cli.Main - Decompiling org.eclipse.jst.jsf.core_1.3.105.v201108261005.jar
package org.eclipse.jst.jsf.core;

import org.eclipse.wst.common.project.facet.core.IProjectFacet;

public final class IJSFCoreConstants
{
  public static final String JSF_CORE_FACET_ID = "jst.jsf";
  public static final String FACET_VERSION_1_0 = "1.0";
  public static final String JSF_VERSION_1_0 = "1.0";
  public static final String FACET_VERSION_1_1 = "1.1";
  public static final String JSF_VERSION_1_1 = "1.1";
  public static final String FACET_VERSION_1_2 = "1.2";
  public static final String JSF_VERSION_1_2 = "1.2";
  public static final String FACET_VERSION_2_0 = "2.0";
  public static final String JSF_VERSION_2_0 = "2.0";
  
  public static boolean isJSFFacet(IProjectFacet facet)
  {
    return "jst.jsf".equals(facet.getId());
  }
}

/* Location:
 * Qualified Name:     org.eclipse.jst.jsf.core.IJSFCoreConstants
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.jst.jsf.core;

import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.wst.common.project.facet.core.FacetedProjectFramework;
import org.eclipse.wst.common.project.facet.core.IFacetedProject;
import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;

public enum JSFVersion
{
  UNKNOWN,  V1_0,  V1_1,  V1_2,  V2_0;
  
  public String toString()
  {
    switch (this)
    {
    case V1_0: 
      return "1.0";
    case V1_1: 
      return "1.1";
    case V1_2: 
      return "1.2";
    case V2_0: 
      return "2.0";
    case UNKNOWN: 
      return "unknown";
    }
    throw new IllegalStateException("Missing string conversion: " + name());
  }
  
  public static JSFVersion valueOfString(String valueAsString)
  {
    if ("1.0".equals(valueAsString)) {
      return V1_0;
    }
    if ("1.1".equals(valueAsString)) {
      return V1_1;
    }
    if ("1.2".equals(valueAsString)) {
      return V1_2;
    }
    if ("2.0".equals(valueAsString)) {
      return V2_0;
    }
    if ("unknown".equals(valueAsString)) {
      return UNKNOWN;
    }
    return null;
  }
  
  public static JSFVersion valueOfFacetVersion(IProjectFacetVersion facetVersion)
  {
    if (!IJSFCoreConstants.isJSFFacet(facetVersion.getProjectFacet())) {
      throw new IllegalArgumentException("Not a JSF facet: " + facetVersion.getProjectFacet().toString());
    }
    String versionString = facetVersion.getVersionString();
    if (versionString != null) {
      return valueOfString(versionString);
    }
    return null;
  }
  
  public static JSFVersion valueOfProject(IProject project)
  {
    try
    {
      if ((project != null) && (FacetedProjectFramework.isFacetedProject(project)))
      {
        IFacetedProject fProj = ProjectFacetsManager.create(project);
        if (fProj != null)
        {
          IProjectFacetVersion projectFacetVersion = fProj.getProjectFacetVersion(
            ProjectFacetsManager.getProjectFacet("jst.jsf"));
          if (projectFacetVersion != null) {
            return valueOfFacetVersion(projectFacetVersion);
          }
        }
      }
    }
    catch (CoreException localCoreException) {}
    return null;
  }
}

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

import java.util.Set;

public abstract class AbstractTagRegistryFactoryProvider
  implements ITagRegistryFactoryProvider
{
  public abstract Set<ITagRegistryFactoryInfo> getTagRegistryFactories();
}

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

import java.util.List;
import org.eclipse.core.runtime.preferences.IScopeContext;
import org.eclipse.jface.preference.IPreferenceStore;

public class CompositeJSFPreferenceModel
  implements IJSFPreferenceModel
{
  private final List<IJSFPreferenceModel> _models;
  
  public CompositeJSFPreferenceModel(List<IJSFPreferenceModel> models)
  {
    _models = models;
  }
  
  public void commit(IPreferenceStore prefStore)
  {
    for (IJSFPreferenceModel model : _models) {
      model.commit(prefStore);
    }
  }
  
  public Object getStoredValueByKey(IScopeContext context, String key)
  {
    Object value = null;
    for (IJSFPreferenceModel model : _models)
    {
      value = model.getStoredValueByKey(context, key);
      if (value != null) {
        break;
      }
    }
    return value;
  }
  
  public Object getValueByKey(IScopeContext context, String key)
  {
    Object value = null;
    for (IJSFPreferenceModel model : _models)
    {
      value = model.getValueByKey(context, key);
      if (value != null) {
        break;
      }
    }
    return value;
  }
  
  public void load(IPreferenceStore prefStore)
  {
    for (IJSFPreferenceModel model : _models) {
      model.load(prefStore);
    }
  }
  
  public void setDefaults()
  {
    for (IJSFPreferenceModel model : _models) {
      model.setDefaults();
    }
  }
  
  public Object setValueByKey(IScopeContext context, String key, Object value)
  {
    for (IJSFPreferenceModel model : _models) {
      if (model.getValueByKey(context, key) != null) {
        return model.setValueByKey(context, key, value);
      }
    }
    return null;
  }
}

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

import java.util.Set;

class CompositeTagRegistryFactory$1$1
  extends AbstractTagRegistryFactoryProvider
{
  CompositeTagRegistryFactory$1$1(CompositeTagRegistryFactory.1 param1, ITagRegistryFactoryProvider paramITagRegistryFactoryProvider) {}
  
  public Set<ITagRegistryFactoryInfo> getTagRegistryFactories()
  {
    return val$useMe.getTagRegistryFactories();
  }
}

/* Location:
 * Qualified Name:     org.eclipse.jst.jsf.core.internal.CompositeTagRegistryFactory.1.1
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.jst.jsf.core.internal;

import java.util.Set;
import org.eclipse.core.resources.IProject;
import org.eclipse.jst.jsf.common.internal.strategy.AbstractIdentifiableStrategy;

class CompositeTagRegistryFactory$1
  extends AbstractIdentifiableStrategy<IProject, ITagRegistryFactoryProvider, String>
{
  CompositeTagRegistryFactory$1(CompositeTagRegistryFactory paramCompositeTagRegistryFactory, String $anonymous0, String $anonymous1, ITagRegistryFactoryProvider $anonymous2)
  {
    super($anonymous0, $anonymous1, $anonymous2);
  }
  
  public ITagRegistryFactoryProvider perform(IProject input)
    throws Exception
  {
    ITagRegistryFactoryProvider injectedProvider = null;
    synchronized (CompositeTagRegistryFactory.class)
    {
      injectedProvider = CompositeTagRegistryFactory.access$0();
    }
    if (injectedProvider != null)
    {
      final ITagRegistryFactoryProvider useMe = injectedProvider;
      new AbstractTagRegistryFactoryProvider()
      {
        public Set<ITagRegistryFactoryInfo> getTagRegistryFactories()
        {
          return useMe.getTagRegistryFactories();
        }
      };
    }
    return null;
  }
}

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

import java.util.Set;

class CompositeTagRegistryFactory$2$1
  extends AbstractTagRegistryFactoryProvider
{
  CompositeTagRegistryFactory$2$1(CompositeTagRegistryFactory.2 param2) {}
  
  public Set<ITagRegistryFactoryInfo> getTagRegistryFactories()
  {
    return TagLibraryRegistryLoader.getAllHandlers();
  }
}

/* Location:
 * Qualified Name:     org.eclipse.jst.jsf.core.internal.CompositeTagRegistryFactory.2.1
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.jst.jsf.core.internal;

import java.util.Set;
import org.eclipse.core.resources.IProject;
import org.eclipse.jst.jsf.common.internal.strategy.AbstractIdentifiableStrategy;

class CompositeTagRegistryFactory$2
  extends AbstractIdentifiableStrategy<IProject, ITagRegistryFactoryProvider, String>
{
  CompositeTagRegistryFactory$2(CompositeTagRegistryFactory paramCompositeTagRegistryFactory, String $anonymous0, String $anonymous1, ITagRegistryFactoryProvider $anonymous2)
  {
    super($anonymous0, $anonymous1, $anonymous2);
  }
  
  public ITagRegistryFactoryProvider perform(IProject input)
    throws Exception
  {
    new AbstractTagRegistryFactoryProvider()
    {
      public Set<ITagRegistryFactoryInfo> getTagRegistryFactories()
      {
        return TagLibraryRegistryLoader.getAllHandlers();
      }
    };
  }
}

/* Location:
 * Qualified Name:     org.eclipse.jst.jsf.core.internal.CompositeTagRegistryFactory.2
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.jst.jsf.core.internal;

import org.eclipse.core.resources.IProject;
import org.eclipse.jst.jsf.common.internal.policy.IIteratorPolicy;
import org.eclipse.jst.jsf.common.internal.strategy.IIdentifiableStrategy;
import org.eclipse.jst.jsf.common.internal.strategy.IteratorPolicyBasedStrategyComposite;

class CompositeTagRegistryFactory$TagRegistryFactoryProviderSelectionStrategy
  extends IteratorPolicyBasedStrategyComposite<IProject, ITagRegistryFactoryProvider, ITagRegistryFactoryProvider, String, IIdentifiableStrategy<IProject, ITagRegistryFactoryProvider, String>>
{
  protected CompositeTagRegistryFactory$TagRegistryFactoryProviderSelectionStrategy(IIteratorPolicy<String> policy)
  {
    super(policy);
  }
  
  private static final ITagRegistryFactoryProvider NO_RESULT = null;
  
  public ITagRegistryFactoryProvider getNoResult()
  {
    return NO_RESULT;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.jst.jsf.core.internal.CompositeTagRegistryFactory.TagRegistryFactoryProviderSelectionStrategy
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.jst.jsf.core.internal;

import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.content.IContentType;

public final class CompositeTagRegistryFactory$TagRegistryIdentifier
{
  private final IProject _project;
  private final IContentType _contentType;
  
  public CompositeTagRegistryFactory$TagRegistryIdentifier(IProject project, IContentType contentType)
  {
    _project = project;
    _contentType = contentType;
  }
  
  public IProject getProject()
  {
    return _project;
  }
  
  public IContentType getContentType()
  {
    return _contentType;
  }
  
  public boolean equals(Object o)
  {
    if ((o instanceof TagRegistryIdentifier))
    {
      TagRegistryIdentifier other = (TagRegistryIdentifier)o;
      int otherProjectHash = other.getProject() != null ? other.getProject().hashCode() : 0;
      int thisProjectHash = getProject() != null ? getProject().hashCode() : 0;
      if ((otherProjectHash == thisProjectHash) && 
        (other.getContentType().equals(getContentType()))) {
        return true;
      }
    }
    return false;
  }
  
  public int hashCode()
  {
    return (getProject() != null ? getProject().hashCode() : 0) + 7 * _contentType.hashCode();
  }
}

/* Location:
 * Qualified Name:     org.eclipse.jst.jsf.core.internal.CompositeTagRegistryFactory.TagRegistryIdentifier
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.jst.jsf.core.internal;

import org.eclipse.core.resources.IProject;
import org.eclipse.jst.jsf.common.internal.policy.IIteratorPolicy;
import org.eclipse.jst.jsf.common.internal.strategy.IIdentifiableStrategy;
import org.eclipse.jst.jsf.common.internal.strategy.IteratorPolicyBasedStrategyComposite;
import org.eclipse.jst.jsf.designtime.internal.view.model.ITagRegistry;

class CompositeTagRegistryFactory$TagRegistrySelectionStrategy
  extends IteratorPolicyBasedStrategyComposite<IProject, ITagRegistry, ITagRegistry, String, IIdentifiableStrategy<IProject, ITagRegistry, String>>
{
  private static final ITagRegistry NO_RESULT = null;
  
  protected CompositeTagRegistryFactory$TagRegistrySelectionStrategy(IIteratorPolicy<String> policy)
  {
    super(policy);
  }
  
  public ITagRegistry getNoResult()
  {
    return NO_RESULT;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.jst.jsf.core.internal.CompositeTagRegistryFactory.TagRegistrySelectionStrategy
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.jst.jsf.core.internal;

import java.util.ArrayList;
import java.util.Collections;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Set;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.content.IContentType;
import org.eclipse.jst.jsf.common.internal.policy.CanonicallyOrderedIteratorPolicy;
import org.eclipse.jst.jsf.common.internal.policy.IIteratorPolicy;
import org.eclipse.jst.jsf.common.internal.policy.IdentifierOrderedIteratorPolicy;
import org.eclipse.jst.jsf.common.internal.strategy.AbstractIdentifiableStrategy;
import org.eclipse.jst.jsf.common.internal.strategy.IIdentifiableStrategy;
import org.eclipse.jst.jsf.common.internal.strategy.IteratorPolicyBasedStrategyComposite;
import org.eclipse.jst.jsf.designtime.internal.view.model.ITagRegistry;
import org.eclipse.jst.jsf.designtime.internal.view.model.TagRegistryFactory;
import org.eclipse.jst.jsf.designtime.internal.view.model.TagRegistryFactory.TagRegistryFactoryException;

public final class CompositeTagRegistryFactory
{
  private static CompositeTagRegistryFactory INSTANCE;
  private static ITagRegistryFactoryProvider TEST_PROVIDER;
  
  public synchronized void setTestInjectedProvider(ITagRegistryFactoryProvider factoryProvider)
  {
    TEST_PROVIDER = factoryProvider;
  }
  
  public static synchronized CompositeTagRegistryFactory getInstance()
  {
    if (INSTANCE == null) {
      INSTANCE = new CompositeTagRegistryFactory();
    }
    return INSTANCE;
  }
  
  public final ITagRegistry getRegistry(TagRegistryIdentifier id)
  {
    Set<ITagRegistryFactoryInfo> handlers = getAllTagRegistryFactories();
    
    Set<ITagRegistryFactoryInfo> matchingHandlers = findMatchingExtensions(
      id, handlers);
    if (matchingHandlers.size() > 0) {
      if (matchingHandlers.size() == 1)
      {
        try
        {
          return 
            ((ITagRegistryFactoryInfo)matchingHandlers.iterator().next()).getTagRegistryFactory().createTagRegistry(id.getProject());
        }
        catch (TagRegistryFactory.TagRegistryFactoryException e)
        {
          JSFCorePlugin.log(e, "While trying to acquire a registry");
        }
      }
      else
      {
        TagRegistrySelectionStrategy selectionStrategy = new TagRegistrySelectionStrategy(
          new CanonicallyOrderedIteratorPolicy());
        for (Iterator<ITagRegistryFactoryInfo> it = matchingHandlers
              .iterator(); 
              it.hasNext();) {
          selectionStrategy.addStrategy(((ITagRegistryFactoryInfo)it.next()).getTagRegistryFactory());
        }
        return (ITagRegistry)selectionStrategy.perform(id.getProject());
      }
    }
    return null;
  }
  
  public Set<ITagRegistryFactoryInfo> getAllTagRegistryFactories()
  {
    List<String> selectionOrder = new ArrayList();
    selectionOrder.add("testInjection");
    selectionOrder.add("extensionPointInjection");
    selectionOrder.add("platformDefault");
    
    IdentifierOrderedIteratorPolicy<String> policy = new IdentifierOrderedIteratorPolicy(selectionOrder);
    
    policy.setExcludeNonExplicitValues(true);
    TagRegistryFactoryProviderSelectionStrategy providerSelector = 
      new TagRegistryFactoryProviderSelectionStrategy(policy);
    providerSelector.addStrategy(
      new AbstractIdentifiableStrategy("testInjection", "FIXME: not for display", null)
      {
        public ITagRegistryFactoryProvider perform(IProject input)
          throws Exception
        {
          ITagRegistryFactoryProvider injectedProvider = null;
          synchronized (CompositeTagRegistryFactory.class)
          {
            injectedProvider = CompositeTagRegistryFactory.TEST_PROVIDER;
          }
          if (injectedProvider != null)
          {
            final ITagRegistryFactoryProvider useMe = injectedProvider;
            new AbstractTagRegistryFactoryProvider()
            {
              public Set<ITagRegistryFactoryInfo> getTagRegistryFactories()
              {
                return useMe.getTagRegistryFactories();
              }
            };
          }
          return null;
        }
      });
      providerSelector.addStrategy(
        new AbstractIdentifiableStrategy("platformDefault", "FIXME: not for display", null)
        {
          public ITagRegistryFactoryProvider perform(IProject input)
            throws Exception
          {
            new AbstractTagRegistryFactoryProvider()
            {
              public Set<ITagRegistryFactoryInfo> getTagRegistryFactories()
              {
                return TagLibraryRegistryLoader.getAllHandlers();
              }
            };
          }
        });
        ITagRegistryFactoryProvider provider = (ITagRegistryFactoryProvider)providerSelector.perform(null);
        if (provider != null) {
          return provider.getTagRegistryFactories();
        }
        return Collections.emptySet();
      }
      
      private Set<ITagRegistryFactoryInfo> findMatchingExtensions(TagRegistryIdentifier id, Set<ITagRegistryFactoryInfo> handlers)
      {
        Set<ITagRegistryFactoryInfo> matching = new HashSet(
          4);
        for (ITagRegistryFactoryInfo handler : handlers) {
          if ((handler.getContentTypes().contains(id.getContentType())) && 
            (handler.getTagRegistryFactory().projectIsValid(
            id.getProject()))) {
            matching.add(handler);
          }
        }
        return matching;
      }
      
      public static final class TagRegistryIdentifier
      {
        private final IProject _project;
        private final IContentType _contentType;
        
        public TagRegistryIdentifier(IProject project, IContentType contentType)
        {
          _project = project;
          _contentType = contentType;
        }
        
        public IProject getProject()
        {
          return _project;
        }
        
        public IContentType getContentType()
        {
          return _contentType;
        }
        
        public boolean equals(Object o)
        {
          if ((o instanceof TagRegistryIdentifier))
          {
            TagRegistryIdentifier other = (TagRegistryIdentifier)o;
            int otherProjectHash = other.getProject() != null ? other.getProject().hashCode() : 0;
            int thisProjectHash = getProject() != null ? getProject().hashCode() : 0;
            if ((otherProjectHash == thisProjectHash) && 
              (other.getContentType().equals(getContentType()))) {
              return true;
            }
          }
          return false;
        }
        
        public int hashCode()
        {
          return (getProject() != null ? getProject().hashCode() : 0) + 7 * _contentType.hashCode();
        }
      }
      
      private static class TagRegistrySelectionStrategy
        extends IteratorPolicyBasedStrategyComposite<IProject, ITagRegistry, ITagRegistry, String, IIdentifiableStrategy<IProject, ITagRegistry, String>>
      {
        private static final ITagRegistry NO_RESULT = null;
        
        protected TagRegistrySelectionStrategy(IIteratorPolicy<String> policy)
        {
          super();
        }
        
        public ITagRegistry getNoResult()
        {
          return NO_RESULT;
        }
      }
      
      private static class TagRegistryFactoryProviderSelectionStrategy
        extends IteratorPolicyBasedStrategyComposite<IProject, ITagRegistryFactoryProvider, ITagRegistryFactoryProvider, String, IIdentifiableStrategy<IProject, ITagRegistryFactoryProvider, String>>
      {
        protected TagRegistryFactoryProviderSelectionStrategy(IIteratorPolicy<String> policy)
        {
          super();
        }
        
        private static final ITagRegistryFactoryProvider NO_RESULT = null;
        
        public ITagRegistryFactoryProvider getNoResult()
        {
          return NO_RESULT;
        }
      }
    }

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

import org.eclipse.core.runtime.preferences.IScopeContext;
import org.eclipse.jface.preference.IPreferenceStore;

public abstract interface IJSFPreferenceModel
{
  public abstract void load(IPreferenceStore paramIPreferenceStore);
  
  public abstract void commit(IPreferenceStore paramIPreferenceStore);
  
  public abstract void setDefaults();
  
  public abstract Object getValueByKey(IScopeContext paramIScopeContext, String paramString);
  
  public abstract Object getStoredValueByKey(IScopeContext paramIScopeContext, String paramString);
  
  public abstract Object setValueByKey(IScopeContext paramIScopeContext, String paramString, Object paramObject);
}

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

import java.util.Set;
import org.eclipse.core.runtime.content.IContentType;
import org.eclipse.jst.jsf.designtime.internal.view.model.TagRegistryFactory;

public abstract interface ITagRegistryFactoryInfo
{
  public abstract Set<IContentType> getContentTypes();
  
  public abstract TagRegistryFactory getTagRegistryFactory();
  
  public abstract String getId();
  
  public abstract String getDescription();
}

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

import java.util.Set;

public abstract interface ITagRegistryFactoryProvider
{
  public abstract Set<ITagRegistryFactoryInfo> getTagRegistryFactories();
}

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

import java.io.PrintStream;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import org.eclipse.core.runtime.IExtensionPoint;
import org.eclipse.core.runtime.IExtensionRegistry;
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.core.runtime.preferences.InstanceScope;
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.jst.jsf.context.IDelegatingFactory;
import org.eclipse.jst.jsf.context.resolver.structureddocument.internal.IStructuredDocumentContextResolverFactory2;
import org.eclipse.jst.jsf.designtime.context.AbstractDTExternalContextFactory;
import org.eclipse.jst.jsf.designtime.el.AbstractDTMethodResolver;
import org.eclipse.jst.jsf.designtime.el.AbstractDTPropertyResolver;
import org.eclipse.jst.jsf.designtime.el.AbstractDTVariableResolver;
import org.eclipse.jst.jsf.designtime.internal.BasicExtensionFactory;
import org.eclipse.jst.jsf.designtime.internal.BasicExtensionFactory.ExtensionData;
import org.eclipse.jst.jsf.designtime.internal.DecoratableExtensionFactory;
import org.eclipse.jst.jsf.designtime.internal.resolver.ViewBasedTaglibResolverFactory;
import org.eclipse.jst.jsf.designtime.internal.view.AbstractDTViewHandler;
import org.eclipse.ui.preferences.ScopedPreferenceStore;
import org.eclipse.wst.common.frameworks.internal.WTPPlugin;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;

public class JSFCorePlugin
  extends WTPPlugin
{
  public static final String PLUGIN_ID = "org.eclipse.jst.jsf.core";
  public static final String TAG_REGISTRY_FACTORY_PROVIDER_ID = "tagRegistryFactory";
  private static JSFCorePlugin plugin;
  private IPreferenceStore preferenceStore;
  private ViewBasedTaglibResolverFactory _tagLibResolverFactory;
  private static DecoratableExtensionFactory<AbstractDTVariableResolver> _variableResolverFactory;
  private static final String VARIABLE_RESOLVER_EXT_POINT_NAME = "variableresolver";
  private static final String VARIABLE_RESOLVER_ELEMENT_NAME = "variableresolver";
  private static DecoratableExtensionFactory<AbstractDTPropertyResolver> _propertyResolverFactory;
  private static final String PROPERTY_RESOLVER_EXT_POINT_NAME = "propertyresolver";
  private static final String PROPERTY_RESOLVER_ELEMENT_NAME = "propertyresolver";
  private static BasicExtensionFactory<AbstractDTMethodResolver> _methodResolverFactory;
  private static final String METHOD_RESOLVER_EXT_POINT_NAME = "methodresolver";
  private static final String METHOD_RESOLVER_ELEMENT_NAME = "methodresolver";
  private static BasicExtensionFactory<AbstractDTExternalContextFactory> _externalContextResolverFactory;
  private static final String EXTERNAL_CONTEXT_EXT_POINT_NAME = "externalcontext";
  private static final String EXTERNAL_CONTEXT_ELEMENT_NAME = "externalcontext";
  private static BasicExtensionFactory<AbstractDTViewHandler> _viewHandlerFactory;
  private static final String VIEWHANDLER_EXT_POINT_NAME = "viewhandler";
  private static final String VIEWHANDLER_ELEMENT_NAME = "viewhandler";
  
  public JSFCorePlugin()
  {
    plugin = this;
  }
  
  public void start(BundleContext context)
    throws Exception
  {
    super.start(context);
    IStructuredDocumentContextResolverFactory2 factory = IStructuredDocumentContextResolverFactory2.INSTANCE;
    if ((factory instanceof IDelegatingFactory))
    {
      _tagLibResolverFactory = new ViewBasedTaglibResolverFactory();
      ((IDelegatingFactory)factory)
        .addFactoryDelegate(_tagLibResolverFactory);
    }
    else
    {
      log("Error adding tag resolver delegate", new Throwable());
    }
  }
  
  public void stop(BundleContext context)
    throws Exception
  {
    super.stop(context);
    
    IStructuredDocumentContextResolverFactory2 factory = IStructuredDocumentContextResolverFactory2.INSTANCE;
    if (((factory instanceof IDelegatingFactory)) && 
      (_tagLibResolverFactory != null)) {
      ((IDelegatingFactory)factory).removeFactoryDelegate(_tagLibResolverFactory);
    }
    plugin = null;
  }
  
  public static JSFCorePlugin getDefault()
  {
    return plugin;
  }
  
  public static void log(Exception e, String msg)
  {
    IStatus logStatus = new Status(4, "org.eclipse.jst.jsf.core", 0, msg, e);
    JSFCorePlugin currentPlugin = getDefault();
    if (currentPlugin != null)
    {
      ILog log = currentPlugin.getLog();
      if (log != null) {
        log.log(logStatus);
      }
    }
    System.err.println(logStatus);
  }
  
  public static void log(int severity, String message, Throwable ex)
  {
    Status logObject = new Status(severity, "org.eclipse.jst.jsf.core", 0, message, ex);
    JSFCorePlugin default1 = getDefault();
    if (default1 != null)
    {
      ILog log = default1.getLog();
      if (log != null)
      {
        log.log(logObject);
        return;
      }
    }
    System.err.println(logObject.toString());
  }
  
  public static void log(int severity, String message)
  {
    log(severity, message, null);
  }
  
  public static void log(String message, Throwable t)
  {
    ILog log = plugin.getLog();
    log.log(new Status(4, plugin.getBundle().getSymbolicName(), 
      0, message, t));
  }
  
  public String getPluginID()
  {
    return "org.eclipse.jst.jsf.core";
  }
  
  public static synchronized BasicExtensionFactory.ExtensionData<AbstractDTVariableResolver> getVariableResolvers(String id)
  {
    checkAndInitVariableResolverFactory();
    return (BasicExtensionFactory.ExtensionData)_variableResolverFactory.getExtensions().get(id);
  }
  
  public static synchronized List<String> getVariableResolversForName(String forName)
  {
    checkAndInitVariableResolverFactory();
    return Collections.unmodifiableList(_variableResolverFactory
      .getIdsForName(forName));
  }
  
  public static synchronized boolean hasDecorativeVariableResolvers()
  {
    checkAndInitVariableResolverFactory();
    return _variableResolverFactory.getNumDecorativeResolvers() > 0;
  }
  
  private static synchronized void checkAndInitVariableResolverFactory()
  {
    if (_variableResolverFactory == null) {
      _variableResolverFactory = new DecoratableExtensionFactory(
        getDefault().getBundle(), "variableresolver", 
        "variableresolver", false);
    }
  }
  
  public static synchronized BasicExtensionFactory.ExtensionData<AbstractDTPropertyResolver> getPropertyResolver(String id)
  {
    checkAndInitPropertyFactory();
    return (BasicExtensionFactory.ExtensionData)_propertyResolverFactory.getExtensions().get(id);
  }
  
  private static synchronized void checkAndInitPropertyFactory()
  {
    if (_propertyResolverFactory == null) {
      _propertyResolverFactory = new DecoratableExtensionFactory(
        getDefault().getBundle(), "propertyresolver", 
        "propertyresolver", false);
    }
  }
  
  public static synchronized List<String> getPropertyResolversForName(String forName)
  {
    checkAndInitVariableResolverFactory();
    return Collections.unmodifiableList(_propertyResolverFactory
      .getIdsForName(forName));
  }
  
  public static synchronized boolean hasDecorativePropertyResolvers()
  {
    checkAndInitVariableResolverFactory();
    return _propertyResolverFactory.getNumDecorativeResolvers() > 0;
  }
  
  public static synchronized BasicExtensionFactory.ExtensionData<AbstractDTMethodResolver> getMethodResolvers(String id)
  {
    checkAndInitMethodResolverFactory();
    return (BasicExtensionFactory.ExtensionData)_methodResolverFactory.getExtensions().get(id);
  }
  
  private static synchronized void checkAndInitMethodResolverFactory()
  {
    if (_methodResolverFactory == null) {
      _methodResolverFactory = new BasicExtensionFactory(
        getDefault().getBundle(), "methodresolver", 
        "methodresolver", false);
    }
  }
  
  public static synchronized BasicExtensionFactory.ExtensionData<AbstractDTExternalContextFactory> getExternalContextProviders(String id)
  {
    checkAndInitExternalContextFactory();
    return (BasicExtensionFactory.ExtensionData)_externalContextResolverFactory.getExtensions().get(id);
  }
  
  private static synchronized void checkAndInitExternalContextFactory()
  {
    if (_externalContextResolverFactory == null) {
      _externalContextResolverFactory = new BasicExtensionFactory(
        getDefault().getBundle(), "externalcontext", 
        "externalcontext", false);
    }
  }
  
  public static synchronized BasicExtensionFactory.ExtensionData<AbstractDTViewHandler> getViewHandlers(String id)
  {
    checkAndInitViewHandler();
    return (BasicExtensionFactory.ExtensionData)_viewHandlerFactory.getExtensions().get(id);
  }
  
  private static synchronized void checkAndInitViewHandler()
  {
    if (_viewHandlerFactory == null) {
      _viewHandlerFactory = new BasicExtensionFactory(
        getDefault().getBundle(), "viewhandler", 
        "viewhandler", true);
    }
  }
  
  public synchronized IPreferenceStore getPreferenceStore()
  {
    if (preferenceStore == null) {
      preferenceStore = new ScopedPreferenceStore(
        new InstanceScope(), getBundle().getSymbolicName());
    }
    return preferenceStore;
  }
  
  public IExtensionPoint getExtension(String name)
  {
    return Platform.getExtensionRegistry().getExtensionPoint(
      plugin.getBundle().getSymbolicName(), name);
  }
}

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

import java.io.PrintStream;
import org.eclipse.osgi.framework.debug.FrameworkDebugOptions;
import org.eclipse.osgi.service.debug.DebugOptions;

public final class JSFCoreTraceOptions
{
  public static final boolean ENABLED;
  public static final boolean TRACE_JSPTAGINTROSPECTOR;
  public static final boolean TRACE_JSPTAGINTROSPECTOR_PERF;
  public static final boolean TRACE_JSPTAGREGISTRY;
  public static final boolean TRACE_JSPTAGREGISTRY_CHANGES;
  public static final boolean TRACE_JSPTAGPERSISTENCE;
  public static final boolean TRACE_TLDREGISTRYMANAGER;
  public static final boolean TRACE_JSPTAGREGISTRY_PERF;
  private static final String KEY_DEBUG_ENABLED = "/debug";
  private static final String KEY_DESIGNTIME = "/designtime";
  private static final String KEY_DESIGNTIME_VIEW = "/designtime/view";
  private static final String KEY_VIEW_JSPTAGINTROSPECTOR = "/designtime/view/jsptagintrospection";
  private static final String KEY_VIEW_JSPTAGINTROSPECTOR_PERF = "/designtime/view/jsptagintrospection/perf";
  private static final String KEY_VIEW_JSPTAGREGISTRY = "/designtime/view/jsptagregistry";
  private static final String KEY_VIEW_JSPTAGPERSISTENCE = "/designtime/view/jsptagpersistence";
  private static final String KEY_VIEW_JSPTAGREGISTRY_CHANGES = "/designtime/view/jsptagregistry/changes";
  private static final String KEY_VIEW_JSPTAGREGISTRY_PERF = "/designtime/view/jsptagregistry/perf";
  private static final String KEY_VIEW_TLDREGISTRYMANAGER = "/designtime/view/tldregistrymanager";
  
  static
  {
    DebugOptions debugOptions = FrameworkDebugOptions.getDefault();
    
    ENABLED = (debugOptions != null) && 
      (debugOptions.getBooleanOption("org.eclipse.jst.jsf.core/debug", 
      false));
    if (ENABLED)
    {
      TRACE_JSPTAGINTROSPECTOR = debugOptions.getBooleanOption(
        "org.eclipse.jst.jsf.core/designtime/view/jsptagintrospection", false);
      TRACE_JSPTAGREGISTRY = debugOptions.getBooleanOption(
        "org.eclipse.jst.jsf.core/designtime/view/jsptagregistry", false);
      TRACE_JSPTAGREGISTRY_CHANGES = debugOptions.getBooleanOption(
        "org.eclipse.jst.jsf.core/designtime/view/jsptagregistry/changes", false);
      TRACE_TLDREGISTRYMANAGER = debugOptions.getBooleanOption(
        "org.eclipse.jst.jsf.core/designtime/view/tldregistrymanager", false);
      TRACE_JSPTAGREGISTRY_PERF = debugOptions.getBooleanOption(
        "org.eclipse.jst.jsf.core/designtime/view/jsptagregistry/perf", false);
      TRACE_JSPTAGINTROSPECTOR_PERF = debugOptions.getBooleanOption(
        "org.eclipse.jst.jsf.core/designtime/view/jsptagintrospection/perf", false);
      TRACE_JSPTAGPERSISTENCE = debugOptions.getBooleanOption(
        "org.eclipse.jst.jsf.core/designtime/view/jsptagpersistence", false);
    }
    else
    {
      TRACE_JSPTAGINTROSPECTOR = false;
      TRACE_JSPTAGREGISTRY = false;
      TRACE_JSPTAGREGISTRY_CHANGES = false;
      TRACE_TLDREGISTRYMANAGER = false;
      TRACE_JSPTAGREGISTRY_PERF = false;
      TRACE_JSPTAGINTROSPECTOR_PERF = false;
      TRACE_JSPTAGPERSISTENCE = false;
    }
  }
  
  public static void log(String message)
  {
    System.out.println(message);
  }
  
  public static void log(String msg, Throwable t)
  {
    System.out.printf("%s: Exception Trace:\n\n", new Object[] { msg });
    t.printStackTrace(System.out);
    System.out.print("\n\n\n");
  }
}

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

import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.jdt.core.ClasspathContainerInitializer;
import org.eclipse.jdt.core.IClasspathContainer;
import org.eclipse.jdt.core.IJavaProject;
import org.eclipse.jdt.core.JavaCore;
import org.eclipse.jst.jsf.core.internal.jsflibraryconfig.JSFLibraryRegistryUtil;
import org.eclipse.jst.jsf.core.internal.jsflibraryregistry.JSFLibrary;
import org.eclipse.jst.jsf.core.internal.jsflibraryregistry.JSFLibraryRegistry;

public class JSFLibrariesContainerInitializer
  extends ClasspathContainerInitializer
{
  private static final String MISSING_LIBRARY = Messages.JSFLibrariesContainerInitializer_missing_library;
  
  public void initialize(IPath containerPath, IJavaProject project)
    throws CoreException
  {
    if (isJSFLibraryContainer(containerPath))
    {
      String libId = containerPath.lastSegment();
      
      JSFLibrary ref = JSFLibraryRegistryUtil.getInstance().getJSFLibraryRegistry().getJSFLibraryByID(libId);
      if (ref != null)
      {
        JSFLibraryClasspathContainer container = new JSFLibraryClasspathContainer(ref);
        JavaCore.setClasspathContainer(containerPath, new IJavaProject[] { project }, new IClasspathContainer[] { container }, null);
      }
    }
  }
  
  private boolean isJSFLibraryContainer(IPath path)
  {
    return (path != null) && (path.segmentCount() == 2) && ("org.eclipse.jst.jsf.core.internal.jsflibrarycontainer".equals(path.segment(0)));
  }
  
  public boolean canUpdateClasspathContainer(IPath containerPath, IJavaProject project)
  {
    return isJSFLibraryContainer(containerPath);
  }
  
  public String getDescription(IPath containerPath, IJavaProject project)
  {
    if (isJSFLibraryContainer(containerPath))
    {
      String id = containerPath.lastSegment();
      JSFLibrary libref = JSFLibraryRegistryUtil.getInstance().getJSFLibraryRegistry().getJSFLibraryByID(id);
      String displayText = id;
      if (libref == null) {
        displayText = displayText + " " + MISSING_LIBRARY;
      }
      return displayText;
    }
    return super.getDescription(containerPath, project);
  }
  
  public Object getComparisonID(IPath containerPath, IJavaProject project)
  {
    return containerPath;
  }
}

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

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.jst.jsf.core.internal.jsflibraryconfig.JSFLibraryRegistryUtil;
import org.eclipse.jst.jsf.core.internal.jsflibraryregistry.JSFLibrary;

public class JSFLibraryClasspathContainer
  implements IClasspathContainer
{
  private static final String NON_IMPL_DESC = Messages.JSFLibraryClasspathContainer_NON_IMPL_LIBRARY;
  private static final String IMPL_DESC = Messages.JSFLibraryClasspathContainer_IMPL_LIBRARY;
  private JSFLibrary lib;
  
  public JSFLibraryClasspathContainer(JSFLibrary lib)
  {
    this.lib = lib;
  }
  
  public IClasspathEntry[] getClasspathEntries()
  {
    return JSFLibraryRegistryUtil.getInstance().getClasspathEntries(lib);
  }
  
  public String getDescription()
  {
    StringBuffer buf = new StringBuffer(lib.getLabel());
    buf.append(" ");
    if (lib.isImplementation()) {
      buf.append(IMPL_DESC);
    } else {
      buf.append(NON_IMPL_DESC);
    }
    return buf.toString();
  }
  
  public int getKind()
  {
    return 1;
  }
  
  public IPath getPath()
  {
    return new Path("org.eclipse.jst.jsf.core.internal.jsflibrarycontainer").append(lib.getID());
  }
}

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

import org.osgi.framework.Version;

final class JSFRegistryVersionInfo
{
  private Version _curVersion;
  private Version _expectedVersion;
  
  JSFR
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

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