Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 161052 Details for
Bug 251798
[JSF2.0] Move Facelet support into JSF Core for 2.0 support
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Address basic issues to bring Facelet incubator into JSF
patch.txt (text/plain), 46.28 KB, created by
Cameron Bateman
on 2010-03-04 19:07:14 EST
(
hide
)
Description:
Address basic issues to bring Facelet incubator into JSF
Filename:
MIME Type:
Creator:
Cameron Bateman
Created:
2010-03-04 19:07:14 EST
Size:
46.28 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jst.jsf.facelet.core >Index: META-INF/MANIFEST.MF >=================================================================== >RCS file: /cvsroot/webtools/incubator/org.eclipse.jsf/plugins/org.eclipse.jst.jsf.facelet.core/META-INF/MANIFEST.MF,v >retrieving revision 1.9 >diff -u -r1.9 MANIFEST.MF >--- META-INF/MANIFEST.MF 25 Jun 2009 23:25:58 -0000 1.9 >+++ META-INF/MANIFEST.MF 4 Mar 2010 22:54:35 -0000 >@@ -12,7 +12,7 @@ > org.eclipse.wst.common.frameworks;bundle-version="1.1.102", > org.eclipse.jst.jsf.common.runtime, > org.eclipse.jst.jsf.core, >- org.eclipse.jst.jsf.common;bundle-version="1.0.1", >+ org.eclipse.jst.jsf.common;bundle-version="1.0.1";visibility:=reexport, > org.eclipse.jface.text;bundle-version="3.4.0", > org.eclipse.wst.sse.core;bundle-version="1.1.300", > org.eclipse.wst.html.core;bundle-version="1.1.200", >Index: src/org/eclipse/jst/jsf/facelet/core/internal/FaceletCorePlugin.java >=================================================================== >RCS file: /cvsroot/webtools/incubator/org.eclipse.jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/FaceletCorePlugin.java,v >retrieving revision 1.3 >diff -u -r1.3 FaceletCorePlugin.java >--- src/org/eclipse/jst/jsf/facelet/core/internal/FaceletCorePlugin.java 10 Jun 2008 17:24:14 -0000 1.3 >+++ src/org/eclipse/jst/jsf/facelet/core/internal/FaceletCorePlugin.java 4 Mar 2010 22:54:35 -0000 >@@ -108,7 +108,7 @@ > public static void log(final String string, final Throwable exception) > { > final IStatus status = new Status(IStatus.ERROR, PLUGIN_ID, >- "Exception logged", exception); //$NON-NLS-1$ >+ string, exception); > getDefault().getLog().log(status); > } > >Index: src/org/eclipse/jst/jsf/facelet/core/internal/cm/strategy/TagInfoStrategyComposite.java >=================================================================== >RCS file: /cvsroot/webtools/incubator/org.eclipse.jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/cm/strategy/TagInfoStrategyComposite.java,v >retrieving revision 1.1 >diff -u -r1.1 TagInfoStrategyComposite.java >--- src/org/eclipse/jst/jsf/facelet/core/internal/cm/strategy/TagInfoStrategyComposite.java 10 Jun 2008 17:24:09 -0000 1.1 >+++ src/org/eclipse/jst/jsf/facelet/core/internal/cm/strategy/TagInfoStrategyComposite.java 4 Mar 2010 22:54:35 -0000 >@@ -26,7 +26,7 @@ > */ > public class TagInfoStrategyComposite > extends >- IteratorPolicyBasedStrategyComposite<TagIdentifier, ExternalTagInfo, String, IExternalMetadataStrategy> >+ IteratorPolicyBasedStrategyComposite<TagIdentifier, ExternalTagInfo, ExternalTagInfo, String, IExternalMetadataStrategy> > { > private final Iterable<String> _policyOrder; > >Index: src/org/eclipse/jst/jsf/facelet/core/internal/facet/FaceletChangeDelegate.java >=================================================================== >RCS file: /cvsroot/webtools/incubator/org.eclipse.jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/facet/FaceletChangeDelegate.java,v >retrieving revision 1.1 >diff -u -r1.1 FaceletChangeDelegate.java >--- src/org/eclipse/jst/jsf/facelet/core/internal/facet/FaceletChangeDelegate.java 31 May 2008 00:35:57 -0000 1.1 >+++ src/org/eclipse/jst/jsf/facelet/core/internal/facet/FaceletChangeDelegate.java 4 Mar 2010 22:54:35 -0000 >@@ -50,14 +50,15 @@ > { > final FacetChangeModel model = (FacetChangeModel) config; > >+ // XXX: look at glassfish changes > handleDesignTimeViewHandler(project); > > if (model.isChgViewHandler()) > { > maybeChangeFaceletViewHandler(project, monitor); >- } >- >- final WebAppConfigurator configurator = WebAppConfigurator >+ } >+ >+ final WebAppConfigurator configurator = WebAppConfigurator > .getConfigurator(project); > > if (configurator != null) >Index: src/org/eclipse/jst/jsf/facelet/core/internal/registry/FaceletTagRegistry.java >=================================================================== >RCS file: /cvsroot/webtools/incubator/org.eclipse.jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/FaceletTagRegistry.java,v >retrieving revision 1.7 >diff -u -r1.7 FaceletTagRegistry.java >--- src/org/eclipse/jst/jsf/facelet/core/internal/registry/FaceletTagRegistry.java 16 Jun 2008 18:38:50 -0000 1.7 >+++ src/org/eclipse/jst/jsf/facelet/core/internal/registry/FaceletTagRegistry.java 4 Mar 2010 22:54:35 -0000 >@@ -279,7 +279,7 @@ > private class MyTaglibListener extends Listener > { > @Override >- public void tagLibChanged(TaglibChangedEvent event) >+ public void changed(TaglibChangedEvent event) > { > switch (event.getChangeType()) > { >Index: src/org/eclipse/jst/jsf/facelet/core/internal/registry/taglib/AbstractFaceletTaglibLocator.java >=================================================================== >RCS file: /cvsroot/webtools/incubator/org.eclipse.jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/taglib/AbstractFaceletTaglibLocator.java,v >retrieving revision 1.2 >diff -u -r1.2 AbstractFaceletTaglibLocator.java >--- src/org/eclipse/jst/jsf/facelet/core/internal/registry/taglib/AbstractFaceletTaglibLocator.java 16 Jun 2008 20:40:10 -0000 1.2 >+++ src/org/eclipse/jst/jsf/facelet/core/internal/registry/taglib/AbstractFaceletTaglibLocator.java 4 Mar 2010 22:54:35 -0000 >@@ -11,7 +11,11 @@ > package org.eclipse.jst.jsf.facelet.core.internal.registry.taglib; > > import java.util.Map; >-import java.util.concurrent.CopyOnWriteArrayList; >+ >+import org.eclipse.core.resources.IProject; >+import org.eclipse.jst.jsf.common.internal.locator.AbstractLocator; >+import org.eclipse.jst.jsf.common.internal.locator.ILocatorChangeListener; >+import org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.Listener.TaglibChangedEvent; > > /** > * Parent of all locators of facelet taglibs. >@@ -20,48 +24,61 @@ > * > */ > public abstract class AbstractFaceletTaglibLocator >+ extends >+ AbstractLocator<Map<String, ? extends IFaceletTagRecord>, IProject, String> >+ implements IFaceletTaglibLocator > { >- private final CopyOnWriteArrayList<Listener> _listeners = new CopyOnWriteArrayList<Listener>(); >+ /** >+ * @param id >+ * @param displayName >+ */ >+ public AbstractFaceletTaglibLocator(final String id, >+ final String displayName) >+ { >+ super(id, displayName); >+ // new MapMergingCompositionStrategy >+ // <IProject, Map<String, IFaceletTagRecord>, Map<String, >+ // IFaceletTagRecord>, >+ // ILocator<Map<String, IFaceletTagRecord>, IProject, String>> >+ // (new HashMap<String, IFaceletTagRecord>(), Collections.EMPTY_MAP) >+ } > > /** > * @return a list of all tag libraries known to this locator > */ >- public abstract Map<String, ? extends IFaceletTagRecord> locate(); >+ @Override >+ protected abstract Map<String, ? extends IFaceletTagRecord> doLocate( >+ IProject context); > > /** >- * @param listener >+ * Listener argument must be of type Listener. >+ * >+ * @see org.eclipse.jst.jsf.common.internal.locator.AbstractLocator#addListener(org.eclipse.jst.jsf.common.internal.locator.ILocatorChangeListener) > */ >- public void addListener(final Listener listener) >+ @Override >+ public void addListener(final ILocatorChangeListener listener) > { >- _listeners.addIfAbsent(listener); >+ if (!(listener instanceof Listener)) >+ { >+ throw new IllegalArgumentException(); >+ } >+ super.addListener(listener); > } >- >+ > /** > * @param listener > */ >- public void removeListener(final Listener listener) >+ public void addListener(final Listener listener) > { >- _listeners.remove(listener); >+ super.addListener(listener); > } > > /** >+ * @param taglibChangedEvent > */ >- public abstract void startLocating(); >- >- /** >- * >- */ >- public abstract void stopLocating(); >- >- /** >- * @param event >- */ >- protected final void fireEvent(final Listener.TaglibChangedEvent event) >+ protected void fireChangeEvent(final TaglibChangedEvent taglibChangedEvent) > { >- for (final Listener listener : _listeners) >- { >- listener.tagLibChanged(event); >- } >+ super.fireChangeEvent(taglibChangedEvent); > } >- >+ > } >Index: src/org/eclipse/jst/jsf/facelet/core/internal/registry/taglib/ContextParamSpecifiedFaceletTaglibLocator.java >=================================================================== >RCS file: /cvsroot/webtools/incubator/org.eclipse.jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/taglib/ContextParamSpecifiedFaceletTaglibLocator.java,v >retrieving revision 1.2 >diff -u -r1.2 ContextParamSpecifiedFaceletTaglibLocator.java >--- src/org/eclipse/jst/jsf/facelet/core/internal/registry/taglib/ContextParamSpecifiedFaceletTaglibLocator.java 16 Jun 2008 20:40:10 -0000 1.2 >+++ src/org/eclipse/jst/jsf/facelet/core/internal/registry/taglib/ContextParamSpecifiedFaceletTaglibLocator.java 4 Mar 2010 22:54:35 -0000 >@@ -51,6 +51,8 @@ > /* package */class ContextParamSpecifiedFaceletTaglibLocator extends > AbstractFaceletTaglibLocator > { >+ private static final String ID = ContextParamSpecifiedFaceletTaglibLocator.class.getCanonicalName(); >+ private static final String DISPLAYNAME = Messages.ContextParamSpecifiedFaceletTaglibLocator_0; > private final IProject _project; > private final Map<String, IFaceletTagRecord> _records; > private final TagRecordFactory _factory; >@@ -59,6 +61,7 @@ > public ContextParamSpecifiedFaceletTaglibLocator(final IProject project, > final TagRecordFactory factory) > { >+ super(ID, DISPLAYNAME); > _project = project; > _records = new HashMap<String, IFaceletTagRecord>(); > _factory = factory; >@@ -73,9 +76,10 @@ > * startLocating() > */ > @Override >- public void startLocating() >+ public void start(final IProject project) > { > _fileManager.initFiles(); >+ super.start(project); > } > > /* >@@ -85,15 +89,14 @@ > * stopLocating() > */ > @Override >- public void stopLocating() >+ public void stop() > { >- > _fileManager.dispose(); > } > > > @Override >- public Map<String, ? extends IFaceletTagRecord> locate() >+ protected Map<String, ? extends IFaceletTagRecord> doLocate(IProject context) > { > return findInWebRoot(); > } >@@ -325,15 +328,14 @@ > @Override > public void checkpoint() > { >- // TODO Auto-generated method stub >+ // nothing currently persisted > > } > > @Override > public void destroy() > { >- // TODO Auto-generated method stub >- >+ // nothing currently persisted > } > > @Override >@@ -398,7 +400,7 @@ > tracker.setUri(tagRecord.getURI()); > } > >- fireEvent(new TaglibChangedEvent( >+ fireChangeEvent(new TaglibChangedEvent( > ContextParamSpecifiedFaceletTaglibLocator.this, null, > tagRecord, CHANGE_TYPE.ADDED)); > } >@@ -407,7 +409,7 @@ > public void removed(final String uri, final IFile file) > { > final IFaceletTagRecord tagRecord = _records.remove(uri); >- fireEvent(new TaglibChangedEvent( >+ fireChangeEvent(new TaglibChangedEvent( > ContextParamSpecifiedFaceletTaglibLocator.this, tagRecord, > null, CHANGE_TYPE.REMOVED)); > } >@@ -419,7 +421,7 @@ > if (newValue != null) > { > _records.put(uri, newValue); >- fireEvent(new TaglibChangedEvent( >+ fireChangeEvent(new TaglibChangedEvent( > ContextParamSpecifiedFaceletTaglibLocator.this, > oldValue, newValue, CHANGE_TYPE.CHANGED)); > } >Index: src/org/eclipse/jst/jsf/facelet/core/internal/registry/taglib/IFaceletTaglibLocator.java >=================================================================== >RCS file: src/org/eclipse/jst/jsf/facelet/core/internal/registry/taglib/IFaceletTaglibLocator.java >diff -N src/org/eclipse/jst/jsf/facelet/core/internal/registry/taglib/IFaceletTaglibLocator.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/jst/jsf/facelet/core/internal/registry/taglib/IFaceletTaglibLocator.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,18 @@ >+package org.eclipse.jst.jsf.facelet.core.internal.registry.taglib; >+ >+import java.util.Map; >+ >+import org.eclipse.core.resources.IProject; >+import org.eclipse.jst.jsf.common.internal.locator.ILocator; >+ >+/** >+ * A locator that returns a name-keyed map of facelet tag records for a particular >+ * project. >+ * >+ * @author cbateman >+ * >+ */ >+public interface IFaceletTaglibLocator extends ILocator<Map<String, ? extends IFaceletTagRecord>, IProject, String> >+{ >+ // do nothing >+} >\ No newline at end of file >Index: src/org/eclipse/jst/jsf/facelet/core/internal/registry/taglib/JarFileFaceletTaglibLocator.java >=================================================================== >RCS file: /cvsroot/webtools/incubator/org.eclipse.jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/taglib/JarFileFaceletTaglibLocator.java,v >retrieving revision 1.2 >diff -u -r1.2 JarFileFaceletTaglibLocator.java >--- src/org/eclipse/jst/jsf/facelet/core/internal/registry/taglib/JarFileFaceletTaglibLocator.java 16 Jun 2008 20:40:10 -0000 1.2 >+++ src/org/eclipse/jst/jsf/facelet/core/internal/registry/taglib/JarFileFaceletTaglibLocator.java 4 Mar 2010 22:54:37 -0000 >@@ -20,6 +20,7 @@ > import java.util.Map; > import java.util.jar.JarEntry; > import java.util.jar.JarFile; >+import java.util.regex.Pattern; > > import javax.xml.parsers.ParserConfigurationException; > >@@ -31,6 +32,7 @@ > import org.eclipse.jdt.core.IJavaProject; > import org.eclipse.jdt.core.JavaCore; > import org.eclipse.jdt.core.JavaModelException; >+import org.eclipse.jst.jsf.common.internal.strategy.SimpleStrategyComposite; > import org.eclipse.jst.jsf.facelet.core.internal.FaceletCorePlugin; > import org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.FaceletTaglibDefn; > import org.xml.sax.SAXException; >@@ -41,41 +43,64 @@ > * @author cbateman > * > */ >-/* package */class JarFileFaceletTaglibLocator extends >- AbstractFaceletTaglibLocator >+public class JarFileFaceletTaglibLocator extends AbstractFaceletTaglibLocator > { >+ /** >+ * Default taglib finder that looks in meta-inf >+ */ >+ public static final TaglibJarEntryFinder _taglibMetaInfFinder = new TaglibJarEntryFinder( >+ Pattern.compile("META-INF/.*\\.taglib\\.xml")); //$NON-NLS-1$ >+ /** >+ * Default finder that looks in the glassfish package. >+ */ >+ public static final TaglibJarEntryFinder _taglibGlassfishFinder = new TaglibJarEntryFinder( >+ Pattern.compile("com/sun/faces/metadata/taglib/.*\\.taglib\\.xml")); //$NON-NLS-1$ > >- private final IProject _project; >- private final TagRecordFactory _factory; >+ private static final String DISPLAYNAME = Messages.JarFileFaceletTaglibLocator_0; >+ private static final String ID = JarFileFaceletTaglibLocator.class >+ .getCanonicalName(); >+ private final TagRecordFactory _factory; > private Map<String, IFaceletTagRecord> _records; >+ private final SimpleStrategyComposite<JarEntry, JarEntry, JarEntry, String, TaglibFinder<JarEntry, JarEntry>> _finder; > >- public JarFileFaceletTaglibLocator(final IProject project, >- final TagRecordFactory factory) >+ /** >+ * @param factory >+ */ >+ public JarFileFaceletTaglibLocator(final TagRecordFactory factory) > { >- _project = project; >+ super(ID, DISPLAYNAME); > _factory = factory; > _records = new HashMap<String, IFaceletTagRecord>(); >+ >+ List<TaglibFinder<JarEntry, JarEntry>> finders = new ArrayList<TaglibFinder<JarEntry, JarEntry>>(); >+ finders.add(_taglibMetaInfFinder); >+ finders.add(_taglibGlassfishFinder); >+ >+ _finder = new SimpleStrategyComposite<JarEntry, JarEntry, JarEntry, String, TaglibFinder<JarEntry, JarEntry>>( >+ finders); >+ > } > > @Override >- public Map<String, ? extends IFaceletTagRecord> locate() >+ public Map<String, ? extends IFaceletTagRecord> doLocate( >+ final IProject project) > { > try > { >- return findInJars(); >- } >- catch (JavaModelException e) >+ return findInJars(project); >+ } catch (JavaModelException e) > { > FaceletCorePlugin > .log( >- "Couldn't locate jar file taglibs: " + _project.getProject(), e); //$NON-NLS-1$ >+ "Couldn't locate jar file taglibs: " + project.getProject(), e); //$NON-NLS-1$ > } > return Collections.EMPTY_MAP; > } > >- private Map<String, ? extends IFaceletTagRecord> findInJars() throws JavaModelException >+ private Map<String, ? extends IFaceletTagRecord> findInJars( >+ final IProject project) throws JavaModelException > { >- final IJavaProject javaProject = JavaCore.create(_project); >+ final IJavaProject javaProject = JavaCore.create(project); > > final IClasspathEntry[] entries = javaProject > .getResolvedClasspath(true); >@@ -87,44 +112,44 @@ > > switch (entry.getEntryKind()) > { >- // this entry describes a source root in its project >- case IClasspathEntry.CPE_SOURCE: >+ // this entry describes a source root in its project >+ case IClasspathEntry.CPE_SOURCE: > > break; >- // - this entry describes a folder or JAR containing >- // binaries >- case IClasspathEntry.CPE_LIBRARY: >- { >- tagLibsFound.addAll(processJar(entry)); >- } >+ // - this entry describes a folder or JAR containing >+ // binaries >+ case IClasspathEntry.CPE_LIBRARY: >+ { >+ tagLibsFound.addAll(processJar(entry)); >+ } > break; >- // - this entry describes another project >- case IClasspathEntry.CPE_PROJECT: >- // { >- // final IPath pathToProject = entry.getPath(); >- // IWorkspace wkspace = ResourcesPlugin.getWorkspace(); >- // IResource res = >- // wkspace.getRoot().findMember(pathToProject); >- // if (res instanceof IProject) >- // { >- // tagLibsFound.addAll(); >- // } >- // } >+ // - this entry describes another project >+ case IClasspathEntry.CPE_PROJECT: >+ // { >+ // final IPath pathToProject = entry.getPath(); >+ // IWorkspace wkspace = ResourcesPlugin.getWorkspace(); >+ // IResource res = >+ // wkspace.getRoot().findMember(pathToProject); >+ // if (res instanceof IProject) >+ // { >+ // tagLibsFound.addAll(); >+ // } >+ // } > break; >- // - this entry describes a project or library indirectly >- // via a >- // classpath variable in the first segment of the path * >- case IClasspathEntry.CPE_VARIABLE: >+ // - this entry describes a project or library indirectly >+ // via a >+ // classpath variable in the first segment of the path * >+ case IClasspathEntry.CPE_VARIABLE: > break; >- // - this entry describes set of entries referenced >- // indirectly >- // via a classpath container >- case IClasspathEntry.CPE_CONTAINER: >+ // - this entry describes set of entries referenced >+ // indirectly >+ // via a classpath container >+ case IClasspathEntry.CPE_CONTAINER: > break; > } > } >- >- for (final FaceletTaglibDefn tag : tagLibsFound) >+ >+ for (final FaceletTaglibDefn tag : tagLibsFound) > { > IFaceletTagRecord record = _factory.createRecords(tag); > if (record != null) >@@ -132,7 +157,7 @@ > _records.put(record.getURI(), record); > } > } >- >+ > return _records; > } > >@@ -185,69 +210,70 @@ > final Enumeration<JarEntry> jarEntries = jarFile.entries(); > while (jarEntries.hasMoreElements()) > { >- final JarEntry jarEntry = jarEntries.nextElement(); >- final String name = jarEntry.getName(); >+ JarEntry jarEntry = jarEntries.nextElement(); >+ >+ jarEntry = _finder.perform(jarEntry); > >- if (name.startsWith("META-INF/") //$NON-NLS-1$ >- && name.endsWith(".taglib.xml")) //$NON-NLS-1$ >+ if (jarEntry != null && jarEntry != _finder.getNoResult()) > { >- InputStream is = null; >- try >+ // if ((name.startsWith("META-INF/") //$NON-NLS-1$ >+ // && name.endsWith(".taglib.xml")) //$NON-NLS-1$ >+ // || (name.startsWith("com/sun/faces/metadata/taglib/") //$NON-NLS-1$ //ludo GlassFish v3 >+ // && name.endsWith(".taglib.xml"))) //$NON-NLS-1$ > { >- is = jarFile.getInputStream(jarEntry); >+ InputStream is = null; >+ try >+ { >+ is = jarFile.getInputStream(jarEntry); > >- FaceletTaglibDefn tagLib = TagModelParser.loadFromInputStream(is, null); >+ FaceletTaglibDefn tagLib = TagModelParser >+ .loadFromInputStream(is, null); > >- if (tagLib != null) >+ if (tagLib != null) >+ { >+ tagLibsFound.add(tagLib); >+ } >+ } catch (final ParserConfigurationException e) > { >- tagLibsFound.add(tagLib); >- } >- } >- catch (final ParserConfigurationException e) >- { >- FaceletCorePlugin >- .log( >- "Error initializing facelet registry entry", //$NON-NLS-1$ >- e); >- } >- catch (final IOException ioe) >- { >- FaceletCorePlugin >- .log( >- "Error initializing facelet registry entry", //$NON-NLS-1$ >- ioe); >- } >- catch (final SAXException ioe) >- { >- FaceletCorePlugin >- .log( >- "Error initializing facelet registry entry", //$NON-NLS-1$ >- ioe); >- } >- finally >- { >- if (is != null) >+ FaceletCorePlugin >+ .log( >+ "Error initializing facelet registry entry", //$NON-NLS-1$ >+ e); >+ } catch (final IOException ioe) >+ { >+ FaceletCorePlugin >+ .log( >+ "Error initializing facelet registry entry", //$NON-NLS-1$ >+ ioe); >+ } catch (final SAXException ioe) > { >- // is.close(); >+ FaceletCorePlugin >+ .log( >+ "Error initializing facelet registry entry", //$NON-NLS-1$ >+ ioe); >+ } finally >+ { >+ if (is != null) >+ { >+ // is.close(); >+ } > } > } > } > } > } >- } >- catch (final IOException e) >+ } catch (final IOException e) > { >- FaceletCorePlugin.log("Error opening classpath jar file", e); //$NON-NLS-1$ >- } >- finally >+ FaceletCorePlugin.log( >+ "Error opening classpath jar file: " + entry, e); //$NON-NLS-1$ >+ } finally > { > if (jarFile != null) > { > try > { > jarFile.close(); >- } >- catch (final IOException ioe) >+ } catch (final IOException ioe) > { > FaceletCorePlugin.log("Error closing jar file", ioe); //$NON-NLS-1$ > } >@@ -255,19 +281,4 @@ > } > return tagLibsFound; > } >- >- @Override >- public void startLocating() >- { >- // TODO Auto-generated method stub >- >- } >- >- @Override >- public void stopLocating() >- { >- // TODO Auto-generated method stub >- >- } >- > } >Index: src/org/eclipse/jst/jsf/facelet/core/internal/registry/taglib/LibraryClassBasedTagRecord.java >=================================================================== >RCS file: /cvsroot/webtools/incubator/org.eclipse.jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/taglib/LibraryClassBasedTagRecord.java,v >retrieving revision 1.2 >diff -u -r1.2 LibraryClassBasedTagRecord.java >--- src/org/eclipse/jst/jsf/facelet/core/internal/registry/taglib/LibraryClassBasedTagRecord.java 4 Nov 2008 00:04:18 -0000 1.2 >+++ src/org/eclipse/jst/jsf/facelet/core/internal/registry/taglib/LibraryClassBasedTagRecord.java 4 Mar 2010 22:54:37 -0000 >@@ -121,6 +121,7 @@ > "Couldn't find type proxy for " + _model.getLibraryClass())); //$NON-NLS-1$ > } > >+ // TODO: wrap in try per the Glassfish patch > _classTypeWrapper = new BeanProxyWrapper(_project, libFactoryTypeProxy); > > try >Index: src/org/eclipse/jst/jsf/facelet/core/internal/registry/taglib/Listener.java >=================================================================== >RCS file: /cvsroot/webtools/incubator/org.eclipse.jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/taglib/Listener.java,v >retrieving revision 1.1 >diff -u -r1.1 Listener.java >--- src/org/eclipse/jst/jsf/facelet/core/internal/registry/taglib/Listener.java 16 Jun 2008 07:47:54 -0000 1.1 >+++ src/org/eclipse/jst/jsf/facelet/core/internal/registry/taglib/Listener.java 4 Mar 2010 22:54:37 -0000 >@@ -1,20 +1,20 @@ > package org.eclipse.jst.jsf.facelet.core.internal.registry.taglib; > >-import java.util.EventObject; >+import org.eclipse.jst.jsf.common.internal.locator.ILocatorChangeListener; > > /** > * A listener for locator detected tag library changes > * @author cbateman > * > */ >-public abstract class Listener >+public abstract class Listener implements ILocatorChangeListener > { > /** > * Indicates that a tag library has changed > * @author cbateman > * > */ >- public static class TaglibChangedEvent extends EventObject >+ public static class TaglibChangedEvent extends LocatorChangeEvent > { > /** > * TODO: what happens if one locator has a namespace collision with >@@ -97,9 +97,16 @@ > } > } > >+ >+ public final void changed(final LocatorChangeEvent event) >+ { >+ changed((TaglibChangedEvent)event); >+ } >+ >+ > /** > * @param event > * > */ >- public abstract void tagLibChanged(Listener.TaglibChangedEvent event); >+ public abstract void changed(Listener.TaglibChangedEvent event); > } >\ No newline at end of file >Index: src/org/eclipse/jst/jsf/facelet/core/internal/registry/taglib/Messages.java >=================================================================== >RCS file: src/org/eclipse/jst/jsf/facelet/core/internal/registry/taglib/Messages.java >diff -N src/org/eclipse/jst/jsf/facelet/core/internal/registry/taglib/Messages.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/jst/jsf/facelet/core/internal/registry/taglib/Messages.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,31 @@ >+package org.eclipse.jst.jsf.facelet.core.internal.registry.taglib; >+ >+import org.eclipse.osgi.util.NLS; >+ >+/** >+ * Package NLS manager. >+ * @author cbateman >+ * >+ */ >+public class Messages extends NLS >+{ >+ private static final String BUNDLE_NAME = "org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.messages"; //$NON-NLS-1$ >+ /** >+ * see messages.properties. >+ */ >+ public static String ContextParamSpecifiedFaceletTaglibLocator_0; >+ /** >+ * see messages.properties/ >+ */ >+ public static String JarFileFaceletTaglibLocator_0; >+ static >+ { >+ // initialize resource bundle >+ NLS.initializeMessages(BUNDLE_NAME, Messages.class); >+ } >+ >+ private Messages() >+ { >+ // no external instantiation. >+ } >+} >Index: src/org/eclipse/jst/jsf/facelet/core/internal/registry/taglib/ProjectTaglibDescriptor.java >=================================================================== >RCS file: /cvsroot/webtools/incubator/org.eclipse.jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/taglib/ProjectTaglibDescriptor.java,v >retrieving revision 1.1 >diff -u -r1.1 ProjectTaglibDescriptor.java >--- src/org/eclipse/jst/jsf/facelet/core/internal/registry/taglib/ProjectTaglibDescriptor.java 16 Jun 2008 07:47:54 -0000 1.1 >+++ src/org/eclipse/jst/jsf/facelet/core/internal/registry/taglib/ProjectTaglibDescriptor.java 4 Mar 2010 22:54:38 -0000 >@@ -59,7 +59,7 @@ > > final TagRecordFactory factory = new TagRecordFactory(project, > _registry); >- _locators.add(new JarFileFaceletTaglibLocator(_project, factory)); >+ _locators.add(new JarFileFaceletTaglibLocator(factory)); > _locators.add(new ContextParamSpecifiedFaceletTaglibLocator(_project, > factory)); > >@@ -99,8 +99,8 @@ > public void run() throws Exception > { > locator.addListener(_libChangeListener); >- locator.startLocating(); >- _tagRecords.putAll(locator.locate()); >+ locator.start(_project); >+ _tagRecords.putAll(locator.locate(_project)); > } > }); > } >@@ -162,7 +162,7 @@ > > for (final AbstractFaceletTaglibLocator locator : _locators) > { >- locator.stopLocating(); >+ locator.stop(); > } > } > } >@@ -170,7 +170,7 @@ > private class MyChangeListener extends Listener > { > @Override >- public void tagLibChanged(final TaglibChangedEvent event) >+ public void changed(final TaglibChangedEvent event) > { > switch (event.getChangeType()) > { >Index: src/org/eclipse/jst/jsf/facelet/core/internal/registry/taglib/TaglibFinder.java >=================================================================== >RCS file: src/org/eclipse/jst/jsf/facelet/core/internal/registry/taglib/TaglibFinder.java >diff -N src/org/eclipse/jst/jsf/facelet/core/internal/registry/taglib/TaglibFinder.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/jst/jsf/facelet/core/internal/registry/taglib/TaglibFinder.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,28 @@ >+package org.eclipse.jst.jsf.facelet.core.internal.registry.taglib; >+ >+import org.eclipse.jst.jsf.common.internal.strategy.AbstractIdentifiableStrategy; >+ >+ >+/** >+ * A finder strategy for Facelet tag libraries. >+ * @author cbateman >+ * >+ * @param <INPUT> >+ * @param <OUTPUT> >+ */ >+public abstract class TaglibFinder<INPUT, OUTPUT> extends AbstractIdentifiableStrategy<INPUT, OUTPUT, String> >+{ >+ /** >+ * @param id >+ * @param displayName >+ * @param noResultValue >+ */ >+ public TaglibFinder(String id, String displayName, >+ OUTPUT noResultValue) >+ { >+ super(id, displayName, noResultValue); >+ } >+ >+ @Override >+ public abstract OUTPUT perform(INPUT input) throws Exception; >+} >\ No newline at end of file >Index: src/org/eclipse/jst/jsf/facelet/core/internal/registry/taglib/TaglibJarEntryFinder.java >=================================================================== >RCS file: src/org/eclipse/jst/jsf/facelet/core/internal/registry/taglib/TaglibJarEntryFinder.java >diff -N src/org/eclipse/jst/jsf/facelet/core/internal/registry/taglib/TaglibJarEntryFinder.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/jst/jsf/facelet/core/internal/registry/taglib/TaglibJarEntryFinder.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,38 @@ >+package org.eclipse.jst.jsf.facelet.core.internal.registry.taglib; >+ >+import java.util.jar.JarEntry; >+import java.util.regex.Pattern; >+ >+ >+/** >+ * @author cbateman >+ * >+ */ >+public class TaglibJarEntryFinder extends TaglibFinder<JarEntry, JarEntry> >+{ >+ /** >+ * Unique id of this strategy. >+ */ >+ public static final String ID = TaglibJarEntryFinder.class.getCanonicalName(); >+ private static final String DISPLAY_NAME = "Display Name"; //$NON-NLS-1$ >+ private final Pattern _pattern; >+ >+ /** >+ * @param pattern >+ */ >+ public TaglibJarEntryFinder(final Pattern pattern) >+ { >+ super(ID, DISPLAY_NAME, null); >+ _pattern = pattern; >+ } >+ >+ @Override >+ public JarEntry perform(JarEntry input) throws Exception >+ { >+ if (_pattern.matcher(input.getName()).matches()) >+ { >+ return input; >+ } >+ return getNoResult(); >+ } >+} >\ No newline at end of file >Index: src/org/eclipse/jst/jsf/facelet/core/internal/registry/taglib/WebappConfiguration.java >=================================================================== >RCS file: /cvsroot/webtools/incubator/org.eclipse.jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/taglib/WebappConfiguration.java,v >retrieving revision 1.2 >diff -u -r1.2 WebappConfiguration.java >--- src/org/eclipse/jst/jsf/facelet/core/internal/registry/taglib/WebappConfiguration.java 16 Jun 2008 20:40:10 -0000 1.2 >+++ src/org/eclipse/jst/jsf/facelet/core/internal/registry/taglib/WebappConfiguration.java 4 Mar 2010 22:54:39 -0000 >@@ -47,7 +47,9 @@ > */ > public class WebappConfiguration > { >- private static final String FACELET_LIBRARIES_CONTEXT_PARAM_NAME = "facelets.LIBRARIES"; //$NON-NLS-1$ >+ // TODO: move these to jsf core. >+ private static final String FACELET_10_LIBRARIES_CONTEXT_PARAM_NAME = "facelets.LIBRARIES"; //$NON-NLS-1$ >+ private static final String JSF20_FACELET_LIBRARIES_CONTEXT_PARAM_NAME = "javax.faces.FACELETS_LIBRARIES"; //$NON-NLS-1$ > private final IProject _project; > /** > * Cached instance of ContextParamAdapter. >@@ -307,7 +309,9 @@ > final org.eclipse.jst.javaee.core.ParamValue paramValue = (org.eclipse.jst.javaee.core.ParamValue) itContextParams > .next(); > if (paramValue.getParamName().equals( >- FACELET_LIBRARIES_CONTEXT_PARAM_NAME)) >+ FACELET_10_LIBRARIES_CONTEXT_PARAM_NAME)|| >+ paramValue.getParamName().equals( >+ JSF20_FACELET_LIBRARIES_CONTEXT_PARAM_NAME)) > { > filesString = paramValue.getParamValue(); > break; >@@ -352,7 +356,11 @@ > final ContextParam contextParam = (ContextParam) itContexts > .next(); > if (contextParam.getParamName().equals( >- FACELET_LIBRARIES_CONTEXT_PARAM_NAME)) >+ FACELET_10_LIBRARIES_CONTEXT_PARAM_NAME)|| >+ contextParam.getParamName().equals( >+ JSF20_FACELET_LIBRARIES_CONTEXT_PARAM_NAME)) >+ // if (contextParam.getParamName().equals( >+ // FACELET_LIBRARIES_CONTEXT_PARAM_NAME)) > { > filesString = contextParam.getParamValue(); > break; >@@ -369,7 +377,11 @@ > final ParamValue paramValue = (ParamValue) itContextParams > .next(); > if (paramValue.getName().equals( >- FACELET_LIBRARIES_CONTEXT_PARAM_NAME)) >+ FACELET_10_LIBRARIES_CONTEXT_PARAM_NAME)|| >+ paramValue.getName().equals( >+ JSF20_FACELET_LIBRARIES_CONTEXT_PARAM_NAME)) >+ // if (paramValue.getName().equals( >+ // FACELET_LIBRARIES_CONTEXT_PARAM_NAME)) > { > filesString = paramValue.getValue(); > break; >@@ -611,7 +623,8 @@ > .getParamName(); > } > >- if (FACELET_LIBRARIES_CONTEXT_PARAM_NAME.equals(name)) >+ if (FACELET_10_LIBRARIES_CONTEXT_PARAM_NAME.equals(name)|| >+ JSF20_FACELET_LIBRARIES_CONTEXT_PARAM_NAME.equals(name)) > { > isConfigFiles = true; > } >@@ -644,7 +657,8 @@ > .getParamName(); > } > >- if (FACELET_LIBRARIES_CONTEXT_PARAM_NAME.equals(name)) >+ if (FACELET_10_LIBRARIES_CONTEXT_PARAM_NAME.equals(name)|| >+ JSF20_FACELET_LIBRARIES_CONTEXT_PARAM_NAME.equals(name)) > { > isConfigFiles = true; > } >Index: src/org/eclipse/jst/jsf/facelet/core/internal/registry/taglib/messages.properties >=================================================================== >RCS file: src/org/eclipse/jst/jsf/facelet/core/internal/registry/taglib/messages.properties >diff -N src/org/eclipse/jst/jsf/facelet/core/internal/registry/taglib/messages.properties >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/jst/jsf/facelet/core/internal/registry/taglib/messages.properties 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,2 @@ >+ContextParamSpecifiedFaceletTaglibLocator_0=Facelet Taglib Locator for Context Params >+JarFileFaceletTaglibLocator_0=Facelet Taglib Locator for Jar Files >Index: src/org/eclipse/jst/jsf/facelet/core/internal/view/FaceletViewDefnAdapter.java >=================================================================== >RCS file: /cvsroot/webtools/incubator/org.eclipse.jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/view/FaceletViewDefnAdapter.java,v >retrieving revision 1.2 >diff -u -r1.2 FaceletViewDefnAdapter.java >--- src/org/eclipse/jst/jsf/facelet/core/internal/view/FaceletViewDefnAdapter.java 31 May 2008 00:35:59 -0000 1.2 >+++ src/org/eclipse/jst/jsf/facelet/core/internal/view/FaceletViewDefnAdapter.java 4 Mar 2010 22:54:40 -0000 >@@ -242,11 +242,6 @@ > return _uri; > } > >- public final String getPrefix() >- { >- return _prefix; >- } >- > @Override > public int hashCode() > { >#P org.eclipse.jst.jsf.facelet.tagsupport >Index: metadata/facelet_ui.properties >=================================================================== >RCS file: /cvsroot/webtools/incubator/org.eclipse.jsf/plugins/org.eclipse.jst.jsf.facelet.tagsupport/metadata/facelet_ui.properties,v >retrieving revision 1.1 >diff -u -r1.1 facelet_ui.properties >--- metadata/facelet_ui.properties 11 Jun 2008 19:04:20 -0000 1.1 >+++ metadata/facelet_ui.properties 4 Mar 2010 22:54:41 -0000 >@@ -3,7 +3,7 @@ > component.display-label=Component > component.description=Adds a new UIComponent into the view's component tree. The new component will be the parent of the tag's component children. Text outside the tag is removed before view rendering similar to composition. > >-composition.display-name=Composition >+composition.display-label=Composition > composition.description=<p><em>Inserts a composite component that ignores content around it:</em></p> \ > <br><p><i>This text will be removed</i><br> \ > <b><ui:composition></b><br> \ >@@ -12,10 +12,10 @@ > <b></ui:composition></b><br> \ > <i>This text will be removed</i></p> > >-debug.display-name=Debug >+debug.display-label=Debug > debug.description=Saves the component tree and EL variables in a view. Accessible by hitting the hotkey (CTRL-SHIFT-D by default). > >-decorate.display-name=Decorate >+decorate.display-label=Decorate > decorate.description=<p><em>Inserts a composite component that keeps the content around it:</em></p> \ > <br><p><i>This text will NOT be removed</i><br> \ > <b><ui:composition></b><br> \ >@@ -24,7 +24,7 @@ > <b></ui:composition></b><br> \ > <i>This text will NOT be removed</i></p> > >-define.display-name=Define >+define.display-label=Define > define.description=Defines a template area that can be used instances using insert. > > fragment.display-label=Fragment >#P org.eclipse.jst.jsf.facelet.ui >Index: src/org/eclipse/jst/jsf/facelet/ui/internal/contentassist/XHTMLContentAssistProcessor2.java >=================================================================== >RCS file: /cvsroot/webtools/incubator/org.eclipse.jsf/plugins/org.eclipse.jst.jsf.facelet.ui/src/org/eclipse/jst/jsf/facelet/ui/internal/contentassist/XHTMLContentAssistProcessor2.java,v >retrieving revision 1.2 >diff -u -r1.2 XHTMLContentAssistProcessor2.java >--- src/org/eclipse/jst/jsf/facelet/ui/internal/contentassist/XHTMLContentAssistProcessor2.java 31 May 2008 00:36:06 -0000 1.2 >+++ src/org/eclipse/jst/jsf/facelet/ui/internal/contentassist/XHTMLContentAssistProcessor2.java 4 Mar 2010 22:54:42 -0000 >@@ -251,11 +251,6 @@ > { > return _localName; > } >- >- public boolean isHasColon() >- { >- return _hasColon; >- } > } > > private static class PrefixEntry >@@ -295,11 +290,6 @@ > return _uri; > } > >- public final String getPrefix() >- { >- return _prefix; >- } >- > public int hashCode() > { > return _uri.hashCode(); >Index: src/org/eclipse/jst/jsf/facelet/ui/internal/validation/HTMLValidator.java >=================================================================== >RCS file: /cvsroot/webtools/incubator/org.eclipse.jsf/plugins/org.eclipse.jst.jsf.facelet.ui/src/org/eclipse/jst/jsf/facelet/ui/internal/validation/HTMLValidator.java,v >retrieving revision 1.3 >diff -u -r1.3 HTMLValidator.java >--- src/org/eclipse/jst/jsf/facelet/ui/internal/validation/HTMLValidator.java 31 May 2008 00:36:07 -0000 1.3 >+++ src/org/eclipse/jst/jsf/facelet/ui/internal/validation/HTMLValidator.java 4 Mar 2010 22:54:42 -0000 >@@ -198,6 +198,8 @@ > > if (findUri == null) > { >+ // XXX: Add resource locator call to find composite components, >+ // per the glassfish changes. > // TODO: need factory > final Diagnostic diag = new BasicDiagnostic( > Diagnostic.WARNING, "", -1, >@@ -211,7 +213,7 @@ > } > } > } >- >+ > private boolean shouldValidate(final IFile model) > { > final IContentTypeManager manager = Platform.getContentTypeManager(); >Index: templates/templates.xml >=================================================================== >RCS file: /cvsroot/webtools/incubator/org.eclipse.jsf/plugins/org.eclipse.jst.jsf.facelet.ui/templates/templates.xml,v >retrieving revision 1.3 >diff -u -r1.3 templates.xml >--- templates/templates.xml 17 Jun 2008 06:47:34 -0000 1.3 >+++ templates/templates.xml 4 Mar 2010 22:54:42 -0000 >@@ -61,7 +61,7 @@ > xmlns:h="http://java.sun.com/jsf/html" > xmlns:f="http://java.sun.com/jsf/core"> > >-<ui:composition template=""> >+<ui:composition> > <ui:define name="header"> > Add your header here or delete to use the default > </ui:define>
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 251798
: 161052