Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorcbateman2010-03-08 18:49:45 +0000
committercbateman2010-03-08 18:49:45 +0000
commit40b89e49854e82b35febf5c500f57a45fcf40b68 (patch)
treed455c6bd9256eb612d4d536c607ff724136f65c0
parent27e71d9e9580d525bc160f0c86482d5dc4891400 (diff)
downloadwebtools.jsf-40b89e49854e82b35febf5c500f57a45fcf40b68.tar.gz
webtools.jsf-40b89e49854e82b35febf5c500f57a45fcf40b68.tar.xz
webtools.jsf-40b89e49854e82b35febf5c500f57a45fcf40b68.zip
Move facelet.core into JSF Tools mainline from incubator.
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.facelet.core/.classpath7
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.facelet.core/.options11
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.facelet.core/.project28
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.facelet.core/.settings/org.eclipse.jdt.core.prefs82
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.facelet.core/.settings/org.eclipse.pde.prefs22
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.facelet.core/META-INF/MANIFEST.MF62
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.facelet.core/about.html22
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.facelet.core/about.ini2
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.facelet.core/about.properties6
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.facelet.core/build.properties15
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.facelet.core/dtd/facelet-taglib_1_0.dtd36
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.facelet.core/eclipse32.pngbin0 -> 4594 bytes
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.facelet.core/eclipse_update_120.jpgbin0 -> 21695 bytes
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.facelet.core/icons/full/obj16/AttributeData.gifbin0 -> 129 bytes
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.facelet.core/icons/full/obj16/ElementData.gifbin0 -> 129 bytes
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.facelet.core/jars/fake_el.jarbin0 -> 2394 bytes
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.facelet.core/model/additionalTagMetadata.ecore47
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.facelet.core/model/additionalTagMetadata.genmodel28
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.facelet.core/model/faceletTaglib.ecore40
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.facelet.core/model/faceletTaglib.genmodel44
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.facelet.core/model/templates/Header.javajetinc10
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.facelet.core/plugin.properties30
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.facelet.core/plugin.xml118
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/FaceletCorePlugin.java115
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/FaceletCoreTraceOptions.java88
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/cm/AttributeCMAdapter.java90
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/cm/DocumentElementCMAdapter.java109
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/cm/DocumentNamespaceCMAdapter.java161
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/cm/ElementCMAdapter.java147
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/cm/ExternalTagInfo.java104
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/cm/FaceletDocumentFactory.java158
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/cm/MetadataTagInfo.java137
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/cm/NamespaceCMAdapter.java222
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/cm/addtagmd/AddTagMDFactory.java56
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/cm/addtagmd/AddTagMDPackage.java339
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/cm/addtagmd/AttributeData.java112
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/cm/addtagmd/AttributeUsage.java287
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/cm/addtagmd/ElementData.java75
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/cm/addtagmd/impl/AddTagMDFactoryImpl.java187
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/cm/addtagmd/impl/AddTagMDPackageImpl.java352
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/cm/addtagmd/impl/AttributeDataImpl.java294
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/cm/addtagmd/impl/ElementDataImpl.java239
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/cm/addtagmd/provider/AddTagMDItemProviderAdapterFactory.java246
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/cm/addtagmd/provider/AttributeDataItemProvider.java258
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/cm/addtagmd/provider/ElementDataItemProvider.java228
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/cm/addtagmd/provider/IResourceProvider.java31
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/cm/addtagmd/util/AddTagMDAdapterFactory.java156
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/cm/addtagmd/util/AddTagMDSwitch.java168
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/cm/attributevalues/TemplateWebPathType.java179
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/cm/strategy/AbstractExternalMetadataStrategy.java52
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/cm/strategy/IExternalMetadataStrategy.java56
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/cm/strategy/JSPExternalMetadataStrategy.java87
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/cm/strategy/MDExternalMetadataStrategy.java482
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/cm/strategy/Messages.java56
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/cm/strategy/TagInfoStrategyComposite.java78
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/cm/strategy/messages.properties13
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/facet/ChangeActionType.java31
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/facet/FaceletChangeDelegate.java160
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/facet/FaceletFacet.java96
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/facet/FaceletFacetChangeDataModelProvider.java108
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/facet/FaceletFacetDefaultVersionProvider.java34
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/facet/FaceletFacetInstallDataModelProvider.java39
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/facet/FaceletFacetUninstallModelProvider.java49
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/facet/FaceletInstallDelegate.java234
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/facet/FaceletUninstallDelegate.java236
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/facet/FaceletUninstallModel.java39
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/facet/FacetChangeModel.java95
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/facet/FacetInstallModel.java29
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/facet/Messages.java42
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/facet/WebAppConfigurator.java394
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/facet/messages.properties2
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/ELProxyContributor.java53
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/FaceletMetaResolvingStrategy.java210
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/FaceletRegistryManager.java112
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/FaceletTagRegistry.java383
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/FaceletTagResolvingStrategy.java167
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/IFaceletTagResolvingStrategy.java63
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/LibraryOperation.java47
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/LibraryOperationFactory.java122
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/Messages.java46
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/MetadataAttributeAdvisor.java63
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/ServletBeanProxyContributor.java58
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/VeryTemporaryDefaultFaceletResolver.java215
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/messages.properties3
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/taglib/AbstractFaceletTaglibLocator.java84
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/taglib/ContextParamSpecifiedFaceletTaglibLocator.java430
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/taglib/FaceletTagIndex.java46
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/taglib/FaceletTagRecord.java55
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/taglib/IFaceletTagRecord.java85
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/taglib/IFaceletTaglibLocator.java18
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/taglib/IProjectTaglibDescriptor.java45
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/taglib/JarFileFaceletTaglibLocator.java284
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/taglib/LibraryClassBasedTagRecord.java546
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/taglib/Listener.java112
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/taglib/Messages.java31
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/taglib/ProjectTaglibDescriptor.java191
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/taglib/TagModelParser.java461
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/taglib/TagRecordFactory.java81
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/taglib/TaglibFinder.java28
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/taglib/TaglibJarEntryFinder.java38
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/taglib/WebappConfiguration.java696
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/taglib/XMLBasedTagRecord.java99
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/taglib/faceletTaglib/ComponentTagDefn.java81
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/taglib/faceletTaglib/ConverterTagDefn.java54
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/taglib/faceletTaglib/FaceletLibraryClassTagLib.java54
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/taglib/faceletTaglib/FaceletTaglibDefn.java24
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/taglib/faceletTaglib/FaceletTaglibFactory.java128
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/taglib/faceletTaglib/FaceletTaglibPackage.java944
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/taglib/faceletTaglib/FaceletXMLDefnTaglib.java89
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/taglib/faceletTaglib/FunctionDefn.java109
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/taglib/faceletTaglib/HandlerTagDefn.java54
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/taglib/faceletTaglib/SourceTagDefn.java54
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/taglib/faceletTaglib/TagDefn.java55
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/taglib/faceletTaglib/ValidatorTagDefn.java54
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/taglib/faceletTaglib/impl/ComponentTagDefnImpl.java236
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/taglib/faceletTaglib/impl/ConverterTagDefnImpl.java180
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/taglib/faceletTaglib/impl/FaceletLibraryClassTagLibImpl.java180
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/taglib/faceletTaglib/impl/FaceletTaglibDefnImpl.java48
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/taglib/faceletTaglib/impl/FaceletTaglibFactoryImpl.java220
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/taglib/faceletTaglib/impl/FaceletTaglibPackageImpl.java559
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/taglib/faceletTaglib/impl/FaceletXMLDefnTaglibImpl.java261
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/taglib/faceletTaglib/impl/FunctionDefnImpl.java293
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/taglib/faceletTaglib/impl/HandlerTagDefnImpl.java180
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/taglib/faceletTaglib/impl/SourceTagDefnImpl.java180
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/taglib/faceletTaglib/impl/TagDefnImpl.java181
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/taglib/faceletTaglib/impl/ValidatorTagDefnImpl.java180
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/taglib/faceletTaglib/util/FaceletTaglibAdapterFactory.java316
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/taglib/faceletTaglib/util/FaceletTaglibSwitch.java362
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/taglib/messages.properties2
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/tagmodel/AttributeHandlerMapAdapter.java191
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/tagmodel/ComponentTag.java76
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/tagmodel/ConverterTag.java62
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/tagmodel/FaceletNamespace.java214
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/tagmodel/FaceletTag.java88
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/tagmodel/HandlerTag.java56
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/tagmodel/IFaceletTagConstants.java149
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/tagmodel/Messages.java42
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/tagmodel/NoArchetypeFaceletTag.java31
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/tagmodel/SourceTag.java40
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/tagmodel/ValidatorTag.java53
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/tagmodel/messages.properties2
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/util/TagMetadataLoader.java162
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/util/ViewUtil.java220
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/validation/TaglibValidator.java181
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/view/DTFaceletViewHandler.java146
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/view/FaceletUIViewRoot.java25
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/view/FaceletViewDefnAdapter.java257
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/view/ViewDefnAdapterFactory.java50
148 files changed, 19555 insertions, 0 deletions
diff --git a/jsf/plugins/org.eclipse.jst.jsf.facelet.core/.classpath b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/.classpath
new file mode 100644
index 000000000..304e86186
--- /dev/null
+++ b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/jsf/plugins/org.eclipse.jst.jsf.facelet.core/.options b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/.options
new file mode 100644
index 000000000..5e3f0bcf4
--- /dev/null
+++ b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/.options
@@ -0,0 +1,11 @@
+# Debugging options for the org.eclipse.jst.jsf.core
+
+# Turn on general debugging for the org.eclipse.jsf.core plugin.
+org.eclipse.jst.jsf.facelet.core/debug=false
+
+org.eclipse.jst.jsf.facelet.core/tagregistry=false
+org.eclipse.jst.jsf.facelet.core/tagregistry/changes=false
+org.eclipse.jst.jsf.facelet.core/registrymanager=false
+org.eclipse.jst.jsf.facelet.core/facetinstalldelegate=false
+org.eclipse.jst.jsf.facelet.core/facetuninstalldelegate=false
+org.eclipse.jst.jsf.facelet.core/facetchangedelegate=false \ No newline at end of file
diff --git a/jsf/plugins/org.eclipse.jst.jsf.facelet.core/.project b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/.project
new file mode 100644
index 000000000..782c0aa1f
--- /dev/null
+++ b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.jst.jsf.facelet.core</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
diff --git a/jsf/plugins/org.eclipse.jst.jsf.facelet.core/.settings/org.eclipse.jdt.core.prefs b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 000000000..8c1950bb2
--- /dev/null
+++ b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,82 @@
+#Fri May 30 12:28:19 PDT 2008
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=disabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.doc.comment.support=enabled
+org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.autoboxing=warning
+org.eclipse.jdt.core.compiler.problem.deprecation=warning
+org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
+org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
+org.eclipse.jdt.core.compiler.problem.discouragedReference=ignore
+org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.problem.fallthroughCase=warning
+org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled
+org.eclipse.jdt.core.compiler.problem.fieldHiding=warning
+org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
+org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
+org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
+org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
+org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
+org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning
+org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore
+org.eclipse.jdt.core.compiler.problem.invalidJavadoc=error
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTags=enabled
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsDeprecatedRef=disabled
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsNotVisibleRef=disabled
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=protected
+org.eclipse.jdt.core.compiler.problem.localVariableHiding=warning
+org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
+org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=warning
+org.eclipse.jdt.core.compiler.problem.missingJavadocComments=warning
+org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=disabled
+org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=protected
+org.eclipse.jdt.core.compiler.problem.missingJavadocTags=warning
+org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=disabled
+org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=protected
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=warning
+org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
+org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
+org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
+org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=error
+org.eclipse.jdt.core.compiler.problem.nullReference=warning
+org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
+org.eclipse.jdt.core.compiler.problem.parameterAssignment=error
+org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning
+org.eclipse.jdt.core.compiler.problem.potentialNullReference=warning
+org.eclipse.jdt.core.compiler.problem.rawTypeReference=ignore
+org.eclipse.jdt.core.compiler.problem.redundantNullCheck=warning
+org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore
+org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
+org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
+org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
+org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
+org.eclipse.jdt.core.compiler.problem.typeParameterHiding=ignore
+org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=ignore
+org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=error
+org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.unnecessaryElse=warning
+org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning
+org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=warning
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
+org.eclipse.jdt.core.compiler.problem.unusedImport=error
+org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
+org.eclipse.jdt.core.compiler.problem.unusedLocal=error
+org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
+org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
+org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=error
+org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
+org.eclipse.jdt.core.compiler.source=1.5
diff --git a/jsf/plugins/org.eclipse.jst.jsf.facelet.core/.settings/org.eclipse.pde.prefs b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/.settings/org.eclipse.pde.prefs
new file mode 100644
index 000000000..e611bfe2c
--- /dev/null
+++ b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/.settings/org.eclipse.pde.prefs
@@ -0,0 +1,22 @@
+#Fri May 30 12:02:33 PDT 2008
+compilers.f.unresolved-features=1
+compilers.f.unresolved-plugins=1
+compilers.incompatible-environment=1
+compilers.p.build=1
+compilers.p.deprecated=1
+compilers.p.discouraged-class=1
+compilers.p.internal=1
+compilers.p.missing-packages=0
+compilers.p.no-required-att=0
+compilers.p.not-externalized-att=0
+compilers.p.unknown-attribute=1
+compilers.p.unknown-class=1
+compilers.p.unknown-element=1
+compilers.p.unknown-identifier=1
+compilers.p.unknown-resource=1
+compilers.p.unresolved-ex-points=0
+compilers.p.unresolved-import=0
+compilers.s.create-docs=false
+compilers.s.doc-folder=doc
+compilers.s.open-tags=1
+eclipse.preferences.version=1
diff --git a/jsf/plugins/org.eclipse.jst.jsf.facelet.core/META-INF/MANIFEST.MF b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/META-INF/MANIFEST.MF
new file mode 100644
index 000000000..0d7466fe5
--- /dev/null
+++ b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/META-INF/MANIFEST.MF
@@ -0,0 +1,62 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %Bundle-Name.0
+Bundle-SymbolicName: org.eclipse.jst.jsf.facelet.core;singleton:=true
+Bundle-Version: 0.2.0.qualifier
+Bundle-Activator: org.eclipse.jst.jsf.facelet.core.internal.FaceletCorePlugin$Implementation
+Bundle-Localization: plugin
+Require-Bundle: org.eclipse.core.runtime,
+ org.eclipse.wst.common.project.facet.core,
+ org.eclipse.core.resources;bundle-version="3.4.0",
+ org.eclipse.wst.common.modulecore;bundle-version="1.1.103",
+ 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";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",
+ org.eclipse.jst.jsp.core;bundle-version="1.2.100",
+ org.eclipse.jst.jsf.facesconfig;bundle-version="1.0.1",
+ org.eclipse.emf.common;bundle-version="2.4.0",
+ org.eclipse.jst.j2ee;bundle-version="1.1.105",
+ org.eclipse.emf.ecore;bundle-version="2.4.0",
+ org.eclipse.ui;bundle-version="3.4.0",
+ org.eclipse.emf.edit.ui;bundle-version="2.4.0",
+ org.eclipse.jst.j2ee.web;bundle-version="1.1.200",
+ org.eclipse.wst.validation;bundle-version="1.2.0",
+ org.eclipse.debug.core;bundle-version="[3.5.0,4.0.0)"
+Bundle-ActivationPolicy: lazy
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Import-Package: org.eclipse.jdt.core,
+ org.eclipse.jem.internal.proxy.core,
+ org.eclipse.jem.internal.proxy.ide,
+ org.eclipse.jst.j2ee.common,
+ org.eclipse.jst.j2ee.webapplication,
+ org.eclipse.jst.javaee.core,
+ org.eclipse.jst.javaee.web,
+ org.eclipse.jst.jsf.common.runtime.internal.model.component,
+ org.eclipse.jst.jsf.core.jsfappconfig,
+ org.eclipse.jst.jsf.designtime.internal.view,
+ org.eclipse.wst.xml.core.internal.contentmodel,
+ org.eclipse.wst.xml.core.internal.contentmodel.factory,
+ org.eclipse.wst.xml.core.internal.regions
+Export-Package: org.eclipse.jst.jsf.facelet.core.internal;x-internal:=true,
+ org.eclipse.jst.jsf.facelet.core.internal.cm;x-internal:=true,
+ org.eclipse.jst.jsf.facelet.core.internal.cm.addtagmd;x-friends:="org.eclipse.jst.jsf.facelet.tagsupport",
+ org.eclipse.jst.jsf.facelet.core.internal.cm.addtagmd.impl;x-internal:=true,
+ org.eclipse.jst.jsf.facelet.core.internal.cm.addtagmd.provider;x-internal:=true,
+ org.eclipse.jst.jsf.facelet.core.internal.cm.addtagmd.util;x-internal:=true,
+ org.eclipse.jst.jsf.facelet.core.internal.cm.attributevalues;x-internal:=true,
+ org.eclipse.jst.jsf.facelet.core.internal.cm.strategy;x-internal:=true,
+ org.eclipse.jst.jsf.facelet.core.internal.facet;x-internal:=true,
+ org.eclipse.jst.jsf.facelet.core.internal.registry;x-internal:=true,
+ org.eclipse.jst.jsf.facelet.core.internal.registry.taglib;x-internal:=true,
+ org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib;x-internal:=true,
+ org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.impl;x-internal:=true,
+ org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.util;x-internal:=true,
+ org.eclipse.jst.jsf.facelet.core.internal.tagmodel;x-internal:=true,
+ org.eclipse.jst.jsf.facelet.core.internal.util;x-internal:=true,
+ org.eclipse.jst.jsf.facelet.core.internal.validation;x-internal:=true,
+ org.eclipse.jst.jsf.facelet.core.internal.view;x-internal:=true
+Bundle-Vendor: %providerName
diff --git a/jsf/plugins/org.eclipse.jst.jsf.facelet.core/about.html b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/about.html
new file mode 100644
index 000000000..90bd74d4d
--- /dev/null
+++ b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/about.html
@@ -0,0 +1,22 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
+<html>
+<head>
+<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
+<title>About</title>
+</head>
+<body lang="EN-US">
+<h2>About This Content</h2>
+
+<p>June, 2008</p>
+<h3>License</h3>
+
+<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise indicated below, the Content is provided to you under the terms and conditions of the
+Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
+For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
+
+<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
+apply to your use of any object code in the Content. Check the Redistributor's license that was provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
+indicated below, the terms and conditions of the EPL still apply to any source code in the Content.</p>
+
+</body>
+</html>
diff --git a/jsf/plugins/org.eclipse.jst.jsf.facelet.core/about.ini b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/about.ini
new file mode 100644
index 000000000..b20fd5bfb
--- /dev/null
+++ b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/about.ini
@@ -0,0 +1,2 @@
+aboutText = %aboutText
+featureImage = eclipse32.png \ No newline at end of file
diff --git a/jsf/plugins/org.eclipse.jst.jsf.facelet.core/about.properties b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/about.properties
new file mode 100644
index 000000000..477e2f8ee
--- /dev/null
+++ b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/about.properties
@@ -0,0 +1,6 @@
+aboutText=JSF Facelets Tools - WTP Incubator Project\n\
+\n\
+Version: 0.1.0\n\
+\n\
+(c) Copyright Eclipse contributors and others 2008. All rights reserved. \n\
+Visit http://www.eclipse.org/webtools \ No newline at end of file
diff --git a/jsf/plugins/org.eclipse.jst.jsf.facelet.core/build.properties b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/build.properties
new file mode 100644
index 000000000..4bd6b85f6
--- /dev/null
+++ b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/build.properties
@@ -0,0 +1,15 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ plugin.xml,\
+ jars/,\
+ plugin.properties,\
+ dtd/,\
+ icons/,\
+ model/,\
+ about.ini,\
+ about.properties,\
+ eclipse_update_120.jpg,\
+ about.html,\
+ eclipse32.png
diff --git a/jsf/plugins/org.eclipse.jst.jsf.facelet.core/dtd/facelet-taglib_1_0.dtd b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/dtd/facelet-taglib_1_0.dtd
new file mode 100644
index 000000000..5cbf61057
--- /dev/null
+++ b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/dtd/facelet-taglib_1_0.dtd
@@ -0,0 +1,36 @@
+<!--
+ Copyright 2005 Sun Microsystems, Inc. All rights reserved.
+ Licensed under the Common Development and Distribution License,
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.sun.com/cddl/
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied. See the License for the specific language governing
+ permissions and limitations under the License.
+
+ $Id: facelet-taglib_1_0.dtd,v 1.1 2010/03/08 18:49:45 cbateman Exp $
+-->
+
+<!ELEMENT facelet-taglib (library-class|(namespace,(tag|function)+))>
+<!ATTLIST facelet-taglib xmlns CDATA #FIXED "http://java.sun.com/JSF/Facelet">
+<!ELEMENT namespace (#PCDATA)>
+<!ELEMENT library-class (#PCDATA)>
+<!ELEMENT tag (tag-name,(handler-class|component|converter|validator|source))>
+<!ELEMENT tag-name (#PCDATA)>
+<!ELEMENT handler-class (#PCDATA)>
+<!ELEMENT component (component-type,renderer-type?,handler-class?)>
+<!ELEMENT component-type (#PCDATA)>
+<!ELEMENT renderer-type (#PCDATA)>
+<!ELEMENT converter (converter-id, handler-class?)>
+<!ELEMENT converter-id (#PCDATA)>
+<!ELEMENT validator (validator-id, handler-class?)>
+<!ELEMENT validator-id (#PCDATA)>
+<!ELEMENT source (#PCDATA)>
+<!ELEMENT function (function-name,function-class,function-signature)>
+<!ELEMENT function-name (#PCDATA)>
+<!ELEMENT function-class (#PCDATA)>
+<!ELEMENT function-signature (#PCDATA)>
diff --git a/jsf/plugins/org.eclipse.jst.jsf.facelet.core/eclipse32.png b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/eclipse32.png
new file mode 100644
index 000000000..568fac1d0
--- /dev/null
+++ b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/eclipse32.png
Binary files differ
diff --git a/jsf/plugins/org.eclipse.jst.jsf.facelet.core/eclipse_update_120.jpg b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/eclipse_update_120.jpg
new file mode 100644
index 000000000..bfdf708ad
--- /dev/null
+++ b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/eclipse_update_120.jpg
Binary files differ
diff --git a/jsf/plugins/org.eclipse.jst.jsf.facelet.core/icons/full/obj16/AttributeData.gif b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/icons/full/obj16/AttributeData.gif
new file mode 100644
index 000000000..c414fe9f7
--- /dev/null
+++ b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/icons/full/obj16/AttributeData.gif
Binary files differ
diff --git a/jsf/plugins/org.eclipse.jst.jsf.facelet.core/icons/full/obj16/ElementData.gif b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/icons/full/obj16/ElementData.gif
new file mode 100644
index 000000000..d92f34c8a
--- /dev/null
+++ b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/icons/full/obj16/ElementData.gif
Binary files differ
diff --git a/jsf/plugins/org.eclipse.jst.jsf.facelet.core/jars/fake_el.jar b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/jars/fake_el.jar
new file mode 100644
index 000000000..78b04b1bb
--- /dev/null
+++ b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/jars/fake_el.jar
Binary files differ
diff --git a/jsf/plugins/org.eclipse.jst.jsf.facelet.core/model/additionalTagMetadata.ecore b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/model/additionalTagMetadata.ecore
new file mode 100644
index 000000000..38f283ab6
--- /dev/null
+++ b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/model/additionalTagMetadata.ecore
@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ecore:EPackage xmi:version="2.0"
+ xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="addtagmd"
+ nsURI="http://org.eclipse.jst.jsf.facelet.core/additionalTagMetadata.ecore" nsPrefix="addTagMD">
+ <eClassifiers xsi:type="ecore:EClass" name="ElementData">
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString">
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="element"/>
+ <details key="name" value="name"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="attributes" upperBound="-1"
+ eType="#//AttributeData" containment="true">
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="element"/>
+ <details key="name" value="attribute"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ </eClassifiers>
+ <eClassifiers xsi:type="ecore:EClass" name="AttributeData">
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString">
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="element"/>
+ <details key="name" value="name"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="usage" eType="#//AttributeUsage">
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="element"/>
+ <details key="name" value="usage"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="description" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString">
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="element"/>
+ <details key="name" value="description"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ </eClassifiers>
+ <eClassifiers xsi:type="ecore:EEnum" name="AttributeUsage">
+ <eLiterals name="OPTIONAL"/>
+ <eLiterals name="REQUIRED" value="1"/>
+ <eLiterals name="FIXED" value="2"/>
+ <eLiterals name="PROHIBITED" value="3"/>
+ </eClassifiers>
+</ecore:EPackage>
diff --git a/jsf/plugins/org.eclipse.jst.jsf.facelet.core/model/additionalTagMetadata.genmodel b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/model/additionalTagMetadata.genmodel
new file mode 100644
index 000000000..b87ea5ad6
--- /dev/null
+++ b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/model/additionalTagMetadata.genmodel
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<genmodel:GenModel xmi:version="2.0"
+ xmlns:xmi="http://www.omg.org/XMI" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore"
+ xmlns:genmodel="http://www.eclipse.org/emf/2002/GenModel" copyrightText=""
+ modelDirectory="/org.eclipse.jst.jsf.facelet.core/src" editDirectory="/org.eclipse.jst.jsf.facelet.core/src"
+ modelPluginID="org.eclipse.jst.jsf.facelet.core" templateDirectory="templates"
+ dynamicTemplates="true" modelName="AdditionalTagMetadata" editPluginClass="org.eclipse.jst.jsf.facelet.core.internal.FaceletCorePlugin"
+ nonNLSMarkers="true" importerID="org.eclipse.emf.importer.ecore" complianceLevel="5.0"
+ copyrightFields="false" language="">
+ <foreignModel>additionalTagMetadata.ecore</foreignModel>
+ <genPackages prefix="AddTagMD" basePackage="org.eclipse.jst.jsf.facelet.core.internal.cm"
+ disposableProviderFactory="true" ecorePackage="additionalTagMetadata.ecore#/">
+ <genEnums typeSafeEnumCompatible="false" ecoreEnum="additionalTagMetadata.ecore#//AttributeUsage">
+ <genEnumLiterals ecoreEnumLiteral="additionalTagMetadata.ecore#//AttributeUsage/OPTIONAL"/>
+ <genEnumLiterals ecoreEnumLiteral="additionalTagMetadata.ecore#//AttributeUsage/REQUIRED"/>
+ <genEnumLiterals ecoreEnumLiteral="additionalTagMetadata.ecore#//AttributeUsage/FIXED"/>
+ <genEnumLiterals ecoreEnumLiteral="additionalTagMetadata.ecore#//AttributeUsage/PROHIBITED"/>
+ </genEnums>
+ <genClasses ecoreClass="additionalTagMetadata.ecore#//ElementData">
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute additionalTagMetadata.ecore#//ElementData/name"/>
+ <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference additionalTagMetadata.ecore#//ElementData/attributes"/>
+ </genClasses>
+ <genClasses ecoreClass="additionalTagMetadata.ecore#//AttributeData">
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute additionalTagMetadata.ecore#//AttributeData/name"/>
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute additionalTagMetadata.ecore#//AttributeData/usage"/>
+ </genClasses>
+ </genPackages>
+</genmodel:GenModel>
diff --git a/jsf/plugins/org.eclipse.jst.jsf.facelet.core/model/faceletTaglib.ecore b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/model/faceletTaglib.ecore
new file mode 100644
index 000000000..e6c801da7
--- /dev/null
+++ b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/model/faceletTaglib.ecore
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ecore:EPackage xmi:version="2.0"
+ xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="faceletTaglib"
+ nsURI="http://org.eclipse.jst.jsf.facelet.core/faceletTaglib.ecore" nsPrefix="faceletTaglib">
+ <eClassifiers xsi:type="ecore:EClass" name="FaceletLibraryClassTagLib" eSuperTypes="#//FaceletTaglibDefn">
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="libraryClass" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+ </eClassifiers>
+ <eClassifiers xsi:type="ecore:EClass" name="FaceletXMLDefnTaglib" eSuperTypes="#//FaceletTaglibDefn">
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="namespace" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="tags" upperBound="-1" eType="#//TagDefn"/>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="functions" upperBound="-1"
+ eType="#//FunctionDefn"/>
+ </eClassifiers>
+ <eClassifiers xsi:type="ecore:EClass" name="FaceletTaglibDefn"/>
+ <eClassifiers xsi:type="ecore:EClass" name="ComponentTagDefn" eSuperTypes="#//HandlerTagDefn">
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="componentType" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="rendererType" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+ </eClassifiers>
+ <eClassifiers xsi:type="ecore:EClass" name="ValidatorTagDefn" eSuperTypes="#//HandlerTagDefn">
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="validatorId" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+ </eClassifiers>
+ <eClassifiers xsi:type="ecore:EClass" name="ConverterTagDefn" eSuperTypes="#//HandlerTagDefn">
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="converterId" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+ </eClassifiers>
+ <eClassifiers xsi:type="ecore:EClass" name="HandlerTagDefn" eSuperTypes="#//TagDefn">
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="handlerClass" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+ </eClassifiers>
+ <eClassifiers xsi:type="ecore:EClass" name="SourceTagDefn" eSuperTypes="#//TagDefn">
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="source" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+ </eClassifiers>
+ <eClassifiers xsi:type="ecore:EClass" name="TagDefn">
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+ </eClassifiers>
+ <eClassifiers xsi:type="ecore:EClass" name="FunctionDefn">
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="functionName" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="functionClass" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="functionSignature" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+ </eClassifiers>
+</ecore:EPackage>
diff --git a/jsf/plugins/org.eclipse.jst.jsf.facelet.core/model/faceletTaglib.genmodel b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/model/faceletTaglib.genmodel
new file mode 100644
index 000000000..54e07e903
--- /dev/null
+++ b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/model/faceletTaglib.genmodel
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<genmodel:GenModel xmi:version="2.0"
+ xmlns:xmi="http://www.omg.org/XMI" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore"
+ xmlns:genmodel="http://www.eclipse.org/emf/2002/GenModel" modelDirectory="/org.eclipse.jst.jsf.facelet.core/src"
+ modelPluginID="org.eclipse.jst.jsf.facelet.core" modelName="FaceletTaglib" importerID="org.eclipse.emf.importer.ecore"
+ complianceLevel="5.0" copyrightFields="false">
+ <foreignModel>faceletTaglib.ecore</foreignModel>
+ <genPackages prefix="FaceletTaglib" basePackage="org.eclipse.jst.jsf.facelet.core.internal.registry.taglib"
+ disposableProviderFactory="true" ecorePackage="faceletTaglib.ecore#/">
+ <genClasses ecoreClass="faceletTaglib.ecore#//FaceletLibraryClassTagLib">
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute faceletTaglib.ecore#//FaceletLibraryClassTagLib/libraryClass"/>
+ </genClasses>
+ <genClasses ecoreClass="faceletTaglib.ecore#//FaceletXMLDefnTaglib">
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute faceletTaglib.ecore#//FaceletXMLDefnTaglib/namespace"/>
+ <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference faceletTaglib.ecore#//FaceletXMLDefnTaglib/tags"/>
+ <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference faceletTaglib.ecore#//FaceletXMLDefnTaglib/functions"/>
+ </genClasses>
+ <genClasses ecoreClass="faceletTaglib.ecore#//FaceletTaglibDefn"/>
+ <genClasses ecoreClass="faceletTaglib.ecore#//ComponentTagDefn">
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute faceletTaglib.ecore#//ComponentTagDefn/componentType"/>
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute faceletTaglib.ecore#//ComponentTagDefn/rendererType"/>
+ </genClasses>
+ <genClasses ecoreClass="faceletTaglib.ecore#//ValidatorTagDefn">
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute faceletTaglib.ecore#//ValidatorTagDefn/validatorId"/>
+ </genClasses>
+ <genClasses ecoreClass="faceletTaglib.ecore#//ConverterTagDefn">
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute faceletTaglib.ecore#//ConverterTagDefn/converterId"/>
+ </genClasses>
+ <genClasses ecoreClass="faceletTaglib.ecore#//HandlerTagDefn">
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute faceletTaglib.ecore#//HandlerTagDefn/handlerClass"/>
+ </genClasses>
+ <genClasses ecoreClass="faceletTaglib.ecore#//SourceTagDefn">
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute faceletTaglib.ecore#//SourceTagDefn/source"/>
+ </genClasses>
+ <genClasses ecoreClass="faceletTaglib.ecore#//TagDefn">
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute faceletTaglib.ecore#//TagDefn/name"/>
+ </genClasses>
+ <genClasses ecoreClass="faceletTaglib.ecore#//FunctionDefn">
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute faceletTaglib.ecore#//FunctionDefn/functionName"/>
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute faceletTaglib.ecore#//FunctionDefn/functionClass"/>
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute faceletTaglib.ecore#//FunctionDefn/functionSignature"/>
+ </genClasses>
+ </genPackages>
+</genmodel:GenModel>
diff --git a/jsf/plugins/org.eclipse.jst.jsf.facelet.core/model/templates/Header.javajetinc b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/model/templates/Header.javajetinc
new file mode 100644
index 000000000..f7c8f2b9c
--- /dev/null
+++ b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/model/templates/Header.javajetinc
@@ -0,0 +1,10 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Oracle Corporation.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Oracle - initial API and implementation
+ *******************************************************************************/
diff --git a/jsf/plugins/org.eclipse.jst.jsf.facelet.core/plugin.properties b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/plugin.properties
new file mode 100644
index 000000000..c6957e618
--- /dev/null
+++ b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/plugin.properties
@@ -0,0 +1,30 @@
+plugin.facet.extension.name=Facelet
+plugin.facet.description=Facelet (XHTML) support
+Facelet_1_0_Project=Facelet 1.0 Project
+Facelet_1_0_PresetDesc=Configures a Dynamic Web application for Facelet 1.0, JSF v1.2 using Web Module v2.5 and Java v1.5.
+
+Bundle-Name.0 = JSF Facelets Tools - WTP Incubator Project
+tagRegistry.description.0 = Facelet Tag Registry
+pluginName = AdditionalTagMetadata Model
+providerName = Eclipse.org
+_UI_CreateChild_text = {0}
+_UI_CreateChild_text2 = {1} {0}
+_UI_CreateChild_text3 = {1}
+_UI_CreateChild_tooltip = Create New {0} Under {1} Feature
+_UI_CreateChild_description = Create a new child of type {0} for the {1} feature of the selected {2}.
+_UI_CreateSibling_description = Create a new sibling of type {0} for the selected {2}, under the {1} feature of their parent.
+ _UI_PropertyDescriptor_description = The {0} of the {1}
+ _UI_ElementData_type = Element Data
+_UI_AttributeData_type = Attribute Data
+_UI_Unknown_type = Object
+ _UI_Unknown_datatype= Value
+ _UI_ElementData_name_feature = Name
+_UI_ElementData_attributes_feature = Attributes
+_UI_AttributeData_name_feature = Name
+_UI_AttributeData_usage_feature = Usage
+_UI_Unknown_feature = Unspecified
+ _UI_AttributeUsage_OPTIONAL_literal = OPTIONAL
+_UI_AttributeUsage_REQUIRED_literal = REQUIRED
+_UI_AttributeUsage_FIXED_literal = FIXED
+_UI_AttributeUsage_PROHIBITED_literal = PROHIBITED
+_UI_AttributeData_description_feature = Description
diff --git a/jsf/plugins/org.eclipse.jst.jsf.facelet.core/plugin.xml b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/plugin.xml
new file mode 100644
index 000000000..35bb920e6
--- /dev/null
+++ b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/plugin.xml
@@ -0,0 +1,118 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.2"?>
+<plugin>
+ <extension
+ id="org.eclipse.jst.jsf.project.facet"
+ name="%plugin.facet.extension.name"
+ point="org.eclipse.wst.common.project.facet.core.facets">
+
+ <project-facet id="jsf.facelet">
+ <label>Facelet</label>
+ <description>%plugin.facet.description</description>
+ <default-version
+ provider="org.eclipse.jst.jsf.facelet.core.internal.facet.FaceletFacetDefaultVersionProvider">
+ </default-version>
+ </project-facet>
+
+ <project-facet-version facet="jsf.facelet" version="1.0">
+ <constraint>
+ <and>
+ <requires
+ facet="jst.jsf"
+ version="[1.0">
+ </requires>
+ </and>
+ </constraint>
+ </project-facet-version>
+
+ <action id="jsf.facelet.v10.install" facet="jsf.facelet" type="INSTALL" version="1.0">
+ <delegate class="org.eclipse.jst.jsf.facelet.core.internal.facet.FaceletInstallDelegate"/>
+ <config-factory
+ class="org.eclipse.jst.jsf.facelet.core.internal.facet.FaceletFacetInstallDataModelProvider">
+ </config-factory>
+ </action>
+ <action id="jsf.facelet.v10.uninstall" facet="jsf.facelet" type="UNINSTALL" version="1.0" >
+ <delegate class="org.eclipse.jst.jsf.facelet.core.internal.facet.FaceletUninstallDelegate"/>
+ <config-factory
+ class="org.eclipse.jst.jsf.facelet.core.internal.facet.FaceletFacetUninstallModelProvider">
+ </config-factory>
+ </action>
+ </extension>
+ <extension point="org.eclipse.wst.common.project.facet.core.runtimes">
+ <supported>
+ <runtime-component any="true"/>
+ <facet id="jsf.facelet" version="1.0"/>
+ </supported>
+ </extension>
+ <extension
+ point="org.eclipse.jst.jsf.core.tagregistry">
+ <tagRegistry
+ class="org.eclipse.jst.jsf.facelet.core.internal.registry.FaceletRegistryManager$MyRegistryFactory"
+ description="%tagRegistry.description.0"
+ id="FaceletRegistry">
+ <content-type
+ contentTypeId="org.eclipse.wst.html.core.htmlsource">
+ </content-type>
+ </tagRegistry>
+ </extension>
+ <extension point="org.eclipse.wst.xml.core.documentFactories">
+ <factory
+ type="xhtml"
+ class="org.eclipse.jst.jsf.facelet.core.internal.cm.FaceletDocumentFactory">
+ </factory>
+ </extension>
+ <extension
+ point="org.eclipse.jst.jsf.core.viewhandler">
+ <viewhandler
+ class="org.eclipse.jst.jsf.facelet.core.internal.view.DTFaceletViewHandler"
+ id="org.eclipse.jst.jsf.facelet.core.html.viewhandler">
+ </viewhandler>
+ </extension>
+ <extension
+ point="org.eclipse.wst.common.project.facet.core.presets">
+ <static-preset
+ extends="preset.jst.jsf.v1_2"
+ id="org.eclipse.jst.jsf.facelet.core.preset">
+ <facet
+ id="jsf.facelet"
+ version="1.0">
+ </facet>
+ <label>
+ %Facelet_1_0_Project
+ </label>
+ <description>
+ %Facelet_1_0_PresetDesc
+ </description>
+ </static-preset>
+ </extension>
+ <extension
+ point="org.eclipse.emf.edit.itemProviderAdapterFactories">
+ <factory
+ uri = "http://org.eclipse.jst.jsf.facelet.core/additionalTagMetadata.ecore"
+ class = "org.eclipse.jst.jsf.facelet.core.internal.cm.addtagmd.provider.AddTagMDItemProviderAdapterFactory"
+ supportedTypes =
+ "org.eclipse.emf.edit.provider.IEditingDomainItemProvider
+ org.eclipse.emf.edit.provider.IStructuredItemContentProvider
+ org.eclipse.emf.edit.provider.ITreeItemContentProvider
+ org.eclipse.emf.edit.provider.IItemLabelProvider
+ org.eclipse.emf.edit.provider.IItemPropertySource
+ org.eclipse.jst.jsf.facelet.core.internal.cm.addtagmd.provider.IResourceProvider"/>
+ </extension>
+ <extension
+ point="org.eclipse.wst.xml.core.catalogContributions">
+ <catalogContribution id="default">
+ <public
+ publicId="-//Sun Microsystems, Inc.//DTD Facelet Taglib 1.0//EN"
+ uri="dtd/facelet-taglib_1_0.dtd"
+ webURL="facelet-taglib_1_0.dtd" />
+ </catalogContribution>
+ </extension>
+
+ <extension
+ point="org.eclipse.jst.jsf.core.AttributeValueRuntimeTypes">
+
+ <attributeValueRuntimeType
+ class="org.eclipse.jst.jsf.facelet.core.internal.cm.attributevalues.TemplateWebPathType"
+ id="attributevalues.TemplateWebPathType"/>
+ </extension>
+</plugin>
diff --git a/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/FaceletCorePlugin.java b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/FaceletCorePlugin.java
new file mode 100644
index 000000000..35487a771
--- /dev/null
+++ b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/FaceletCorePlugin.java
@@ -0,0 +1,115 @@
+package org.eclipse.jst.jsf.facelet.core.internal;
+
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.emf.common.EMFPlugin;
+import org.eclipse.emf.common.util.ResourceLocator;
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class FaceletCorePlugin extends EMFPlugin
+{
+
+ /**
+ * Keep track of the singleton.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static final FaceletCorePlugin INSTANCE = new FaceletCorePlugin();
+
+ /**
+ * The plug-in ID
+ */
+ public static final String PLUGIN_ID = "org.eclipse.jst.jsf.facelet.core"; //$NON-NLS-1$
+
+ // The shared instance
+ private static Implementation plugin;
+
+ /**
+ * Create the instance.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public FaceletCorePlugin()
+ {
+ super
+ (new ResourceLocator []
+ {
+ });
+ }
+
+ /**
+ * Returns the singleton instance of the Eclipse plugin.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the singleton instance.
+ * @generated
+ */
+ @Override
+ public ResourceLocator getPluginResourceLocator()
+ {
+ return plugin;
+ }
+
+ /**
+ * Returns the singleton instance of the Eclipse plugin.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the singleton instance.
+ * @generated
+ */
+ public static Implementation getPlugin()
+ {
+ return plugin;
+ }
+
+ /**
+ * The actual implementation of the Eclipse <b>Plugin</b>.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static class Implementation extends EclipsePlugin
+ {
+ /**
+ * Creates an instance.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Implementation()
+ {
+ super();
+
+ // Remember the static instance.
+ //
+ plugin = this;
+ }
+ }
+
+
+ /**
+ * Returns the shared instance
+ *
+ * @return the shared instance
+ */
+ public static Implementation getDefault()
+ {
+ return plugin;
+ }
+
+ /**
+ * @param logMessage
+ * @param exception
+ */
+ public static void log(final String logMessage, final Throwable exception)
+ {
+ final IStatus status = new Status(IStatus.ERROR, PLUGIN_ID,
+ logMessage, exception);
+ getDefault().getLog().log(status);
+ }
+
+}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/FaceletCoreTraceOptions.java b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/FaceletCoreTraceOptions.java
new file mode 100644
index 000000000..70250cc40
--- /dev/null
+++ b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/FaceletCoreTraceOptions.java
@@ -0,0 +1,88 @@
+package org.eclipse.jst.jsf.facelet.core.internal;
+
+import org.eclipse.osgi.framework.debug.FrameworkDebugOptions;
+import org.eclipse.osgi.service.debug.DebugOptions;
+
+/**
+ * Defines that standard runtime trace options for debugging. See .options file
+ * for definitions.
+ *
+ * @author cbateman
+ *
+ */
+public final class FaceletCoreTraceOptions
+{
+ /**
+ * True if debug tracing is enabled. Other tracing cannot be enabled unless
+ * this is enabled.
+ */
+ public static final boolean ENABLED;
+
+ /**
+ * True if the registry manager tracing is enabled
+ */
+ public static final boolean TRACE_REGISTRYMANAGER;
+
+ /**
+ * True if the facet installer is being traced.
+ */
+ public static final boolean TRACE_FACETINSTALLDELEGATE;
+ /**
+ * True if the facet uninstaller is being traced
+ */
+ public static final boolean TRACE_FACETUNINSTALLDELEGATE;
+ /**
+ * True if the base facet change delegate is being traced
+ */
+ public static final boolean TRACE_FACETCHANGEDELEGATE;
+
+ private static final String KEY_DEBUG_ENABLED = "/debug"; //$NON-NLS-1$
+// private static final String KEY_VIEW_TAGREGISTRY = "/jsptagregistry";
+// private static final String KEY_VIEW_JSPTAGREGISTRY_CHANGES =
+// KEY_VIEW_TAGREGISTRY + "/changes";
+ private static final String KEY_VIEW_REGISTRYMANAGER = "/registrymanager"; //$NON-NLS-1$
+ private static final String KEY_FACETINSTALLDELEGATE = "/facetinstalldelegate"; //$NON-NLS-1$
+ private static final String KEY_FACETUNINSTALLDELEGATE = "facetuninstalldelegate"; //$NON-NLS-1$
+ private static final String KEY_FACETCHANGEDELEGATE = "facetchangedelegate"; //$NON-NLS-1$
+
+ static
+ {
+ final DebugOptions debugOptions = FrameworkDebugOptions.getDefault();
+
+ ENABLED = debugOptions != null
+ && debugOptions.getBooleanOption(FaceletCorePlugin.PLUGIN_ID
+ + KEY_DEBUG_ENABLED, false);
+
+ if (ENABLED && debugOptions != null)
+ {
+ TRACE_REGISTRYMANAGER = debugOptions.getBooleanOption(
+ FaceletCorePlugin.PLUGIN_ID + KEY_VIEW_REGISTRYMANAGER, false);
+ TRACE_FACETINSTALLDELEGATE = debugOptions.getBooleanOption(
+ FaceletCorePlugin.PLUGIN_ID + KEY_FACETINSTALLDELEGATE, false);
+ TRACE_FACETUNINSTALLDELEGATE = debugOptions.getBooleanOption(
+ FaceletCorePlugin.PLUGIN_ID + KEY_FACETUNINSTALLDELEGATE, false);
+ TRACE_FACETCHANGEDELEGATE = debugOptions.getBooleanOption(
+ FaceletCorePlugin.PLUGIN_ID + KEY_FACETCHANGEDELEGATE, false);
+ }
+ else
+ {
+ TRACE_REGISTRYMANAGER = false;
+ TRACE_FACETINSTALLDELEGATE = false;
+ TRACE_FACETUNINSTALLDELEGATE = false;
+ TRACE_FACETCHANGEDELEGATE = false;
+ }
+ }
+
+ /**
+ * @param message
+ */
+ public static void log(final String message)
+ {
+ System.out.println(message);
+ }
+
+ private FaceletCoreTraceOptions()
+ {
+ // no instantiation
+ }
+}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/cm/AttributeCMAdapter.java b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/cm/AttributeCMAdapter.java
new file mode 100644
index 000000000..3e9a1dc3e
--- /dev/null
+++ b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/cm/AttributeCMAdapter.java
@@ -0,0 +1,90 @@
+package org.eclipse.jst.jsf.facelet.core.internal.cm;
+
+import java.util.Enumeration;
+
+import org.eclipse.jst.jsp.core.internal.contentmodel.tld.CMDataTypeImpl;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
+
+/**
+ * Adapts Facelet attribute date to the CM model.
+ *
+ * @author cbateman
+ *
+ */
+public class AttributeCMAdapter implements CMAttributeDeclaration
+{
+ private static final String DESCRIPTION = "description"; //$NON-NLS-1$
+ private int _usage;
+ private String _name;
+ private String _description;
+
+ /**
+ * @param name
+ * @param usage
+ */
+ public AttributeCMAdapter(final String name, final int usage)
+ {
+ _name = name;
+ _usage = usage;
+ }
+
+ public String getAttrName()
+ {
+ return _name;
+ }
+
+ public CMDataType getAttrType()
+ {
+ return new CMDataTypeImpl(CMDataType.CDATA);
+ }
+
+ public String getDefaultValue()
+ {
+ return null;
+ }
+
+ public Enumeration<?> getEnumAttr()
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public int getUsage()
+ {
+ return _usage;
+ }
+
+ public String getNodeName()
+ {
+ return _name;
+ }
+
+ public int getNodeType()
+ {
+ return CMNode.ATTRIBUTE_DECLARATION;
+ }
+
+ public Object getProperty(String propertyName)
+ {
+ if (DESCRIPTION.equals(propertyName))
+ {
+ return _description;
+ }
+ return null;
+ }
+
+ /**
+ * @param description
+ */
+ public void setDescription(final String description)
+ {
+ _description = description;
+ }
+
+ public boolean supports(String propertyName)
+ {
+ return false;
+ }
+}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/cm/DocumentElementCMAdapter.java b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/cm/DocumentElementCMAdapter.java
new file mode 100644
index 000000000..a20c5f1ef
--- /dev/null
+++ b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/cm/DocumentElementCMAdapter.java
@@ -0,0 +1,109 @@
+package org.eclipse.jst.jsf.facelet.core.internal.cm;
+
+import java.util.Iterator;
+
+import org.eclipse.wst.xml.core.internal.contentmodel.CMContent;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
+
+class DocumentElementCMAdapter implements CMNamedNodeMap,
+ CMElementDeclaration
+{
+ private final String _prefix;
+ private final ElementCMAdapter _adapter;
+
+ public DocumentElementCMAdapter(final ElementCMAdapter adapter, final String prefix)
+ {
+ _prefix = prefix;
+ _adapter = adapter;
+ }
+
+ public int getLength()
+ {
+ return _adapter.getLength();
+ }
+
+ public CMNode getNamedItem(String name)
+ {
+ return _adapter.getNamedItem(name);
+ }
+
+ public CMNode item(int index)
+ {
+ return _adapter.item(index);
+ }
+
+ @SuppressWarnings("unchecked")
+ public Iterator iterator()
+ {
+ return _adapter.iterator();
+ }
+
+ public CMNamedNodeMap getAttributes()
+ {
+ return _adapter.getAttributes();
+ }
+
+ public CMContent getContent()
+ {
+ return _adapter.getContent();
+ }
+
+ public int getContentType()
+ {
+ return _adapter.getContentType();
+ }
+
+ public CMDataType getDataType()
+ {
+ return _adapter.getDataType();
+ }
+
+ public String getElementName()
+ {
+ return getPrefixedName(_adapter.getElementName());
+ }
+
+ public CMNamedNodeMap getLocalElements()
+ {
+ return _adapter.getLocalElements();
+ }
+
+ public int getMaxOccur()
+ {
+ return _adapter.getMaxOccur();
+ }
+
+ public int getMinOccur()
+ {
+ return _adapter.getMinOccur();
+ }
+
+ public String getNodeName()
+ {
+ return getPrefixedName(_adapter.getNodeName());
+ }
+
+ private String getPrefixedName(final String name)
+ {
+ return _prefix + ":"+name; //$NON-NLS-1$
+ }
+
+ public int getNodeType()
+ {
+ return _adapter.getNodeType();
+ }
+
+ public Object getProperty(String propertyName)
+ {
+ return _adapter.getProperty(propertyName);
+ }
+
+ public boolean supports(String propertyName)
+ {
+ return _adapter.supports(propertyName);
+ }
+
+}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/cm/DocumentNamespaceCMAdapter.java b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/cm/DocumentNamespaceCMAdapter.java
new file mode 100644
index 000000000..bae83f7a7
--- /dev/null
+++ b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/cm/DocumentNamespaceCMAdapter.java
@@ -0,0 +1,161 @@
+package org.eclipse.jst.jsf.facelet.core.internal.cm;
+
+import java.util.Iterator;
+
+import org.eclipse.wst.xml.core.internal.contentmodel.CMDocument;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMNamespace;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
+
+/**
+ * A namespace a specific to a document, where it's tag name prefix is known.
+ *
+ */
+class DocumentNamespaceCMAdapter implements CMNamedNodeMap, CMDocument
+{
+ private final String _prefix;
+ private final NamespaceCMAdapter _adapter;
+
+ public DocumentNamespaceCMAdapter(final NamespaceCMAdapter adapter, final String prefix)
+ {
+ _prefix = prefix;
+ _adapter = adapter;
+ }
+
+ public int getLength()
+ {
+ return _adapter.getLength();
+ }
+
+ public CMNode getNamedItem(String name)
+ {
+ CMNode node = _adapter.getNamedItem(name);
+
+ if (node != null)
+ {
+ node = new DocumentElementCMAdapter((ElementCMAdapter) node,_prefix);
+ }
+ return node;
+ }
+
+ public CMNode item(int index)
+ {
+ CMNode item = _adapter.item(index);
+
+ if (item != null)
+ {
+ item = new DocumentElementCMAdapter((ElementCMAdapter) item,_prefix);
+ }
+ return item;
+ }
+
+ public Iterator<?> iterator()
+ {
+ return new WrappingIterator(_adapter.iterator());
+ }
+
+ private class WrappingIterator implements Iterator<CMNode>
+ {
+ private Iterator<?> _it;
+
+ public WrappingIterator(final Iterator<?> it)
+ {
+ _it = it;
+ }
+ public boolean hasNext()
+ {
+ return _it.hasNext();
+ }
+
+ public CMNode next()
+ {
+ CMNode node = (CMNode) _it.next();
+ node = getNamedItem(node.getNodeName());
+ return node;
+ }
+
+ public void remove()
+ {
+ throw new UnsupportedOperationException(""); //$NON-NLS-1$
+ }
+ }
+
+ public CMNamedNodeMap getElements()
+ {
+ return this;
+ }
+
+ public CMNamedNodeMap getEntities()
+ {
+ //not changing entities
+ return _adapter.getEntities();
+ }
+
+ public CMNamespace getNamespace()
+ {
+ return new CMNamespaceImpl(_adapter.getNamespace(), _prefix);
+ }
+
+ public String getNodeName()
+ {
+ // not changing node name
+ return _adapter.getNodeName();
+ }
+
+ public int getNodeType()
+ {
+ return _adapter.getNodeType();
+ }
+
+ public Object getProperty(String propertyName)
+ {
+ return _adapter.getProperty(propertyName);
+ }
+
+ public boolean supports(String propertyName)
+ {
+ return _adapter.supports(propertyName);
+ }
+
+ private static class CMNamespaceImpl implements CMNamespace
+ {
+ private final CMNamespace _proxy;
+ private final String _prefix;
+
+ CMNamespaceImpl(CMNamespace proxy, final String prefix)
+ {
+ _proxy = proxy;
+ _prefix = prefix;
+ }
+
+ public String getPrefix()
+ {
+ return _prefix;
+ }
+
+ public String getURI()
+ {
+ return _proxy.getURI();
+ }
+
+ public String getNodeName()
+ {
+ return _proxy.getNodeName();
+ }
+
+ public int getNodeType()
+ {
+ return _proxy.getNodeType();
+ }
+
+ public Object getProperty(String propertyName)
+ {
+ return _proxy.getProperty(propertyName);
+ }
+
+ public boolean supports(String propertyName)
+ {
+ return _proxy.supports(propertyName);
+ }
+ }
+}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/cm/ElementCMAdapter.java b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/cm/ElementCMAdapter.java
new file mode 100644
index 000000000..35c5c8f14
--- /dev/null
+++ b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/cm/ElementCMAdapter.java
@@ -0,0 +1,147 @@
+/**
+ *
+ */
+package org.eclipse.jst.jsf.facelet.core.internal.cm;
+
+import java.util.Iterator;
+
+import org.eclipse.jst.jsf.common.runtime.internal.view.model.common.ITagElement;
+import org.eclipse.jst.jsp.core.internal.contentmodel.tld.CMDataTypeImpl;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMContent;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
+
+class ElementCMAdapter implements CMElementDeclaration, CMNamedNodeMap
+{
+ private final ITagElement _tagElement;
+ private final ExternalTagInfo _tLDTagInfo;
+
+ ElementCMAdapter(final ITagElement tagElement, final ExternalTagInfo tldTagInfo)
+ {
+ _tagElement = tagElement;
+ _tLDTagInfo = tldTagInfo;
+ }
+
+ public CMNamedNodeMap getAttributes()
+ {
+ return this;
+ }
+
+ public CMContent getContent()
+ {
+ return null;
+ }
+
+ public int getContentType()
+ {
+ return ELEMENT;
+ }
+
+ public CMDataType getDataType()
+ {
+ return new CMDataTypeImpl(CMDataType.CDATA);
+ }
+
+ public String getElementName()
+ {
+ return _tagElement.getName();
+ }
+
+ public CMNamedNodeMap getLocalElements()
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public int getMaxOccur()
+ {
+ // unbounded
+ return -1;
+ }
+
+ public int getMinOccur()
+ {
+ // optional
+ return 0;
+ }
+
+ public String getNodeName()
+ {
+ return _tagElement.getName();
+ }
+
+ public int getNodeType()
+ {
+ return CMNode.ELEMENT_DECLARATION;
+ }
+
+ public Object getProperty(final String propertyName)
+ {
+ return _tLDTagInfo.getTagProperty(_tagElement.getName(), propertyName);
+ }
+
+ public boolean supports(final String propertyName)
+ {
+ return false;
+ }
+
+ @Override
+ public boolean equals(final Object obj)
+ {
+ if (obj instanceof ElementCMAdapter)
+ {
+ return ((ElementCMAdapter) obj)._tagElement.equals(_tagElement);
+ }
+
+ return false;
+ }
+
+ @Override
+ public int hashCode()
+ {
+ return _tagElement.hashCode();
+ }
+
+ public int getLength()
+ {
+ final CMNamedNodeMap map = _tLDTagInfo.getAttributes(_tagElement.getName());
+
+ if (map != null)
+ {
+ return map.getLength();
+ }
+
+ return 0;
+ }
+
+ public CMNode getNamedItem(final String name)
+ {
+ final CMNamedNodeMap map = _tLDTagInfo.getAttributes(_tagElement.getName());
+
+ if (map != null)
+ {
+ return map.getNamedItem(name);
+ }
+ return null;
+ }
+
+ public CMNode item(final int index)
+ {
+ final CMNamedNodeMap map = _tLDTagInfo.getAttributes(_tagElement.getName());
+
+ if (map != null)
+ {
+ return map.item(index);
+ }
+ return null;
+ }
+
+ public Iterator<?> iterator()
+ {
+ final CMNamedNodeMap map = _tLDTagInfo.getAttributes(_tagElement.getName());
+ return map.iterator();
+ }
+
+} \ No newline at end of file
diff --git a/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/cm/ExternalTagInfo.java b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/cm/ExternalTagInfo.java
new file mode 100644
index 000000000..705a57bff
--- /dev/null
+++ b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/cm/ExternalTagInfo.java
@@ -0,0 +1,104 @@
+package org.eclipse.jst.jsf.facelet.core.internal.cm;
+
+import java.util.Iterator;
+import java.util.NoSuchElementException;
+
+import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
+
+/**
+ * Represents information about Facelets brought from external sources such as
+ * the JSP tag library.
+ *
+ * @author cbateman
+ *
+ */
+public abstract class ExternalTagInfo
+{
+ /**
+ * Single instance of the null external tag info
+ */
+ public static ExternalTagInfo NULL_INSTANCE = new NullExternalTagInfo();
+
+ /**
+ * @param tagName
+ * @return the node map of attributes for the tag called tagName
+ */
+ public abstract CMNamedNodeMap getAttributes(final String tagName);
+
+ /**
+ * @param tagName
+ * @param key
+ * @return the tag property in the CM model for tagName at key or null if
+ * not found.
+ */
+ public abstract Object getTagProperty(final String tagName, final String key);
+
+ /**
+ * @author cbateman
+ *
+ */
+ public static class NullExternalTagInfo extends ExternalTagInfo
+ {
+ private NullExternalTagInfo()
+ {
+ // no external instantitation
+ }
+
+ @Override
+ public CMNamedNodeMap getAttributes(final String tagName)
+ {
+ return new NullCMNamedNodeMap();
+ }
+
+ @Override
+ public Object getTagProperty(final String tagName, final String key)
+ {
+ // no data so always null
+ return null;
+ }
+
+ private static class NullCMNamedNodeMap implements CMNamedNodeMap
+ {
+ public int getLength()
+ {
+ return 0;
+ }
+
+ public CMNode getNamedItem(final String name)
+ {
+ return null;
+ }
+
+ public CMNode item(final int index)
+ {
+ return null;
+ }
+
+ public Iterator iterator()
+ {
+ return new NullIterator();
+ }
+ }
+
+ private static class NullIterator implements Iterator
+ {
+ public boolean hasNext()
+ {
+ return false;
+ }
+
+ public Object next()
+ {
+ throw new NoSuchElementException();
+ }
+
+ public void remove()
+ {
+ throw new UnsupportedOperationException(
+ "can not remove regions via iterator"); //$NON-NLS-1$
+ }
+ }
+ }
+
+} \ No newline at end of file
diff --git a/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/cm/FaceletDocumentFactory.java b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/cm/FaceletDocumentFactory.java
new file mode 100644
index 000000000..c7b3965c5
--- /dev/null
+++ b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/cm/FaceletDocumentFactory.java
@@ -0,0 +1,158 @@
+package org.eclipse.jst.jsf.facelet.core.internal.cm;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.jst.jsf.common.runtime.internal.view.model.common.Namespace;
+import org.eclipse.jst.jsf.designtime.internal.view.model.ITagRegistry;
+import org.eclipse.jst.jsf.designtime.internal.view.model.TagRegistryFactory.TagRegistryFactoryException;
+import org.eclipse.jst.jsf.facelet.core.internal.registry.FaceletRegistryManager.MyRegistryFactory;
+import org.eclipse.jst.jsf.facelet.core.internal.util.ViewUtil;
+import org.eclipse.jst.jsf.facelet.core.internal.util.ViewUtil.PrefixEntry;
+import org.eclipse.jst.jsp.core.internal.contentmodel.tld.CMDocumentFactoryTLD;
+import org.eclipse.jst.jsp.core.internal.contentmodel.tld.provisional.TLDDocument;
+import org.eclipse.jst.jsp.core.taglib.ITaglibRecord;
+import org.eclipse.jst.jsp.core.taglib.TaglibIndex;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMDocument;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
+import org.w3c.dom.Element;
+
+/**
+ * Creates CMDocument framework adaptation for Facelet features.
+ *
+ * NOTE: this class currently caches state and is NOT THREADSAFE. Share
+ * instances of this class between unowned classes at your own risk.
+ *
+ * @author cbateman
+ *
+ */
+public class FaceletDocumentFactory
+{
+ private final IProject _project;
+ private final Map<String, NamespaceCMAdapter> _cmDocuments;
+ private final Map<String, ExternalTagInfo> _externalTagInfo;
+
+ /**
+ * @param project
+ */
+ public FaceletDocumentFactory(final IProject project)
+ {
+ _project = project;
+ _cmDocuments = new HashMap<String, NamespaceCMAdapter>(8);
+ _externalTagInfo = new HashMap<String, ExternalTagInfo>(8);
+ }
+
+ /**
+ * @param uri
+ * @param prefix
+ * @return the CMDocument for the uri where prefix is used as its namespace
+ * short-form (usually in the context of an XML document instance).
+ */
+ public CMDocument createCMDocumentForContext(final String uri,
+ final String prefix)
+ {
+ final NamespaceCMAdapter cmDoc = getOrCreateCMDocument(_project, uri);
+
+ if (cmDoc != null)
+ {
+ return new DocumentNamespaceCMAdapter(cmDoc, prefix);
+ }
+ return null;
+ }
+
+ /**
+ * @param element
+ * @return the CM model data for element or null if none.
+ */
+ public CMElementDeclaration createCMElementDeclaration(final Element element)
+ {
+ final String prefix = element.getPrefix();
+ final Map<String, PrefixEntry> namespaces = ViewUtil
+ .getDocumentNamespaces(element.getOwnerDocument());
+ final PrefixEntry prefixEntry = namespaces.get(prefix);
+
+ if (prefixEntry != null)
+ {
+ final CMDocument cmDoc = createCMDocumentForContext(prefixEntry
+ .getUri(), prefixEntry.getPrefix());
+
+ if (cmDoc != null)
+ {
+ return (CMElementDeclaration) cmDoc.getElements().getNamedItem(
+ element.getLocalName());
+ }
+ }
+
+ return null;
+ }
+
+ /**
+ * @param ns
+ * @return the externa tag info the namespace. May return a previously
+ * cached value. If there is no cached value, then creates it.
+ */
+ public ExternalTagInfo getOrCreateExtraTagInfo(final String ns)
+ {
+ ExternalTagInfo tagInfo = _externalTagInfo.get(ns);
+
+ if (tagInfo == null)
+ {
+ tagInfo = createExternalTagInfo(ns);
+ _externalTagInfo.put(ns, tagInfo);
+ }
+ return tagInfo;
+ }
+
+ /**
+ * @return a new external tag info for this namespace
+ */
+ private ExternalTagInfo createExternalTagInfo(final String uri)
+ {
+ ExternalTagInfo tldTagInfo = new MetadataTagInfo(_project, uri);
+ final ITaglibRecord[] tldrecs = TaglibIndex
+ .getAvailableTaglibRecords(_project.getFullPath());
+ FIND_TLDRECORD: for (final ITaglibRecord rec : tldrecs)
+ {
+ final String matchUri = rec.getDescriptor().getURI();
+ if (uri.equals(matchUri))
+ {
+ final CMDocumentFactoryTLD factory = new CMDocumentFactoryTLD();
+ tldTagInfo = new MetadataTagInfo(_project, (TLDDocument) factory
+ .createCMDocument(rec));
+ break FIND_TLDRECORD;
+ }
+ }
+ return tldTagInfo;
+ }
+
+ private NamespaceCMAdapter getOrCreateCMDocument(final IProject project,
+ final String uri)
+ {
+ NamespaceCMAdapter adapter = _cmDocuments.get(uri);
+
+ if (adapter == null)
+ {
+ final MyRegistryFactory factory = new MyRegistryFactory();
+
+ ITagRegistry registry;
+ try
+ {
+ registry = factory.createTagRegistry(project);
+ final Namespace ns = registry.getTagLibrary(uri);
+
+ if (ns != null)
+ {
+ adapter = new NamespaceCMAdapter(ns, project);
+ _cmDocuments.put(uri, adapter);
+ }
+ }
+ catch (final TagRegistryFactoryException e)
+ {
+ // fall-through
+ }
+ }
+ return adapter;
+ }
+
+}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/cm/MetadataTagInfo.java b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/cm/MetadataTagInfo.java
new file mode 100644
index 000000000..0e91290a1
--- /dev/null
+++ b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/cm/MetadataTagInfo.java
@@ -0,0 +1,137 @@
+package org.eclipse.jst.jsf.facelet.core.internal.cm;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.jst.jsf.common.dom.TagIdentifier;
+import org.eclipse.jst.jsf.core.internal.tld.TagIdentifierFactory;
+import org.eclipse.jst.jsf.facelet.core.internal.FaceletCorePlugin;
+import org.eclipse.jst.jsf.facelet.core.internal.cm.strategy.IExternalMetadataStrategy;
+import org.eclipse.jst.jsf.facelet.core.internal.cm.strategy.JSPExternalMetadataStrategy;
+import org.eclipse.jst.jsf.facelet.core.internal.cm.strategy.MDExternalMetadataStrategy;
+import org.eclipse.jst.jsf.facelet.core.internal.cm.strategy.TagInfoStrategyComposite;
+import org.eclipse.jst.jsp.core.internal.contentmodel.tld.provisional.TLDDocument;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
+
+/**
+ * An external tag info that checks first the meta-data repository and second in
+ * the provided TLDDocument for data.
+ *
+ * @author cbateman
+ *
+ */
+/* package */class MetadataTagInfo extends ExternalTagInfo
+{
+ private final String _uri;
+// private final MDExternalMetadataStrategy _mdStrategy;
+// private final JSPExternalMetadataStrategy _jspStrategy;
+ private final TagInfoStrategyComposite _compositeStrategy;
+
+ private MetadataTagInfo(final IProject project, final TLDDocument doc,
+ final String uri)
+ {
+ _uri = uri;
+ IExternalMetadataStrategy mdStrategy = MDExternalMetadataStrategy.create(project);
+ JSPExternalMetadataStrategy jspStrategy = new JSPExternalMetadataStrategy(doc);
+
+ final List<String> ids = new ArrayList<String>();
+ ids.add(MDExternalMetadataStrategy.STRATEGY_ID);
+ ids.add(JSPExternalMetadataStrategy.STRATEGY_ID);
+
+ _compositeStrategy = new TagInfoStrategyComposite(ids);
+ _compositeStrategy.addStrategy(mdStrategy);
+ _compositeStrategy.addStrategy(jspStrategy);
+ }
+
+ public MetadataTagInfo(final IProject project, final String uri)
+ {
+ this(project, null, uri);
+ }
+
+ /**
+ * @param project
+ * @param doc
+ */
+ public MetadataTagInfo(final IProject project, final TLDDocument doc)
+ {
+ this(project, doc, doc.getUri());
+ }
+
+ @Override
+ public Object getTagProperty(final String tagName, final String key)
+ {
+ final TagIdentifier tagId = TagIdentifierFactory.createJSPTagWrapper(
+ _uri, tagName);
+ _compositeStrategy.resetIterator();
+
+ for (ExternalTagInfo tagInfo = getNextExternalInfo(tagId); tagInfo != _compositeStrategy
+ .getNoResult(); tagInfo = getNextExternalInfo(tagId))
+ {
+ try
+ {
+ if (tagInfo != _compositeStrategy.getNoResult())
+ {
+ final Object value = tagInfo.getTagProperty(tagName, key);
+
+ if (value != null)
+ {
+ return value;
+ }
+ }
+
+ // fall-through
+ }
+ catch (final Exception e)
+ {
+ FaceletCorePlugin.log("During meta-data strategy", e); //$NON-NLS-1$
+ }
+ }
+
+ return null;
+ }
+
+ /**
+ * @param tagName
+ * @return a named node map of known attributes for the tag, or null if not
+ * found
+ */
+ @Override
+ public CMNamedNodeMap getAttributes(final String tagName)
+ {
+ final TagIdentifier tagId = TagIdentifierFactory.createJSPTagWrapper(
+ _uri, tagName);
+ _compositeStrategy.resetIterator();
+
+ for (ExternalTagInfo tagInfo = getNextExternalInfo(tagId); tagInfo != _compositeStrategy
+ .getNoResult(); tagInfo = getNextExternalInfo(tagId))
+ {
+ try
+ {
+ if (tagInfo != _compositeStrategy.getNoResult())
+ {
+ final CMNamedNodeMap nodeMap = tagInfo
+ .getAttributes(tagName);
+
+ if (nodeMap != null)
+ {
+ return nodeMap;
+ }
+ }
+
+ // fall-through
+ }
+ catch (final Exception e)
+ {
+ FaceletCorePlugin.log("During meta-data strategy", e); //$NON-NLS-1$
+ }
+ }
+
+ return null;
+ }
+
+ private ExternalTagInfo getNextExternalInfo(final TagIdentifier input)
+ {
+ return _compositeStrategy.perform(input);
+ }
+}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/cm/NamespaceCMAdapter.java b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/cm/NamespaceCMAdapter.java
new file mode 100644
index 000000000..8fe6225a9
--- /dev/null
+++ b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/cm/NamespaceCMAdapter.java
@@ -0,0 +1,222 @@
+package org.eclipse.jst.jsf.facelet.core.internal.cm;
+
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.jst.jsf.common.internal.managedobject.IManagedObject;
+import org.eclipse.jst.jsf.common.runtime.internal.view.model.common.ITagElement;
+import org.eclipse.jst.jsf.common.runtime.internal.view.model.common.Namespace;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMDocument;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMNamespace;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
+
+/*package*/class NamespaceCMAdapter implements CMNamedNodeMap, CMDocument, IManagedObject
+{
+ private final Namespace _ns;
+ private final Map<String, ElementCMAdapter> _elements;
+ private final FaceletDocumentFactory _factory;
+
+ public NamespaceCMAdapter(final Namespace ns, final IProject project)
+ {
+ _ns = ns;
+ _elements = new HashMap<String, ElementCMAdapter>();
+ _factory = new FaceletDocumentFactory(project);
+ }
+
+ public int getLength()
+ {
+ if (_ns.hasViewElements())
+ {
+ return _ns.getViewElements().size();
+ }
+ return 0;
+ }
+
+ public CMNode getNamedItem(final String name)
+ {
+ String localname = name;
+
+ if (name != null && name.indexOf(':') > -1)
+ {
+ String[] splitName = name.split(":"); //$NON-NLS-1$
+
+ if (splitName.length == 2)
+ {
+ localname = splitName[1];
+ }
+ }
+ ElementCMAdapter element = _elements.get(localname);
+
+ if (element == null)
+ {
+ final ITagElement tagElement = _ns.getViewElement(localname);
+ if (tagElement != null)
+ {
+ ExternalTagInfo tagInfo = _factory.getOrCreateExtraTagInfo(_ns.getNSUri());
+ element = new ElementCMAdapter(tagElement, tagInfo);
+ _elements.put(localname, element);
+ }
+ }
+ return element;
+ }
+
+ // TODO: optimize
+ public CMNode item(int index)
+ {
+ if (_ns.hasViewElements() && index >= 0
+ && index < _ns.getViewElements().size())
+ {
+ final Iterator<?> it = iterator();
+ for (int i = 0; it.hasNext(); i++)
+ {
+ final ITagElement tagElement = (ITagElement) it.next();
+ if (i == index)
+ {
+ ElementCMAdapter element = _elements.get(tagElement.getName());
+
+ if (element == null)
+ {
+ element = new ElementCMAdapter(tagElement, _factory.getOrCreateExtraTagInfo(_ns.getNSUri()));
+ _elements.put(tagElement.getName(), element);
+ return element;
+ }
+ }
+ }
+ }
+ return null;
+ }
+
+ public Iterator<?> iterator()
+ {
+ return new WrappingIterator(_ns.getViewElements());
+ }
+
+ private class WrappingIterator implements Iterator<CMNode>
+ {
+ @SuppressWarnings("unchecked")
+ final Iterator _viewElementIterator;
+ @SuppressWarnings("unchecked")
+ public WrappingIterator(final Collection viewElements)
+ {
+ _viewElementIterator = viewElements.iterator();
+ }
+
+ public boolean hasNext()
+ {
+ return _viewElementIterator.hasNext();
+ }
+
+ public CMNode next()
+ {
+ ITagElement nextElement = (ITagElement) _viewElementIterator.next();
+ CMNode node = getNamedItem(nextElement.getName());
+ return node;
+ }
+
+ public void remove()
+ {
+ throw new UnsupportedOperationException(""); //$NON-NLS-1$
+ }
+
+ }
+ public CMNamedNodeMap getElements()
+ {
+ return this;
+ }
+
+ public CMNamedNodeMap getEntities()
+ {
+ // no entities
+ return null;
+ }
+
+ public CMNamespace getNamespace()
+ {
+ return new CMNamespaceImpl(_ns.getNSUri());
+ }
+
+ public String getNodeName()
+ {
+ return getNamespace().getURI();
+ }
+
+ public int getNodeType()
+ {
+ return CMNode.DOCUMENT;
+ }
+
+ public Object getProperty(String propertyName)
+ {
+ // none supported for now
+ return null;
+ }
+
+ public boolean supports(String propertyName)
+ {
+ // support none for now
+ return false;
+ }
+
+ private static class CMNamespaceImpl implements CMNamespace
+ {
+ private final String _uri;
+
+ CMNamespaceImpl(final String uri)
+ {
+ _uri = uri;
+ }
+
+ public String getPrefix()
+ {
+ return null;
+ }
+
+ public String getURI()
+ {
+ return _uri;
+ }
+
+ public String getNodeName()
+ {
+ return getURI();
+ }
+
+ public int getNodeType()
+ {
+ return CMNode.NAME_SPACE;
+ }
+
+ public Object getProperty(String propertyName)
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public boolean supports(String propertyName)
+ {
+ // TODO Auto-generated method stub
+ return false;
+ }
+ }
+ public void dispose()
+ {
+ _elements.clear();
+ }
+
+ public void checkpoint()
+ {
+ // TODO: ??
+
+ }
+
+ public void destroy()
+ {
+ // TODO: ??
+
+ }
+
+}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/cm/addtagmd/AddTagMDFactory.java b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/cm/addtagmd/AddTagMDFactory.java
new file mode 100644
index 000000000..aac6e1294
--- /dev/null
+++ b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/cm/addtagmd/AddTagMDFactory.java
@@ -0,0 +1,56 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id: AddTagMDFactory.java,v 1.1 2010/03/08 18:49:41 cbateman Exp $
+ */
+package org.eclipse.jst.jsf.facelet.core.internal.cm.addtagmd;
+
+import org.eclipse.emf.ecore.EFactory;
+
+/**
+ * <!-- begin-user-doc -->
+ * The <b>Factory</b> for the model.
+ * It provides a create method for each non-abstract class of the model.
+ * <!-- end-user-doc -->
+ * @see org.eclipse.jst.jsf.facelet.core.internal.cm.addtagmd.AddTagMDPackage
+ * @generated
+ */
+public interface AddTagMDFactory extends EFactory
+{
+ /**
+ * The singleton instance of the factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ AddTagMDFactory eINSTANCE = org.eclipse.jst.jsf.facelet.core.internal.cm.addtagmd.impl.AddTagMDFactoryImpl.init();
+
+ /**
+ * Returns a new object of class '<em>Element Data</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return a new object of class '<em>Element Data</em>'.
+ * @generated
+ */
+ ElementData createElementData();
+
+ /**
+ * Returns a new object of class '<em>Attribute Data</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return a new object of class '<em>Attribute Data</em>'.
+ * @generated
+ */
+ AttributeData createAttributeData();
+
+ /**
+ * Returns the package supported by this factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the package supported by this factory.
+ * @generated
+ */
+ AddTagMDPackage getAddTagMDPackage();
+
+} //AddTagMDFactory
diff --git a/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/cm/addtagmd/AddTagMDPackage.java b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/cm/addtagmd/AddTagMDPackage.java
new file mode 100644
index 000000000..deaa28449
--- /dev/null
+++ b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/cm/addtagmd/AddTagMDPackage.java
@@ -0,0 +1,339 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id: AddTagMDPackage.java,v 1.1 2010/03/08 18:49:41 cbateman Exp $
+ */
+package org.eclipse.jst.jsf.facelet.core.internal.cm.addtagmd;
+
+import org.eclipse.emf.ecore.EAttribute;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EEnum;
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.emf.ecore.EReference;
+
+/**
+ * <!-- begin-user-doc -->
+ * The <b>Package</b> for the model.
+ * It contains accessors for the meta objects to represent
+ * <ul>
+ * <li>each class,</li>
+ * <li>each feature of each class,</li>
+ * <li>each enum,</li>
+ * <li>and each data type</li>
+ * </ul>
+ * <!-- end-user-doc -->
+ * @see org.eclipse.jst.jsf.facelet.core.internal.cm.addtagmd.AddTagMDFactory
+ * @model kind="package"
+ * @generated
+ */
+public interface AddTagMDPackage extends EPackage
+{
+ /**
+ * The package name.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ String eNAME = "addtagmd"; //$NON-NLS-1$
+
+ /**
+ * The package namespace URI.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ String eNS_URI = "http://org.eclipse.jst.jsf.facelet.core/additionalTagMetadata.ecore"; //$NON-NLS-1$
+
+ /**
+ * The package namespace name.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ String eNS_PREFIX = "addTagMD"; //$NON-NLS-1$
+
+ /**
+ * The singleton instance of the package.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ AddTagMDPackage eINSTANCE = org.eclipse.jst.jsf.facelet.core.internal.cm.addtagmd.impl.AddTagMDPackageImpl.init();
+
+ /**
+ * The meta object id for the '{@link org.eclipse.jst.jsf.facelet.core.internal.cm.addtagmd.impl.ElementDataImpl <em>Element Data</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.jst.jsf.facelet.core.internal.cm.addtagmd.impl.ElementDataImpl
+ * @see org.eclipse.jst.jsf.facelet.core.internal.cm.addtagmd.impl.AddTagMDPackageImpl#getElementData()
+ * @generated
+ */
+ int ELEMENT_DATA = 0;
+
+ /**
+ * The feature id for the '<em><b>Name</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int ELEMENT_DATA__NAME = 0;
+
+ /**
+ * The feature id for the '<em><b>Attributes</b></em>' containment reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int ELEMENT_DATA__ATTRIBUTES = 1;
+
+ /**
+ * The number of structural features of the '<em>Element Data</em>' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int ELEMENT_DATA_FEATURE_COUNT = 2;
+
+ /**
+ * The meta object id for the '{@link org.eclipse.jst.jsf.facelet.core.internal.cm.addtagmd.impl.AttributeDataImpl <em>Attribute Data</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.jst.jsf.facelet.core.internal.cm.addtagmd.impl.AttributeDataImpl
+ * @see org.eclipse.jst.jsf.facelet.core.internal.cm.addtagmd.impl.AddTagMDPackageImpl#getAttributeData()
+ * @generated
+ */
+ int ATTRIBUTE_DATA = 1;
+
+ /**
+ * The feature id for the '<em><b>Name</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int ATTRIBUTE_DATA__NAME = 0;
+
+ /**
+ * The feature id for the '<em><b>Usage</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int ATTRIBUTE_DATA__USAGE = 1;
+
+ /**
+ * The feature id for the '<em><b>Description</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int ATTRIBUTE_DATA__DESCRIPTION = 2;
+
+ /**
+ * The number of structural features of the '<em>Attribute Data</em>' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int ATTRIBUTE_DATA_FEATURE_COUNT = 3;
+
+ /**
+ * The meta object id for the '{@link org.eclipse.jst.jsf.facelet.core.internal.cm.addtagmd.AttributeUsage <em>Attribute Usage</em>}' enum.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.jst.jsf.facelet.core.internal.cm.addtagmd.AttributeUsage
+ * @see org.eclipse.jst.jsf.facelet.core.internal.cm.addtagmd.impl.AddTagMDPackageImpl#getAttributeUsage()
+ * @generated
+ */
+ int ATTRIBUTE_USAGE = 2;
+
+
+ /**
+ * Returns the meta object for class '{@link org.eclipse.jst.jsf.facelet.core.internal.cm.addtagmd.ElementData <em>Element Data</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for class '<em>Element Data</em>'.
+ * @see org.eclipse.jst.jsf.facelet.core.internal.cm.addtagmd.ElementData
+ * @generated
+ */
+ EClass getElementData();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.jst.jsf.facelet.core.internal.cm.addtagmd.ElementData#getName <em>Name</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Name</em>'.
+ * @see org.eclipse.jst.jsf.facelet.core.internal.cm.addtagmd.ElementData#getName()
+ * @see #getElementData()
+ * @generated
+ */
+ EAttribute getElementData_Name();
+
+ /**
+ * Returns the meta object for the containment reference list '{@link org.eclipse.jst.jsf.facelet.core.internal.cm.addtagmd.ElementData#getAttributes <em>Attributes</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the containment reference list '<em>Attributes</em>'.
+ * @see org.eclipse.jst.jsf.facelet.core.internal.cm.addtagmd.ElementData#getAttributes()
+ * @see #getElementData()
+ * @generated
+ */
+ EReference getElementData_Attributes();
+
+ /**
+ * Returns the meta object for class '{@link org.eclipse.jst.jsf.facelet.core.internal.cm.addtagmd.AttributeData <em>Attribute Data</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for class '<em>Attribute Data</em>'.
+ * @see org.eclipse.jst.jsf.facelet.core.internal.cm.addtagmd.AttributeData
+ * @generated
+ */
+ EClass getAttributeData();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.jst.jsf.facelet.core.internal.cm.addtagmd.AttributeData#getName <em>Name</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Name</em>'.
+ * @see org.eclipse.jst.jsf.facelet.core.internal.cm.addtagmd.AttributeData#getName()
+ * @see #getAttributeData()
+ * @generated
+ */
+ EAttribute getAttributeData_Name();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.jst.jsf.facelet.core.internal.cm.addtagmd.AttributeData#getUsage <em>Usage</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Usage</em>'.
+ * @see org.eclipse.jst.jsf.facelet.core.internal.cm.addtagmd.AttributeData#getUsage()
+ * @see #getAttributeData()
+ * @generated
+ */
+ EAttribute getAttributeData_Usage();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.jst.jsf.facelet.core.internal.cm.addtagmd.AttributeData#getDescription <em>Description</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Description</em>'.
+ * @see org.eclipse.jst.jsf.facelet.core.internal.cm.addtagmd.AttributeData#getDescription()
+ * @see #getAttributeData()
+ * @generated
+ */
+ EAttribute getAttributeData_Description();
+
+ /**
+ * Returns the meta object for enum '{@link org.eclipse.jst.jsf.facelet.core.internal.cm.addtagmd.AttributeUsage <em>Attribute Usage</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for enum '<em>Attribute Usage</em>'.
+ * @see org.eclipse.jst.jsf.facelet.core.internal.cm.addtagmd.AttributeUsage
+ * @generated
+ */
+ EEnum getAttributeUsage();
+
+ /**
+ * Returns the factory that creates the instances of the model.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the factory that creates the instances of the model.
+ * @generated
+ */
+ AddTagMDFactory getAddTagMDFactory();
+
+ /**
+ * <!-- begin-user-doc -->
+ * Defines literals for the meta objects that represent
+ * <ul>
+ * <li>each class,</li>
+ * <li>each feature of each class,</li>
+ * <li>each enum,</li>
+ * <li>and each data type</li>
+ * </ul>
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @SuppressWarnings("hiding")
+ interface Literals
+ {
+ /**
+ * The meta object literal for the '{@link org.eclipse.jst.jsf.facelet.core.internal.cm.addtagmd.impl.ElementDataImpl <em>Element Data</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.jst.jsf.facelet.core.internal.cm.addtagmd.impl.ElementDataImpl
+ * @see org.eclipse.jst.jsf.facelet.core.internal.cm.addtagmd.impl.AddTagMDPackageImpl#getElementData()
+ * @generated
+ */
+ EClass ELEMENT_DATA = eINSTANCE.getElementData();
+
+ /**
+ * The meta object literal for the '<em><b>Name</b></em>' attribute feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute ELEMENT_DATA__NAME = eINSTANCE.getElementData_Name();
+
+ /**
+ * The meta object literal for the '<em><b>Attributes</b></em>' containment reference list feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EReference ELEMENT_DATA__ATTRIBUTES = eINSTANCE.getElementData_Attributes();
+
+ /**
+ * The meta object literal for the '{@link org.eclipse.jst.jsf.facelet.core.internal.cm.addtagmd.impl.AttributeDataImpl <em>Attribute Data</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.jst.jsf.facelet.core.internal.cm.addtagmd.impl.AttributeDataImpl
+ * @see org.eclipse.jst.jsf.facelet.core.internal.cm.addtagmd.impl.AddTagMDPackageImpl#getAttributeData()
+ * @generated
+ */
+ EClass ATTRIBUTE_DATA = eINSTANCE.getAttributeData();
+
+ /**
+ * The meta object literal for the '<em><b>Name</b></em>' attribute feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute ATTRIBUTE_DATA__NAME = eINSTANCE.getAttributeData_Name();
+
+ /**
+ * The meta object literal for the '<em><b>Usage</b></em>' attribute feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute ATTRIBUTE_DATA__USAGE = eINSTANCE.getAttributeData_Usage();
+
+ /**
+ * The meta object literal for the '<em><b>Description</b></em>' attribute feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute ATTRIBUTE_DATA__DESCRIPTION = eINSTANCE.getAttributeData_Description();
+
+ /**
+ * The meta object literal for the '{@link org.eclipse.jst.jsf.facelet.core.internal.cm.addtagmd.AttributeUsage <em>Attribute Usage</em>}' enum.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.jst.jsf.facelet.core.internal.cm.addtagmd.AttributeUsage
+ * @see org.eclipse.jst.jsf.facelet.core.internal.cm.addtagmd.impl.AddTagMDPackageImpl#getAttributeUsage()
+ * @generated
+ */
+ EEnum ATTRIBUTE_USAGE = eINSTANCE.getAttributeUsage();
+
+ }
+
+} //AddTagMDPackage
diff --git a/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/cm/addtagmd/AttributeData.java b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/cm/addtagmd/AttributeData.java
new file mode 100644
index 000000000..1ffa6351a
--- /dev/null
+++ b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/cm/addtagmd/AttributeData.java
@@ -0,0 +1,112 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id: AttributeData.java,v 1.1 2010/03/08 18:49:41 cbateman Exp $
+ */
+package org.eclipse.jst.jsf.facelet.core.internal.cm.addtagmd;
+
+import org.eclipse.emf.ecore.EObject;
+
+/**
+ * <!-- begin-user-doc -->
+ * A representation of the model object '<em><b>Attribute Data</b></em>'.
+ * <!-- end-user-doc -->
+ *
+ * <p>
+ * The following features are supported:
+ * <ul>
+ * <li>{@link org.eclipse.jst.jsf.facelet.core.internal.cm.addtagmd.AttributeData#getName <em>Name</em>}</li>
+ * <li>{@link org.eclipse.jst.jsf.facelet.core.internal.cm.addtagmd.AttributeData#getUsage <em>Usage</em>}</li>
+ * <li>{@link org.eclipse.jst.jsf.facelet.core.internal.cm.addtagmd.AttributeData#getDescription <em>Description</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @see org.eclipse.jst.jsf.facelet.core.internal.cm.addtagmd.AddTagMDPackage#getAttributeData()
+ * @model
+ * @generated
+ */
+public interface AttributeData extends EObject
+{
+ /**
+ * Returns the value of the '<em><b>Name</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Name</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Name</em>' attribute.
+ * @see #setName(String)
+ * @see org.eclipse.jst.jsf.facelet.core.internal.cm.addtagmd.AddTagMDPackage#getAttributeData_Name()
+ * @model extendedMetaData="kind='element' name='name'"
+ * @generated
+ */
+ String getName();
+
+ /**
+ * Sets the value of the '{@link org.eclipse.jst.jsf.facelet.core.internal.cm.addtagmd.AttributeData#getName <em>Name</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Name</em>' attribute.
+ * @see #getName()
+ * @generated
+ */
+ void setName(String value);
+
+ /**
+ * Returns the value of the '<em><b>Usage</b></em>' attribute.
+ * The literals are from the enumeration {@link org.eclipse.jst.jsf.facelet.core.internal.cm.addtagmd.AttributeUsage}.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Usage</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Usage</em>' attribute.
+ * @see org.eclipse.jst.jsf.facelet.core.internal.cm.addtagmd.AttributeUsage
+ * @see #setUsage(AttributeUsage)
+ * @see org.eclipse.jst.jsf.facelet.core.internal.cm.addtagmd.AddTagMDPackage#getAttributeData_Usage()
+ * @model extendedMetaData="kind='element' name='usage'"
+ * @generated
+ */
+ AttributeUsage getUsage();
+
+ /**
+ * Sets the value of the '{@link org.eclipse.jst.jsf.facelet.core.internal.cm.addtagmd.AttributeData#getUsage <em>Usage</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Usage</em>' attribute.
+ * @see org.eclipse.jst.jsf.facelet.core.internal.cm.addtagmd.AttributeUsage
+ * @see #getUsage()
+ * @generated
+ */
+ void setUsage(AttributeUsage value);
+
+ /**
+ * Returns the value of the '<em><b>Description</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Description</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Description</em>' attribute.
+ * @see #setDescription(String)
+ * @see org.eclipse.jst.jsf.facelet.core.internal.cm.addtagmd.AddTagMDPackage#getAttributeData_Description()
+ * @model extendedMetaData="kind='element' name='description'"
+ * @generated
+ */
+ String getDescription();
+
+ /**
+ * Sets the value of the '{@link org.eclipse.jst.jsf.facelet.core.internal.cm.addtagmd.AttributeData#getDescription <em>Description</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Description</em>' attribute.
+ * @see #getDescription()
+ * @generated
+ */
+ void setDescription(String value);
+
+} // AttributeData
diff --git a/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/cm/addtagmd/AttributeUsage.java b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/cm/addtagmd/AttributeUsage.java
new file mode 100644
index 000000000..f8bee810f
--- /dev/null
+++ b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/cm/addtagmd/AttributeUsage.java
@@ -0,0 +1,287 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id: AttributeUsage.java,v 1.1 2010/03/08 18:49:41 cbateman Exp $
+ */
+package org.eclipse.jst.jsf.facelet.core.internal.cm.addtagmd;
+
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.List;
+
+import org.eclipse.emf.common.util.Enumerator;
+
+/**
+ * <!-- begin-user-doc -->
+ * A representation of the literals of the enumeration '<em><b>Attribute Usage</b></em>',
+ * and utility methods for working with them.
+ * <!-- end-user-doc -->
+ * @see org.eclipse.jst.jsf.facelet.core.internal.cm.addtagmd.AddTagMDPackage#getAttributeUsage()
+ * @model
+ * @generated
+ */
+public enum AttributeUsage implements Enumerator
+{
+ /**
+ * The '<em><b>OPTIONAL</b></em>' literal object.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #OPTIONAL_VALUE
+ * @generated
+ * @ordered
+ */
+ OPTIONAL(0, "OPTIONAL", "OPTIONAL"), //$NON-NLS-1$ //$NON-NLS-2$
+
+ /**
+ * The '<em><b>REQUIRED</b></em>' literal object.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #REQUIRED_VALUE
+ * @generated
+ * @ordered
+ */
+ REQUIRED(1, "REQUIRED", "REQUIRED"), //$NON-NLS-1$ //$NON-NLS-2$
+
+ /**
+ * The '<em><b>FIXED</b></em>' literal object.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #FIXED_VALUE
+ * @generated
+ * @ordered
+ */
+ FIXED(2, "FIXED", "FIXED"), //$NON-NLS-1$ //$NON-NLS-2$
+
+ /**
+ * The '<em><b>PROHIBITED</b></em>' literal object.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #PROHIBITED_VALUE
+ * @generated
+ * @ordered
+ */
+ PROHIBITED(3, "PROHIBITED", "PROHIBITED"); //$NON-NLS-1$ //$NON-NLS-2$
+
+ /**
+ * The '<em><b>OPTIONAL</b></em>' literal value.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of '<em><b>OPTIONAL</b></em>' literal object isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @see #OPTIONAL
+ * @model
+ * @generated
+ * @ordered
+ */
+ public static final int OPTIONAL_VALUE = 0;
+
+ /**
+ * The '<em><b>REQUIRED</b></em>' literal value.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of '<em><b>REQUIRED</b></em>' literal object isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @see #REQUIRED
+ * @model
+ * @generated
+ * @ordered
+ */
+ public static final int REQUIRED_VALUE = 1;
+
+ /**
+ * The '<em><b>FIXED</b></em>' literal value.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of '<em><b>FIXED</b></em>' literal object isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @see #FIXED
+ * @model
+ * @generated
+ * @ordered
+ */
+ public static final int FIXED_VALUE = 2;
+
+ /**
+ * The '<em><b>PROHIBITED</b></em>' literal value.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of '<em><b>PROHIBITED</b></em>' literal object isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @see #PROHIBITED
+ * @model
+ * @generated
+ * @ordered
+ */
+ public static final int PROHIBITED_VALUE = 3;
+
+ /**
+ * An array of all the '<em><b>Attribute Usage</b></em>' enumerators.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private static final AttributeUsage[] VALUES_ARRAY =
+ new AttributeUsage[]
+ {
+ OPTIONAL,
+ REQUIRED,
+ FIXED,
+ PROHIBITED,
+ };
+
+ /**
+ * A public read-only list of all the '<em><b>Attribute Usage</b></em>' enumerators.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static final List<AttributeUsage> VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY));
+
+ /**
+ * Returns the '<em><b>Attribute Usage</b></em>' literal with the specified literal value.
+ * <!-- begin-user-doc -->
+ * @param literal
+ * @return the attribute usage
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static AttributeUsage get(String literal)
+ {
+ for (int i = 0; i < VALUES_ARRAY.length; ++i)
+ {
+ AttributeUsage result = VALUES_ARRAY[i];
+ if (result.toString().equals(literal))
+ {
+ return result;
+ }
+ }
+ return null;
+ }
+
+ /**
+ * Returns the '<em><b>Attribute Usage</b></em>' literal with the specified name.
+ * <!-- begin-user-doc -->
+ * @param name
+ * @return the attribute usage
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static AttributeUsage getByName(String name)
+ {
+ for (int i = 0; i < VALUES_ARRAY.length; ++i)
+ {
+ AttributeUsage result = VALUES_ARRAY[i];
+ if (result.getName().equals(name))
+ {
+ return result;
+ }
+ }
+ return null;
+ }
+
+ /**
+ * Returns the '<em><b>Attribute Usage</b></em>' literal with the specified integer value.
+ * <!-- begin-user-doc -->
+ * @param value
+ * @return the attribute usage
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static AttributeUsage get(int value)
+ {
+ switch (value)
+ {
+ case OPTIONAL_VALUE: return OPTIONAL;
+ case REQUIRED_VALUE: return REQUIRED;
+ case FIXED_VALUE: return FIXED;
+ case PROHIBITED_VALUE: return PROHIBITED;
+ }
+ return null;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private final int value;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private final String name;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private final String literal;
+
+ /**
+ * Only this class can construct instances.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private AttributeUsage(int value, String name, String literal)
+ {
+ this.value = value;
+ this.name = name;
+ this.literal = literal;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public int getValue()
+ {
+ return value;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String getName()
+ {
+ return name;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String getLiteral()
+ {
+ return literal;
+ }
+
+ /**
+ * Returns the literal value of the enumerator, which is its string representation.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public String toString()
+ {
+ return literal;
+ }
+
+} //AttributeUsage
diff --git a/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/cm/addtagmd/ElementData.java b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/cm/addtagmd/ElementData.java
new file mode 100644
index 000000000..2e0d68f70
--- /dev/null
+++ b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/cm/addtagmd/ElementData.java
@@ -0,0 +1,75 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id: ElementData.java,v 1.1 2010/03/08 18:49:41 cbateman Exp $
+ */
+package org.eclipse.jst.jsf.facelet.core.internal.cm.addtagmd;
+
+import org.eclipse.emf.common.util.EList;
+
+import org.eclipse.emf.ecore.EObject;
+
+/**
+ * <!-- begin-user-doc -->
+ * A representation of the model object '<em><b>Element Data</b></em>'.
+ * <!-- end-user-doc -->
+ *
+ * <p>
+ * The following features are supported:
+ * <ul>
+ * <li>{@link org.eclipse.jst.jsf.facelet.core.internal.cm.addtagmd.ElementData#getName <em>Name</em>}</li>
+ * <li>{@link org.eclipse.jst.jsf.facelet.core.internal.cm.addtagmd.ElementData#getAttributes <em>Attributes</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @see org.eclipse.jst.jsf.facelet.core.internal.cm.addtagmd.AddTagMDPackage#getElementData()
+ * @model
+ * @generated
+ */
+public interface ElementData extends EObject
+{
+ /**
+ * Returns the value of the '<em><b>Name</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Name</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Name</em>' attribute.
+ * @see #setName(String)
+ * @see org.eclipse.jst.jsf.facelet.core.internal.cm.addtagmd.AddTagMDPackage#getElementData_Name()
+ * @model extendedMetaData="kind='element' name='name'"
+ * @generated
+ */
+ String getName();
+
+ /**
+ * Sets the value of the '{@link org.eclipse.jst.jsf.facelet.core.internal.cm.addtagmd.ElementData#getName <em>Name</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Name</em>' attribute.
+ * @see #getName()
+ * @generated
+ */
+ void setName(String value);
+
+ /**
+ * Returns the value of the '<em><b>Attributes</b></em>' containment reference list.
+ * The list contents are of type {@link org.eclipse.jst.jsf.facelet.core.internal.cm.addtagmd.AttributeData}.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Attributes</em>' reference list isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Attributes</em>' containment reference list.
+ * @see org.eclipse.jst.jsf.facelet.core.internal.cm.addtagmd.AddTagMDPackage#getElementData_Attributes()
+ * @model containment="true"
+ * extendedMetaData="kind='element' name='attribute'"
+ * @generated
+ */
+ EList<AttributeData> getAttributes();
+
+} // ElementData
diff --git a/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/cm/addtagmd/impl/AddTagMDFactoryImpl.java b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/cm/addtagmd/impl/AddTagMDFactoryImpl.java
new file mode 100644
index 000000000..44fc5553c
--- /dev/null
+++ b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/cm/addtagmd/impl/AddTagMDFactoryImpl.java
@@ -0,0 +1,187 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id: AddTagMDFactoryImpl.java,v 1.1 2010/03/08 18:49:41 cbateman Exp $
+ */
+package org.eclipse.jst.jsf.facelet.core.internal.cm.addtagmd.impl;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EDataType;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EPackage;
+
+import org.eclipse.emf.ecore.impl.EFactoryImpl;
+
+import org.eclipse.emf.ecore.plugin.EcorePlugin;
+
+import org.eclipse.jst.jsf.facelet.core.internal.cm.addtagmd.*;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model <b>Factory</b>.
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public class AddTagMDFactoryImpl extends EFactoryImpl implements AddTagMDFactory
+{
+ /**
+ * Creates the default factory implementation.
+ * <!-- begin-user-doc -->
+ * @return the factory
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static AddTagMDFactory init()
+ {
+ try
+ {
+ AddTagMDFactory theAddTagMDFactory = (AddTagMDFactory)EPackage.Registry.INSTANCE.getEFactory("http://org.eclipse.jst.jsf.facelet.core/additionalTagMetadata.ecore"); //$NON-NLS-1$
+ if (theAddTagMDFactory != null)
+ {
+ return theAddTagMDFactory;
+ }
+ }
+ catch (Exception exception)
+ {
+ EcorePlugin.INSTANCE.log(exception);
+ }
+ return new AddTagMDFactoryImpl();
+ }
+
+ /**
+ * Creates an instance of the factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public AddTagMDFactoryImpl()
+ {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public EObject create(EClass eClass)
+ {
+ switch (eClass.getClassifierID())
+ {
+ case AddTagMDPackage.ELEMENT_DATA: return createElementData();
+ case AddTagMDPackage.ATTRIBUTE_DATA: return createAttributeData();
+ default:
+ throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier"); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object createFromString(EDataType eDataType, String initialValue)
+ {
+ switch (eDataType.getClassifierID())
+ {
+ case AddTagMDPackage.ATTRIBUTE_USAGE:
+ return createAttributeUsageFromString(eDataType, initialValue);
+ default:
+ throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier"); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public String convertToString(EDataType eDataType, Object instanceValue)
+ {
+ switch (eDataType.getClassifierID())
+ {
+ case AddTagMDPackage.ATTRIBUTE_USAGE:
+ return convertAttributeUsageToString(eDataType, instanceValue);
+ default:
+ throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier"); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public ElementData createElementData()
+ {
+ ElementDataImpl elementData = new ElementDataImpl();
+ return elementData;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public AttributeData createAttributeData()
+ {
+ AttributeDataImpl attributeData = new AttributeDataImpl();
+ return attributeData;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * @param eDataType
+ * @param initialValue
+ * @return the attribute usage
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public AttributeUsage createAttributeUsageFromString(EDataType eDataType, String initialValue)
+ {
+ AttributeUsage result = AttributeUsage.get(initialValue);
+ if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ return result;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * @param eDataType
+ * @param instanceValue
+ * @return the usage string
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String convertAttributeUsageToString(EDataType eDataType, Object instanceValue)
+ {
+ return instanceValue == null ? null : instanceValue.toString();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public AddTagMDPackage getAddTagMDPackage()
+ {
+ return (AddTagMDPackage)getEPackage();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * @return the package
+ * <!-- end-user-doc -->
+ * @deprecated
+ * @generated
+ */
+ @Deprecated
+ public static AddTagMDPackage getPackage()
+ {
+ return AddTagMDPackage.eINSTANCE;
+ }
+
+} //AddTagMDFactoryImpl
diff --git a/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/cm/addtagmd/impl/AddTagMDPackageImpl.java b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/cm/addtagmd/impl/AddTagMDPackageImpl.java
new file mode 100644
index 000000000..743afa086
--- /dev/null
+++ b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/cm/addtagmd/impl/AddTagMDPackageImpl.java
@@ -0,0 +1,352 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id: AddTagMDPackageImpl.java,v 1.1 2010/03/08 18:49:41 cbateman Exp $
+ */
+package org.eclipse.jst.jsf.facelet.core.internal.cm.addtagmd.impl;
+
+import org.eclipse.emf.ecore.EAttribute;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EEnum;
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.emf.ecore.EReference;
+
+import org.eclipse.emf.ecore.impl.EPackageImpl;
+
+import org.eclipse.jst.jsf.facelet.core.internal.cm.addtagmd.AddTagMDFactory;
+import org.eclipse.jst.jsf.facelet.core.internal.cm.addtagmd.AddTagMDPackage;
+import org.eclipse.jst.jsf.facelet.core.internal.cm.addtagmd.AttributeData;
+import org.eclipse.jst.jsf.facelet.core.internal.cm.addtagmd.AttributeUsage;
+import org.eclipse.jst.jsf.facelet.core.internal.cm.addtagmd.ElementData;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model <b>Package</b>.
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public class AddTagMDPackageImpl extends EPackageImpl implements AddTagMDPackage
+{
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private EClass elementDataEClass = null;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private EClass attributeDataEClass = null;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private EEnum attributeUsageEEnum = null;
+
+ /**
+ * Creates an instance of the model <b>Package</b>, registered with
+ * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package
+ * package URI value.
+ * <p>Note: the correct way to create the package is via the static
+ * factory method {@link #init init()}, which also performs
+ * initialization of the package, or returns the registered package,
+ * if one already exists.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.emf.ecore.EPackage.Registry
+ * @see org.eclipse.jst.jsf.facelet.core.internal.cm.addtagmd.AddTagMDPackage#eNS_URI
+ * @see #init()
+ * @generated
+ */
+ private AddTagMDPackageImpl()
+ {
+ super(eNS_URI, AddTagMDFactory.eINSTANCE);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private static boolean isInited = false;
+
+ /**
+ * Creates, registers, and initializes the <b>Package</b> for this
+ * model, and for any others upon which it depends. Simple
+ * dependencies are satisfied by calling this method on all
+ * dependent packages before doing anything else. This method drives
+ * initialization for interdependent packages directly, in parallel
+ * with this package, itself.
+ * <p>Of this package and its interdependencies, all packages which
+ * have not yet been registered by their URI values are first created
+ * and registered. The packages are then initialized in two steps:
+ * meta-model objects for all of the packages are created before any
+ * are initialized, since one package's meta-model objects may refer to
+ * those of another.
+ * <p>Invocation of this method will not affect any packages that have
+ * already been initialized.
+ * <!-- begin-user-doc -->
+ * @return the package
+ * <!-- end-user-doc -->
+ * @see #eNS_URI
+ * @see #createPackageContents()
+ * @see #initializePackageContents()
+ * @generated
+ */
+ public static AddTagMDPackage init()
+ {
+ if (isInited) return (AddTagMDPackage)EPackage.Registry.INSTANCE.getEPackage(AddTagMDPackage.eNS_URI);
+
+ // Obtain or create and register package
+ AddTagMDPackageImpl theAddTagMDPackage = (AddTagMDPackageImpl)(EPackage.Registry.INSTANCE.getEPackage(eNS_URI) instanceof AddTagMDPackageImpl ? EPackage.Registry.INSTANCE.getEPackage(eNS_URI) : new AddTagMDPackageImpl());
+
+ isInited = true;
+
+ // Create package meta-data objects
+ theAddTagMDPackage.createPackageContents();
+
+ // Initialize created meta-data
+ theAddTagMDPackage.initializePackageContents();
+
+ // Mark meta-data to indicate it can't be changed
+ theAddTagMDPackage.freeze();
+
+ return theAddTagMDPackage;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EClass getElementData()
+ {
+ return elementDataEClass;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getElementData_Name()
+ {
+ return (EAttribute)elementDataEClass.getEStructuralFeatures().get(0);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getElementData_Attributes()
+ {
+ return (EReference)elementDataEClass.getEStructuralFeatures().get(1);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EClass getAttributeData()
+ {
+ return attributeDataEClass;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getAttributeData_Name()
+ {
+ return (EAttribute)attributeDataEClass.getEStructuralFeatures().get(0);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getAttributeData_Usage()
+ {
+ return (EAttribute)attributeDataEClass.getEStructuralFeatures().get(1);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getAttributeData_Description()
+ {
+ return (EAttribute)attributeDataEClass.getEStructuralFeatures().get(2);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EEnum getAttributeUsage()
+ {
+ return attributeUsageEEnum;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public AddTagMDFactory getAddTagMDFactory()
+ {
+ return (AddTagMDFactory)getEFactoryInstance();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private boolean isCreated = false;
+
+ /**
+ * Creates the meta-model objects for the package. This method is
+ * guarded to have no affect on any invocation but its first.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void createPackageContents()
+ {
+ if (isCreated) return;
+ isCreated = true;
+
+ // Create classes and their features
+ elementDataEClass = createEClass(ELEMENT_DATA);
+ createEAttribute(elementDataEClass, ELEMENT_DATA__NAME);
+ createEReference(elementDataEClass, ELEMENT_DATA__ATTRIBUTES);
+
+ attributeDataEClass = createEClass(ATTRIBUTE_DATA);
+ createEAttribute(attributeDataEClass, ATTRIBUTE_DATA__NAME);
+ createEAttribute(attributeDataEClass, ATTRIBUTE_DATA__USAGE);
+ createEAttribute(attributeDataEClass, ATTRIBUTE_DATA__DESCRIPTION);
+
+ // Create enums
+ attributeUsageEEnum = createEEnum(ATTRIBUTE_USAGE);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private boolean isInitialized = false;
+
+ /**
+ * Complete the initialization of the package and its meta-model. This
+ * method is guarded to have no affect on any invocation but its first.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void initializePackageContents()
+ {
+ if (isInitialized) return;
+ isInitialized = true;
+
+ // Initialize package
+ setName(eNAME);
+ setNsPrefix(eNS_PREFIX);
+ setNsURI(eNS_URI);
+
+ // Create type parameters
+
+ // Set bounds for type parameters
+
+ // Add supertypes to classes
+
+ // Initialize classes and features; add operations and parameters
+ initEClass(elementDataEClass, ElementData.class, "ElementData", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$
+ initEAttribute(getElementData_Name(), ecorePackage.getEString(), "name", null, 0, 1, ElementData.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$
+ initEReference(getElementData_Attributes(), this.getAttributeData(), null, "attributes", null, 0, -1, ElementData.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$
+
+ initEClass(attributeDataEClass, AttributeData.class, "AttributeData", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$
+ initEAttribute(getAttributeData_Name(), ecorePackage.getEString(), "name", null, 0, 1, AttributeData.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$
+ initEAttribute(getAttributeData_Usage(), this.getAttributeUsage(), "usage", null, 0, 1, AttributeData.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$
+ initEAttribute(getAttributeData_Description(), ecorePackage.getEString(), "description", null, 0, 1, AttributeData.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$
+
+ // Initialize enums and add enum literals
+ initEEnum(attributeUsageEEnum, AttributeUsage.class, "AttributeUsage"); //$NON-NLS-1$
+ addEEnumLiteral(attributeUsageEEnum, AttributeUsage.OPTIONAL);
+ addEEnumLiteral(attributeUsageEEnum, AttributeUsage.REQUIRED);
+ addEEnumLiteral(attributeUsageEEnum, AttributeUsage.FIXED);
+ addEEnumLiteral(attributeUsageEEnum, AttributeUsage.PROHIBITED);
+
+ // Create resource
+ createResource(eNS_URI);
+
+ // Create annotations
+ // http:///org/eclipse/emf/ecore/util/ExtendedMetaData
+ createExtendedMetaDataAnnotations();
+ }
+
+ /**
+ * Initializes the annotations for <b>http:///org/eclipse/emf/ecore/util/ExtendedMetaData</b>.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void createExtendedMetaDataAnnotations()
+ {
+ String source = "http:///org/eclipse/emf/ecore/util/ExtendedMetaData"; //$NON-NLS-1$
+ addAnnotation
+ (getElementData_Name(),
+ source,
+ new String[]
+ {
+ "kind", "element", //$NON-NLS-1$ //$NON-NLS-2$
+ "name", "name" //$NON-NLS-1$ //$NON-NLS-2$
+ });
+ addAnnotation
+ (getElementData_Attributes(),
+ source,
+ new String[]
+ {
+ "kind", "element", //$NON-NLS-1$ //$NON-NLS-2$
+ "name", "attribute" //$NON-NLS-1$ //$NON-NLS-2$
+ });
+ addAnnotation
+ (getAttributeData_Name(),
+ source,
+ new String[]
+ {
+ "kind", "element", //$NON-NLS-1$ //$NON-NLS-2$
+ "name", "name" //$NON-NLS-1$ //$NON-NLS-2$
+ });
+ addAnnotation
+ (getAttributeData_Usage(),
+ source,
+ new String[]
+ {
+ "kind", "element", //$NON-NLS-1$ //$NON-NLS-2$
+ "name", "usage" //$NON-NLS-1$ //$NON-NLS-2$
+ });
+ addAnnotation
+ (getAttributeData_Description(),
+ source,
+ new String[]
+ {
+ "kind", "element", //$NON-NLS-1$ //$NON-NLS-2$
+ "name", "description" //$NON-NLS-1$ //$NON-NLS-2$
+ });
+ }
+
+} //AddTagMDPackageImpl
diff --git a/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/cm/addtagmd/impl/AttributeDataImpl.java b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/cm/addtagmd/impl/AttributeDataImpl.java
new file mode 100644
index 000000000..6e47d33bb
--- /dev/null
+++ b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/cm/addtagmd/impl/AttributeDataImpl.java
@@ -0,0 +1,294 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id: AttributeDataImpl.java,v 1.1 2010/03/08 18:49:41 cbateman Exp $
+ */
+package org.eclipse.jst.jsf.facelet.core.internal.cm.addtagmd.impl;
+
+import org.eclipse.emf.common.notify.Notification;
+
+import org.eclipse.emf.ecore.EClass;
+
+import org.eclipse.emf.ecore.impl.ENotificationImpl;
+import org.eclipse.emf.ecore.impl.EObjectImpl;
+
+import org.eclipse.jst.jsf.facelet.core.internal.cm.addtagmd.AddTagMDPackage;
+import org.eclipse.jst.jsf.facelet.core.internal.cm.addtagmd.AttributeData;
+import org.eclipse.jst.jsf.facelet.core.internal.cm.addtagmd.AttributeUsage;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model object '<em><b>Attribute Data</b></em>'.
+ * <!-- end-user-doc -->
+ * <p>
+ * The following features are implemented:
+ * <ul>
+ * <li>{@link org.eclipse.jst.jsf.facelet.core.internal.cm.addtagmd.impl.AttributeDataImpl#getName <em>Name</em>}</li>
+ * <li>{@link org.eclipse.jst.jsf.facelet.core.internal.cm.addtagmd.impl.AttributeDataImpl#getUsage <em>Usage</em>}</li>
+ * <li>{@link org.eclipse.jst.jsf.facelet.core.internal.cm.addtagmd.impl.AttributeDataImpl#getDescription <em>Description</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @generated
+ */
+public class AttributeDataImpl extends EObjectImpl implements AttributeData
+{
+ /**
+ * The default value of the '{@link #getName() <em>Name</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getName()
+ * @generated
+ * @ordered
+ */
+ protected static final String NAME_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getName() <em>Name</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getName()
+ * @generated
+ * @ordered
+ */
+ protected String name = NAME_EDEFAULT;
+
+ /**
+ * The default value of the '{@link #getUsage() <em>Usage</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getUsage()
+ * @generated
+ * @ordered
+ */
+ protected static final AttributeUsage USAGE_EDEFAULT = AttributeUsage.OPTIONAL;
+
+ /**
+ * The cached value of the '{@link #getUsage() <em>Usage</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getUsage()
+ * @generated
+ * @ordered
+ */
+ protected AttributeUsage usage = USAGE_EDEFAULT;
+
+ /**
+ * The default value of the '{@link #getDescription() <em>Description</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getDescription()
+ * @generated
+ * @ordered
+ */
+ protected static final String DESCRIPTION_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getDescription() <em>Description</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getDescription()
+ * @generated
+ * @ordered
+ */
+ protected String description = DESCRIPTION_EDEFAULT;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected AttributeDataImpl()
+ {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected EClass eStaticClass()
+ {
+ return AddTagMDPackage.Literals.ATTRIBUTE_DATA;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String getName()
+ {
+ return name;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setName(String newName)
+ {
+ String oldName = name;
+ name = newName;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, AddTagMDPackage.ATTRIBUTE_DATA__NAME, oldName, name));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public AttributeUsage getUsage()
+ {
+ return usage;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setUsage(AttributeUsage newUsage)
+ {
+ AttributeUsage oldUsage = usage;
+ usage = newUsage == null ? USAGE_EDEFAULT : newUsage;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, AddTagMDPackage.ATTRIBUTE_DATA__USAGE, oldUsage, usage));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String getDescription()
+ {
+ return description;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setDescription(String newDescription)
+ {
+ String oldDescription = description;
+ description = newDescription;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, AddTagMDPackage.ATTRIBUTE_DATA__DESCRIPTION, oldDescription, description));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object eGet(int featureID, boolean resolve, boolean coreType)
+ {
+ switch (featureID)
+ {
+ case AddTagMDPackage.ATTRIBUTE_DATA__NAME:
+ return getName();
+ case AddTagMDPackage.ATTRIBUTE_DATA__USAGE:
+ return getUsage();
+ case AddTagMDPackage.ATTRIBUTE_DATA__DESCRIPTION:
+ return getDescription();
+ }
+ return super.eGet(featureID, resolve, coreType);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void eSet(int featureID, Object newValue)
+ {
+ switch (featureID)
+ {
+ case AddTagMDPackage.ATTRIBUTE_DATA__NAME:
+ setName((String)newValue);
+ return;
+ case AddTagMDPackage.ATTRIBUTE_DATA__USAGE:
+ setUsage((AttributeUsage)newValue);
+ return;
+ case AddTagMDPackage.ATTRIBUTE_DATA__DESCRIPTION:
+ setDescription((String)newValue);
+ return;
+ }
+ super.eSet(featureID, newValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void eUnset(int featureID)
+ {
+ switch (featureID)
+ {
+ case AddTagMDPackage.ATTRIBUTE_DATA__NAME:
+ setName(NAME_EDEFAULT);
+ return;
+ case AddTagMDPackage.ATTRIBUTE_DATA__USAGE:
+ setUsage(USAGE_EDEFAULT);
+ return;
+ case AddTagMDPackage.ATTRIBUTE_DATA__DESCRIPTION:
+ setDescription(DESCRIPTION_EDEFAULT);
+ return;
+ }
+ super.eUnset(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public boolean eIsSet(int featureID)
+ {
+ switch (featureID)
+ {
+ case AddTagMDPackage.ATTRIBUTE_DATA__NAME:
+ return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
+ case AddTagMDPackage.ATTRIBUTE_DATA__USAGE:
+ return usage != USAGE_EDEFAULT;
+ case AddTagMDPackage.ATTRIBUTE_DATA__DESCRIPTION:
+ return DESCRIPTION_EDEFAULT == null ? description != null : !DESCRIPTION_EDEFAULT.equals(description);
+ }
+ return super.eIsSet(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public String toString()
+ {
+ if (eIsProxy()) return super.toString();
+
+ StringBuffer result = new StringBuffer(super.toString());
+ result.append(" (name: "); //$NON-NLS-1$
+ result.append(name);
+ result.append(", usage: "); //$NON-NLS-1$
+ result.append(usage);
+ result.append(", description: "); //$NON-NLS-1$
+ result.append(description);
+ result.append(')');
+ return result.toString();
+ }
+
+} //AttributeDataImpl
diff --git a/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/cm/addtagmd/impl/ElementDataImpl.java b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/cm/addtagmd/impl/ElementDataImpl.java
new file mode 100644
index 000000000..4860f62d2
--- /dev/null
+++ b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/cm/addtagmd/impl/ElementDataImpl.java
@@ -0,0 +1,239 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id: ElementDataImpl.java,v 1.1 2010/03/08 18:49:41 cbateman Exp $
+ */
+package org.eclipse.jst.jsf.facelet.core.internal.cm.addtagmd.impl;
+
+import java.util.Collection;
+
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.common.notify.NotificationChain;
+import org.eclipse.emf.common.util.EList;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.InternalEObject;
+import org.eclipse.emf.ecore.impl.ENotificationImpl;
+import org.eclipse.emf.ecore.impl.EObjectImpl;
+import org.eclipse.emf.ecore.util.EObjectContainmentEList;
+import org.eclipse.emf.ecore.util.InternalEList;
+import org.eclipse.jst.jsf.facelet.core.internal.cm.addtagmd.AddTagMDPackage;
+import org.eclipse.jst.jsf.facelet.core.internal.cm.addtagmd.AttributeData;
+import org.eclipse.jst.jsf.facelet.core.internal.cm.addtagmd.ElementData;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model object '<em><b>Element Data</b></em>'.
+ * <!-- end-user-doc -->
+ * <p>
+ * The following features are implemented:
+ * <ul>
+ * <li>{@link org.eclipse.jst.jsf.facelet.core.internal.cm.addtagmd.impl.ElementDataImpl#getName <em>Name</em>}</li>
+ * <li>{@link org.eclipse.jst.jsf.facelet.core.internal.cm.addtagmd.impl.ElementDataImpl#getAttributes <em>Attributes</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @generated
+ */
+public class ElementDataImpl extends EObjectImpl implements ElementData
+{
+ /**
+ * The default value of the '{@link #getName() <em>Name</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getName()
+ * @generated
+ * @ordered
+ */
+ protected static final String NAME_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getName() <em>Name</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getName()
+ * @generated
+ * @ordered
+ */
+ protected String name = NAME_EDEFAULT;
+
+ /**
+ * The cached value of the '{@link #getAttributes() <em>Attributes</em>}' containment reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getAttributes()
+ * @generated
+ * @ordered
+ */
+ protected EList<AttributeData> attributes;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected ElementDataImpl()
+ {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected EClass eStaticClass()
+ {
+ return AddTagMDPackage.Literals.ELEMENT_DATA;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String getName()
+ {
+ return name;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setName(String newName)
+ {
+ String oldName = name;
+ name = newName;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, AddTagMDPackage.ELEMENT_DATA__NAME, oldName, name));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EList<AttributeData> getAttributes()
+ {
+ if (attributes == null)
+ {
+ attributes = new EObjectContainmentEList<AttributeData>(AttributeData.class, this, AddTagMDPackage.ELEMENT_DATA__ATTRIBUTES);
+ }
+ return attributes;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
+ {
+ switch (featureID)
+ {
+ case AddTagMDPackage.ELEMENT_DATA__ATTRIBUTES:
+ return ((InternalEList<?>)getAttributes()).basicRemove(otherEnd, msgs);
+ }
+ return super.eInverseRemove(otherEnd, featureID, msgs);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object eGet(int featureID, boolean resolve, boolean coreType)
+ {
+ switch (featureID)
+ {
+ case AddTagMDPackage.ELEMENT_DATA__NAME:
+ return getName();
+ case AddTagMDPackage.ELEMENT_DATA__ATTRIBUTES:
+ return getAttributes();
+ }
+ return super.eGet(featureID, resolve, coreType);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @SuppressWarnings("unchecked")
+ @Override
+ public void eSet(int featureID, Object newValue)
+ {
+ switch (featureID)
+ {
+ case AddTagMDPackage.ELEMENT_DATA__NAME:
+ setName((String)newValue);
+ return;
+ case AddTagMDPackage.ELEMENT_DATA__ATTRIBUTES:
+ getAttributes().clear();
+ getAttributes().addAll((Collection<? extends AttributeData>)newValue);
+ return;
+ }
+ super.eSet(featureID, newValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void eUnset(int featureID)
+ {
+ switch (featureID)
+ {
+ case AddTagMDPackage.ELEMENT_DATA__NAME:
+ setName(NAME_EDEFAULT);
+ return;
+ case AddTagMDPackage.ELEMENT_DATA__ATTRIBUTES:
+ getAttributes().clear();
+ return;
+ }
+ super.eUnset(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public boolean eIsSet(int featureID)
+ {
+ switch (featureID)
+ {
+ case AddTagMDPackage.ELEMENT_DATA__NAME:
+ return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
+ case AddTagMDPackage.ELEMENT_DATA__ATTRIBUTES:
+ return attributes != null && !attributes.isEmpty();
+ }
+ return super.eIsSet(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public String toString()
+ {
+ if (eIsProxy()) return super.toString();
+
+ StringBuffer result = new StringBuffer(super.toString());
+ result.append(" (name: "); //$NON-NLS-1$
+ result.append(name);
+ result.append(')');
+ return result.toString();
+ }
+
+} //ElementDataImpl
diff --git a/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/cm/addtagmd/provider/AddTagMDItemProviderAdapterFactory.java b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/cm/addtagmd/provider/AddTagMDItemProviderAdapterFactory.java
new file mode 100644
index 000000000..4d23f22ea
--- /dev/null
+++ b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/cm/addtagmd/provider/AddTagMDItemProviderAdapterFactory.java
@@ -0,0 +1,246 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id: AddTagMDItemProviderAdapterFactory.java,v 1.1 2010/03/08 18:49:40 cbateman Exp $
+ */
+package org.eclipse.jst.jsf.facelet.core.internal.cm.addtagmd.provider;
+
+import java.util.ArrayList;
+import java.util.Collection;
+
+import org.eclipse.emf.common.notify.Adapter;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.common.notify.Notifier;
+
+import org.eclipse.emf.edit.provider.ChangeNotifier;
+import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
+import org.eclipse.emf.edit.provider.ComposedAdapterFactory;
+import org.eclipse.emf.edit.provider.IChangeNotifier;
+import org.eclipse.emf.edit.provider.IDisposable;
+import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
+import org.eclipse.emf.edit.provider.IItemLabelProvider;
+import org.eclipse.emf.edit.provider.IItemPropertySource;
+import org.eclipse.emf.edit.provider.INotifyChangedListener;
+import org.eclipse.emf.edit.provider.IStructuredItemContentProvider;
+import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
+
+import org.eclipse.jst.jsf.facelet.core.internal.cm.addtagmd.util.AddTagMDAdapterFactory;
+
+/**
+ * This is the factory that is used to provide the interfaces needed to support Viewers.
+ * The adapters generated by this factory convert EMF adapter notifications into calls to {@link #fireNotifyChanged fireNotifyChanged}.
+ * The adapters also support Eclipse property sheets.
+ * Note that most of the adapters are shared among multiple instances.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public class AddTagMDItemProviderAdapterFactory extends AddTagMDAdapterFactory implements ComposeableAdapterFactory, IChangeNotifier, IDisposable
+{
+ /**
+ * This keeps track of the root adapter factory that delegates to this adapter factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected ComposedAdapterFactory parentAdapterFactory;
+
+ /**
+ * This is used to implement {@link org.eclipse.emf.edit.provider.IChangeNotifier}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected IChangeNotifier changeNotifier = new ChangeNotifier();
+
+ /**
+ * This keeps track of all the supported types checked by {@link #isFactoryForType isFactoryForType}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected Collection<Object> supportedTypes = new ArrayList<Object>();
+
+ /**
+ * This constructs an instance.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public AddTagMDItemProviderAdapterFactory()
+ {
+ supportedTypes.add(IEditingDomainItemProvider.class);
+ supportedTypes.add(IStructuredItemContentProvider.class);
+ supportedTypes.add(ITreeItemContentProvider.class);
+ supportedTypes.add(IItemLabelProvider.class);
+ supportedTypes.add(IItemPropertySource.class);
+ supportedTypes.add(IResourceProvider.class);
+ }
+
+ /**
+ * This keeps track of the one adapter used for all {@link org.eclipse.jst.jsf.facelet.core.internal.cm.addtagmd.ElementData} instances.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected ElementDataItemProvider elementDataItemProvider;
+
+ /**
+ * This creates an adapter for a {@link org.eclipse.jst.jsf.facelet.core.internal.cm.addtagmd.ElementData}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Adapter createElementDataAdapter()
+ {
+ if (elementDataItemProvider == null)
+ {
+ elementDataItemProvider = new ElementDataItemProvider(this);
+ }
+
+ return elementDataItemProvider;
+ }
+
+ /**
+ * This keeps track of the one adapter used for all {@link org.eclipse.jst.jsf.facelet.core.internal.cm.addtagmd.AttributeData} instances.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected AttributeDataItemProvider attributeDataItemProvider;
+
+ /**
+ * This creates an adapter for a {@link org.eclipse.jst.jsf.facelet.core.internal.cm.addtagmd.AttributeData}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Adapter createAttributeDataAdapter()
+ {
+ if (attributeDataItemProvider == null)
+ {
+ attributeDataItemProvider = new AttributeDataItemProvider(this);
+ }
+
+ return attributeDataItemProvider;
+ }
+
+ /**
+ * This returns the root adapter factory that contains this factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public ComposeableAdapterFactory getRootAdapterFactory()
+ {
+ return parentAdapterFactory == null ? this : parentAdapterFactory.getRootAdapterFactory();
+ }
+
+ /**
+ * This sets the composed adapter factory that contains this factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setParentAdapterFactory(ComposedAdapterFactory parentAdapterFactory)
+ {
+ this.parentAdapterFactory = parentAdapterFactory;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public boolean isFactoryForType(Object type)
+ {
+ return supportedTypes.contains(type) || super.isFactoryForType(type);
+ }
+
+ /**
+ * This implementation substitutes the factory itself as the key for the adapter.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Adapter adapt(Notifier notifier, Object type)
+ {
+ return super.adapt(notifier, this);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object adapt(Object object, Object type)
+ {
+ if (isFactoryForType(type))
+ {
+ Object adapter = super.adapt(object, type);
+ if (!(type instanceof Class) || (((Class<?>)type).isInstance(adapter)))
+ {
+ return adapter;
+ }
+ }
+
+ return null;
+ }
+
+ /**
+ * This adds a listener.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void addListener(INotifyChangedListener notifyChangedListener)
+ {
+ changeNotifier.addListener(notifyChangedListener);
+ }
+
+ /**
+ * This removes a listener.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void removeListener(INotifyChangedListener notifyChangedListener)
+ {
+ changeNotifier.removeListener(notifyChangedListener);
+ }
+
+ /**
+ * This delegates to {@link #changeNotifier} and to {@link #parentAdapterFactory}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void fireNotifyChanged(Notification notification)
+ {
+ changeNotifier.fireNotifyChanged(notification);
+
+ if (parentAdapterFactory != null)
+ {
+ parentAdapterFactory.fireNotifyChanged(notification);
+ }
+ }
+
+ /**
+ * This disposes all of the item providers created by this factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void dispose()
+ {
+ if (elementDataItemProvider != null) elementDataItemProvider.dispose();
+ if (attributeDataItemProvider != null) attributeDataItemProvider.dispose();
+ }
+
+}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/cm/addtagmd/provider/AttributeDataItemProvider.java b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/cm/addtagmd/provider/AttributeDataItemProvider.java
new file mode 100644
index 000000000..1bc1152a7
--- /dev/null
+++ b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/cm/addtagmd/provider/AttributeDataItemProvider.java
@@ -0,0 +1,258 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id: AttributeDataItemProvider.java,v 1.1 2010/03/08 18:49:40 cbateman Exp $
+ */
+package org.eclipse.jst.jsf.facelet.core.internal.cm.addtagmd.provider;
+
+
+import java.util.Collection;
+import java.util.List;
+
+import org.eclipse.emf.common.notify.AdapterFactory;
+import org.eclipse.emf.common.notify.Notification;
+
+import org.eclipse.emf.common.util.ResourceLocator;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
+import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
+import org.eclipse.emf.edit.provider.IItemLabelProvider;
+import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
+import org.eclipse.emf.edit.provider.IItemPropertySource;
+import org.eclipse.emf.edit.provider.IStructuredItemContentProvider;
+import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
+import org.eclipse.emf.edit.provider.ItemPropertyDescriptor;
+import org.eclipse.emf.edit.provider.ItemProviderAdapter;
+import org.eclipse.emf.edit.provider.ViewerNotification;
+
+import org.eclipse.jst.jsf.common.metadata.Trait;
+import org.eclipse.jst.jsf.common.metadata.internal.TraitValueHelper;
+import org.eclipse.jst.jsf.facelet.core.internal.FaceletCorePlugin;
+
+import org.eclipse.jst.jsf.facelet.core.internal.cm.addtagmd.AddTagMDPackage;
+import org.eclipse.jst.jsf.facelet.core.internal.cm.addtagmd.AttributeData;
+
+/**
+ * This is the item provider adapter for a {@link org.eclipse.jst.jsf.facelet.core.internal.cm.addtagmd.AttributeData} object.
+ * <!-- begin-user-doc -->
+ * @extends IResourceProvider
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public class AttributeDataItemProvider
+ extends ItemProviderAdapter
+ implements
+ IEditingDomainItemProvider,
+ IStructuredItemContentProvider,
+ ITreeItemContentProvider,
+ IItemLabelProvider,
+ IItemPropertySource,
+ IResourceProvider
+{
+ /**
+ * This constructs an instance from a factory and a notifier.
+ * <!-- begin-user-doc -->
+ * @param adapterFactory
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public AttributeDataItemProvider(AdapterFactory adapterFactory)
+ {
+ super(adapterFactory);
+ }
+
+ /**
+ * This returns the property descriptors for the adapted class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object)
+ {
+ if (itemPropertyDescriptors == null)
+ {
+ super.getPropertyDescriptors(object);
+
+ addNamePropertyDescriptor(object);
+ addUsagePropertyDescriptor(object);
+ addDescriptionPropertyDescriptor(object);
+ }
+ return itemPropertyDescriptors;
+ }
+
+ /**
+ * This adds a property descriptor for the Name feature.
+ * <!-- begin-user-doc -->
+ * @param object
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void addNamePropertyDescriptor(Object object)
+ {
+ itemPropertyDescriptors.add
+ (createItemPropertyDescriptor
+ (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
+ getResourceLocator(),
+ getString("_UI_AttributeData_name_feature"), //$NON-NLS-1$
+ getString("_UI_PropertyDescriptor_description", "_UI_AttributeData_name_feature", "_UI_AttributeData_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ AddTagMDPackage.Literals.ATTRIBUTE_DATA__NAME,
+ true,
+ false,
+ false,
+ ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
+ null,
+ null));
+ }
+
+ /**
+ * This adds a property descriptor for the Usage feature.
+ * <!-- begin-user-doc -->
+ * @param object
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void addUsagePropertyDescriptor(Object object)
+ {
+ itemPropertyDescriptors.add
+ (createItemPropertyDescriptor
+ (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
+ getResourceLocator(),
+ getString("_UI_AttributeData_usage_feature"), //$NON-NLS-1$
+ getString("_UI_PropertyDescriptor_description", "_UI_AttributeData_usage_feature", "_UI_AttributeData_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ AddTagMDPackage.Literals.ATTRIBUTE_DATA__USAGE,
+ true,
+ false,
+ false,
+ ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
+ null,
+ null));
+ }
+
+ /**
+ * This adds a property descriptor for the Description feature.
+ * <!-- begin-user-doc -->
+ * @param object
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void addDescriptionPropertyDescriptor(Object object)
+ {
+ itemPropertyDescriptors.add
+ (createItemPropertyDescriptor
+ (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
+ getResourceLocator(),
+ getString("_UI_AttributeData_description_feature"), //$NON-NLS-1$
+ getString("_UI_PropertyDescriptor_description", "_UI_AttributeData_description_feature", "_UI_AttributeData_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ AddTagMDPackage.Literals.ATTRIBUTE_DATA__DESCRIPTION,
+ true,
+ false,
+ false,
+ ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
+ null,
+ null));
+ }
+
+ /**
+ * This returns AttributeData.gif.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object getImage(Object object)
+ {
+ return overlayImage(object, getResourceLocator().getImage("full/obj16/AttributeData")); //$NON-NLS-1$
+ }
+
+ /**
+ * This returns the label text for the adapted class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public String getText(Object object)
+ {
+ String label = ((AttributeData)object).getName();
+ return label == null || label.length() == 0 ?
+ getString("_UI_AttributeData_type") : //$NON-NLS-1$
+ getString("_UI_AttributeData_type") + " " + label; //$NON-NLS-1$ //$NON-NLS-2$
+ }
+
+ /**
+ * This handles model notifications by calling {@link #updateChildren} to update any cached
+ * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void notifyChanged(Notification notification)
+ {
+ updateChildren(notification);
+
+ switch (notification.getFeatureID(AttributeData.class))
+ {
+ case AddTagMDPackage.ATTRIBUTE_DATA__NAME:
+ case AddTagMDPackage.ATTRIBUTE_DATA__USAGE:
+ case AddTagMDPackage.ATTRIBUTE_DATA__DESCRIPTION:
+ fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true));
+ return;
+ }
+ super.notifyChanged(notification);
+ }
+
+ /**
+ * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children
+ * that can be created under this object.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object)
+ {
+ super.collectNewChildDescriptors(newChildDescriptors, object);
+ }
+
+ /**
+ * Return the resource locator for this item provider's resources.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public ResourceLocator getResourceLocator()
+ {
+ return FaceletCorePlugin.INSTANCE;
+ }
+
+ public String getTranslatedString(EObject object, EStructuralFeature feature)
+ {
+ Object value = object.eGet(feature);
+
+ if (value != null)
+ {
+ EObject testObject = object;
+
+ while (! (testObject instanceof Trait)
+ && testObject != null)
+ {
+ testObject = testObject.eContainer();
+ }
+
+ if (testObject instanceof Trait)
+ {
+ Trait trait = (Trait) testObject;
+ value = TraitValueHelper.getNLSValue(trait, value.toString());
+ }
+ return value.toString();
+ }
+
+ return object.toString();
+ }
+}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/cm/addtagmd/provider/ElementDataItemProvider.java b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/cm/addtagmd/provider/ElementDataItemProvider.java
new file mode 100644
index 000000000..9aeae53ea
--- /dev/null
+++ b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/cm/addtagmd/provider/ElementDataItemProvider.java
@@ -0,0 +1,228 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id: ElementDataItemProvider.java,v 1.1 2010/03/08 18:49:40 cbateman Exp $
+ */
+package org.eclipse.jst.jsf.facelet.core.internal.cm.addtagmd.provider;
+
+
+import java.util.Collection;
+import java.util.List;
+
+import org.eclipse.emf.common.notify.AdapterFactory;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.common.util.ResourceLocator;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
+import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
+import org.eclipse.emf.edit.provider.IItemLabelProvider;
+import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
+import org.eclipse.emf.edit.provider.IItemPropertySource;
+import org.eclipse.emf.edit.provider.IStructuredItemContentProvider;
+import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
+import org.eclipse.emf.edit.provider.ItemPropertyDescriptor;
+import org.eclipse.emf.edit.provider.ItemProviderAdapter;
+import org.eclipse.emf.edit.provider.ViewerNotification;
+import org.eclipse.jst.jsf.common.metadata.Trait;
+import org.eclipse.jst.jsf.common.metadata.internal.TraitValueHelper;
+import org.eclipse.jst.jsf.facelet.core.internal.FaceletCorePlugin;
+import org.eclipse.jst.jsf.facelet.core.internal.cm.addtagmd.AddTagMDPackage;
+import org.eclipse.jst.jsf.facelet.core.internal.cm.addtagmd.ElementData;
+
+/**
+ * This is the item provider adapter for a {@link org.eclipse.jst.jsf.facelet.core.internal.cm.addtagmd.ElementData} object.
+ * <!-- begin-user-doc -->
+ * @extends IResourceProvider
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public class ElementDataItemProvider
+ extends ItemProviderAdapter
+ implements
+ IEditingDomainItemProvider,
+ IStructuredItemContentProvider,
+ ITreeItemContentProvider,
+ IItemLabelProvider,
+ IItemPropertySource,
+ IResourceProvider
+{
+ /**
+ * This constructs an instance from a factory and a notifier.
+ * <!-- begin-user-doc -->
+ * @param adapterFactory
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public ElementDataItemProvider(AdapterFactory adapterFactory)
+ {
+ super(adapterFactory);
+ }
+
+ /**
+ * This returns the property descriptors for the adapted class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object)
+ {
+ if (itemPropertyDescriptors == null)
+ {
+ super.getPropertyDescriptors(object);
+
+ addNamePropertyDescriptor(object);
+ addAttributesPropertyDescriptor(object);
+ }
+ return itemPropertyDescriptors;
+ }
+
+ /**
+ * This adds a property descriptor for the Name feature.
+ * <!-- begin-user-doc -->
+ * @param object
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void addNamePropertyDescriptor(Object object)
+ {
+ itemPropertyDescriptors.add
+ (createItemPropertyDescriptor
+ (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
+ getResourceLocator(),
+ getString("_UI_ElementData_name_feature"), //$NON-NLS-1$
+ getString("_UI_PropertyDescriptor_description", "_UI_ElementData_name_feature", "_UI_ElementData_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ AddTagMDPackage.Literals.ELEMENT_DATA__NAME,
+ true,
+ false,
+ false,
+ ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
+ null,
+ null));
+ }
+
+ /**
+ * This adds a property descriptor for the Attributes feature.
+ * <!-- begin-user-doc -->
+ * @param object
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void addAttributesPropertyDescriptor(Object object)
+ {
+ itemPropertyDescriptors.add
+ (createItemPropertyDescriptor
+ (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
+ getResourceLocator(),
+ getString("_UI_ElementData_attributes_feature"), //$NON-NLS-1$
+ getString("_UI_PropertyDescriptor_description", "_UI_ElementData_attributes_feature", "_UI_ElementData_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ AddTagMDPackage.Literals.ELEMENT_DATA__ATTRIBUTES,
+ true,
+ false,
+ true,
+ null,
+ null,
+ null));
+ }
+
+ /**
+ * This returns ElementData.gif.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object getImage(Object object)
+ {
+ return overlayImage(object, getResourceLocator().getImage("full/obj16/ElementData")); //$NON-NLS-1$
+ }
+
+ /**
+ * This returns the label text for the adapted class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public String getText(Object object)
+ {
+ String label = ((ElementData)object).getName();
+ return label == null || label.length() == 0 ?
+ getString("_UI_ElementData_type") : //$NON-NLS-1$
+ getString("_UI_ElementData_type") + " " + label; //$NON-NLS-1$ //$NON-NLS-2$
+ }
+
+ /**
+ * This handles model notifications by calling {@link #updateChildren} to update any cached
+ * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void notifyChanged(Notification notification)
+ {
+ updateChildren(notification);
+
+ switch (notification.getFeatureID(ElementData.class))
+ {
+ case AddTagMDPackage.ELEMENT_DATA__NAME:
+ fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true));
+ return;
+ }
+ super.notifyChanged(notification);
+ }
+
+ /**
+ * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children
+ * that can be created under this object.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object)
+ {
+ super.collectNewChildDescriptors(newChildDescriptors, object);
+ }
+
+ /**
+ * Return the resource locator for this item provider's resources.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public ResourceLocator getResourceLocator()
+ {
+ return FaceletCorePlugin.INSTANCE;
+ }
+
+ public String getTranslatedString(EObject object, EStructuralFeature feature)
+ {
+ Object value = object.eGet(feature);
+
+ if (value != null)
+ {
+ EObject testObject = object;
+
+ while (! (testObject instanceof Trait)
+ && testObject != null)
+ {
+ testObject = testObject.eContainer();
+ }
+
+ if (testObject instanceof Trait)
+ {
+ Trait trait = (Trait) testObject;
+ value = TraitValueHelper.getNLSValue(trait, value.toString());
+ }
+ return value.toString();
+ }
+
+ return object.toString();
+ }
+
+}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/cm/addtagmd/provider/IResourceProvider.java b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/cm/addtagmd/provider/IResourceProvider.java
new file mode 100644
index 000000000..d441f590c
--- /dev/null
+++ b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/cm/addtagmd/provider/IResourceProvider.java
@@ -0,0 +1,31 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Oracle Corporation.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Cameron Bateman - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jst.jsf.facelet.core.internal.cm.addtagmd.provider;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EStructuralFeature;
+
+/**
+ * A translated string provider.
+ *
+ * @author cbateman
+ *
+ */
+public interface IResourceProvider
+{
+ /**
+ * @param object
+ * @param feature
+ * @return the string value of object.eGet(feature)
+ */
+ String getTranslatedString(final EObject object,
+ final EStructuralFeature feature);
+}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/cm/addtagmd/util/AddTagMDAdapterFactory.java b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/cm/addtagmd/util/AddTagMDAdapterFactory.java
new file mode 100644
index 000000000..0ec5f7206
--- /dev/null
+++ b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/cm/addtagmd/util/AddTagMDAdapterFactory.java
@@ -0,0 +1,156 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id: AddTagMDAdapterFactory.java,v 1.1 2010/03/08 18:49:42 cbateman Exp $
+ */
+package org.eclipse.jst.jsf.facelet.core.internal.cm.addtagmd.util;
+
+import org.eclipse.emf.common.notify.Adapter;
+import org.eclipse.emf.common.notify.Notifier;
+
+import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl;
+
+import org.eclipse.emf.ecore.EObject;
+
+import org.eclipse.jst.jsf.facelet.core.internal.cm.addtagmd.*;
+
+/**
+ * <!-- begin-user-doc -->
+ * The <b>Adapter Factory</b> for the model.
+ * It provides an adapter <code>createXXX</code> method for each class of the model.
+ * <!-- end-user-doc -->
+ * @see org.eclipse.jst.jsf.facelet.core.internal.cm.addtagmd.AddTagMDPackage
+ * @generated
+ */
+public class AddTagMDAdapterFactory extends AdapterFactoryImpl
+{
+ /**
+ * The cached model package.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected static AddTagMDPackage modelPackage;
+
+ /**
+ * Creates an instance of the adapter factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public AddTagMDAdapterFactory()
+ {
+ if (modelPackage == null)
+ {
+ modelPackage = AddTagMDPackage.eINSTANCE;
+ }
+ }
+
+ /**
+ * Returns whether this factory is applicable for the type of the object.
+ * <!-- begin-user-doc -->
+ * This implementation returns <code>true</code> if the object is either the model's package or is an instance object of the model.
+ * <!-- end-user-doc -->
+ * @return whether this factory is applicable for the type of the object.
+ * @generated
+ */
+ @Override
+ public boolean isFactoryForType(Object object)
+ {
+ if (object == modelPackage)
+ {
+ return true;
+ }
+ if (object instanceof EObject)
+ {
+ return ((EObject)object).eClass().getEPackage() == modelPackage;
+ }
+ return false;
+ }
+
+ /**
+ * The switch that delegates to the <code>createXXX</code> methods.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected AddTagMDSwitch<Adapter> modelSwitch =
+ new AddTagMDSwitch<Adapter>()
+ {
+ @Override
+ public Adapter caseElementData(ElementData object)
+ {
+ return createElementDataAdapter();
+ }
+ @Override
+ public Adapter caseAttributeData(AttributeData object)
+ {
+ return createAttributeDataAdapter();
+ }
+ @Override
+ public Adapter defaultCase(EObject object)
+ {
+ return createEObjectAdapter();
+ }
+ };
+
+ /**
+ * Creates an adapter for the <code>target</code>.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param target the object to adapt.
+ * @return the adapter for the <code>target</code>.
+ * @generated
+ */
+ @Override
+ public Adapter createAdapter(Notifier target)
+ {
+ return modelSwitch.doSwitch((EObject)target);
+ }
+
+
+ /**
+ * Creates a new adapter for an object of class '{@link org.eclipse.jst.jsf.facelet.core.internal.cm.addtagmd.ElementData <em>Element Data</em>}'.
+ * <!-- begin-user-doc -->
+ * This default implementation returns null so that we can easily ignore cases;
+ * it's useful to ignore a case when inheritance will catch all the cases anyway.
+ * <!-- end-user-doc -->
+ * @return the new adapter.
+ * @see org.eclipse.jst.jsf.facelet.core.internal.cm.addtagmd.ElementData
+ * @generated
+ */
+ public Adapter createElementDataAdapter()
+ {
+ return null;
+ }
+
+ /**
+ * Creates a new adapter for an object of class '{@link org.eclipse.jst.jsf.facelet.core.internal.cm.addtagmd.AttributeData <em>Attribute Data</em>}'.
+ * <!-- begin-user-doc -->
+ * This default implementation returns null so that we can easily ignore cases;
+ * it's useful to ignore a case when inheritance will catch all the cases anyway.
+ * <!-- end-user-doc -->
+ * @return the new adapter.
+ * @see org.eclipse.jst.jsf.facelet.core.internal.cm.addtagmd.AttributeData
+ * @generated
+ */
+ public Adapter createAttributeDataAdapter()
+ {
+ return null;
+ }
+
+ /**
+ * Creates a new adapter for the default case.
+ * <!-- begin-user-doc -->
+ * This default implementation returns null.
+ * <!-- end-user-doc -->
+ * @return the new adapter.
+ * @generated
+ */
+ public Adapter createEObjectAdapter()
+ {
+ return null;
+ }
+
+} //AddTagMDAdapterFactory
diff --git a/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/cm/addtagmd/util/AddTagMDSwitch.java b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/cm/addtagmd/util/AddTagMDSwitch.java
new file mode 100644
index 000000000..e15cffd81
--- /dev/null
+++ b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/cm/addtagmd/util/AddTagMDSwitch.java
@@ -0,0 +1,168 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id: AddTagMDSwitch.java,v 1.1 2010/03/08 18:49:42 cbateman Exp $
+ */
+package org.eclipse.jst.jsf.facelet.core.internal.cm.addtagmd.util;
+
+import java.util.List;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EObject;
+
+import org.eclipse.jst.jsf.facelet.core.internal.cm.addtagmd.*;
+
+/**
+ * <!-- begin-user-doc -->
+ * The <b>Switch</b> for the model's inheritance hierarchy.
+ * It supports the call {@link #doSwitch(EObject) doSwitch(object)}
+ * to invoke the <code>caseXXX</code> method for each class of the model,
+ * starting with the actual class of the object
+ * and proceeding up the inheritance hierarchy
+ * until a non-null result is returned,
+ * which is the result of the switch.
+ * @param <T>
+ * <!-- end-user-doc -->
+ * @see org.eclipse.jst.jsf.facelet.core.internal.cm.addtagmd.AddTagMDPackage
+ * @generated
+ */
+public class AddTagMDSwitch<T>
+{
+ /**
+ * The cached model package
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected static AddTagMDPackage modelPackage;
+
+ /**
+ * Creates an instance of the switch.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public AddTagMDSwitch()
+ {
+ if (modelPackage == null)
+ {
+ modelPackage = AddTagMDPackage.eINSTANCE;
+ }
+ }
+
+ /**
+ * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result.
+ * <!-- begin-user-doc -->
+ * @param theEObject
+ * <!-- end-user-doc -->
+ * @return the first non-null result returned by a <code>caseXXX</code> call.
+ * @generated
+ */
+ public T doSwitch(EObject theEObject)
+ {
+ return doSwitch(theEObject.eClass(), theEObject);
+ }
+
+ /**
+ * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result.
+ * <!-- begin-user-doc -->
+ * @param theEClass
+ * @param theEObject
+ * <!-- end-user-doc -->
+ * @return the first non-null result returned by a <code>caseXXX</code> call.
+ * @generated
+ */
+ protected T doSwitch(EClass theEClass, EObject theEObject)
+ {
+ if (theEClass.eContainer() == modelPackage)
+ {
+ return doSwitch(theEClass.getClassifierID(), theEObject);
+ }
+ List<EClass> eSuperTypes = theEClass.getESuperTypes();
+ return
+ eSuperTypes.isEmpty() ?
+ defaultCase(theEObject) :
+ doSwitch(eSuperTypes.get(0), theEObject);
+ }
+
+ /**
+ * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result.
+ * <!-- begin-user-doc -->
+ * @param classifierID
+ * @param theEObject
+ * <!-- end-user-doc -->
+ * @return the first non-null result returned by a <code>caseXXX</code> call.
+ * @generated
+ */
+ protected T doSwitch(int classifierID, EObject theEObject)
+ {
+ switch (classifierID)
+ {
+ case AddTagMDPackage.ELEMENT_DATA:
+ {
+ ElementData elementData = (ElementData)theEObject;
+ T result = caseElementData(elementData);
+ if (result == null) result = defaultCase(theEObject);
+ return result;
+ }
+ case AddTagMDPackage.ATTRIBUTE_DATA:
+ {
+ AttributeData attributeData = (AttributeData)theEObject;
+ T result = caseAttributeData(attributeData);
+ if (result == null) result = defaultCase(theEObject);
+ return result;
+ }
+ default: return defaultCase(theEObject);
+ }
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of '<em>Element Data</em>'.
+ * <!-- begin-user-doc -->
+ * This implementation returns null;
+ * returning a non-null result will terminate the switch.
+ * <!-- end-user-doc -->
+ * @param object the target of the switch.
+ * @return the result of interpreting the object as an instance of '<em>Element Data</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T caseElementData(ElementData object)
+ {
+ return null;
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of '<em>Attribute Data</em>'.
+ * <!-- begin-user-doc -->
+ * This implementation returns null;
+ * returning a non-null result will terminate the switch.
+ * <!-- end-user-doc -->
+ * @param object the target of the switch.
+ * @return the result of interpreting the object as an instance of '<em>Attribute Data</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T caseAttributeData(AttributeData object)
+ {
+ return null;
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of '<em>EObject</em>'.
+ * <!-- begin-user-doc -->
+ * This implementation returns null;
+ * returning a non-null result will terminate the switch, but this is the last case anyway.
+ * <!-- end-user-doc -->
+ * @param object the target of the switch.
+ * @return the result of interpreting the object as an instance of '<em>EObject</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject)
+ * @generated
+ */
+ public T defaultCase(EObject object)
+ {
+ return null;
+ }
+
+} //AddTagMDSwitch
diff --git a/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/cm/attributevalues/TemplateWebPathType.java b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/cm/attributevalues/TemplateWebPathType.java
new file mode 100644
index 000000000..572d7d55d
--- /dev/null
+++ b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/cm/attributevalues/TemplateWebPathType.java
@@ -0,0 +1,179 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Oracle Corporation.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Cameron Bateman - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jst.jsf.facelet.core.internal.cm.attributevalues;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import org.eclipse.core.resources.IContainer;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.jst.jsf.context.resolver.structureddocument.IDOMContextResolver;
+import org.eclipse.jst.jsf.context.resolver.structureddocument.IStructuredDocumentContextResolverFactory;
+import org.eclipse.jst.jsf.context.structureddocument.IStructuredDocumentContext;
+import org.eclipse.jst.jsf.facelet.core.internal.FaceletCorePlugin;
+import org.eclipse.jst.jsf.metadataprocessors.features.IPossibleValues;
+import org.eclipse.jst.jsf.metadataprocessors.features.PossibleValue;
+import org.eclipse.jst.jsf.taglibprocessing.attributevalues.WebPathType;
+import org.eclipse.wst.common.componentcore.ComponentCore;
+import org.eclipse.wst.common.componentcore.resources.IVirtualContainer;
+import org.eclipse.wst.common.componentcore.resources.IVirtualResource;
+import org.w3c.dom.Attr;
+import org.w3c.dom.Node;
+
+/**
+ * Web-path attribute value type that adds possible values support
+ *
+ * @author cbateman
+ *
+ */
+public class TemplateWebPathType extends WebPathType implements IPossibleValues
+{
+
+ public List getPossibleValues()
+ {
+ final IStructuredDocumentContext context = getStructuredDocumentContext();
+ final IDOMContextResolver resolver = IStructuredDocumentContextResolverFactory.INSTANCE
+ .getDOMContextResolver(context);
+ if (resolver != null)
+ {
+ final Node node = resolver.getNode();
+ if (node instanceof Attr)
+ {
+ return createPossibleValues((Attr) node);
+ }
+ }
+ return Collections.EMPTY_LIST;
+ }
+
+ private List createPossibleValues(final Attr node)
+ {
+ String currentPathString = node.getNodeValue();
+
+ final List possibleValues = new ArrayList();
+
+ if (currentPathString == null || "".equals(currentPathString.trim())) //$NON-NLS-1$
+ {
+ currentPathString = "/"; //$NON-NLS-1$
+ }
+
+ final IPath currentPath = new Path(currentPathString);
+
+ final IVirtualContainer webRoot = getWebRoot();
+
+ final IVirtualResource deepestElement = findDeepestCommonElement(
+ currentPath, webRoot);
+
+ if (deepestElement == null)
+ {
+ // empty
+ return possibleValues;
+ }
+
+ final IResource[] allResources = deepestElement
+ .getUnderlyingResources();
+ for (final IResource res : allResources)
+ {
+ if (res instanceof IContainer)
+ {
+ try
+ {
+ for (final IResource child : ((IContainer) res).members())
+ {
+ if (child.exists())
+ {
+ IPath childPath = child.getProjectRelativePath();
+ int numLeadingSegments = webRoot
+ .getProjectRelativePath()
+ .matchingFirstSegments(childPath);
+ childPath = childPath
+ .removeFirstSegments(numLeadingSegments);
+ String pathName = null;
+ if (currentPath.isAbsolute())
+ {
+ pathName = childPath.makeAbsolute()
+ .toString();
+ }
+ else
+ {
+ pathName = childPath.makeRelative().toString();
+ }
+
+ final PossibleValue pv = new PossibleValue(
+ pathName, pathName);
+ possibleValues.add(pv);
+ }
+ }
+ }
+ catch (final CoreException ce)
+ {
+ FaceletCorePlugin.log("While trying possible values", ce); //$NON-NLS-1$
+ }
+ }
+ }
+ return possibleValues;
+ }
+
+ private IVirtualResource findDeepestCommonElement(
+ final IPath currentPath, final IVirtualContainer webRoot)
+ {
+ final String[] segments = currentPath.segments();
+ IVirtualResource deepestElement = null;
+ if (segments != null)
+ {
+ IPath longestSubPath = new Path(""); //$NON-NLS-1$
+ for (final String segment : segments)
+ {
+ longestSubPath = longestSubPath.append(segment);
+ deepestElement = webRoot.findMember(longestSubPath);
+ if (deepestElement == null)
+ {
+ longestSubPath = longestSubPath.removeLastSegments(1);
+ break;
+ }
+ }
+
+ deepestElement = webRoot.findMember(longestSubPath);
+ if (deepestElement == null)
+ {
+ deepestElement = webRoot;
+ }
+ else
+ {
+ int avoidInfiniteLoopCount = 0;
+ while(avoidInfiniteLoopCount < 1000 && // we timeout in cause of circular chains.
+ deepestElement != null &&
+ ! (deepestElement.getUnderlyingResource() instanceof IContainer))
+ {
+ deepestElement = deepestElement.getParent();
+ }
+
+ if (avoidInfiniteLoopCount == 1000)
+ {
+ throw new IllegalStateException();
+ }
+ }
+ }
+ return deepestElement;
+ }
+
+ private IVirtualContainer getWebRoot()
+
+ {
+ final IVirtualContainer webRoot = ComponentCore.createComponent(
+ getProject()).getRootFolder();
+
+ return webRoot;
+ }
+}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/cm/strategy/AbstractExternalMetadataStrategy.java b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/cm/strategy/AbstractExternalMetadataStrategy.java
new file mode 100644
index 000000000..e5792404b
--- /dev/null
+++ b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/cm/strategy/AbstractExternalMetadataStrategy.java
@@ -0,0 +1,52 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Oracle Corporation.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Cameron Bateman - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jst.jsf.facelet.core.internal.cm.strategy;
+
+import org.eclipse.jst.jsf.common.dom.TagIdentifier;
+import org.eclipse.jst.jsf.facelet.core.internal.cm.ExternalTagInfo;
+
+/**
+ * Super class of all external meta-data strategy.
+ *
+ * @author cbateman
+ *
+ */
+/* package */abstract class AbstractExternalMetadataStrategy implements
+IExternalMetadataStrategy
+{
+ private final String _displayName;
+ private final String _id;
+
+ protected AbstractExternalMetadataStrategy(final String id,
+ final String displayName)
+ {
+ _id = id;
+ _displayName = displayName;
+ }
+
+ public final ExternalTagInfo getNoResult()
+ {
+ // this value must be "==" comparable
+ return ExternalTagInfo.NULL_INSTANCE;
+ }
+
+ public abstract ExternalTagInfo perform(TagIdentifier input) throws Exception;
+
+ public final String getDisplayName()
+ {
+ return _displayName;
+ }
+
+ public String getId()
+ {
+ return _id;
+ }
+}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/cm/strategy/IExternalMetadataStrategy.java b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/cm/strategy/IExternalMetadataStrategy.java
new file mode 100644
index 000000000..763c2b643
--- /dev/null
+++ b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/cm/strategy/IExternalMetadataStrategy.java
@@ -0,0 +1,56 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Oracle Corporation.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Cameron Bateman - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jst.jsf.facelet.core.internal.cm.strategy;
+
+import org.eclipse.jst.jsf.common.dom.TagIdentifier;
+import org.eclipse.jst.jsf.common.internal.strategy.IIdentifiableStrategy;
+import org.eclipse.jst.jsf.facelet.core.internal.cm.ExternalTagInfo;
+
+/**
+ * A strategy whose algorithm loads the tag CM data for a tag.
+ *
+ * @author cbateman
+ *
+ */
+public interface IExternalMetadataStrategy extends
+ IIdentifiableStrategy<TagIdentifier, ExternalTagInfo, String>
+{
+
+ /**
+ * A null strategy that returns no result for all queries
+ * @author cbateman
+ *
+ */
+ static class NullExternalMetadataStrategy implements IExternalMetadataStrategy
+ {
+
+ public ExternalTagInfo getNoResult()
+ {
+ return ExternalTagInfo.NULL_INSTANCE;
+ }
+
+ public ExternalTagInfo perform(TagIdentifier input) throws Exception
+ {
+ return getNoResult();
+ }
+
+ public String getDisplayName()
+ {
+ return "NULL instance; you shouldn't see this label!"; //$NON-NLS-1$
+ }
+
+ public String getId()
+ {
+ return "NULL Strategy"; //$NON-NLS-1$
+ }
+
+ }
+}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/cm/strategy/JSPExternalMetadataStrategy.java b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/cm/strategy/JSPExternalMetadataStrategy.java
new file mode 100644
index 000000000..fc00a4b70
--- /dev/null
+++ b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/cm/strategy/JSPExternalMetadataStrategy.java
@@ -0,0 +1,87 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Oracle Corporation.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Cameron Bateman - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jst.jsf.facelet.core.internal.cm.strategy;
+
+import org.eclipse.jst.jsf.common.dom.TagIdentifier;
+import org.eclipse.jst.jsf.facelet.core.internal.cm.ExternalTagInfo;
+import org.eclipse.jst.jsp.core.internal.contentmodel.tld.provisional.TLDDocument;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
+
+/**
+ * A metadata strategy that uses JSP TLD metadata.
+ *
+ * @author cbateman
+ *
+ */
+public class JSPExternalMetadataStrategy extends
+ AbstractExternalMetadataStrategy
+{
+ private final TLDDocument _doc;
+ /**
+ * The unique identifier for the strategy.
+ */
+ public final static String STRATEGY_ID = "org.eclipse.jst.jsf.facelet.core.internal.cm.strategy.JSPExternalMetadataStrategy"; //$NON-NLS-1$
+
+ /**
+ * @param doc
+ */
+ public JSPExternalMetadataStrategy(final TLDDocument doc)
+ {
+ super(STRATEGY_ID, Messages.JSPExternalMetadataStrategy_DisplayName);
+ _doc = doc;
+ }
+
+ @Override
+ public ExternalTagInfo perform(final TagIdentifier input) throws Exception
+ {
+ if (_doc != null)
+ {
+ return new TLDMetadataExternalInfo(_doc);
+ }
+ return getNoResult();
+ }
+
+ private static class TLDMetadataExternalInfo extends ExternalTagInfo
+ {
+ private final TLDDocument _doc;
+
+ public TLDMetadataExternalInfo(final TLDDocument doc)
+ {
+ _doc = doc;
+ }
+
+ @Override
+ public CMNamedNodeMap getAttributes(final String tagName)
+ {
+ final CMElementDeclaration element = (CMElementDeclaration) _doc
+ .getElements().getNamedItem(tagName);
+
+ if (element != null)
+ {
+ return element.getAttributes();
+ }
+ return null;
+ }
+
+ @Override
+ public Object getTagProperty(final String tagName, final String key)
+ {
+ final CMElementDeclaration element = (CMElementDeclaration) _doc
+ .getElements().getNamedItem(tagName);
+ if (element != null)
+ {
+ return element.getProperty(key);
+ }
+ return null;
+ }
+ }
+}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/cm/strategy/MDExternalMetadataStrategy.java b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/cm/strategy/MDExternalMetadataStrategy.java
new file mode 100644
index 000000000..1d4d7c75e
--- /dev/null
+++ b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/cm/strategy/MDExternalMetadataStrategy.java
@@ -0,0 +1,482 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Oracle Corporation.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Cameron Bateman - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jst.jsf.facelet.core.internal.cm.strategy;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.atomic.AtomicBoolean;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.ISafeRunnable;
+import org.eclipse.emf.edit.provider.ComposedAdapterFactory;
+import org.eclipse.jface.util.SafeRunnable;
+import org.eclipse.jst.jsf.common.dom.TagIdentifier;
+import org.eclipse.jst.jsf.common.internal.managedobject.IManagedObject;
+import org.eclipse.jst.jsf.common.internal.managedobject.ObjectManager.ManagedObjectException;
+import org.eclipse.jst.jsf.common.internal.resource.ResourceSingletonObjectManager;
+import org.eclipse.jst.jsf.facelet.core.internal.FaceletCorePlugin;
+import org.eclipse.jst.jsf.facelet.core.internal.cm.AttributeCMAdapter;
+import org.eclipse.jst.jsf.facelet.core.internal.cm.ExternalTagInfo;
+import org.eclipse.jst.jsf.facelet.core.internal.cm.addtagmd.AddTagMDPackage;
+import org.eclipse.jst.jsf.facelet.core.internal.cm.addtagmd.AttributeData;
+import org.eclipse.jst.jsf.facelet.core.internal.cm.addtagmd.AttributeUsage;
+import org.eclipse.jst.jsf.facelet.core.internal.cm.addtagmd.ElementData;
+import org.eclipse.jst.jsf.facelet.core.internal.cm.addtagmd.provider.IResourceProvider;
+import org.eclipse.jst.jsf.facelet.core.internal.util.TagMetadataLoader;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
+
+/**
+ * An external meta-data strategy that uses the JSF meta-data framework.
+ *
+ * @author cbateman
+ *
+ */
+public class MDExternalMetadataStrategy extends
+ AbstractExternalMetadataStrategy implements IManagedObject
+{
+ private static MySingletonManager MANAGER = new MySingletonManager();
+
+ /**
+ * @param project
+ * @return the instance of the strategy for project or
+ */
+ public static IExternalMetadataStrategy create(final IProject project)
+ {
+ try
+ {
+ return MANAGER.getInstance(project);
+ }
+ catch (final ManagedObjectException e)
+ {
+ FaceletCorePlugin.log(
+ "Getting managed instance of tag metadata strategy", e); //$NON-NLS-1$
+ }
+ return new NullExternalMetadataStrategy();
+ }
+
+ /**
+ * The unique identifier for the strategy.
+ */
+ public final static String STRATEGY_ID = "org.eclipse.jst.jsf.facelet.core.internal.cm.strategy.MDExternalMetadataStrategy"; //$NON-NLS-1$
+
+ // private static final String VAR = "var"; //$NON-NLS-1$
+ // private static final String VALUE = "value"; //$NON-NLS-1$
+ // private static final String SRC = "src"; //$NON-NLS-1$
+ // private static final String NAME = "name"; //$NON-NLS-1$
+ // private static final String HOTKEY = "hotkey"; //$NON-NLS-1$
+ // private static final String TEMPLATE = "template"; //$NON-NLS-1$
+ // private static final String BINDING = "binding"; //$NON-NLS-1$
+ // private static final String ID = "id"; //$NON-NLS-1$
+
+ private final IProject _project;
+ private final TagMetadataLoader _tagMetadataLoader;
+ private final Map<String, MDExternalTagInfo> _cached;
+ private final AtomicBoolean _isDisposed = new AtomicBoolean(
+ false);
+
+ /**
+ * Default constructor
+ *
+ * @param project
+ */
+ private MDExternalMetadataStrategy(final IProject project)
+ {
+ super(STRATEGY_ID, Messages.MDExternalMetadataStrategy_DisplayName);
+ _project = project;
+ _tagMetadataLoader = new TagMetadataLoader(_project);
+ _cached = new HashMap<String, MDExternalTagInfo>();
+ }
+
+ public void checkpoint()
+ {
+ // do nothing
+ }
+
+ public void destroy()
+ {
+ // currently no persistent state, so just dispose
+ }
+
+ public void dispose()
+ {
+ if (_isDisposed.compareAndSet(false, true))
+ {
+ _cached.clear();
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.jst.jsf.facelet.core.internal.cm.strategy.
+ * AbstractExternalMetadataStrategy
+ * #perform(org.eclipse.jst.jsf.common.dom.TagIdentifier)
+ */
+ @Override
+ public ExternalTagInfo perform(final TagIdentifier input) throws Exception
+ {
+ MDExternalTagInfo tagInfo = _cached.get(input.getUri());
+
+ if (tagInfo == null)
+ {
+ tagInfo = new MDExternalTagInfo(input.getUri(), _tagMetadataLoader);
+ _cached.put(input.getUri(), tagInfo);
+ }
+ return tagInfo;
+ }
+
+ private static class MDExternalTagInfo extends ExternalTagInfo
+ {
+ private final String _uri;
+ private final TagMetadataLoader _tagMetadataLoader;
+ private final Map<String, InternalNamedNodeMap> _attributes;
+
+ public MDExternalTagInfo(final String uri,
+ final TagMetadataLoader tagMetadataLoader)
+ {
+ _uri = uri;
+ _tagMetadataLoader = tagMetadataLoader;
+ _attributes = new HashMap<String, InternalNamedNodeMap>();
+ }
+
+ @Override
+ public CMNamedNodeMap getAttributes(final String tagName)
+ {
+ final InternalNamedNodeMap nodeMap = _attributes.get(tagName);
+ final InternalNamedNodeMap[] innerClassNodeMap = new InternalNamedNodeMap[1];
+ innerClassNodeMap[0] = nodeMap;
+
+ if (nodeMap == null)
+ {
+ SafeRunnable.run(new ISafeRunnable()
+ {
+ public void run()
+ {
+ final ElementData data = _tagMetadataLoader
+ .getElementData(_uri, tagName);
+
+ if (data != null)
+ {
+ innerClassNodeMap[0] = new InternalNamedNodeMap();
+
+ for (final AttributeData attribute : data
+ .getAttributes())
+ {
+ innerClassNodeMap[0]
+ .add(createAttribute(attribute));
+ }
+ _attributes.put(tagName, innerClassNodeMap[0]);
+ }
+ // no meta-data found for this tag, so mark as null
+ // instance so future calls don't bother a re-lookup.
+ else
+ {
+ _attributes.put(tagName,
+ MDExternalMetadataStrategy.NULL_INSTANCE);
+ }
+ }
+
+ public void handleException(final Throwable exception)
+ {
+ FaceletCorePlugin.log(
+ "While loading attribute meta-data", exception); //$NON-NLS-1$
+ }
+ });
+ }
+
+ // don't return the null map instance
+ if (innerClassNodeMap[0] == MDExternalMetadataStrategy.NULL_INSTANCE)
+ {
+ return null;
+ }
+ return innerClassNodeMap[0];
+ }
+
+ @Override
+ public Object getTagProperty(final String tagName, final String key)
+ {
+ final Object[] value = new Object[1];
+ value[0] = null;
+
+ SafeRunnable.run(new ISafeRunnable()
+ {
+ public void run()
+ {
+ if ("description".equals(key)) //$NON-NLS-1$
+ {
+ value[0] = _tagMetadataLoader.getDescription(_uri,
+ tagName);
+ }
+ }
+
+ public void handleException(final Throwable exception)
+ {
+ FaceletCorePlugin.log(
+ "While loading tag property meta-data", exception); //$NON-NLS-1$
+ }
+ });
+ return value[0];
+ }
+ }
+
+ private static class InternalNamedNodeMap implements CMNamedNodeMap
+ {
+ private final List<CMNode> _nodes = new ArrayList<CMNode>();
+
+ public void add(final CMNode node)
+ {
+ _nodes.add(node);
+ }
+
+ public int getLength()
+ {
+ return _nodes.size();
+ }
+
+ public CMNode getNamedItem(final String name)
+ {
+ for (final CMNode foundNode : _nodes)
+ {
+ if (name.equals(foundNode.getNodeName()))
+ {
+ return foundNode;
+ }
+ }
+ return null;
+ }
+
+ public CMNode item(final int index)
+ {
+ if (index < _nodes.size())
+ {
+ return _nodes.get(index);
+ }
+ return null;
+ }
+
+ public Iterator<?> iterator()
+ {
+ return Collections.unmodifiableList(_nodes).iterator();
+ }
+ }
+
+ private final static NullInternalNamedNodeMap NULL_INSTANCE = new NullInternalNamedNodeMap();
+
+ private static class NullInternalNamedNodeMap extends InternalNamedNodeMap
+ {
+
+ @Override
+ public void add(final CMNode node)
+ {
+ // do nothing
+ }
+
+ @Override
+ public int getLength()
+ {
+ // always empty
+ return 0;
+ }
+
+ @Override
+ public CMNode getNamedItem(final String name)
+ {
+ return null;
+ }
+
+ @Override
+ public CMNode item(final int index)
+ {
+ return null;
+ }
+
+ @Override
+ public Iterator<?> iterator()
+ {
+ return Collections.EMPTY_LIST.iterator();
+ }
+
+ }
+
+ // temporary: transfer out to metadata
+ final static Map<String, InternalNamedNodeMap> _faceletData;
+
+ static
+ {
+ // final String ID_DESCRIPTION =
+ // Messages.MDExternalMetadataStrategy_ID_DESCRIPTION;
+ // final String BINDING_DESCRIPTION =
+ // Messages.MDExternalMetadataStrategy_BINDING_DESCRIPTION;
+ // final String TEMPLATE_DESCRIPTION =
+ // Messages.MDExternalMetadataStrategy_TEMPLATE_DESCRIPTION;
+ // final String HOTKEY_DESCRIPTION =
+ // Messages.MDExternalMetadataStrategy_HOTKEY_DESCRIPTION;
+ // final String DEFINE_NAME_DESCRIPTION =
+ // Messages.MDExternalMetadataStrategy_DEFINE_NAME_DESCRIPTION;
+ // final String SRC_DESCRIPTION =
+ // Messages.MDExternalMetadataStrategy_SRC_DESCRIPTION;
+ // final String INSERT_NAME_DESCRIPTION =
+ // Messages.MDExternalMetadataStrategy_INSERT_NAME_DESCRIPTION;
+ // final String PARAM_NAME_DESCRIPTION =
+ // Messages.MDExternalMetadataStrategy_PARAM_NAME_DESCRIPTION;
+ // final String PARAM_VALUE_DESCRIPTION =
+ // Messages.MDExternalMetadataStrategy_PARAM_VALUE_DESCRIPTION;
+ // final String REPEAT_VAR_DESCRIPTION =
+ // Messages.MDExternalMetadataStrategy_REPEAT_VAR_DESCRIPTION;
+ // final String REPEAT_VALUE_DESCRIPTION =
+ // Messages.MDExternalMetadataStrategy_REPEAT_VALUE_DESCRIPTION;
+
+ final Map<String, InternalNamedNodeMap> map = new HashMap<String, InternalNamedNodeMap>();
+ // component
+ // InternalNamedNodeMap nodeMap = new InternalNamedNodeMap();
+ // nodeMap.add(createAttribute(ID, CMAttributeDeclaration.OPTIONAL,
+ // ID_DESCRIPTION));
+ // nodeMap.add(createAttribute(BINDING, CMAttributeDeclaration.OPTIONAL,
+ // BINDING_DESCRIPTION));
+ // map.put(IFaceletTagConstants.TAG_COMPONENT, nodeMap);
+ //
+ // // composition
+ // nodeMap = new InternalNamedNodeMap();
+ // nodeMap.add(createAttribute(TEMPLATE,
+ // CMAttributeDeclaration.OPTIONAL,
+ // TEMPLATE_DESCRIPTION));
+ // map.put(IFaceletTagConstants.TAG_COMPOSITION, nodeMap);
+
+ // debug
+ // nodeMap = new InternalNamedNodeMap();
+ // nodeMap.add(createAttribute(HOTKEY, CMAttributeDeclaration.OPTIONAL,
+ // HOTKEY_DESCRIPTION));
+ // map.put(IFaceletTagConstants.TAG_DEBUG, nodeMap);
+
+ // decorate
+ // nodeMap = new InternalNamedNodeMap();
+ // nodeMap.add(createAttribute(TEMPLATE,
+ // CMAttributeDeclaration.REQUIRED,
+ // TEMPLATE_DESCRIPTION));
+ // map.put(IFaceletTagConstants.TAG_DECORATE, nodeMap);
+
+ // define
+ // nodeMap = new InternalNamedNodeMap();
+ // nodeMap.add(createAttribute(NAME, CMAttributeDeclaration.REQUIRED,
+ // DEFINE_NAME_DESCRIPTION));
+ // map.put(IFaceletTagConstants.TAG_DEFINE, nodeMap);
+
+ // fragment
+ // nodeMap = new InternalNamedNodeMap();
+ // nodeMap.add(createAttribute(ID, CMAttributeDeclaration.OPTIONAL,
+ // ID_DESCRIPTION));
+ // nodeMap.add(createAttribute(BINDING, CMAttributeDeclaration.OPTIONAL,
+ // BINDING_DESCRIPTION));
+ // map.put(IFaceletTagConstants.TAG_FRAGMENT, nodeMap);
+
+ // include
+ // nodeMap = new InternalNamedNodeMap();
+ // nodeMap.add(createAttribute(SRC, CMAttributeDeclaration.REQUIRED,
+ // SRC_DESCRIPTION));
+ // map.put(IFaceletTagConstants.TAG_INCLUDE, nodeMap);
+
+ // insert
+ // nodeMap = new InternalNamedNodeMap();
+ // nodeMap.add(createAttribute(NAME, CMAttributeDeclaration.OPTIONAL,
+ // INSERT_NAME_DESCRIPTION));
+ // map.put(IFaceletTagConstants.TAG_INSERT, nodeMap);
+
+ // param
+ // nodeMap = new InternalNamedNodeMap();
+ // nodeMap.add(createAttribute(NAME, CMAttributeDeclaration.REQUIRED,
+ // PARAM_NAME_DESCRIPTION));
+ // nodeMap.add(createAttribute(VALUE, CMAttributeDeclaration.REQUIRED,
+ // PARAM_VALUE_DESCRIPTION));
+ // map.put(IFaceletTagConstants.TAG_PARAM, nodeMap);
+
+ // remove
+ // nodeMap = new InternalNamedNodeMap();
+ // // no attributes
+ // map.put(IFaceletTagConstants.TAG_PARAM, nodeMap);
+
+ // repeat
+ // nodeMap = new InternalNamedNodeMap();
+ // nodeMap.add(createAttribute(VALUE, CMAttributeDeclaration.REQUIRED,
+ // REPEAT_VALUE_DESCRIPTION));
+ // nodeMap.add(createAttribute(VAR, CMAttributeDeclaration.REQUIRED,
+ // REPEAT_VAR_DESCRIPTION));
+ // map.put(IFaceletTagConstants.TAG_REPEAT, nodeMap);
+
+ _faceletData = Collections.unmodifiableMap(map);
+ }
+
+ private static CMAttributeDeclaration createAttribute(
+ final AttributeData attributeData)
+ {
+ final AttributeCMAdapter attribute = new AttributeCMAdapter(
+ attributeData.getName(), convertUsageEnum(attributeData
+ .getUsage()));
+
+ final ComposedAdapterFactory factory = new ComposedAdapterFactory(
+ ComposedAdapterFactory.Descriptor.Registry.INSTANCE);
+
+ final Object provider = factory.adapt(attributeData,
+ IResourceProvider.class);
+
+ // get the description from meta-data and feed through the provider
+ // for possible translation
+ String description = attributeData.getDescription();
+
+ if (provider instanceof IResourceProvider)
+ {
+ final IResourceProvider resProvider = (IResourceProvider) provider;
+ final String translated = resProvider.getTranslatedString(
+ attributeData, AddTagMDPackage.eINSTANCE
+ .getAttributeData_Description());
+ description = translated != null ? translated : description;
+ }
+
+ attribute.setDescription(description);
+ return attribute;
+ }
+
+ private static int convertUsageEnum(final AttributeUsage usage)
+ {
+ switch (usage)
+ {
+ case OPTIONAL:
+ return CMAttributeDeclaration.OPTIONAL;
+ case REQUIRED:
+ return CMAttributeDeclaration.REQUIRED;
+ case FIXED:
+ return CMAttributeDeclaration.FIXED;
+ case PROHIBITED:
+ return CMAttributeDeclaration.PROHIBITED;
+ default:
+ return CMAttributeDeclaration.OPTIONAL;
+ }
+ }
+
+ private static class MySingletonManager
+ extends
+ ResourceSingletonObjectManager<MDExternalMetadataStrategy, IProject>
+ {
+
+ @Override
+ protected MDExternalMetadataStrategy createNewInstance(
+ final IProject resource)
+ {
+ return new MDExternalMetadataStrategy(resource);
+ }
+
+ }
+}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/cm/strategy/Messages.java b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/cm/strategy/Messages.java
new file mode 100644
index 000000000..8105851ff
--- /dev/null
+++ b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/cm/strategy/Messages.java
@@ -0,0 +1,56 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Oracle Corporation.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Cameron Bateman - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jst.jsf.facelet.core.internal.cm.strategy;
+
+import org.eclipse.osgi.util.NLS;
+
+/**
+ *
+ * @author cbateman
+ *
+ */
+/*package*/ class Messages extends NLS
+{
+ private static final String BUNDLE_NAME = "org.eclipse.jst.jsf.facelet.core.internal.cm.strategy.messages"; //$NON-NLS-1$
+
+
+ public static String JSPExternalMetadataStrategy_DisplayName;
+
+
+ /**
+ * Display name for MDExternalMetadataStrategy
+ */
+ public static String MDExternalMetadataStrategy_DisplayName;
+
+ public static String MDExternalMetadataStrategy_BINDING_DESCRIPTION;
+ public static String MDExternalMetadataStrategy_DEFINE_NAME_DESCRIPTION;
+ public static String MDExternalMetadataStrategy_HOTKEY_DESCRIPTION;
+ public static String MDExternalMetadataStrategy_ID_DESCRIPTION;
+ public static String MDExternalMetadataStrategy_INSERT_NAME_DESCRIPTION;
+ public static String MDExternalMetadataStrategy_PARAM_NAME_DESCRIPTION;
+ public static String MDExternalMetadataStrategy_PARAM_VALUE_DESCRIPTION;
+ public static String MDExternalMetadataStrategy_REPEAT_VALUE_DESCRIPTION;
+ public static String MDExternalMetadataStrategy_REPEAT_VAR_DESCRIPTION;
+ public static String MDExternalMetadataStrategy_SRC_DESCRIPTION;
+ public static String MDExternalMetadataStrategy_TEMPLATE_DESCRIPTION;
+
+
+ static
+ {
+ // initialize resource bundle
+ NLS.initializeMessages(BUNDLE_NAME, Messages.class);
+ }
+
+ private Messages()
+ {
+ // no external instantiation
+ }
+}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/cm/strategy/TagInfoStrategyComposite.java b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/cm/strategy/TagInfoStrategyComposite.java
new file mode 100644
index 000000000..ffdcacd72
--- /dev/null
+++ b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/cm/strategy/TagInfoStrategyComposite.java
@@ -0,0 +1,78 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Oracle Corporation.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Cameron Bateman - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jst.jsf.facelet.core.internal.cm.strategy;
+
+import java.util.Collection;
+import java.util.Iterator;
+
+import org.eclipse.jst.jsf.common.dom.TagIdentifier;
+import org.eclipse.jst.jsf.common.internal.policy.IdentifierOrderedIteratorPolicy;
+import org.eclipse.jst.jsf.common.internal.strategy.IteratorPolicyBasedStrategyComposite;
+import org.eclipse.jst.jsf.facelet.core.internal.cm.ExternalTagInfo;
+
+/**
+ * A composite of strategies for deriving external tag metadata.
+ *
+ * @author cbateman
+ *
+ */
+public class TagInfoStrategyComposite
+ extends
+ IteratorPolicyBasedStrategyComposite<TagIdentifier, ExternalTagInfo, ExternalTagInfo, String, IExternalMetadataStrategy>
+{
+ private final Iterable<String> _policyOrder;
+
+ /**
+ * @param policyOrder
+ */
+ public TagInfoStrategyComposite(final Iterable<String> policyOrder)
+ {
+ super(new MyIteratorPolicy(policyOrder));
+ _policyOrder = policyOrder;
+ }
+
+ @Override
+ public ExternalTagInfo getNoResult()
+ {
+ return ExternalTagInfo.NULL_INSTANCE;
+ }
+
+ /**
+ *
+ */
+ public void resetIterator()
+ {
+ setPolicy(new MyIteratorPolicy(_policyOrder));
+ }
+
+ private static class MyIteratorPolicy extends
+ IdentifierOrderedIteratorPolicy<String>
+ {
+ private Iterator<String> _iterator;
+
+ public MyIteratorPolicy(final Iterable<String> policyOrder)
+ {
+ super(policyOrder);
+ setExcludeNonExplicitValues(true);
+ }
+
+ @Override
+ public Iterator<String> getIterator(
+ final Collection<String> forCollection)
+ {
+ if (_iterator == null)
+ {
+ _iterator = super.getIterator(forCollection);
+ }
+ return _iterator;
+ }
+ }
+}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/cm/strategy/messages.properties b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/cm/strategy/messages.properties
new file mode 100644
index 000000000..8cbba2514
--- /dev/null
+++ b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/cm/strategy/messages.properties
@@ -0,0 +1,13 @@
+JSPExternalMetadataStrategy_DisplayName=JSP TLD meta-data
+MDExternalMetadataStrategy_DisplayName=Tag meta-data from MD framework
+MDExternalMetadataStrategy_BINDING_DESCRIPTION=A method binding of the form of the form \#{bean.binding} where 'binding' has the signature <b>UIComponent binding()</b>, that returns the component instance to use. If not present, Facelets will automatically instantiate one.
+MDExternalMetadataStrategy_DEFINE_NAME_DESCRIPTION=The name of a template area. This name is referenced in instance documents using the insert tag
+MDExternalMetadataStrategy_HOTKEY_DESCRIPTION=The key in combination with CTRL-SHIFT to use to launch the debug viewer
+MDExternalMetadataStrategy_ID_DESCRIPTION=Assign a unique idea to generated component. If not present, Facelets will automatically generate one.
+MDExternalMetadataStrategy_INSERT_NAME_DESCRIPTION=The name of a template area to insert (defined in the template using the define tag). If not specified, the entire template will be inserted.
+MDExternalMetadataStrategy_PARAM_NAME_DESCRIPTION=The name of the new EL variable to declare
+MDExternalMetadataStrategy_PARAM_VALUE_DESCRIPTION=The literal or EL value to assign to the new variable
+MDExternalMetadataStrategy_REPEAT_VALUE_DESCRIPTION=The EL expression used to derive the list of items to repeat over
+MDExternalMetadataStrategy_REPEAT_VAR_DESCRIPTION=The name of the EL variable to use as the iterator
+MDExternalMetadataStrategy_SRC_DESCRIPTION=The path, absolute or relative to the original request, to another Facelet to include. May be EL. e.g. 'headerPage.xhtml'
+MDExternalMetadataStrategy_TEMPLATE_DESCRIPTION=A uri that points to the template to use. e.g. /WEB-INF/templates/mytemplate.xhtml
diff --git a/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/facet/ChangeActionType.java b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/facet/ChangeActionType.java
new file mode 100644
index 000000000..334897631
--- /dev/null
+++ b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/facet/ChangeActionType.java
@@ -0,0 +1,31 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Oracle Corporation.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Cameron Bateman - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jst.jsf.facelet.core.internal.facet;
+
+/**
+ * Indicates the type of change that should be made with the data in a
+ * FacetChangeModel.
+ *
+ * @author cbateman
+ *
+ */
+public enum ChangeActionType
+{
+ /**
+ * Change is to add indicated values
+ */
+ ADD,
+
+ /**
+ * Change is to remove indicated values
+ */
+ REMOVE
+}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/facet/FaceletChangeDelegate.java b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/facet/FaceletChangeDelegate.java
new file mode 100644
index 000000000..84a5bb203
--- /dev/null
+++ b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/facet/FaceletChangeDelegate.java
@@ -0,0 +1,160 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Oracle Corporation.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Cameron Bateman - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jst.jsf.facelet.core.internal.facet;
+
+import java.util.Iterator;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.emf.common.util.EList;
+import org.eclipse.jst.jsf.facelet.core.internal.FaceletCoreTraceOptions;
+import org.eclipse.jst.jsf.facesconfig.emf.ApplicationType;
+import org.eclipse.jst.jsf.facesconfig.emf.FacesConfigType;
+import org.eclipse.jst.jsf.facesconfig.emf.ViewHandlerType;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.wst.common.project.facet.core.IDelegate;
+import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
+
+/**
+ * The super-class of all Facelet facet change delegates. The only expected
+ * delegates at this time are install and uninstall. Each super-class must
+ * decide the meaning of "change" and implement the abstract members
+ * appropriately.
+ *
+ * @author cbateman
+ *
+ */
+public abstract class FaceletChangeDelegate implements IDelegate
+{
+ /**
+ * The default name of the Facelet runtime view handler
+ */
+ protected static final String RUNTIME_VIEWHANDLER_CLASS_NAME = "com.sun.facelets.FaceletViewHandler"; //$NON-NLS-1$
+
+ public void execute(final IProject project, final IProjectFacetVersion fv,
+ final Object config, final IProgressMonitor monitor)
+ throws CoreException
+ {
+ PlatformUI.getWorkbench().getDisplay().syncExec(new Runnable()
+ {
+ public void run()
+ {
+ final FacetChangeModel model = (FacetChangeModel) config;
+
+ // XXX: look at glassfish changes
+ handleDesignTimeViewHandler(project);
+
+ if (model.isChgViewHandler())
+ {
+ maybeChangeFaceletViewHandler(project, monitor);
+ }
+
+ final WebAppConfigurator configurator = WebAppConfigurator
+ .getConfigurator(project);
+
+ if (configurator != null)
+ {
+ maybeChangeDefaultSuffix(model, configurator);
+ maybeChangeConfigureListener(model, configurator);
+ maybeChangeWebLifecycleListener(model, configurator);
+ }
+ else if (FaceletCoreTraceOptions.TRACE_FACETCHANGEDELEGATE)
+ {
+ FaceletCoreTraceOptions
+ .log("FaceletChangeDelegate: No web configurator"); //$NON-NLS-1$
+ }
+ }
+ });
+ }
+
+ /**
+ * Performs the change to the web lifecycle listener configuration of of the
+ * web.xml model using configurator, if applicable.
+ *
+ * @param model
+ * @param configurator
+ */
+ protected abstract void maybeChangeWebLifecycleListener(
+ FacetChangeModel model, WebAppConfigurator configurator);
+
+ /**
+ * Performs the change to the configure listener configuration of the
+ * web.xml model using configurator, if applicable.
+ *
+ * @param model
+ * @param configurator
+ */
+ protected abstract void maybeChangeConfigureListener(
+ FacetChangeModel model, WebAppConfigurator configurator);
+
+ /**
+ * Performs the change to the DEFAULT_SUFFIX configuration of the web.xml
+ * model using configurator, if applicable.
+ *
+ * @param model
+ * @param configurator
+ */
+ protected abstract void maybeChangeDefaultSuffix(FacetChangeModel model,
+ WebAppConfigurator configurator);
+
+ /**
+ * Changes the runtime view handler settings on project if applicable.
+ *
+ * @param project
+ * @param monitor
+ *
+ */
+ protected abstract void maybeChangeFaceletViewHandler(IProject project,
+ IProgressMonitor monitor);
+
+ /**
+ * Change the designtime view handler if applicable.
+ *
+ * @param project
+ */
+ protected abstract void handleDesignTimeViewHandler(final IProject project);
+
+ /**
+ * @return a user displayable name of the sub-classing change delegate.
+ */
+ protected abstract String getDisplayName();
+
+ /**
+ * @param root
+ * @return true if the Facelet view handler is already present in the
+ * WEB-INF/faces-config.xml file.
+ */
+ protected final boolean isViewHandlerPresent(final FacesConfigType root)
+ {
+ final EList<?> applications = root.getApplication();
+ for (final Object name : applications)
+ {
+ final ApplicationType app = (ApplicationType) name;
+ if (app != null)
+ {
+ for (final Iterator<?> viewIt = app.getViewHandler().iterator(); viewIt
+ .hasNext();)
+ {
+ final ViewHandlerType viewHandler = (ViewHandlerType) viewIt
+ .next();
+ if (viewHandler != null
+ && RUNTIME_VIEWHANDLER_CLASS_NAME
+ .equals(viewHandler.getTextContent().trim()))
+ {
+ return true;
+ }
+ }
+ }
+ }
+ return false;
+ }
+}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/facet/FaceletFacet.java b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/facet/FaceletFacet.java
new file mode 100644
index 000000000..ed425a425
--- /dev/null
+++ b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/facet/FaceletFacet.java
@@ -0,0 +1,96 @@
+package org.eclipse.jst.jsf.facelet.core.internal.facet;
+
+import java.util.Iterator;
+import java.util.Set;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.jst.jsf.core.internal.JSFCorePlugin;
+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;
+
+/**
+ * Facelet facet constants and utilities
+ * @author cbateman
+ *
+ */
+public final class FaceletFacet
+{
+ /**
+ * Facelet facet id
+ */
+ public final static String FACET_ID = "jsf.facelet"; //$NON-NLS-1$
+ /**
+ * The id of the Facelet HTML view handler
+ */
+ public final static String VIEW_HANDLER_ID = "org.eclipse.jst.jsf.facelet.core.html.viewhandler"; //$NON-NLS-1$
+ static final String COM_SUN_FACES_APPLICATION_WEBAPP_LIFECYCLE_LISTENER = "com.sun.faces.application.WebappLifecycleListener"; //$NON-NLS-1$
+ static final String COM_SUN_FACES_CONFIG_CONFIGURE_LISTENER = "com.sun.faces.config.ConfigureListener"; //$NON-NLS-1$
+ static final String XHTML = ".xhtml"; //$NON-NLS-1$
+ static final String JAVAX_FACES_DEFAULT_SUFFIX = "javax.faces.DEFAULT_SUFFIX"; //$NON-NLS-1$
+
+ private FaceletFacet()
+ {
+ // no external instantiation
+ }
+
+ /**
+ * @param project
+ * @return true if projec has the facelet facet installed.
+ */
+ public static boolean hasFacet(final IProject project)
+ {
+ final IProjectFacetVersion facetVersion = getProjectFacet(project);
+
+ if (facetVersion != null)
+ {
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * Get the facet version for the project
+ *
+ * @param project
+ * @return the project facet version or null if could not be found or if
+ * project is not accessible
+ */
+ @SuppressWarnings("unchecked")
+ public static IProjectFacetVersion getProjectFacet(final IProject project)
+ {
+ // check for null or inaccessible project
+ if (project != null && project.isAccessible())
+ {
+ // check for Facelet facet on project
+ try
+ {
+ final IFacetedProject facetedProject = ProjectFacetsManager
+ .create(project);
+ if (facetedProject != null)
+ {
+ final Set projectFacets = facetedProject.getProjectFacets();
+ final Iterator itProjectFacets = projectFacets.iterator();
+ while (itProjectFacets.hasNext())
+ {
+ final IProjectFacetVersion projectFacetVersion = (IProjectFacetVersion) itProjectFacets
+ .next();
+ if (FACET_ID.equals(projectFacetVersion
+ .getProjectFacet().getId()))
+ {
+ return projectFacetVersion;
+ }
+ }
+ }
+ }
+ catch (final CoreException ce)
+ {
+ // log error
+ JSFCorePlugin.log(IStatus.ERROR, ce.getLocalizedMessage(), ce);
+ }
+ }
+ return null;
+ }
+}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/facet/FaceletFacetChangeDataModelProvider.java b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/facet/FaceletFacetChangeDataModelProvider.java
new file mode 100644
index 000000000..f987c6aac
--- /dev/null
+++ b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/facet/FaceletFacetChangeDataModelProvider.java
@@ -0,0 +1,108 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Oracle Corporation.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Cameron Bateman - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jst.jsf.facelet.core.internal.facet;
+
+import java.beans.BeanInfo;
+import java.beans.IntrospectionException;
+import java.beans.Introspector;
+import java.beans.PropertyDescriptor;
+import java.util.Set;
+
+import org.eclipse.jst.jsf.facelet.core.internal.FaceletCorePlugin;
+import org.eclipse.wst.common.componentcore.datamodel.FacetInstallDataModelProvider;
+
+/**
+ * The base data model provider for the facet install/uninstall
+ *
+ * @author cbateman
+ *
+ */
+public abstract class FaceletFacetChangeDataModelProvider extends
+FacetInstallDataModelProvider
+{
+ /**
+ * Change key identifier for web app lifecycle listener
+ */
+ protected static final String CHG_WEB_APP_LIFECYCLE_LISTENER = "chgWebAppLifecycleListener"; //$NON-NLS-1$
+ /**
+ * Change key identifier for configure listener
+ */
+ protected static final String CHG_CONFIGURE_LISTENER = "chgConfigureListener"; //$NON-NLS-1$
+ /**
+ * Change key identifier for the Facelet runtime view handler
+ */
+ protected static final String CHG_VIEW_HANDLER = "chgViewHandler"; //$NON-NLS-1$
+ /**
+ * Change key identifier for the default suffix
+ */
+ protected static final String CHG_DEFAULT_SUFFIX = "chgDefaultSuffix"; //$NON-NLS-1$
+
+ private BeanInfo _beanInfo;
+
+ /**
+ *
+ */
+ public FaceletFacetChangeDataModelProvider()
+ {
+ try
+ {
+ _beanInfo = Introspector.getBeanInfo(FacetInstallModel.class);
+ }
+ catch (final IntrospectionException e)
+ {
+ // TODO: suppress for now
+ FaceletCorePlugin.log("Problem getting bean info for FacetInstallModel", e); //$NON-NLS-1$
+ }
+ }
+
+ @Override
+ public Object create()
+ {
+ final FacetChangeModel model_ = createChangeModel();
+
+ model_
+ .setChgDefaultSuffix(((Boolean) getDefaultProperty(CHG_DEFAULT_SUFFIX)).booleanValue());
+ model_.setChgViewHandler(((Boolean) getDefaultProperty(CHG_VIEW_HANDLER)).booleanValue());
+ model_
+ .setChgConfigureListener(((Boolean) getDefaultProperty(CHG_CONFIGURE_LISTENER)).booleanValue());
+ model_
+ .setChgWebAppLifecycleListener(((Boolean) getDefaultProperty(CHG_WEB_APP_LIFECYCLE_LISTENER)).booleanValue());
+
+ return model_;
+ }
+
+ /**
+ * @return the change model to be used by the delegate.
+ */
+ protected abstract FacetChangeModel createChangeModel();
+
+ /**
+ * Set the default property value
+ */
+ @Override
+ public Object getDefaultProperty(final String propertyName)
+ {
+ return super.getDefaultProperty(propertyName);
+ }
+
+ @SuppressWarnings("unchecked")
+ @Override
+ public Set getPropertyNames()
+ {
+ final Set<String> propSet = super.getPropertyNames();
+ final PropertyDescriptor[] props = _beanInfo.getPropertyDescriptors();
+ for (final PropertyDescriptor prop : props)
+ {
+ propSet.add(prop.getName());
+ }
+ return propSet;
+ }
+}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/facet/FaceletFacetDefaultVersionProvider.java b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/facet/FaceletFacetDefaultVersionProvider.java
new file mode 100644
index 000000000..fd39d6024
--- /dev/null
+++ b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/facet/FaceletFacetDefaultVersionProvider.java
@@ -0,0 +1,34 @@
+package org.eclipse.jst.jsf.facelet.core.internal.facet;
+
+import org.eclipse.wst.common.project.facet.core.IDefaultVersionProvider;
+import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
+import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
+
+/**
+ * Provides the default Facelet project facet version. Currently always returns
+ * "1.1" facet version.
+ */
+public final class FaceletFacetDefaultVersionProvider implements
+ IDefaultVersionProvider
+{
+
+ /**
+ * The global id for the Facelet facet
+ */
+ private static final String DEFAULT_FACET_ID = FaceletFacet.FACET_ID;
+
+ private static final String DEFAULT_FACET_VERSION = "1.0"; //$NON-NLS-1$
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.wst.common.project.facet.core.IDefaultVersionProvider#getDefaultVersion()
+ */
+
+ public IProjectFacetVersion getDefaultVersion()
+ {
+ return ProjectFacetsManager.getProjectFacet(DEFAULT_FACET_ID)
+ .getVersion(DEFAULT_FACET_VERSION);
+ }
+
+}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/facet/FaceletFacetInstallDataModelProvider.java b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/facet/FaceletFacetInstallDataModelProvider.java
new file mode 100644
index 000000000..25ac2aafe
--- /dev/null
+++ b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/facet/FaceletFacetInstallDataModelProvider.java
@@ -0,0 +1,39 @@
+package org.eclipse.jst.jsf.facelet.core.internal.facet;
+
+
+/**
+ * The data model provider for the facet install.
+ *
+ * @author cbateman
+ *
+ */
+public class FaceletFacetInstallDataModelProvider extends FaceletFacetChangeDataModelProvider
+{
+ @Override
+ public Object getDefaultProperty(final String propertyName)
+ {
+ if (propertyName.equals(CHG_DEFAULT_SUFFIX))
+ {
+ return Boolean.TRUE;
+ }
+ else if (propertyName.equals(CHG_VIEW_HANDLER))
+ {
+ return Boolean.TRUE;
+ }
+ else if (propertyName.equals(CHG_CONFIGURE_LISTENER))
+ {
+ return Boolean.FALSE;
+ }
+ else if (propertyName.equals(CHG_WEB_APP_LIFECYCLE_LISTENER))
+ {
+ return Boolean.FALSE;
+ }
+ return super.getDefaultProperty(propertyName);
+ }
+
+ @Override
+ protected FacetChangeModel createChangeModel()
+ {
+ return new FacetInstallModel();
+ }
+}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/facet/FaceletFacetUninstallModelProvider.java b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/facet/FaceletFacetUninstallModelProvider.java
new file mode 100644
index 000000000..e17e0710d
--- /dev/null
+++ b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/facet/FaceletFacetUninstallModelProvider.java
@@ -0,0 +1,49 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Oracle Corporation.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Cameron Bateman - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jst.jsf.facelet.core.internal.facet;
+
+
+/**
+ * The data model provider for facet uninstall.
+ *
+ * @author cbateman
+ *
+ */
+public class FaceletFacetUninstallModelProvider extends FaceletFacetChangeDataModelProvider
+{
+ @Override
+ public Object getDefaultProperty(final String propertyName)
+ {
+ if (propertyName.equals(CHG_DEFAULT_SUFFIX))
+ {
+ return Boolean.FALSE;
+ }
+ else if (propertyName.equals(CHG_VIEW_HANDLER))
+ {
+ return Boolean.FALSE;
+ }
+ else if (propertyName.equals(CHG_CONFIGURE_LISTENER))
+ {
+ return Boolean.FALSE;
+ }
+ else if (propertyName.equals(CHG_WEB_APP_LIFECYCLE_LISTENER))
+ {
+ return Boolean.FALSE;
+ }
+ return super.getDefaultProperty(propertyName);
+ }
+
+ @Override
+ protected FacetChangeModel createChangeModel()
+ {
+ return new FaceletUninstallModel();
+ }
+}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/facet/FaceletInstallDelegate.java b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/facet/FaceletInstallDelegate.java
new file mode 100644
index 000000000..64eb0ee65
--- /dev/null
+++ b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/facet/FaceletInstallDelegate.java
@@ -0,0 +1,234 @@
+package org.eclipse.jst.jsf.facelet.core.internal.facet;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.emf.common.util.EList;
+import org.eclipse.jst.jsf.designtime.DesignTimeApplicationManager;
+import org.eclipse.jst.jsf.facelet.core.internal.FaceletCoreTraceOptions;
+import org.eclipse.jst.jsf.facesconfig.emf.ApplicationType;
+import org.eclipse.jst.jsf.facesconfig.emf.FacesConfigFactory;
+import org.eclipse.jst.jsf.facesconfig.emf.FacesConfigType;
+import org.eclipse.jst.jsf.facesconfig.emf.ViewHandlerType;
+import org.eclipse.jst.jsf.facesconfig.util.FacesConfigArtifactEdit;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
+
+/**
+ * The facet installing delegate for Facelets.
+ *
+ * @author cbateman
+ *
+ */
+public class FaceletInstallDelegate extends FaceletChangeDelegate
+{
+
+ @Override
+ public void execute(final IProject project, final IProjectFacetVersion fv,
+ final Object config, final IProgressMonitor monitor)
+ throws CoreException
+ {
+ final FacetChangeModel model = (FacetChangeModel) config;
+ if (FaceletCoreTraceOptions.TRACE_FACETINSTALLDELEGATE)
+ {
+ FaceletCoreTraceOptions.log("Installing facet on project: " //$NON-NLS-1$
+ + project.getName());
+
+ FaceletCoreTraceOptions.log(String.format(
+ "FaceletInstallDelegate: Add default selection %b", //$NON-NLS-1$
+ Boolean.valueOf(model.isChgDefaultSuffix())));
+ FaceletCoreTraceOptions
+ .log(String
+ .format(
+ "FaceletInstallDelegate: Add view handler %b", Boolean.valueOf(model //$NON-NLS-1$
+ .isChgViewHandler())));
+ FaceletCoreTraceOptions.log(String.format(
+ "FaceletInstallDelegate: Add configure listener %b", //$NON-NLS-1$
+ Boolean.valueOf(model.isChgConfigureListener())));
+ FaceletCoreTraceOptions
+ .log(String
+ .format(
+ "FaceletInstallDelegate: Add web app lifecycle listener %b", //$NON-NLS-1$
+ Boolean.valueOf(model
+ .isChgWebAppLifecycleListener())));
+ }
+
+ try
+ {
+ if (monitor != null)
+ {
+ monitor.beginTask("Installing facelet facet", 1); //$NON-NLS-1$
+ }
+
+ super.execute(project, fv, config, monitor);
+ }
+ finally
+ {
+ if (monitor != null)
+ {
+ monitor.done();
+ }
+ }
+ }
+
+ /**
+ * Install the facelet view handler in the WEB-INF/faces-config file if not
+ * already present.
+ *
+ * @param project
+ * @param monitor
+ */
+ @Override
+ protected void maybeChangeFaceletViewHandler(final IProject project,
+ final IProgressMonitor monitor)
+ {
+ if (FaceletCoreTraceOptions.TRACE_FACETINSTALLDELEGATE)
+ {
+ FaceletCoreTraceOptions
+ .log("FaceletInstallDelegate: Installing facelet view handler"); //$NON-NLS-1$
+ }
+
+ final FacesConfigArtifactEdit edit = FacesConfigArtifactEdit
+ .getFacesConfigArtifactEditForWrite(project,
+ "WEB-INF/faces-config.xml"); //$NON-NLS-1$
+ if (edit != null)
+ {
+ try
+ {
+ final FacesConfigType root = edit.getFacesConfig();
+ if (!isViewHandlerPresent(root))
+ {
+ if (FaceletCoreTraceOptions.TRACE_FACETINSTALLDELEGATE)
+ {
+ FaceletCoreTraceOptions
+ .log("FaceletInstallDelegate: View Handler not already found in faces-config"); //$NON-NLS-1$
+ }
+
+ PlatformUI.getWorkbench().getDisplay().syncExec(
+ new TempSafeUpdateFacesConfigOnUIThread(edit,
+ monitor));
+
+ if (FaceletCoreTraceOptions.TRACE_FACETINSTALLDELEGATE)
+ {
+ FaceletCoreTraceOptions
+ .log("FaceletInstallDelegate: Saved changes for facelet view handler"); //$NON-NLS-1$
+ }
+ }
+ else
+ {
+ if (FaceletCoreTraceOptions.TRACE_FACETINSTALLDELEGATE)
+ {
+ FaceletCoreTraceOptions
+ .log("FaceletInstallDelegate: View Handler NOT already found in faces-config; not adding"); //$NON-NLS-1$
+ }
+ }
+ }
+ finally
+ {
+ edit.dispose();
+ }
+ }
+ }
+
+ private static class TempSafeUpdateFacesConfigOnUIThread implements
+ Runnable
+ {
+ private final FacesConfigArtifactEdit _edit;
+ private final IProgressMonitor _monitor;
+
+ public TempSafeUpdateFacesConfigOnUIThread(
+ final FacesConfigArtifactEdit edit,
+ final IProgressMonitor monitor)
+ {
+ _edit = edit;
+ _monitor = monitor;
+ }
+
+ @SuppressWarnings("unchecked")
+ public void run()
+ {
+
+ final FacesConfigType root = _edit.getFacesConfig();
+ final EList applications = root.getApplication();
+ ApplicationType application = null;
+ if (applications.size() > 0)
+ {
+ application = (ApplicationType) applications.get(0);
+ }
+ else
+ {
+ application = FacesConfigFactory.eINSTANCE
+ .createApplicationType();
+ applications.add(application);
+ }
+ final ViewHandlerType viewHandlerType = FacesConfigFactory.eINSTANCE
+ .createViewHandlerType();
+ viewHandlerType.setTextContent(RUNTIME_VIEWHANDLER_CLASS_NAME);
+ application.getViewHandler().add(viewHandlerType);
+ _edit.save(_monitor);
+ }
+ }
+
+ @Override
+ protected void handleDesignTimeViewHandler(final IProject project)
+ {
+ final DesignTimeApplicationManager manager = DesignTimeApplicationManager
+ .getInstance(project);
+
+ manager.setViewHandlerId(FaceletFacet.VIEW_HANDLER_ID);
+ }
+
+ @Override
+ protected String getDisplayName()
+ {
+ return Messages.FaceletInstallDelegate_FACET_INSTALLER_DELEGATE_DISPLAY_NAME;
+ }
+
+ @Override
+ protected void maybeChangeDefaultSuffix(final FacetChangeModel model,
+ final WebAppConfigurator configurator)
+ {
+ if (model.isChgDefaultSuffix())
+ {
+ if (FaceletCoreTraceOptions.TRACE_FACETINSTALLDELEGATE)
+ {
+ FaceletCoreTraceOptions
+ .log("FaceletInstallDelegate: Installing DEFAULT_SUFFIX"); //$NON-NLS-1$
+ }
+ configurator.addContextParam(FaceletFacet.JAVAX_FACES_DEFAULT_SUFFIX, FaceletFacet.XHTML,
+ false);
+ }
+ }
+
+ @Override
+ protected void maybeChangeConfigureListener(final FacetChangeModel model,
+ final WebAppConfigurator configurator)
+ {
+ if (model.isChgConfigureListener())
+ {
+ if (FaceletCoreTraceOptions.TRACE_FACETINSTALLDELEGATE)
+ {
+ FaceletCoreTraceOptions
+ .log("FaceletInstallDelegate: Install Configure Listener"); //$NON-NLS-1$
+ }
+ configurator.addListener(FaceletFacet.COM_SUN_FACES_CONFIG_CONFIGURE_LISTENER,
+ false);
+ }
+ }
+
+ @Override
+ protected void maybeChangeWebLifecycleListener(
+ final FacetChangeModel model, final WebAppConfigurator configurator)
+ {
+ if (model.isChgWebAppLifecycleListener())
+ {
+ if (FaceletCoreTraceOptions.TRACE_FACETINSTALLDELEGATE)
+ {
+ FaceletCoreTraceOptions
+ .log("FaceletInstallDelegate: Install WebappLifecycleListener"); //$NON-NLS-1$
+ }
+ configurator.addListener(
+ FaceletFacet.COM_SUN_FACES_APPLICATION_WEBAPP_LIFECYCLE_LISTENER, false);
+ }
+ }
+}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/facet/FaceletUninstallDelegate.java b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/facet/FaceletUninstallDelegate.java
new file mode 100644
index 000000000..3e0170e3a
--- /dev/null
+++ b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/facet/FaceletUninstallDelegate.java
@@ -0,0 +1,236 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Oracle Corporation.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Cameron Bateman - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jst.jsf.facelet.core.internal.facet;
+
+import java.util.Iterator;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.emf.common.util.EList;
+import org.eclipse.jst.jsf.designtime.DesignTimeApplicationManager;
+import org.eclipse.jst.jsf.facelet.core.internal.FaceletCoreTraceOptions;
+import org.eclipse.jst.jsf.facesconfig.emf.ApplicationType;
+import org.eclipse.jst.jsf.facesconfig.emf.FacesConfigType;
+import org.eclipse.jst.jsf.facesconfig.emf.ViewHandlerType;
+import org.eclipse.jst.jsf.facesconfig.util.FacesConfigArtifactEdit;
+import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
+
+/**
+ * The facet removal delegate for Facelets.
+ *
+ * @author cbateman
+ *
+ */
+public class FaceletUninstallDelegate extends FaceletChangeDelegate
+{
+
+ @Override
+ public void execute(final IProject project, final IProjectFacetVersion fv,
+ final Object config, final IProgressMonitor monitor)
+ throws CoreException
+ {
+ final FacetChangeModel model = (FacetChangeModel) config;
+ if (FaceletCoreTraceOptions.TRACE_FACETUNINSTALLDELEGATE)
+ {
+ FaceletCoreTraceOptions.log("Uninstalling facet on project: " //$NON-NLS-1$
+ + project.getName());
+
+ FaceletCoreTraceOptions.log(String.format(
+ "FaceletUninstallDelegate: Remove default selection %b", //$NON-NLS-1$
+ Boolean.valueOf(model.isChgDefaultSuffix())));
+ FaceletCoreTraceOptions
+ .log(String
+ .format(
+ "FaceletUninstallDelegate: Remove view handler %b", Boolean.valueOf(model //$NON-NLS-1$
+ .isChgViewHandler())));
+ FaceletCoreTraceOptions.log(String.format(
+ "FaceletUninstallDelegate: Remove configure listener %b", //$NON-NLS-1$
+ Boolean.valueOf(model.isChgConfigureListener())));
+ FaceletCoreTraceOptions
+ .log(String
+ .format(
+ "FaceletUninstallDelegate: Remove web app lifecycle listener %b", //$NON-NLS-1$
+ Boolean.valueOf(model
+ .isChgWebAppLifecycleListener())));
+ }
+
+ try
+ {
+ if (monitor != null)
+ {
+ monitor.beginTask("Uninstalling facelet facet", 1); //$NON-NLS-1$
+ }
+
+ super.execute(project, fv, config, monitor);
+ }
+ finally
+ {
+ if (monitor != null)
+ {
+ monitor.done();
+ }
+ }
+ }
+
+ /**
+ * Install the facelet view handler in the WEB-INF/faces-config file if not
+ * already present.
+ *
+ * @param project
+ * @param monitor
+ */
+ @SuppressWarnings("unchecked")
+ @Override
+ protected void maybeChangeFaceletViewHandler(final IProject project,
+ final IProgressMonitor monitor)
+ {
+ if (FaceletCoreTraceOptions.TRACE_FACETUNINSTALLDELEGATE)
+ {
+ FaceletCoreTraceOptions
+ .log("FaceletInstallDelegate: Uninstalling facelet view handler"); //$NON-NLS-1$
+ }
+
+ final FacesConfigArtifactEdit edit = FacesConfigArtifactEdit
+ .getFacesConfigArtifactEditForWrite(project,
+ "WEB-INF/faces-config.xml"); //$NON-NLS-1$
+ if (edit != null)
+ {
+ try
+ {
+ final FacesConfigType root = edit.getFacesConfig();
+ if (isViewHandlerPresent(root))
+ {
+ if (FaceletCoreTraceOptions.TRACE_FACETUNINSTALLDELEGATE)
+ {
+ FaceletCoreTraceOptions
+ .log("FaceletInstallDelegate: View Handler not already found in faces-config"); //$NON-NLS-1$
+ }
+ final EList applications = root.getApplication();
+
+ for (final Iterator<?> appIt = applications.iterator(); appIt
+ .hasNext();)
+ {
+ final ApplicationType application = (ApplicationType) appIt
+ .next();
+ for (final Iterator viewHandlerIt = application
+ .getViewHandler().iterator(); viewHandlerIt
+ .hasNext();)
+ {
+ final ViewHandlerType viewHandlerType = (ViewHandlerType) viewHandlerIt
+ .next();
+ if (viewHandlerType != null
+ && RUNTIME_VIEWHANDLER_CLASS_NAME
+ .equals(viewHandlerType
+ .getTextContent().trim()))
+ {
+ viewHandlerIt.remove();
+
+ if (FaceletCoreTraceOptions.TRACE_FACETUNINSTALLDELEGATE)
+ {
+ FaceletCoreTraceOptions
+ .log("FaceletUninstallDelegate: Removed runtime view handler"); //$NON-NLS-1$
+ }
+ }
+ }
+ }
+
+ edit.save(monitor);
+
+ if (FaceletCoreTraceOptions.TRACE_FACETUNINSTALLDELEGATE)
+ {
+ FaceletCoreTraceOptions
+ .log("FaceletUninstallDelegate: Saved changes for facelet view handler"); //$NON-NLS-1$
+ }
+ }
+ else
+ {
+ if (FaceletCoreTraceOptions.TRACE_FACETUNINSTALLDELEGATE)
+ {
+ FaceletCoreTraceOptions
+ .log("FaceletInstallDelegate: View Handler NOT already found in faces-config; not adding"); //$NON-NLS-1$
+ }
+ }
+ }
+ finally
+ {
+ edit.dispose();
+ }
+ }
+ }
+
+ @Override
+ protected void handleDesignTimeViewHandler(final IProject project)
+ {
+ final DesignTimeApplicationManager manager = DesignTimeApplicationManager
+ .getInstance(project);
+
+ // TODO: need this API
+ //manager.clearViewHandlerId();
+ manager.setViewHandlerId("org.eclipse.jst.jsf.designtime.view.jspviewhandler"); //$NON-NLS-1$
+ }
+
+ @Override
+ protected String getDisplayName()
+ {
+ return Messages.FaceletUninstallDelegate_FACET_INSTALLER_DELEGATE_DISPLAY_NAME;
+ }
+
+ @Override
+ protected void maybeChangeDefaultSuffix(final FacetChangeModel model,
+ final WebAppConfigurator configurator)
+ {
+ if (model.isChgDefaultSuffix())
+ {
+ if (FaceletCoreTraceOptions.TRACE_FACETUNINSTALLDELEGATE)
+ {
+ FaceletCoreTraceOptions
+ .log("FaceletUninstallDelegate: Removing DEFAULT_SUFFIX"); //$NON-NLS-1$
+ }
+ configurator
+ .removeContextParam(
+ FaceletFacet.JAVAX_FACES_DEFAULT_SUFFIX,
+ FaceletFacet.XHTML);
+ }
+ }
+
+ @Override
+ protected void maybeChangeConfigureListener(final FacetChangeModel model,
+ final WebAppConfigurator configurator)
+ {
+ if (model.isChgConfigureListener())
+ {
+ if (FaceletCoreTraceOptions.TRACE_FACETUNINSTALLDELEGATE)
+ {
+ FaceletCoreTraceOptions
+ .log("FaceletUninstallDelegate: Remove Configure Listener"); //$NON-NLS-1$
+ }
+ configurator
+ .removeListener(FaceletFacet.COM_SUN_FACES_CONFIG_CONFIGURE_LISTENER);
+ }
+ }
+
+ @Override
+ protected void maybeChangeWebLifecycleListener(
+ final FacetChangeModel model, final WebAppConfigurator configurator)
+ {
+ if (model.isChgWebAppLifecycleListener())
+ {
+ if (FaceletCoreTraceOptions.TRACE_FACETUNINSTALLDELEGATE)
+ {
+ FaceletCoreTraceOptions
+ .log("FaceletUninstallDelegate: Remove WebappLifecycleListener"); //$NON-NLS-1$
+ }
+ configurator
+ .removeListener(FaceletFacet.COM_SUN_FACES_APPLICATION_WEBAPP_LIFECYCLE_LISTENER);
+ }
+ }
+}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/facet/FaceletUninstallModel.java b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/facet/FaceletUninstallModel.java
new file mode 100644
index 000000000..c8b6d1907
--- /dev/null
+++ b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/facet/FaceletUninstallModel.java
@@ -0,0 +1,39 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Oracle Corporation.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Cameron Bateman - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jst.jsf.facelet.core.internal.facet;
+
+import java.beans.PropertyChangeListener;
+import java.beans.PropertyChangeSupport;
+
+/*package*/ class FaceletUninstallModel extends FacetChangeModel
+{
+ // default bean listeners
+ private final PropertyChangeSupport _changeSupport = new PropertyChangeSupport(
+ this);
+
+ public void addPropertyChangeListener(final String propertyName,
+ final PropertyChangeListener listener)
+ {
+ _changeSupport.addPropertyChangeListener(propertyName, listener);
+ }
+
+ public void removePropertyChangeListener(final String propertyName,
+ final PropertyChangeListener listener)
+ {
+ _changeSupport.removePropertyChangeListener(propertyName, listener);
+ }
+
+ @Override
+ public ChangeActionType getChangeActionType()
+ {
+ return ChangeActionType.REMOVE;
+ }
+} \ No newline at end of file
diff --git a/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/facet/FacetChangeModel.java b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/facet/FacetChangeModel.java
new file mode 100644
index 000000000..1235e3fa6
--- /dev/null
+++ b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/facet/FacetChangeModel.java
@@ -0,0 +1,95 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Oracle Corporation.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Cameron Bateman - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jst.jsf.facelet.core.internal.facet;
+
+/**
+ * Encapsulate configuration change data during facet install/uninstall
+ * @author cbateman
+ *
+ */
+public abstract class FacetChangeModel
+{
+ private boolean _chgDefaultSuffix;
+ private boolean _chgViewHandler;
+ private boolean _chgConfigureListener;
+ private boolean _chgWebAppLifecycleListener;
+
+ /**
+ * @return the type of change action
+ */
+ public abstract ChangeActionType getChangeActionType();
+
+ /**
+ * @return true if should change the runtime view handler configuration
+ */
+ public boolean isChgViewHandler()
+ {
+ return _chgViewHandler;
+ }
+
+ /**
+ * @param chgViewHandler
+ */
+ public void setChgViewHandler(final boolean chgViewHandler)
+ {
+ _chgViewHandler = chgViewHandler;
+ }
+
+ /**
+ * @return true if should change DEFAULT_SUFFIX option
+ */
+ public boolean isChgDefaultSuffix()
+ {
+ return _chgDefaultSuffix;
+ }
+
+ /**
+ * @param chgDefaultSuffix
+ */
+ public void setChgDefaultSuffix(final boolean chgDefaultSuffix)
+ {
+ _chgDefaultSuffix = chgDefaultSuffix;
+ }
+
+ /**
+ * @return true if should change the configure listener option
+ */
+ public boolean isChgConfigureListener()
+ {
+ return _chgConfigureListener;
+ }
+
+ /**
+ * @param chgConfigureListener
+ */
+ public void setChgConfigureListener(final boolean chgConfigureListener)
+ {
+ _chgConfigureListener = chgConfigureListener;
+ }
+
+ /**
+ * @return true if should change the webapp lifecycle listener option
+ */
+ public boolean isChgWebAppLifecycleListener()
+ {
+ return _chgWebAppLifecycleListener;
+ }
+
+ /**
+ * @param chgWebAppLifecycleListener
+ */
+ public void setChgWebAppLifecycleListener(
+ final boolean chgWebAppLifecycleListener)
+ {
+ _chgWebAppLifecycleListener = chgWebAppLifecycleListener;
+ }
+
+}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/facet/FacetInstallModel.java b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/facet/FacetInstallModel.java
new file mode 100644
index 000000000..aeac135f6
--- /dev/null
+++ b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/facet/FacetInstallModel.java
@@ -0,0 +1,29 @@
+package org.eclipse.jst.jsf.facelet.core.internal.facet;
+
+import java.beans.PropertyChangeListener;
+import java.beans.PropertyChangeSupport;
+
+/*package*/ class FacetInstallModel extends FacetChangeModel
+{
+ // default bean listeners
+ private final PropertyChangeSupport changeSupport = new PropertyChangeSupport(
+ this);
+
+ public void addPropertyChangeListener(final String propertyName,
+ final PropertyChangeListener listener)
+ {
+ changeSupport.addPropertyChangeListener(propertyName, listener);
+ }
+
+ public void removePropertyChangeListener(final String propertyName,
+ final PropertyChangeListener listener)
+ {
+ changeSupport.removePropertyChangeListener(propertyName, listener);
+ }
+
+ @Override
+ public ChangeActionType getChangeActionType()
+ {
+ return ChangeActionType.ADD;
+ }
+}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/facet/Messages.java b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/facet/Messages.java
new file mode 100644
index 000000000..b7e076ded
--- /dev/null
+++ b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/facet/Messages.java
@@ -0,0 +1,42 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Oracle Corporation.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Cameron Bateman - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jst.jsf.facelet.core.internal.facet;
+
+import org.eclipse.osgi.util.NLS;
+
+/**
+ * NLS message file
+ *
+ * @author cbateman
+ *
+ */
+public class Messages extends NLS
+{
+ private static final String BUNDLE_NAME = "org.eclipse.jst.jsf.facelet.core.internal.facet.messages"; //$NON-NLS-1$
+ /**
+ * see messages.properties
+ */
+ public static String FaceletInstallDelegate_FACET_INSTALLER_DELEGATE_DISPLAY_NAME;
+ /**
+ * see messages.properties
+ */
+ public static String FaceletUninstallDelegate_FACET_INSTALLER_DELEGATE_DISPLAY_NAME;
+ static
+ {
+ // initialize resource bundle
+ NLS.initializeMessages(BUNDLE_NAME, Messages.class);
+ }
+
+ private Messages()
+ {
+ // no external instantiation
+ }
+}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/facet/WebAppConfigurator.java b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/facet/WebAppConfigurator.java
new file mode 100644
index 000000000..f5de1e9de
--- /dev/null
+++ b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/facet/WebAppConfigurator.java
@@ -0,0 +1,394 @@
+package org.eclipse.jst.jsf.facelet.core.internal.facet;
+
+import java.util.Iterator;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.jst.j2ee.model.IModelProvider;
+import org.eclipse.jst.j2ee.model.ModelProviderManager;
+import org.eclipse.jst.jsf.facelet.core.internal.FaceletCorePlugin;
+
+/**
+ * Insulates caller from the insane J2EE/JavaEE dual model.
+ *
+ * @author cbateman
+ *
+ */
+public abstract class WebAppConfigurator
+{
+ /**
+ * @param project
+ * @return the configurator for project or null if none
+ */
+ public static WebAppConfigurator getConfigurator(final IProject project)
+ {
+ final IModelProvider provider = ModelProviderManager
+ .getModelProvider(project);
+ final Object webAppObj = provider.getModelObject();
+ if (webAppObj == null)
+ {
+ FaceletCorePlugin.log("Error getting web app configurator", //$NON-NLS-1$
+ new Throwable());
+ return null;
+ }
+
+ if (webAppObj instanceof org.eclipse.jst.javaee.web.WebApp)
+ {
+ return new JavaEEWebAppConfigurator(project);
+ }
+ else if (webAppObj instanceof org.eclipse.jst.j2ee.webapplication.WebApp)
+ {
+ return new J2EEWebAppConfigurator(project);
+ }
+
+ return null;
+ }
+
+ private final IProject _project;
+
+ WebAppConfigurator(final IProject project)
+ {
+ _project = project;
+ }
+
+ /**
+ * @param paramName
+ * @param paramValue
+ * @param addEvenIfPresent
+ */
+ public abstract void addContextParam(final String paramName,
+ final String paramValue, final boolean addEvenIfPresent);
+
+ /**
+ * @param paramName
+ * @param paramValue
+ */
+ public abstract void removeContextParam(final String paramName,
+ final String paramValue);
+
+ /**
+ * Adds the listenerClass to the webapp config. If addEventIfPresent is
+ * false, then it will not add it if it finds it already. If true, it will
+ * forcibly add.
+ *
+ * @param listenerClass
+ * @param addEvenIfPresent
+ */
+ public abstract void addListener(final String listenerClass,
+ final boolean addEvenIfPresent);
+
+ /**
+ * @param listenerClass
+ */
+ public abstract void removeListener(final String listenerClass);
+
+ /**
+ * @param runnable
+ */
+ protected void executeChange(final Runnable runnable)
+ {
+ final IPath webXMLPath = new Path("WEB-INF").append("web.xml"); //$NON-NLS-1$ //$NON-NLS-2$
+ final IModelProvider provider = ModelProviderManager
+ .getModelProvider(getProject());
+ provider.modify(runnable, webXMLPath);
+ }
+
+ /**
+ * @return the project
+ */
+ protected IProject getProject()
+ {
+ return _project;
+ }
+
+ @SuppressWarnings("unchecked")
+ private static class JavaEEWebAppConfigurator extends WebAppConfigurator
+ {
+ public JavaEEWebAppConfigurator(final IProject project)
+ {
+ super(project);
+ }
+
+ @Override
+ public void addContextParam(final String paramName,
+ final String paramValue, final boolean addEvenIfPresent)
+ {
+ final Runnable runnable = new Runnable()
+ {
+ public void run()
+ {
+ final org.eclipse.jst.javaee.web.WebApp webApp = (org.eclipse.jst.javaee.web.WebApp) ModelProviderManager
+ .getModelProvider(getProject()).getModelObject();
+ if (addEvenIfPresent
+ || !isContextParamPresent(webApp, paramName))
+ {
+ final org.eclipse.jst.javaee.core.ParamValue newParamValue = org.eclipse.jst.javaee.core.JavaeeFactory.eINSTANCE
+ .createParamValue();
+ newParamValue.setParamName(paramName);
+ newParamValue.setParamValue(paramValue);
+ webApp.getContextParams().add(newParamValue);
+ }
+ }
+ };
+ executeChange(runnable);
+ }
+
+ @Override
+ public void removeContextParam(final String paramName,
+ final String paramVal)
+ {
+ final Runnable runnable = new Runnable()
+ {
+ public void run()
+ {
+ final org.eclipse.jst.javaee.web.WebApp webApp = (org.eclipse.jst.javaee.web.WebApp) ModelProviderManager
+ .getModelProvider(getProject()).getModelObject();
+ for (final Iterator<?> it = webApp.getContextParams()
+ .iterator(); it.hasNext();)
+ {
+ final org.eclipse.jst.javaee.core.ParamValue paramValue = (org.eclipse.jst.javaee.core.ParamValue) it
+ .next();
+ if (paramName.equals(paramValue.getParamName().trim())
+ && paramVal.equals(paramValue.getParamValue()
+ .trim()))
+ {
+ it.remove();
+ }
+ }
+ }
+ };
+ executeChange(runnable);
+ }
+
+ private boolean isContextParamPresent(
+ final org.eclipse.jst.javaee.web.WebApp webApp,
+ final String paramName)
+ {
+ for (final Iterator<?> it = webApp.getContextParams().iterator(); it
+ .hasNext();)
+ {
+ final org.eclipse.jst.javaee.core.ParamValue paramValue = (org.eclipse.jst.javaee.core.ParamValue) it
+ .next();
+ if (paramName.equals(paramValue.getParamName().trim()))
+ {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ @Override
+ public void addListener(final String listenerClass,
+ final boolean addEvenIfPresent)
+ {
+ final Runnable runnable = new Runnable()
+ {
+ public void run()
+ {
+ final org.eclipse.jst.javaee.web.WebApp webApp = (org.eclipse.jst.javaee.web.WebApp) ModelProviderManager
+ .getModelProvider(getProject()).getModelObject();
+
+ if (addEvenIfPresent
+ || !isListenerPresent(webApp, listenerClass))
+ {
+ final org.eclipse.jst.javaee.core.Listener listener = org.eclipse.jst.javaee.core.JavaeeFactory.eINSTANCE
+ .createListener();
+ listener.setListenerClass(listenerClass);
+ webApp.getListeners().add(listener);
+ }
+ }
+ };
+ executeChange(runnable);
+ }
+
+ @Override
+ public void removeListener(final String listenerClass)
+ {
+ final Runnable runnable = new Runnable()
+ {
+ public void run()
+ {
+ final org.eclipse.jst.javaee.web.WebApp webApp = (org.eclipse.jst.javaee.web.WebApp) ModelProviderManager
+ .getModelProvider(getProject()).getModelObject();
+ for (final Iterator listenerIt = webApp.getListeners()
+ .iterator(); listenerIt.hasNext();)
+ {
+ final org.eclipse.jst.javaee.core.Listener listener = (org.eclipse.jst.javaee.core.Listener) listenerIt
+ .next();
+ if (listenerClass.equals(listener.getListenerClass()
+ .trim()))
+ {
+ listenerIt.remove();
+ }
+ }
+ }
+ };
+ executeChange(runnable);
+ }
+
+ private boolean isListenerPresent(
+ final org.eclipse.jst.javaee.web.WebApp webApp,
+ final String listenerClass)
+ {
+ for (final Iterator listenerIt = webApp.getListeners().iterator(); listenerIt
+ .hasNext();)
+ {
+ final org.eclipse.jst.javaee.core.Listener listener = (org.eclipse.jst.javaee.core.Listener) listenerIt
+ .next();
+ if (listenerClass.equals(listener.getListenerClass().trim()))
+ {
+ return true;
+ }
+ }
+ return false;
+ }
+ }
+
+ @SuppressWarnings("unchecked")
+ private static class J2EEWebAppConfigurator extends WebAppConfigurator
+ {
+ public J2EEWebAppConfigurator(final IProject project)
+ {
+ super(project);
+ }
+
+ @Override
+ public void addContextParam(final String paramName,
+ final String paramValue, final boolean addEvenIfPresent)
+ {
+ final Runnable runnable = new Runnable()
+ {
+ public void run()
+ {
+ final org.eclipse.jst.j2ee.webapplication.WebApp webApp = (org.eclipse.jst.j2ee.webapplication.WebApp) ModelProviderManager
+ .getModelProvider(getProject()).getModelObject();
+
+ if (addEvenIfPresent
+ || !isContextParamPresent(webApp, paramName))
+ {
+ final org.eclipse.jst.j2ee.common.ParamValue newParamValue = org.eclipse.jst.j2ee.common.CommonFactory.eINSTANCE
+ .createParamValue();
+ newParamValue.setName(paramName);
+ newParamValue.setValue(paramValue);
+ webApp.getContextParams().add(newParamValue);
+ }
+ }
+ };
+ executeChange(runnable);
+ }
+
+ @Override
+ public void removeContextParam(final String paramName,
+ final String paramVal)
+ {
+ final Runnable runnable = new Runnable()
+ {
+ public void run()
+ {
+ final org.eclipse.jst.j2ee.webapplication.WebApp webApp = (org.eclipse.jst.j2ee.webapplication.WebApp) ModelProviderManager
+ .getModelProvider(getProject()).getModelObject();
+ for (final Iterator it = webApp.getContextParams()
+ .iterator(); it.hasNext();)
+ {
+ final org.eclipse.jst.j2ee.common.ParamValue paramValue = (org.eclipse.jst.j2ee.common.ParamValue) it
+ .next();
+ if (paramName.equals(paramValue.getName().trim())
+ && paramVal
+ .equals(paramValue.getValue().trim()))
+ {
+ it.remove();
+ }
+ }
+ }
+ };
+ executeChange(runnable);
+ }
+
+ private boolean isContextParamPresent(
+ final org.eclipse.jst.j2ee.webapplication.WebApp webApp,
+ final String paramName)
+ {
+ for (final Iterator it = webApp.getContextParams().iterator(); it
+ .hasNext();)
+ {
+ final org.eclipse.jst.j2ee.common.ParamValue paramValue = (org.eclipse.jst.j2ee.common.ParamValue) it
+ .next();
+ if (paramName.equals(paramValue.getName().trim()))
+ {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ @Override
+ public void addListener(final String listenerClass,
+ final boolean addEvenIfPresent)
+ {
+ final Runnable runnable = new Runnable()
+ {
+ public void run()
+ {
+ final org.eclipse.jst.j2ee.webapplication.WebApp webApp = (org.eclipse.jst.j2ee.webapplication.WebApp) ModelProviderManager
+ .getModelProvider(getProject()).getModelObject();
+
+ if (addEvenIfPresent
+ || !isListenerPresent(webApp, listenerClass))
+ {
+ final org.eclipse.jst.j2ee.common.Listener listener = org.eclipse.jst.j2ee.common.CommonFactory.eINSTANCE
+ .createListener();
+ listener.setListenerClassName(listenerClass);
+ webApp.getListeners().add(listener);
+ }
+ }
+ };
+ executeChange(runnable);
+ }
+
+ @Override
+ public void removeListener(final String listenerClass)
+ {
+ final Runnable runnable = new Runnable()
+ {
+ public void run()
+ {
+ final org.eclipse.jst.j2ee.webapplication.WebApp webApp = (org.eclipse.jst.j2ee.webapplication.WebApp) ModelProviderManager
+ .getModelProvider(getProject()).getModelObject();
+
+ for (final Iterator listenerIt = webApp.getListeners()
+ .iterator(); listenerIt.hasNext();)
+ {
+ final org.eclipse.jst.j2ee.common.Listener listener = (org.eclipse.jst.j2ee.common.Listener) listenerIt
+ .next();
+ if (listenerClass.equals(listener
+ .getListenerClassName().trim()))
+ {
+ listenerIt.remove();
+ }
+ }
+ }
+ };
+ executeChange(runnable);
+ }
+
+ private boolean isListenerPresent(
+ final org.eclipse.jst.j2ee.webapplication.WebApp webApp,
+ final String listenerClass)
+ {
+ for (final Iterator listenerIt = webApp.getListeners().iterator(); listenerIt
+ .hasNext();)
+ {
+ final org.eclipse.jst.j2ee.common.Listener listener = (org.eclipse.jst.j2ee.common.Listener) listenerIt
+ .next();
+ if (listenerClass
+ .equals(listener.getListenerClassName().trim()))
+ {
+ return true;
+ }
+ }
+ return false;
+ }
+ }
+
+}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/facet/messages.properties b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/facet/messages.properties
new file mode 100644
index 000000000..aa79cd5d7
--- /dev/null
+++ b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/facet/messages.properties
@@ -0,0 +1,2 @@
+FaceletInstallDelegate_FACET_INSTALLER_DELEGATE_DISPLAY_NAME=Facelet Install Delegate
+FaceletUninstallDelegate_FACET_INSTALLER_DELEGATE_DISPLAY_NAME=Facelet Uninstall Delegate
diff --git a/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/ELProxyContributor.java b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/ELProxyContributor.java
new file mode 100644
index 000000000..c000bbc3c
--- /dev/null
+++ b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/ELProxyContributor.java
@@ -0,0 +1,53 @@
+package org.eclipse.jst.jsf.facelet.core.internal.registry;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.IType;
+import org.eclipse.jdt.core.JavaCore;
+import org.eclipse.jem.internal.proxy.core.ConfigurationContributorAdapter;
+import org.eclipse.jem.internal.proxy.core.IConfigurationContributionController;
+import org.eclipse.jst.jsf.facelet.core.internal.FaceletCorePlugin;
+import org.osgi.framework.Bundle;
+
+/**
+ * Contributes additional, sometimes fake, jars to the JEM classpath to allow
+ * for smooth instantiation of introspected objects.
+ *
+ * @author cbateman
+ *
+ */
+public class ELProxyContributor extends ConfigurationContributorAdapter
+{
+ private final IProject _project;
+
+ /**
+ * @param project
+ */
+ public ELProxyContributor(final IProject project)
+ {
+ _project = project;
+ }
+
+ @Override
+ public void contributeClasspaths(
+ final IConfigurationContributionController controller)
+ throws CoreException
+ {
+ if (_project.isAccessible())
+ {
+ final IJavaProject javaProject = JavaCore.create(_project);
+ final IType type = javaProject.findType("java.el.ELException"); //$NON-NLS-1$
+
+ // if we can't find ELException on the classpath,then inject
+ // our fake el jar to aid linkage while introspecting facelet libs
+ if (type == null)
+ {
+ final Bundle faceletBundle = FaceletCorePlugin.getDefault().getBundle();
+ controller.contributeClasspath(faceletBundle, "/jars/fake_el.jar", //$NON-NLS-1$
+ IConfigurationContributionController.APPEND_USER_CLASSPATH,
+ false);
+ }
+ }
+ }
+}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/FaceletMetaResolvingStrategy.java b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/FaceletMetaResolvingStrategy.java
new file mode 100644
index 000000000..9319cbd0a
--- /dev/null
+++ b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/FaceletMetaResolvingStrategy.java
@@ -0,0 +1,210 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Oracle Corporation.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Cameron Bateman - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jst.jsf.facelet.core.internal.registry;
+
+import java.util.Iterator;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.emf.common.util.EList;
+import org.eclipse.jst.jsf.common.dom.TagIdentifier;
+import org.eclipse.jst.jsf.common.runtime.internal.model.component.ComponentTypeInfo;
+import org.eclipse.jst.jsf.common.runtime.internal.model.decorator.ConverterTypeInfo;
+import org.eclipse.jst.jsf.common.runtime.internal.model.decorator.ValidatorTypeInfo;
+import org.eclipse.jst.jsf.common.runtime.internal.model.types.TypeInfo;
+import org.eclipse.jst.jsf.common.runtime.internal.view.model.common.ITagElement;
+import org.eclipse.jst.jsf.common.runtime.internal.view.model.common.IHandlerTagElement.TagHandlerType;
+import org.eclipse.jst.jsf.core.internal.tld.TagIdentifierFactory;
+import org.eclipse.jst.jsf.designtime.internal.Messages;
+import org.eclipse.jst.jsf.designtime.internal.view.mapping.ViewMetadataLoader;
+import org.eclipse.jst.jsf.designtime.internal.view.mapping.ViewMetadataMapper;
+import org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.TagMapping;
+import org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.TagToViewObjectMapping;
+import org.eclipse.jst.jsf.designtime.internal.view.model.jsp.AbstractTagResolvingStrategy;
+import org.eclipse.jst.jsf.designtime.internal.view.model.jsp.DefaultTagTypeInfo;
+import org.eclipse.jst.jsf.facelet.core.internal.cm.FaceletDocumentFactory;
+import org.eclipse.jst.jsf.facelet.core.internal.tagmodel.ComponentTag;
+import org.eclipse.jst.jsf.facelet.core.internal.tagmodel.ConverterTag;
+import org.eclipse.jst.jsf.facelet.core.internal.tagmodel.HandlerTag;
+import org.eclipse.jst.jsf.facelet.core.internal.tagmodel.NoArchetypeFaceletTag;
+import org.eclipse.jst.jsf.facelet.core.internal.tagmodel.ValidatorTag;
+import org.osgi.framework.Version;
+
+/**
+ * Resolves facelet tags from JSF framework metadata.
+ *
+ * @author cbateman
+ *
+ */
+public class FaceletMetaResolvingStrategy
+ extends
+ AbstractTagResolvingStrategy<IFaceletTagResolvingStrategy.TLDWrapper, String>
+ implements IFaceletTagResolvingStrategy
+{
+
+ /**
+ * strategy id
+ */
+ public final static String ID = "org.eclipse.jst.jsf.facelet.metadata.FaceletMetaResolvingStrategy"; //$NON-NLS-1$
+ /**
+ * displayable nameb
+ */
+ public final static String DISPLAY_NAME = Messages.DefaultJSPTagResolver_DisplayName;
+
+ private final ViewMetadataLoader _loader;
+ private final ViewMetadataMapper _mapper;
+ private final FaceletDocumentFactory _factory;
+
+ /**
+ * @param project
+ * @param factory
+ */
+ public FaceletMetaResolvingStrategy(final IProject project,
+ final FaceletDocumentFactory factory)
+ {
+ _factory = factory;
+ _loader = new ViewMetadataLoader(project);
+ _mapper = new ViewMetadataMapper();
+ }
+
+ @Override
+ public ITagElement resolve(
+ final IFaceletTagResolvingStrategy.TLDWrapper elementDecl)
+ {
+ // final IProjectFacetVersion version = JSFAppConfigUtils
+ // .getProjectFacet(_project);
+ // final String versionAsString = version.getVersionString();
+ // final JSFVersion jsfVersion =
+ // JSFVersion.valueOfString(versionAsString);
+
+ final String uri = elementDecl.getUri();
+ final String tagName = elementDecl.getTagDefn().getName();
+ final TagIdentifier tagId = TagIdentifierFactory.createJSPTagWrapper(
+ uri, tagName);
+ // final DefaultTagTypeInfo defaultTagTypeInfo = new
+ // DefaultTagTypeInfo();
+ final TagMapping mapping = _loader.getTagToViewMapping(tagId);
+
+ TypeInfo elementType = null;
+ if (mapping != null)
+ {
+ elementType = findTypeInfo(mapping, "1.1", null); //$NON-NLS-1$
+ }
+
+ if (elementType instanceof ComponentTypeInfo)
+ {
+ return new ComponentTag(uri, tagName,
+ (ComponentTypeInfo) elementType, null, _factory,
+ new MetadataAttributeAdvisor(tagId, _loader));
+ }
+ else if (elementType instanceof ConverterTypeInfo)
+ {
+ return new ConverterTag(uri, tagName,
+ (ConverterTypeInfo) elementType, null, _factory,
+ new MetadataAttributeAdvisor(tagId, _loader));
+ }
+ else if (elementType instanceof ValidatorTypeInfo)
+ {
+ return new ValidatorTag(uri, tagName,
+ (ValidatorTypeInfo) elementType, null, _factory,
+ new MetadataAttributeAdvisor(tagId, _loader));
+ }
+ else if (elementType instanceof TagHandlerType)
+ {
+ return new HandlerTag(uri, tagName,
+ (TagHandlerType) elementType, null, _factory,
+ new MetadataAttributeAdvisor(
+ tagId, _loader));
+ }
+ else if (DefaultTagTypeInfo.isDefaultLib(tagId.getUri()))
+ {
+ return new NoArchetypeFaceletTag(uri, tagName, _factory, new MetadataAttributeAdvisor(tagId, _loader));
+ }
+
+ // not found
+ return null;
+ }
+
+ private TypeInfo findTypeInfo(final TagMapping mapping,
+ final String jsfVersion, final String libVersion)
+ {
+ final EList list = mapping.getVersionedTagToViewMappings();
+
+ FIND_BY_VERSION: for (final Iterator<?> it = list.iterator(); it
+ .hasNext();)
+ {
+ Object obj = it.next();
+
+ if (obj instanceof TagToViewObjectMapping)
+ {
+ final TagToViewObjectMapping viewMapping = (TagToViewObjectMapping) obj;
+
+ final String minJsfVersionString = viewMapping
+ .getMinJSFVersion();
+ if (minJsfVersionString != null)
+ {
+ try
+ {
+ final Version version = new Version(jsfVersion);
+ final Version minVersion = Version
+ .parseVersion(minJsfVersionString);
+
+ if (version.compareTo(minVersion) < 0)
+ {
+ // my version is less than the minimum specified
+ // by this meta-data
+ continue FIND_BY_VERSION;
+ }
+ }
+ catch (final IllegalArgumentException iae)
+ {
+ continue FIND_BY_VERSION;
+ }
+ }
+ final String minLibVersionString = viewMapping
+ .getMinLibraryVersion();
+ if (libVersion != null && minLibVersionString != null)
+ {
+ try
+ {
+ final Version version = new Version(libVersion);
+ final Version minLibVersion = Version
+ .parseVersion(minLibVersionString);
+
+ if (version.compareTo(minLibVersion) < 0)
+ {
+ // my lib version is less than the minimum specified
+ // by the meta-data
+ continue FIND_BY_VERSION;
+ }
+ }
+ catch (IllegalArgumentException iae)
+ {
+ continue FIND_BY_VERSION;
+ }
+ }
+ return _mapper.mapToFrameworkData(viewMapping.getTypeInfo());
+ }
+ }
+ return null;
+ }
+
+ @Override
+ public String getId()
+ {
+ return ID;
+ }
+
+ public String getDisplayName()
+ {
+ return DISPLAY_NAME;
+ }
+
+}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/FaceletRegistryManager.java b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/FaceletRegistryManager.java
new file mode 100644
index 000000000..239cb6f88
--- /dev/null
+++ b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/FaceletRegistryManager.java
@@ -0,0 +1,112 @@
+package org.eclipse.jst.jsf.facelet.core.internal.registry;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.jst.jsf.common.internal.resource.ResourceSingletonObjectManager;
+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.facelet.core.internal.FaceletCoreTraceOptions;
+
+/**
+ * A per-resource singleton manager for TLDTagRegistry's.
+ *
+ * @author cbateman
+ *
+ */
+public final class FaceletRegistryManager extends
+ ResourceSingletonObjectManager<FaceletTagRegistry, IProject>
+{
+ // STATIC
+ private static FaceletRegistryManager INSTANCE;
+
+ /**
+ * @return the singleton instance
+ */
+ private static FaceletRegistryManager getGlobalManager()
+ {
+ if (FaceletCoreTraceOptions.TRACE_REGISTRYMANAGER)
+ {
+ FaceletCoreTraceOptions
+ .log("FaceletRegistryManager: Initializing FaceletRegistryManager singleton"); //$NON-NLS-1$
+ }
+
+ synchronized(FaceletRegistryManager.class)
+ {
+ if (INSTANCE == null)
+ {
+ INSTANCE = new FaceletRegistryManager();
+ }
+
+ return INSTANCE;
+ }
+ }
+
+ private FaceletRegistryManager()
+ {
+ // do nothing
+ }
+
+ @Override
+ protected FaceletTagRegistry createNewInstance(final IProject project)
+ {
+ if (FaceletCoreTraceOptions.TRACE_REGISTRYMANAGER)
+ {
+ FaceletCoreTraceOptions.log("FaceletRegistryManager: creating new instance for " //$NON-NLS-1$
+ + project.toString());
+ }
+
+ return new FaceletTagRegistry(project);
+ }
+
+ @Override
+ protected void runAfterGetInstance(final IProject resource)
+ {
+ if (FaceletCoreTraceOptions.TRACE_REGISTRYMANAGER)
+ {
+ FaceletCoreTraceOptions.log("FaceletRegistryManager: Acquired instance for " //$NON-NLS-1$
+ + resource.toString());
+ }
+ }
+
+ @Override
+ protected void runBeforeGetInstance(final IProject resource)
+ {
+ if (FaceletCoreTraceOptions.TRACE_REGISTRYMANAGER)
+ {
+ FaceletCoreTraceOptions.log("FaceletRegistryManager: Getting registry for " //$NON-NLS-1$
+ + resource.toString());
+ }
+ }
+
+ /**
+ * Adapter used to allow creation by extension point.
+ *
+ * @author cbateman
+ *
+ */
+ public static class MyRegistryFactory extends TagRegistryFactory
+ {
+ @Override
+ public ITagRegistry createTagRegistry(IProject project) throws TagRegistryFactoryException
+ {
+ try
+ {
+ return getGlobalManager().getInstance(project);
+ }
+ catch (ManagedObjectException e)
+ {
+ throw new TagRegistryFactoryException(e);
+ }
+ }
+
+ @Override
+ public boolean isInstance(IProject project)
+ {
+ return getGlobalManager().isInstance(project);
+ }
+
+ public String getDisplayName()
+ {
+ return Messages.FaceletRegistryManager_REGISTRY_FACTORY_DISPLAYNAME;
+ }
+ }
+}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/FaceletTagRegistry.java b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/FaceletTagRegistry.java
new file mode 100644
index 000000000..1d0d8ce3b
--- /dev/null
+++ b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/FaceletTagRegistry.java
@@ -0,0 +1,383 @@
+package org.eclipse.jst.jsf.facelet.core.internal.registry;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.concurrent.ConcurrentLinkedQueue;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.MultiStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.jdt.core.JavaCore;
+import org.eclipse.jdt.core.JavaModelException;
+import org.eclipse.jst.jsf.common.internal.managedobject.IManagedObject;
+import org.eclipse.jst.jsf.common.internal.managedobject.ObjectManager.ManagedObjectException;
+import org.eclipse.jst.jsf.common.internal.policy.IdentifierOrderedIteratorPolicy;
+import org.eclipse.jst.jsf.common.runtime.internal.view.model.common.Namespace;
+import org.eclipse.jst.jsf.core.internal.JSFCorePlugin;
+import org.eclipse.jst.jsf.core.internal.JSFCoreTraceOptions;
+import org.eclipse.jst.jsf.designtime.internal.view.model.AbstractTagRegistry;
+import org.eclipse.jst.jsf.designtime.internal.view.model.jsp.CompositeTagResolvingStrategy;
+import org.eclipse.jst.jsf.facelet.core.internal.FaceletCorePlugin;
+import org.eclipse.jst.jsf.facelet.core.internal.FaceletCoreTraceOptions;
+import org.eclipse.jst.jsf.facelet.core.internal.cm.FaceletDocumentFactory;
+import org.eclipse.jst.jsf.facelet.core.internal.registry.IFaceletTagResolvingStrategy.TLDWrapper;
+import org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.FaceletTagIndex;
+import org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.IFaceletTagRecord;
+import org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.IProjectTaglibDescriptor;
+import org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.Listener;
+import org.eclipse.jst.jsf.facelet.core.internal.tagmodel.FaceletNamespace;
+
+/**
+ * Registry of all facelet tag registries: at most one per project.
+ *
+ */
+public final class FaceletTagRegistry extends AbstractTagRegistry implements
+ IManagedObject
+{
+ // INSTANCE
+ private final ConcurrentLinkedQueue<LibraryOperation> _changeOperations = new ConcurrentLinkedQueue<LibraryOperation>();
+
+ private final IProject _project;
+ private final Map<String, FaceletNamespace> _nsResolved;
+ private final Set<FaceletNamespace> _unResolved;
+ private final CompositeTagResolvingStrategy<TLDWrapper> _resolver;
+ private final FaceletDocumentFactory _factory;
+ private final LibraryOperationFactory _operationFactory = new LibraryOperationFactory(
+ this);
+ private boolean _isInitialized;
+
+ private ChangeJob _changeJob;
+ private MyTaglibListener _listener;
+
+ FaceletTagRegistry(final IProject project)
+ {
+ _project = project;
+ _nsResolved = new HashMap<String, FaceletNamespace>();
+ _unResolved = new HashSet<FaceletNamespace>();
+
+ final List<String> ids = new ArrayList<String>();
+ ids.add(FaceletMetaResolvingStrategy.ID);
+ ids.add(FaceletTagResolvingStrategy.ID);
+ final IdentifierOrderedIteratorPolicy<String> policy = new IdentifierOrderedIteratorPolicy<String>(
+ ids);
+
+ // exclude things that are not explicitly listed in the policy. That
+ // way preference-based disablement will cause those strategies to
+ // be excluded.
+ policy.setExcludeNonExplicitValues(true);
+ _resolver = new CompositeTagResolvingStrategy<TLDWrapper>(policy);
+
+ _factory = new FaceletDocumentFactory(project);
+ // add the strategies
+ _resolver.addStrategy(new FaceletTagResolvingStrategy(_project,
+ _factory));
+ _resolver.addStrategy(new FaceletMetaResolvingStrategy(_project, _factory));
+
+ // _resolver.addStrategy(new DefaultJSPTagResolver(_project));
+ // makes sure that a tag element will always be created for any
+ // given tag definition even if other methods fail
+ // _resolver.addStrategy(new UnresolvedJSPTagResolvingStrategy());
+ _changeJob = new ChangeJob(project.getName());
+ }
+
+ /**
+ * @return a copy of all tag libs, both with namespaces resolved and without
+ * Changing the returned may has no effect on the registry, however
+ * the containned objects are not copies.
+ */
+ @Override
+ public synchronized Collection<FaceletNamespace> getAllTagLibraries()
+ {
+ final Set<FaceletNamespace> allTagLibraries = new HashSet<FaceletNamespace>();
+ if (!_isInitialized)
+ {
+ try
+ {
+ initialize(false);
+ _isInitialized = true;
+ }
+ catch (final JavaModelException e)
+ {
+ FaceletCorePlugin.log("Problem during initialization", e); //$NON-NLS-1$
+ }
+ catch (final CoreException e)
+ {
+ FaceletCorePlugin.log("Problem during initialization", e); //$NON-NLS-1$
+ }
+ }
+ allTagLibraries.addAll(_nsResolved.values());
+ allTagLibraries.addAll(_unResolved);
+ return allTagLibraries;
+ }
+
+ private void initialize(boolean fireEvent) throws JavaModelException, CoreException
+ {
+ if (!_project.exists() || !_project.hasNature(JavaCore.NATURE_ID))
+ {
+ throw new CoreException(new Status(IStatus.ERROR,
+ FaceletCorePlugin.PLUGIN_ID,
+ "Project either does not exists or is not a java project: " //$NON-NLS-1$
+ + _project));
+ }
+
+ final FaceletTagIndex index = FaceletTagIndex.getInstance();
+
+ IProjectTaglibDescriptor tagDesc;
+ try
+ {
+ tagDesc = index.getInstance(_project);
+ }
+ catch (ManagedObjectException e)
+ {
+ throw new CoreException(
+ new Status(
+ IStatus.ERROR,
+ FaceletCorePlugin.PLUGIN_ID,
+ "Error instantiating facelet tag index for project: " + _project.getName(), e)); //$NON-NLS-1$
+ }
+
+ if (tagDesc != null)
+ {
+ for (final IFaceletTagRecord taglib : tagDesc.getTagLibraries())
+ {
+ initialize(taglib, fireEvent);
+ }
+
+ _listener = new MyTaglibListener();
+ tagDesc.addListener(_listener);
+ }
+ }
+
+ FaceletNamespace initialize(final IFaceletTagRecord tagRecord,
+ final boolean fireEvent)
+ {
+ if (JSFCoreTraceOptions.TRACE_JSPTAGREGISTRY_CHANGES)
+ {
+ FaceletCoreTraceOptions
+ .log("TLDTagRegistry.initialize_TagRecord: Initializing new tld record: " + tagRecord.toString()); //$NON-NLS-1$
+ }
+ // long startTime = 0;
+ //
+ // if (JSFCoreTraceOptions.TRACE_JSPTAGREGISTRY_PERF)
+ // {
+ // startTime = System.nanoTime();
+ // }
+ final FaceletNamespace ns = new FaceletNamespace(tagRecord, _resolver);
+ _nsResolved.put(tagRecord.getURI(), ns);
+
+ if (fireEvent)
+ {
+ fireEvent(new TagRegistryChangeEvent(this,
+ TagRegistryChangeEvent.EventType.ADDED_NAMESPACE,
+ Collections.singletonList(ns)));
+ }
+
+ // if (FaceletCoreTraceOptions.TRACE_JSPTAGREGISTRY_PERF)
+ // {
+ // System.out.printf("Time to update namespace %s was %d\n", //$NON-NLS-1$
+ // ns.getNSUri(), Long.valueOf(System.nanoTime()
+ // - startTime));
+ // }
+ return ns;
+ }
+
+ void remove(final IFaceletTagRecord tagRecord)
+ {
+ final FaceletNamespace ns = _nsResolved.remove(tagRecord.getURI());
+
+ if (ns != null)
+ {
+ fireEvent(new TagRegistryChangeEvent(this,
+ TagRegistryChangeEvent.EventType.REMOVED_NAMESPACE,
+ Collections.singletonList(ns)));
+ }
+ }
+
+ @Override
+ public synchronized Namespace getTagLibrary(final String uri)
+ {
+ // TODO:
+ getAllTagLibraries();
+ return _nsResolved.get(uri);
+ }
+
+ @Override
+ protected Job getRefreshJob(final boolean flushCaches)
+ {
+ return new Job("Refreshing Facelet tag registry for " + _project.getName()) //$NON-NLS-1$
+ {
+ @Override
+ protected IStatus run(final IProgressMonitor monitor)
+ {
+// if (FaceletCoreTraceOptions.TRACE_JSPTAGREGISTRY)
+// {
+// JSFCoreTraceOptions.log("FaceletTagRegistry.refresh: start"); //$NON-NLS-1$
+// }
+
+ synchronized (FaceletTagRegistry.this)
+ {
+ if (JSFCoreTraceOptions.TRACE_JSPTAGREGISTRY)
+ {
+ JSFCoreTraceOptions
+ .log("FaceletTagRegistry.refresh: start"); //$NON-NLS-1$
+ }
+
+ final List<Namespace> namespaces = new ArrayList(
+ _nsResolved.values());
+
+ if (flushCaches)
+ {
+ FaceletTagIndex.getInstance().flush(_project);
+ }
+ // if we aren't flushing caches, then check point the
+ // current namespace data, so it isn't lost when we clear
+ // THE NAMESPACES
+ else
+ {
+ checkpoint();
+ }
+
+ _nsResolved.clear();
+
+ fireEvent(new TagRegistryChangeEvent(FaceletTagRegistry.this,
+ TagRegistryChangeEvent.EventType.REMOVED_NAMESPACE,
+ namespaces));
+ try
+ {
+ initialize(true);
+ }
+ catch (JavaModelException e)
+ {
+ return new Status(IStatus.ERROR, FaceletCorePlugin.PLUGIN_ID, "Problem refreshing registry", e); //$NON-NLS-1$
+ }
+ catch (CoreException e)
+ {
+ return new Status(IStatus.ERROR, FaceletCorePlugin.PLUGIN_ID, "Problem refreshing registry", e); //$NON-NLS-1$
+ }
+
+// if (JSFCoreTraceOptions.TRACE_JSPTAGREGISTRY)
+// {
+// JSFCoreTraceOptions
+// .log("TLDTagRegistry.refresh: finished");
+// }
+ return Status.OK_STATUS;
+ }
+ }
+ };
+ }
+
+ private class MyTaglibListener extends Listener
+ {
+ @Override
+ public void changed(TaglibChangedEvent event)
+ {
+ switch (event.getChangeType())
+ {
+ case ADDED:
+ addLibraryOperation(_operationFactory
+ .createAddOperation(event.getNewValue()));
+ break;
+ case CHANGED:
+ addLibraryOperation(_operationFactory
+ .createChangeOperation(event.getNewValue()));
+ break;
+ case REMOVED:
+ addLibraryOperation(_operationFactory
+ .createRemoveOperation(event.getOldValue()));
+ break;
+ }
+ }
+ }
+
+ private void addLibraryOperation(final LibraryOperation operation)
+ {
+ _changeOperations.add(operation);
+ _changeJob.schedule();
+ }
+
+ private class ChangeJob extends Job
+ {
+ private int _rescheduleTime = -1;
+
+ public ChangeJob(final String projectName)
+ {
+ super("Update job for project " + projectName); //$NON-NLS-1$
+ }
+
+ @Override
+ protected IStatus run(final IProgressMonitor monitor)
+ {
+ synchronized (FaceletTagRegistry.this)
+ {
+ _rescheduleTime = -1;
+
+ LibraryOperation operation = null;
+ final MultiStatus multiStatus = new MultiStatus(
+ JSFCorePlugin.PLUGIN_ID, 0, "Result of change job", //$NON-NLS-1$
+ new Throwable());
+ while ((operation = _changeOperations.poll()) != null)
+ {
+ _rescheduleTime = 10000; // ms
+
+ operation.run();
+ multiStatus.add(operation.getResult());
+ }
+
+ if (_rescheduleTime >= 0 && !monitor.isCanceled())
+ {
+ // if any operations were found on this run, reschedule
+ // to run again in 10seconds based on the assumption that
+ // events may be coming in bursts
+ schedule(_rescheduleTime);
+ }
+
+ return multiStatus;
+ }
+ }
+ }
+
+ @Override
+ protected void doDispose()
+ {
+ if (_listener != null)
+ {
+ FaceletTagIndex index = FaceletTagIndex.getInstance();
+ try
+ {
+ IProjectTaglibDescriptor instance = index.getInstance(_project);
+ instance.removeListener(_listener);
+ }
+ catch (ManagedObjectException e)
+ {
+ FaceletCorePlugin
+ .log(
+ "Disposing facelet tag registry for project: " + _project.getName(), e); //$NON-NLS-1$
+ }
+
+ _nsResolved.clear();
+ }
+ }
+
+ @Override
+ protected void cleanupPersistentState()
+ {
+ // TODO ??
+
+ }
+
+ public void checkpoint()
+ {
+ // TODO ??
+
+ }
+}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/FaceletTagResolvingStrategy.java b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/FaceletTagResolvingStrategy.java
new file mode 100644
index 000000000..b3f70afa8
--- /dev/null
+++ b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/FaceletTagResolvingStrategy.java
@@ -0,0 +1,167 @@
+package org.eclipse.jst.jsf.facelet.core.internal.registry;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.jem.internal.proxy.core.IConfigurationContributor;
+import org.eclipse.jst.jsf.common.dom.TagIdentifier;
+import org.eclipse.jst.jsf.common.runtime.internal.model.component.ComponentTypeInfo;
+import org.eclipse.jst.jsf.common.runtime.internal.model.decorator.ConverterTypeInfo;
+import org.eclipse.jst.jsf.common.runtime.internal.model.decorator.ValidatorTypeInfo;
+import org.eclipse.jst.jsf.common.runtime.internal.view.model.common.ITagElement;
+import org.eclipse.jst.jsf.core.internal.tld.TagIdentifierFactory;
+import org.eclipse.jst.jsf.designtime.internal.view.DTComponentIntrospector;
+import org.eclipse.jst.jsf.designtime.internal.view.mapping.ViewMetadataLoader;
+import org.eclipse.jst.jsf.designtime.internal.view.model.jsp.AbstractTagResolvingStrategy;
+import org.eclipse.jst.jsf.designtime.internal.view.model.jsp.IAttributeAdvisor;
+import org.eclipse.jst.jsf.facelet.core.internal.cm.FaceletDocumentFactory;
+import org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.ComponentTagDefn;
+import org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.ConverterTagDefn;
+import org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.HandlerTagDefn;
+import org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.SourceTagDefn;
+import org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.TagDefn;
+import org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.ValidatorTagDefn;
+import org.eclipse.jst.jsf.facelet.core.internal.tagmodel.ComponentTag;
+import org.eclipse.jst.jsf.facelet.core.internal.tagmodel.ConverterTag;
+import org.eclipse.jst.jsf.facelet.core.internal.tagmodel.FaceletTag;
+import org.eclipse.jst.jsf.facelet.core.internal.tagmodel.HandlerTag;
+import org.eclipse.jst.jsf.facelet.core.internal.tagmodel.NoArchetypeFaceletTag;
+import org.eclipse.jst.jsf.facelet.core.internal.tagmodel.SourceTag;
+import org.eclipse.jst.jsf.facelet.core.internal.tagmodel.ValidatorTag;
+
+/*package*/class FaceletTagResolvingStrategy
+ extends
+ AbstractTagResolvingStrategy<IFaceletTagResolvingStrategy.TLDWrapper, String>
+ implements IFaceletTagResolvingStrategy
+{
+ public final static String ID = "org.eclipse.jst.jsf.facelet.core.FaceletTagResolvingStrategy"; //$NON-NLS-1$
+ private final IProject _project;
+ private final FaceletDocumentFactory _factory;
+ private final ViewMetadataLoader _viewLoader;
+
+ public FaceletTagResolvingStrategy(final IProject project,
+ final FaceletDocumentFactory factory)
+ {
+ _project = project;
+ _factory = factory;
+ _viewLoader = new ViewMetadataLoader(project);
+ }
+
+ @Override
+ public final String getId()
+ {
+ return ID;
+ }
+
+ @Override
+ public final ITagElement resolve(final TLDWrapper tldWrapper)
+ {
+ return createFaceletTag(tldWrapper.getUri(), tldWrapper.getTagDefn());
+ }
+
+ public final String getDisplayName()
+ {
+ return Messages.FaceletTagResolvingStrategy_FACELET_TAG_RESOLVER_DISPLAY_NAME;
+ }
+
+ private FaceletTag createFaceletTag(final String uri, final TagDefn tagDefn)
+ {
+ final String tagName = tagDefn.getName();
+ final TagIdentifier tagId = TagIdentifierFactory.createJSPTagWrapper(
+ uri, tagName);
+
+ final IAttributeAdvisor advisor = new MetadataAttributeAdvisor(tagId,
+ _viewLoader);
+
+ if (tagDefn instanceof ComponentTagDefn)
+ {
+ final ComponentTagDefn componentTagDefn = (ComponentTagDefn) tagDefn;
+ final String componentType = componentTagDefn.getComponentType();
+ final String componentClass = DTComponentIntrospector
+ .findComponentClass(componentType, _project);
+
+ ComponentTypeInfo typeInfo = null;
+
+ if (componentClass != null)
+ {
+ typeInfo = DTComponentIntrospector.getComponent(componentType,
+ componentClass, _project,
+ new IConfigurationContributor[]
+ { new ELProxyContributor(_project) });
+ }
+ return new ComponentTag(uri, tagName, typeInfo, safeGetString(componentTagDefn.getHandlerClass()), _factory, advisor);
+ }
+ // render type is optional, but must have component type
+ else if (tagDefn instanceof ValidatorTagDefn)
+ {
+ final ValidatorTagDefn validatorTagDefn = (ValidatorTagDefn) tagDefn;
+ final String validatorId = validatorTagDefn.getValidatorId();
+
+ ValidatorTypeInfo typeInfo;
+
+ if (validatorId != null)
+ {
+ final String validatorClass = DTComponentIntrospector
+ .findValidatorClass(validatorId, _project);
+ typeInfo = new ValidatorTypeInfo(validatorClass, validatorId);
+ }
+ else
+ {
+ typeInfo = ValidatorTypeInfo.UNKNOWN;
+ }
+
+ return new ValidatorTag(uri, tagName, typeInfo, safeGetString(validatorTagDefn.getHandlerClass()), _factory,
+ advisor);
+ }
+ // render type is optional, but must have converter id
+ else if (tagDefn instanceof ConverterTagDefn)
+ {
+ final ConverterTagDefn converterTagDefn = (ConverterTagDefn) tagDefn;
+ final String converterId = converterTagDefn.getConverterId();
+
+ ConverterTypeInfo typeInfo;
+
+ if (converterId != null)
+ {
+ final String converterClass = DTComponentIntrospector
+ .findConverterClass(converterId, _project);
+ typeInfo = new ConverterTypeInfo(converterClass, converterId);
+ }
+ else
+ {
+ typeInfo = ConverterTypeInfo.UNKNOWN;
+ }
+
+ // for now, all converters are unknown
+ return new ConverterTag(uri, tagName, typeInfo,
+ safeGetString(converterTagDefn.getHandlerClass()), _factory, advisor);
+ }
+ else if (tagDefn instanceof HandlerTagDefn)
+ {
+ final String handlerClass = safeGetString(((HandlerTagDefn)tagDefn).getHandlerClass());
+ return new HandlerTag(uri, tagName, null, handlerClass, _factory, advisor);
+ }
+ else if (tagDefn instanceof SourceTagDefn)
+ {
+ final String source = ((SourceTagDefn)tagDefn).getSource();
+ return new SourceTag(uri, tagName, source, _factory, advisor);
+ }
+
+ return new NoArchetypeFaceletTag(uri, tagName, _factory, advisor);
+ }
+
+ private static String safeGetString(final String value)
+ {
+ if (value == null)
+ {
+ return null;
+ }
+
+ final String trimmed = value.trim();
+
+ if ("".equals(trimmed)) //$NON-NLS-1$
+ {
+ return null;
+ }
+
+ return trimmed;
+ }
+}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/IFaceletTagResolvingStrategy.java b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/IFaceletTagResolvingStrategy.java
new file mode 100644
index 000000000..5de18c8ee
--- /dev/null
+++ b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/IFaceletTagResolvingStrategy.java
@@ -0,0 +1,63 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Oracle Corporation.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Cameron Bateman - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jst.jsf.facelet.core.internal.registry;
+
+import org.eclipse.jst.jsf.designtime.internal.view.model.jsp.ITagResolvingStrategy;
+import org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.TagDefn;
+
+/**
+ * @author cbateman
+ *
+ */
+public interface IFaceletTagResolvingStrategy extends
+ ITagResolvingStrategy<IFaceletTagResolvingStrategy.TLDWrapper, String>
+{
+
+ /**
+ * Wraps data for Facelet tag information to used by the resolving strategy
+ *
+ * @author cbateman
+ *
+ */
+ public static class TLDWrapper
+ {
+ private final String _uri;
+ private final TagDefn _tagDefn;
+
+ /**
+ * @param tagDefn
+ * @param uri
+ */
+ public TLDWrapper(TagDefn tagDefn, String uri)
+ {
+ super();
+ _tagDefn = tagDefn;
+ _uri = uri;
+ }
+
+ /**
+ * @return the uri for the tld namespace
+ */
+ public final String getUri()
+ {
+ return _uri;
+ }
+
+ /**
+ * @return the tag definition information
+ */
+ public final TagDefn getTagDefn()
+ {
+ return _tagDefn;
+ }
+
+ }
+}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/LibraryOperation.java b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/LibraryOperation.java
new file mode 100644
index 000000000..51a5d4d1d
--- /dev/null
+++ b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/LibraryOperation.java
@@ -0,0 +1,47 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Oracle Corporation.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Cameron Bateman - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jst.jsf.facelet.core.internal.registry;
+
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.jst.jsf.facelet.core.internal.FaceletCorePlugin;
+import org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.IFaceletTagRecord;
+
+abstract class LibraryOperation
+{
+ protected final IFaceletTagRecord _changeRecord;
+ private IStatus _result;
+
+ protected LibraryOperation(final IFaceletTagRecord changeRecord)
+ {
+ _changeRecord = changeRecord;
+ }
+
+ public final void run()
+ {
+ try
+ {
+ _result = doRun();
+ }
+ catch (final Exception e)
+ {
+ _result = new Status(IStatus.ERROR, FaceletCorePlugin.PLUGIN_ID,
+ "Problem during run", e); //$NON-NLS-1$
+ }
+ }
+
+ public IStatus getResult()
+ {
+ return _result;
+ }
+
+ protected abstract IStatus doRun();
+}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/LibraryOperationFactory.java b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/LibraryOperationFactory.java
new file mode 100644
index 000000000..c69cbfed9
--- /dev/null
+++ b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/LibraryOperationFactory.java
@@ -0,0 +1,122 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Oracle Corporation.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Cameron Bateman - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jst.jsf.facelet.core.internal.registry;
+
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.IFaceletTagRecord;
+
+class LibraryOperationFactory
+{
+ private final FaceletTagRegistry _tagRegistry;
+
+ public LibraryOperationFactory(final FaceletTagRegistry tagRegistry)
+ {
+ _tagRegistry = tagRegistry;
+ }
+
+ LibraryOperation createAddOperation(final IFaceletTagRecord changeRecord)
+ {
+ return new AddTagLibrary(_tagRegistry, changeRecord);
+ }
+
+ LibraryOperation createRemoveOperation(final IFaceletTagRecord changeRecord)
+ {
+ return new RemoveTagLibrary(_tagRegistry, changeRecord);
+ }
+
+ LibraryOperation createChangeOperation(final IFaceletTagRecord changeRecord)
+ {
+ if (changeRecord == null)
+ {
+ throw new IllegalArgumentException();
+ }
+ return new ChangeTagLibrary(_tagRegistry, changeRecord);
+ }
+
+ private static class AddTagLibrary extends LibraryOperation
+ {
+ private final FaceletTagRegistry _tagRegistry;
+
+ public AddTagLibrary(final FaceletTagRegistry tagRegistry,
+ final IFaceletTagRecord newRecord)
+ {
+ super(newRecord);
+ _tagRegistry = tagRegistry;
+ }
+
+ @Override
+ protected IStatus doRun()
+ {
+ synchronized (_tagRegistry)
+ {
+ // fire change event if applicable
+ _tagRegistry.initialize(_changeRecord, true);
+ return Status.OK_STATUS;
+ }
+ }
+ }
+
+ private static class RemoveTagLibrary extends LibraryOperation
+ {
+ private final FaceletTagRegistry _tagRegistry;
+
+ protected RemoveTagLibrary(final FaceletTagRegistry tagRegistry,
+ final IFaceletTagRecord changeRecord)
+ {
+ super(changeRecord);
+ _tagRegistry = tagRegistry;
+ }
+
+ @Override
+ protected IStatus doRun()
+ {
+ _tagRegistry.remove(_changeRecord);
+ return Status.OK_STATUS;
+
+ }
+
+ }
+
+ private static class ChangeTagLibrary extends LibraryOperation
+ {
+ private final FaceletTagRegistry _tagRegistry;
+
+ protected ChangeTagLibrary(final FaceletTagRegistry tagRegistry,
+ final IFaceletTagRecord changeRecord)
+ {
+ super(changeRecord);
+ _tagRegistry = tagRegistry;
+ }
+
+ @Override
+ protected IStatus doRun()
+ {
+ IStatus result = null;
+
+ synchronized (_tagRegistry)
+ {
+ result = new RemoveTagLibrary(_tagRegistry, _changeRecord).doRun();
+
+ if (result.getSeverity() != IStatus.ERROR
+ && result.getSeverity() != IStatus.CANCEL)
+ {
+ result = new AddTagLibrary(_tagRegistry, _changeRecord)
+ .doRun();
+ }
+ }
+
+ return result;
+ }
+
+ }
+
+}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/Messages.java b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/Messages.java
new file mode 100644
index 000000000..1a4f0d641
--- /dev/null
+++ b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/Messages.java
@@ -0,0 +1,46 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Oracle Corporation.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Cameron Bateman - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jst.jsf.facelet.core.internal.registry;
+
+import org.eclipse.osgi.util.NLS;
+
+/**
+ * Externalized string manager.
+ *
+ * @author cbateman
+ *
+ */
+public final class Messages extends NLS
+{
+ private static final String BUNDLE_NAME = "org.eclipse.jst.jsf.facelet.core.internal.registry.messages"; //$NON-NLS-1$
+ /**
+ * see messages.properties
+ */
+ public static String FaceletRegistryManager_REGISTRY_FACTORY_DISPLAYNAME;
+ /**
+ * see messages.properties
+ */
+ public static String FaceletTagRegistry_TAG_REGISTRY_REFRESH_JOB_DESCRIPTION;
+ /**
+ * see messages.properties
+ */
+ public static String FaceletTagResolvingStrategy_FACELET_TAG_RESOLVER_DISPLAY_NAME;
+ static
+ {
+ // initialize resource bundle
+ NLS.initializeMessages(BUNDLE_NAME, Messages.class);
+ }
+
+ private Messages()
+ {
+ // no instantiation
+ }
+}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/MetadataAttributeAdvisor.java b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/MetadataAttributeAdvisor.java
new file mode 100644
index 000000000..4fda2e538
--- /dev/null
+++ b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/MetadataAttributeAdvisor.java
@@ -0,0 +1,63 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Oracle Corporation.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Cameron Bateman - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jst.jsf.facelet.core.internal.registry;
+
+import org.eclipse.jst.jsf.common.dom.TagIdentifier;
+import org.eclipse.jst.jsf.common.runtime.internal.view.model.common.ComponentPropertyHandler;
+import org.eclipse.jst.jsf.common.runtime.internal.view.model.common.ITagAttributeHandler;
+import org.eclipse.jst.jsf.common.runtime.internal.view.model.common.TagAttributeHandler;
+import org.eclipse.jst.jsf.designtime.internal.view.mapping.ViewMetadataLoader;
+import org.eclipse.jst.jsf.designtime.internal.view.mapping.viewmapping.AttributeToPropertyMapping;
+import org.eclipse.jst.jsf.designtime.internal.view.model.jsp.IAttributeAdvisor;
+
+/**
+ * An attribute advisor that composes multiple strategies for deriving information
+ * about Facelet tags.
+ *
+ * @author cbateman
+ *
+ */
+/*package*/ class MetadataAttributeAdvisor implements IAttributeAdvisor
+{
+ private final TagIdentifier _tagId;
+ private final ViewMetadataLoader _loader;
+
+ /**
+ * @param tagId
+ * @param loader
+ */
+ public MetadataAttributeAdvisor(final TagIdentifier tagId,
+ final ViewMetadataLoader loader)
+ {
+ _tagId = tagId;
+ _loader = loader;
+ }
+
+ public ITagAttributeHandler createAttributeHandler(final String name)
+ throws UnknownAttributeException
+ {
+ final AttributeToPropertyMapping mapping = _loader.getAttributeMapping(
+ _tagId, name);
+ if (mapping != null)
+ {
+ final String customHandler = mapping.getCustomConversionFactoryId();
+ final boolean isELAllowed = mapping.isElAllowed();
+ final String propertyName = mapping.getPropertyName();
+ if (propertyName != null)
+ {
+ return new ComponentPropertyHandler(customHandler, name,
+ isELAllowed, propertyName);
+ }
+ return new TagAttributeHandler(customHandler, name, isELAllowed);
+ }
+ return new TagAttributeHandler(null, name, false);
+ }
+}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/ServletBeanProxyContributor.java b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/ServletBeanProxyContributor.java
new file mode 100644
index 000000000..23947381b
--- /dev/null
+++ b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/ServletBeanProxyContributor.java
@@ -0,0 +1,58 @@
+/**
+ *
+ */
+package org.eclipse.jst.jsf.facelet.core.internal.registry;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.jem.internal.proxy.core.ConfigurationContributorAdapter;
+import org.eclipse.jem.internal.proxy.core.IConfigurationContributionController;
+import org.eclipse.jst.jsf.core.JSFVersion;
+import org.osgi.framework.Bundle;
+
+/**
+ * Contributes dummy jsp servlet api to smooth the JEM instantiation for introspection.
+ *
+ * @author cbateman
+ *
+ */
+public class ServletBeanProxyContributor extends ConfigurationContributorAdapter
+{
+ private static final String JAVAX_SERVLET_JSP = "javax.servlet.jsp"; //$NON-NLS-1$
+ private static final String JAVAX_SERVLET = "javax.servlet"; //$NON-NLS-1$
+ private final JSFVersion _jsfVersion;
+
+ /**
+ * @param jsfVersion
+ */
+ public ServletBeanProxyContributor(final JSFVersion jsfVersion)
+ {
+ if (jsfVersion == null)
+ {
+ throw new IllegalArgumentException("jsfVersion must not be null"); //$NON-NLS-1$
+ }
+
+ _jsfVersion = jsfVersion;
+ }
+
+ @Override
+ public void contributeClasspaths(
+ final IConfigurationContributionController controller)
+ throws CoreException
+ {
+ if (_jsfVersion != JSFVersion.V1_2)
+ {
+ final Bundle servletBundle = Platform.getBundle(JAVAX_SERVLET);
+ controller.contributeClasspath(servletBundle, (IPath) null,
+ IConfigurationContributionController.APPEND_USER_CLASSPATH,
+ true);
+
+ final Bundle jspBundle = Platform.getBundle(JAVAX_SERVLET_JSP);
+ controller.contributeClasspath(jspBundle, (IPath) null,
+ IConfigurationContributionController.APPEND_USER_CLASSPATH,
+ true);
+ }
+
+ }
+} \ No newline at end of file
diff --git a/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/VeryTemporaryDefaultFaceletResolver.java b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/VeryTemporaryDefaultFaceletResolver.java
new file mode 100644
index 000000000..7bf66fe0e
--- /dev/null
+++ b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/VeryTemporaryDefaultFaceletResolver.java
@@ -0,0 +1,215 @@
+package org.eclipse.jst.jsf.facelet.core.internal.registry;
+
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.jst.jsf.common.dom.TagIdentifier;
+import org.eclipse.jst.jsf.common.runtime.internal.model.component.ComponentTypeInfo;
+import org.eclipse.jst.jsf.common.runtime.internal.model.decorator.ConverterTypeInfo;
+import org.eclipse.jst.jsf.common.runtime.internal.model.decorator.ValidatorTypeInfo;
+import org.eclipse.jst.jsf.common.runtime.internal.model.types.TypeInfo;
+import org.eclipse.jst.jsf.common.runtime.internal.view.model.common.ITagElement;
+import org.eclipse.jst.jsf.common.runtime.internal.view.model.common.IHandlerTagElement.TagHandlerType;
+import org.eclipse.jst.jsf.core.JSFVersion;
+import org.eclipse.jst.jsf.core.internal.tld.TagIdentifierFactory;
+import org.eclipse.jst.jsf.core.jsfappconfig.JSFAppConfigUtils;
+import org.eclipse.jst.jsf.designtime.internal.view.mapping.ViewMetadataLoader;
+import org.eclipse.jst.jsf.designtime.internal.view.model.jsp.AbstractTagResolvingStrategy;
+import org.eclipse.jst.jsf.designtime.internal.view.model.jsp.DefaultTagTypeInfo;
+import org.eclipse.jst.jsf.facelet.core.internal.cm.FaceletDocumentFactory;
+import org.eclipse.jst.jsf.facelet.core.internal.registry.IFaceletTagResolvingStrategy.TLDWrapper;
+import org.eclipse.jst.jsf.facelet.core.internal.tagmodel.ComponentTag;
+import org.eclipse.jst.jsf.facelet.core.internal.tagmodel.ConverterTag;
+import org.eclipse.jst.jsf.facelet.core.internal.tagmodel.HandlerTag;
+import org.eclipse.jst.jsf.facelet.core.internal.tagmodel.IFaceletTagConstants;
+import org.eclipse.jst.jsf.facelet.core.internal.tagmodel.NoArchetypeFaceletTag;
+import org.eclipse.jst.jsf.facelet.core.internal.tagmodel.ValidatorTag;
+import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
+
+/**
+ * Temporary hard-coded tag resolver (to be replaced by meta-data)
+ * @author cbateman
+ *
+ */
+public class VeryTemporaryDefaultFaceletResolver extends
+ AbstractTagResolvingStrategy<TLDWrapper, String> implements IFaceletTagResolvingStrategy
+{
+ /**
+ * Tag resolver unique identifier
+ */
+ public final static String ID = "org.eclipse.jst.jsf.facelet.core.VeryTemporaryDefaultFaceletResolver"; //$NON-NLS-1$
+ private final DefaultTagTypeInfo _coreHtmlTypeInfo;
+ private final IProject _project;
+ private final FaceletDocumentFactory _factory;
+ private final ViewMetadataLoader _viewLoader;
+
+ /**
+ * @param project
+ * @param factory
+ */
+ public VeryTemporaryDefaultFaceletResolver(final IProject project, final FaceletDocumentFactory factory)
+ {
+ super();
+ _factory = factory;
+ _project = project;
+ _coreHtmlTypeInfo = new DefaultTagTypeInfo();
+ _viewLoader = new ViewMetadataLoader(project);
+ }
+
+ @Override
+ public final String getId()
+ {
+ return ID;
+ }
+
+ @Override
+ public ITagElement resolve(final TLDWrapper element)
+ {
+ final IProjectFacetVersion version = JSFAppConfigUtils
+ .getProjectFacet(_project);
+ final String versionAsString = version.getVersionString();
+ final JSFVersion jsfVersion = JSFVersion.valueOfString(versionAsString);
+
+ final String uri = element.getUri();
+ final String name = element.getTagDefn().getName();
+ final TagIdentifier tagId = TagIdentifierFactory.createJSPTagWrapper(
+ uri, name);
+ TypeInfo typeInfo = null;
+ if (IFaceletTagConstants.URI_JSF_FACELETS.equals(element.getUri()))
+ {
+ typeInfo = getTypeInfo(tagId, jsfVersion);
+ }
+ else
+ {
+ typeInfo = _coreHtmlTypeInfo.getTypeInfo(tagId,
+ jsfVersion);
+ }
+ return createFromTypeInfo(tagId, typeInfo);
+ }
+
+ private ITagElement createFromTypeInfo(final TagIdentifier tagId,
+ final TypeInfo typeInfo)
+ {
+ final MetadataAttributeAdvisor advisor =
+ new MetadataAttributeAdvisor(tagId, _viewLoader);
+ if (typeInfo instanceof ComponentTypeInfo)
+ {
+ return new ComponentTag(tagId.getUri(), tagId.getTagName(),
+ (ComponentTypeInfo) typeInfo, null, _factory, advisor);
+ }
+ else if (typeInfo instanceof ConverterTypeInfo)
+ {
+ return new ConverterTag(tagId.getUri(), tagId.getTagName(),
+ (ConverterTypeInfo) typeInfo, null, _factory, advisor);
+ }
+ else if (typeInfo instanceof ValidatorTypeInfo)
+ {
+ return new ValidatorTag(tagId.getUri(), tagId.getTagName(),
+ (ValidatorTypeInfo) typeInfo, null, _factory, advisor);
+ }
+ else if (typeInfo instanceof TagHandlerType)
+ {
+ return new HandlerTag(tagId.getUri(), tagId.getTagName(),
+ (TagHandlerType) typeInfo, null, _factory, advisor);
+ }
+ else if (DefaultTagTypeInfo.isDefaultLib(tagId.getUri()))
+ {
+ return new NoArchetypeFaceletTag(tagId.getUri(), tagId.getTagName(), _factory, advisor);
+ }
+
+ // not found
+ return null;
+
+ }
+
+ public final String getDisplayName()
+ {
+ return "Meta-data Driven Tag Resolver"; //$NON-NLS-1$
+ }
+
+ private static final ComponentTypeInfo COMPINFO_COMPONENT = new ComponentTypeInfo(
+ "facelets.ui.ComponentRef", //$NON-NLS-1$
+ "com.sun.facelets.tag.ui.ComponentRef", //$NON-NLS-1$
+ new String[]
+ {
+ "javax.faces.component.UIComponentBase", //$NON-NLS-1$
+ "javax.faces.component.UIComponent", "java.lang.Object", }, //$NON-NLS-1$ //$NON-NLS-2$
+ new String[]
+ { "javax.faces.component.StateHolder" }, //$NON-NLS-1$
+ "facelets", //$NON-NLS-1$
+ null);
+
+ private static final ComponentTypeInfo COMPINFO_DEBUG = new ComponentTypeInfo(
+ "facelets.ui.Debug", //$NON-NLS-1$
+ "com.sun.facelets.tag.ui.UIDebug", //$NON-NLS-1$
+ new String[]
+ {
+ "javax.faces.component.UIComponentBase", //$NON-NLS-1$
+ "javax.faces.component.UIComponent", "java.lang.Object", }, //$NON-NLS-1$ //$NON-NLS-2$
+ new String[]
+ { "javax.faces.component.StateHolder" }, //$NON-NLS-1$
+ "facelets", //$NON-NLS-1$
+ null);
+
+ private static final ComponentTypeInfo COMPINFO_REPEAT = new ComponentTypeInfo(
+ "facelets.ui.Repeat", //$NON-NLS-1$
+ "com.sun.facelets.component.UIRepeat", //$NON-NLS-1$
+ new String[]
+ {
+ "javax.faces.component.UIComponentBase", //$NON-NLS-1$
+ "javax.faces.component.UIComponent", "java.lang.Object", }, //$NON-NLS-1$ //$NON-NLS-2$
+ new String[]
+ {
+ "javax.faces.component.StateHolder", //$NON-NLS-1$
+ "javax.faces.component.NamingContainer" }, //$NON-NLS-1$
+ "facelets", //$NON-NLS-1$
+ null);
+
+ /**
+ * @param tagId
+ * @param jsfVersion
+ * @return a type info for the tag id in jsf version or null if none.
+ */
+ private TypeInfo getTypeInfo(final TagIdentifier tagId,
+ final JSFVersion jsfVersion)
+ {
+
+ switch (jsfVersion)
+ {
+ case V1_0:
+ case V1_1:
+ return JSF11_ELEMENTS.get(tagId);
+
+ case V1_2:
+ return JSF12_ELEMENTS.get(tagId);
+
+ default:
+ return null;
+ }
+ }
+ private static Map<TagIdentifier, TypeInfo> JSF11_ELEMENTS;
+ private static Map<TagIdentifier, TypeInfo> JSF12_ELEMENTS;
+ static
+ {
+ final Map<TagIdentifier, TypeInfo> elements = new HashMap<TagIdentifier, TypeInfo>();
+
+ elements.put(IFaceletTagConstants.TAG_IDENTIFIER_COMPONENT,
+ COMPINFO_COMPONENT);
+
+ elements.put(IFaceletTagConstants.TAG_IDENTIFIER_DEBUG,
+ COMPINFO_DEBUG);
+
+ elements.put(IFaceletTagConstants.TAG_IDENTIFIER_FRAGMENT,
+ COMPINFO_COMPONENT);
+
+ elements.put(IFaceletTagConstants.TAG_IDENTIFIER_REPEAT,
+ COMPINFO_REPEAT);
+
+ JSF11_ELEMENTS = Collections.unmodifiableMap(elements);
+
+ JSF12_ELEMENTS = Collections
+ .unmodifiableMap(new HashMap<TagIdentifier, TypeInfo>(elements));
+ }
+}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/messages.properties b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/messages.properties
new file mode 100644
index 000000000..dd82d8168
--- /dev/null
+++ b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/messages.properties
@@ -0,0 +1,3 @@
+FaceletRegistryManager_REGISTRY_FACTORY_DISPLAYNAME=Facelet Registry Factory
+FaceletTagRegistry_TAG_REGISTRY_REFRESH_JOB_DESCRIPTION=Refreshing Facelet tag registry for
+FaceletTagResolvingStrategy_FACELET_TAG_RESOLVER_DISPLAY_NAME=Facelet Introspecting Tag Resolver
diff --git a/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/taglib/AbstractFaceletTaglibLocator.java b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/taglib/AbstractFaceletTaglibLocator.java
new file mode 100644
index 000000000..3b63d2ec0
--- /dev/null
+++ b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/taglib/AbstractFaceletTaglibLocator.java
@@ -0,0 +1,84 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Oracle Corporation.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Cameron Bateman - initial API and implementation
+ *******************************************************************************/
+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.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.
+ *
+ * @author cbateman
+ *
+ */
+public abstract class AbstractFaceletTaglibLocator
+ extends
+ AbstractLocator<Map<String, ? extends IFaceletTagRecord>, IProject, String>
+ implements IFaceletTaglibLocator
+{
+ /**
+ * @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
+ */
+ @Override
+ protected abstract Map<String, ? extends IFaceletTagRecord> doLocate(
+ IProject context);
+
+ /**
+ * 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)
+ */
+ @Override
+ public void addListener(final ILocatorChangeListener listener)
+ {
+ if (!(listener instanceof Listener))
+ {
+ throw new IllegalArgumentException();
+ }
+ super.addListener(listener);
+ }
+
+ /**
+ * @param listener
+ */
+ public void addListener(final Listener listener)
+ {
+ super.addListener(listener);
+ }
+
+ /**
+ * @param taglibChangedEvent
+ */
+ protected void fireChangeEvent(final TaglibChangedEvent taglibChangedEvent)
+ {
+ super.fireChangeEvent(taglibChangedEvent);
+ }
+
+}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/taglib/ContextParamSpecifiedFaceletTaglibLocator.java b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/taglib/ContextParamSpecifiedFaceletTaglibLocator.java
new file mode 100644
index 000000000..5d13e4330
--- /dev/null
+++ b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/taglib/ContextParamSpecifiedFaceletTaglibLocator.java
@@ -0,0 +1,430 @@
+/*******************************************************************************
+ * Copyright (c) 2005, 2007 Oracle Corporation.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Ian Trimble - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jst.jsf.facelet.core.internal.registry.taglib;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.atomic.AtomicLong;
+
+import javax.xml.parsers.ParserConfigurationException;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResourceChangeEvent;
+import org.eclipse.core.resources.IResourceChangeListener;
+import org.eclipse.core.resources.IResourceDelta;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.jst.jsf.common.internal.managedobject.AbstractManagedObject;
+import org.eclipse.jst.jsf.common.internal.managedobject.ObjectManager.ManagedObjectException;
+import org.eclipse.jst.jsf.common.internal.resource.IResourceLifecycleListener;
+import org.eclipse.jst.jsf.common.internal.resource.ResourceLifecycleEvent;
+import org.eclipse.jst.jsf.common.internal.resource.ResourceSingletonObjectManager;
+import org.eclipse.jst.jsf.common.internal.resource.ResourceLifecycleEvent.EventType;
+import org.eclipse.jst.jsf.facelet.core.internal.FaceletCorePlugin;
+import org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.Listener.TaglibChangedEvent;
+import org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.Listener.TaglibChangedEvent.CHANGE_TYPE;
+import org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.WebappConfiguration.WebappListener;
+import org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.FaceletTaglibDefn;
+import org.xml.sax.SAXException;
+
+/**
+ * Attempts to locate Facelet taglib's specified as xml files in project
+ * relative paths specified in the Facelet.LIBRARIES servlet parameters.
+ *
+ * @author Based on class in org.eclipse.jst.jsf.coreby Ian Trimble - Oracle
+ *
+ * TODO:merge back with common code in JSFAppConfig framework
+ */
+/* 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;
+ private final TaglibFileManager _fileManager;
+
+ public ContextParamSpecifiedFaceletTaglibLocator(final IProject project,
+ final TagRecordFactory factory)
+ {
+ super(ID, DISPLAYNAME);
+ _project = project;
+ _records = new HashMap<String, IFaceletTagRecord>();
+ _factory = factory;
+ _fileManager = new TaglibFileManager(project,
+ new LibraryChangeHandler());
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @seeorg.eclipse.jst.jsf.core.jsfappconfig.AbstractJSFAppConfigLocater#
+ * startLocating()
+ */
+ @Override
+ public void start(final IProject project)
+ {
+ _fileManager.initFiles();
+ super.start(project);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @seeorg.eclipse.jst.jsf.core.jsfappconfig.AbstractJSFAppConfigLocater#
+ * stopLocating()
+ */
+ @Override
+ public void stop()
+ {
+ _fileManager.dispose();
+ }
+
+
+ @Override
+ protected Map<String, ? extends IFaceletTagRecord> doLocate(IProject context)
+ {
+ return findInWebRoot();
+ }
+
+ private Map<String, ? extends IFaceletTagRecord> findInWebRoot()
+ {
+ final List<IFile> files = _fileManager.getFiles();
+
+ _records.clear();
+
+ for (final IFile file : files)
+ {
+ if (file.exists())
+ {
+ TaglibFileTracker tracker = null;
+ try
+ {
+ tracker = _fileManager.getInstance(file);
+ }
+ catch (final ManagedObjectException e)
+ {
+ FaceletCorePlugin.log("Creating record", e); //$NON-NLS-1$
+ }
+
+ final IFaceletTagRecord record = createTagRecord(file);
+ if (record != null)
+ {
+ _records.put(record.getURI(), record);
+ if (tracker != null)
+ {
+ tracker.setUri(record.getURI());
+ }
+ }
+ }
+ }
+
+ return _records;
+ }
+
+ private IFaceletTagRecord createTagRecord(final IFile file)
+ {
+ InputStream is = null;
+ try
+ {
+ is = file.getContents();
+ FaceletTaglibDefn taglib = TagModelParser.loadFromInputStream(is, null);
+ if (taglib != null)
+ {
+ return _factory.createRecords(taglib);
+ }
+ }
+ catch (final CoreException e)
+ {
+ FaceletCorePlugin
+ .log(
+ "Loading web root taglibs for project: " + _project.getName(), e); //$NON-NLS-1$
+ }
+ catch (final IOException e)
+ {
+ FaceletCorePlugin
+ .log(
+ "Loading web root taglibs for project: " + _project.getName(), e); //$NON-NLS-1$
+ }
+ catch (final ParserConfigurationException e)
+ {
+ FaceletCorePlugin
+ .log(
+ "Loading web root taglibs for project: " + _project.getName(), e); //$NON-NLS-1$
+ }
+ catch (final SAXException e)
+ {
+ FaceletCorePlugin
+ .log(
+ "Loading web root taglibs for project: " + _project.getName(), e); //$NON-NLS-1$
+ }
+ finally
+ {
+ if (is != null)
+ {
+ try
+ {
+ is.close();
+ }
+ catch (final IOException e)
+ {
+ FaceletCorePlugin.log("Closing taglib.xml", e); //$NON-NLS-1$
+ }
+ }
+ }
+ return null;
+ }
+
+ private static class TaglibFileManager extends
+ ResourceSingletonObjectManager<TaglibFileTracker, IFile>
+ {
+ private final LibraryChangeHandler _handler;
+ private final WebappConfiguration _webAppConfiguration;
+ private final IResourceChangeListener _newFileListener;
+
+ public TaglibFileManager(final IProject project,
+ final LibraryChangeHandler handler)
+ {
+ _handler = handler;
+ _webAppConfiguration = new WebappConfiguration(project);
+ // TODO: fold into LifecycleListener
+ _newFileListener = new IResourceChangeListener()
+ {
+ public void resourceChanged(final IResourceChangeEvent event)
+ {
+ // if the event is post change && has the same parent
+ // project
+ if (event.getType() == IResourceChangeEvent.POST_CHANGE
+ && event.getDelta().findMember(
+ project.getFullPath()) != null)
+ {
+ for (final IFile file : _webAppConfiguration.getFiles())
+ {
+ final IResourceDelta delta = event.getDelta()
+ .findMember(file.getFullPath());
+
+ if (delta != null)
+ {
+ if (delta.getKind() == IResourceDelta.ADDED)
+ {
+ _handler.added(file);
+ }
+ }
+ }
+ }
+ }
+ };
+
+ ResourcesPlugin.getWorkspace().addResourceChangeListener(
+ _newFileListener);
+ }
+
+ public List<IFile> getFiles()
+ {
+ return _webAppConfiguration.getFiles();
+ }
+
+ public void initFiles()
+ {
+ _webAppConfiguration.start();
+ _webAppConfiguration.addListener(new WebappListener()
+ {
+ @Override
+ public void webappChanged(WebappChangeEvent event)
+ {
+ for (final IFile file : event.getRemoved())
+ {
+ TaglibFileTracker tracker;
+ try
+ {
+ tracker = getInstance(file);
+ _handler.removed(tracker._uri, file);
+ }
+ catch (ManagedObjectException e)
+ {
+ FaceletCorePlugin.log("While removing for webapp change", e); //$NON-NLS-1$
+ }
+ }
+
+ for (final IFile file : event.getAdded())
+ {
+ _handler.added(file);
+ }
+ }
+ });
+ }
+
+ @Override
+ protected TaglibFileTracker createNewInstance(final IFile file)
+ {
+ return new TaglibFileTracker(file, this, _handler);
+ }
+
+ public void addListener(final IResourceLifecycleListener listener)
+ {
+ super.addLifecycleEventListener(listener);
+ }
+
+ public void removeListener(final IResourceLifecycleListener listener)
+ {
+ super.removeLifecycleEventListener(listener);
+ }
+
+ public void dispose()
+ {
+ ResourcesPlugin.getWorkspace().removeResourceChangeListener(
+ _newFileListener);
+
+ final Collection<IFile> managedResources = getManagedResources();
+
+ for (final IFile file : managedResources)
+ {
+ unmanageResource(file);
+ }
+
+ _webAppConfiguration.dispose();
+ }
+ }
+
+ private static class TaglibFileTracker extends AbstractManagedObject
+ implements IResourceLifecycleListener
+ {
+ private final IFile _file;
+ private String _uri;
+ private final AtomicLong _lastModifiedStamp = new AtomicLong();
+ private TaglibFileManager _manager;
+ private final LibraryChangeHandler _handler;
+
+ public TaglibFileTracker(final IFile file,
+ final TaglibFileManager manager,
+ final LibraryChangeHandler handler)
+ {
+ _manager = manager;
+ _manager.addListener(this);
+ _file = file;
+ _lastModifiedStamp.set(file.getModificationStamp());
+ _handler = handler;
+ }
+
+ public final void setUri(final String uri)
+ {
+ _uri = uri;
+ }
+
+ @Override
+ public void checkpoint()
+ {
+ // nothing currently persisted
+
+ }
+
+ @Override
+ public void destroy()
+ {
+ // nothing currently persisted
+ }
+
+ @Override
+ public void dispose()
+ {
+ _manager.removeListener(this);
+ _manager = null;
+ }
+
+ public EventResult acceptEvent(final ResourceLifecycleEvent event)
+ {
+ if (!_file.equals(event.getAffectedResource()))
+ {
+ return EventResult.getDefaultEventResult();
+ }
+
+ final EventType eventType = event.getEventType();
+
+ switch (eventType)
+ {
+ case RESOURCE_ADDED:
+ // added resources kick an add event.
+ _handler.added(_file);
+ break;
+ case RESOURCE_CHANGED:
+ // changed resources kick a change event
+ _handler.changed(_uri, _file);
+ break;
+ case RESOURCE_INACCESSIBLE:
+ // removed resources kick a remove event
+ _handler.removed(_uri, _file);
+ break;
+ }
+
+ return EventResult.getDefaultEventResult();
+ }
+
+ }
+
+ private class LibraryChangeHandler
+ {
+ public void added(final IFile file)
+ {
+ final IFaceletTagRecord tagRecord = createTagRecord(file);
+ TaglibFileTracker tracker = null;
+ try
+ {
+ tracker = _fileManager
+ .getInstance(file);
+ }
+ catch (final ManagedObjectException e)
+ {
+ FaceletCorePlugin.log("Adding new library", e); //$NON-NLS-1$
+ }
+
+ if (tagRecord != null)
+ {
+
+ _records.put(tagRecord.getURI(), tagRecord);
+ if (tracker != null)
+ {
+ tracker.setUri(tagRecord.getURI());
+ }
+
+ fireChangeEvent(new TaglibChangedEvent(
+ ContextParamSpecifiedFaceletTaglibLocator.this, null,
+ tagRecord, CHANGE_TYPE.ADDED));
+ }
+ }
+
+ public void removed(final String uri, final IFile file)
+ {
+ final IFaceletTagRecord tagRecord = _records.remove(uri);
+ fireChangeEvent(new TaglibChangedEvent(
+ ContextParamSpecifiedFaceletTaglibLocator.this, tagRecord,
+ null, CHANGE_TYPE.REMOVED));
+ }
+
+ public void changed(final String uri, final IFile file)
+ {
+ final IFaceletTagRecord oldValue = _records.remove(uri);
+ final IFaceletTagRecord newValue = createTagRecord(file);
+ if (newValue != null)
+ {
+ _records.put(uri, newValue);
+ fireChangeEvent(new TaglibChangedEvent(
+ ContextParamSpecifiedFaceletTaglibLocator.this,
+ oldValue, newValue, CHANGE_TYPE.CHANGED));
+ }
+ }
+ }
+}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/taglib/FaceletTagIndex.java b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/taglib/FaceletTagIndex.java
new file mode 100644
index 000000000..fb1b457aa
--- /dev/null
+++ b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/taglib/FaceletTagIndex.java
@@ -0,0 +1,46 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Oracle Corporation.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Cameron Bateman - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jst.jsf.facelet.core.internal.registry.taglib;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.jst.jsf.common.internal.resource.ResourceSingletonObjectManager;
+
+/**
+ * @author cbateman
+ *
+ */
+public class FaceletTagIndex extends ResourceSingletonObjectManager<IProjectTaglibDescriptor, IProject>
+{
+ private final static FaceletTagIndex INSTANCE = new FaceletTagIndex();
+
+ /**
+ * @return the singleton instance
+ */
+ public static FaceletTagIndex getInstance()
+ {
+ return INSTANCE;
+ }
+
+ @Override
+ protected IProjectTaglibDescriptor createNewInstance(IProject project)
+ {
+ return new ProjectTaglibDescriptor(project);
+ }
+
+ /**
+ * Force a project to refresh its tag index info
+ * @param project
+ */
+ public void flush(final IProject project)
+ {
+ unmanageResource(project);
+ }
+}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/taglib/FaceletTagRecord.java b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/taglib/FaceletTagRecord.java
new file mode 100644
index 000000000..26761c26d
--- /dev/null
+++ b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/taglib/FaceletTagRecord.java
@@ -0,0 +1,55 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Oracle Corporation.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Cameron Bateman - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jst.jsf.facelet.core.internal.registry.taglib;
+
+import java.util.Collection;
+import java.util.concurrent.CopyOnWriteArrayList;
+
+import org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.TagDefn;
+
+abstract class FaceletTagRecord implements IFaceletTagRecord
+{
+ private final CopyOnWriteArrayList<ITagRecordChangeListener> _listeners;
+
+ public FaceletTagRecord()
+ {
+ _listeners = new CopyOnWriteArrayList<ITagRecordChangeListener>();
+ }
+
+ public final void addListener(final ITagRecordChangeListener listener)
+ {
+ _listeners.addIfAbsent(listener);
+ }
+
+ public final void removeListener(final ITagRecordChangeListener listener)
+ {
+ _listeners.remove(listener);
+ }
+
+ protected void fireEvent(final TagRecordChangeEvent event)
+ {
+ for (final ITagRecordChangeListener listener : _listeners)
+ {
+ listener.changed(event);
+ }
+ }
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = -4606745577562951499L;
+
+ public abstract String getURI();
+
+ public abstract TagDefn getTag(final String name);
+
+ public abstract Collection<? extends TagDefn> getTags();
+}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/taglib/IFaceletTagRecord.java b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/taglib/IFaceletTagRecord.java
new file mode 100644
index 000000000..56f501736
--- /dev/null
+++ b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/taglib/IFaceletTagRecord.java
@@ -0,0 +1,85 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Oracle Corporation.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Cameron Bateman - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jst.jsf.facelet.core.internal.registry.taglib;
+
+import java.io.Serializable;
+import java.util.Collection;
+import java.util.EventObject;
+
+import org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.TagDefn;
+
+/**
+ * @author cbateman
+ *
+ */
+public interface IFaceletTagRecord extends Serializable
+{
+ /**
+ * @return the uri of the tag library
+ */
+ String getURI();
+
+ /**
+ * This may be implemented differently than getTags().size(), since getting
+ * all tags may be very expensive, while the overall number may be cheap.
+ *
+ * However, it should always be true that getTags().size() == getNumTags()
+ *
+ * @return the number of tags in this record.
+ */
+ int getNumTags();
+
+ /**
+ * @return the tag definitions
+ */
+ Collection<? extends TagDefn> getTags();
+
+ /**
+ * @param name
+ * @return the tag definition for name or null.
+ */
+ TagDefn getTag(final String name);
+
+ /**
+ * @param listener
+ */
+ void addListener(final ITagRecordChangeListener listener);
+
+ /**
+ * @param listener
+ */
+ void removeListener(final ITagRecordChangeListener listener);
+
+ /**
+ * Indicates that a tag record has changed
+ */
+ static class TagRecordChangeEvent extends EventObject
+ {
+ /**
+ *
+ */
+ private static final long serialVersionUID = 5655356157624922019L;
+
+ TagRecordChangeEvent(IFaceletTagRecord source)
+ {
+ super(source);
+ }
+ }
+
+ /**
+ * A listener for tag record change events.
+ *
+ */
+ interface ITagRecordChangeListener
+ {
+ public void changed(final TagRecordChangeEvent event);
+ }
+}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/taglib/IFaceletTaglibLocator.java b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/taglib/IFaceletTaglibLocator.java
new file mode 100644
index 000000000..23c8d3db2
--- /dev/null
+++ b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/taglib/IFaceletTaglibLocator.java
@@ -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
diff --git a/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/taglib/IProjectTaglibDescriptor.java b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/taglib/IProjectTaglibDescriptor.java
new file mode 100644
index 000000000..effe16c7f
--- /dev/null
+++ b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/taglib/IProjectTaglibDescriptor.java
@@ -0,0 +1,45 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Oracle Corporation.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Cameron Bateman - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jst.jsf.facelet.core.internal.registry.taglib;
+
+import java.util.Collection;
+
+import org.eclipse.jst.jsf.common.internal.managedobject.IManagedObject;
+
+/**
+ * A descriptor for all facelet taglibs in a project.
+ *
+ * @author cbateman
+ *
+ */
+public interface IProjectTaglibDescriptor extends IManagedObject
+{
+ /**
+ * @return get the tag library records
+ */
+ public Collection<? extends IFaceletTagRecord> getTagLibraries();
+
+ /**
+ * @param uri
+ * @return get the tag library for uri
+ */
+ public IFaceletTagRecord getTagLibrary(final String uri);
+
+ /**
+ * @param listener
+ */
+ public void addListener(final Listener listener);
+
+ /**
+ * @param listener
+ */
+ public void removeListener(final Listener listener);
+}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/taglib/JarFileFaceletTaglibLocator.java b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/taglib/JarFileFaceletTaglibLocator.java
new file mode 100644
index 000000000..e33d71472
--- /dev/null
+++ b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/taglib/JarFileFaceletTaglibLocator.java
@@ -0,0 +1,284 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Oracle Corporation.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Cameron Bateman - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jst.jsf.facelet.core.internal.registry.taglib;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Enumeration;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.jar.JarEntry;
+import java.util.jar.JarFile;
+import java.util.regex.Pattern;
+
+import javax.xml.parsers.ParserConfigurationException;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IWorkspaceRoot;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.jdt.core.IClasspathEntry;
+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;
+
+/**
+ * A locator that finds Facelet taglibs in jars on the classpath
+ *
+ * @author cbateman
+ *
+ */
+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 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;
+
+ /**
+ * @param factory
+ */
+ public JarFileFaceletTaglibLocator(final TagRecordFactory factory)
+ {
+ 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> doLocate(
+ final IProject project)
+ {
+ try
+ {
+ return findInJars(project);
+ } catch (JavaModelException e)
+ {
+ FaceletCorePlugin
+ .log(
+ "Couldn't locate jar file taglibs: " + project.getProject(), e); //$NON-NLS-1$
+ }
+ return Collections.EMPTY_MAP;
+ }
+
+ private Map<String, ? extends IFaceletTagRecord> findInJars(
+ final IProject project) throws JavaModelException
+ {
+ final IJavaProject javaProject = JavaCore.create(project);
+
+ final IClasspathEntry[] entries = javaProject
+ .getResolvedClasspath(true);
+
+ final List<FaceletTaglibDefn> tagLibsFound = new ArrayList<FaceletTaglibDefn>();
+
+ for (final IClasspathEntry entry : entries)
+ {
+
+ switch (entry.getEntryKind())
+ {
+ // 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));
+ }
+ 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();
+ // }
+ // }
+ break;
+ // - 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:
+ break;
+ }
+ }
+
+ for (final FaceletTaglibDefn tag : tagLibsFound)
+ {
+ IFaceletTagRecord record = _factory.createRecords(tag);
+ if (record != null)
+ {
+ _records.put(record.getURI(), record);
+ }
+ }
+
+ return _records;
+ }
+
+ /**
+ * TODO: Merge into JSFAppConfigUtils.
+ *
+ * @param entry
+ * @return
+ */
+ private static JarFile getJarFileFromCPE(final IClasspathEntry entry)
+ throws IOException
+ {
+ if (entry.getEntryKind() == IClasspathEntry.CPE_LIBRARY)
+ {
+ IPath libraryPath = entry.getPath();
+ if (libraryPath.getFileExtension() != null
+ && libraryPath.getFileExtension().length() > 0)
+ {
+ final IWorkspaceRoot workspaceRoot = ResourcesPlugin
+ .getWorkspace().getRoot();
+ if (libraryPath.getDevice() == null
+ && workspaceRoot.getProject(libraryPath.segment(0))
+ .exists())
+ {
+ libraryPath = workspaceRoot.getFile(libraryPath)
+ .getLocation();
+ }
+ final String libraryPathString = libraryPath.toString();
+ return new JarFile(libraryPathString);
+ }
+ }
+ return null;
+ }
+
+ /**
+ * @param entry
+ * @param defaultDtdStream
+ */
+ private List<FaceletTaglibDefn> processJar(final IClasspathEntry entry)
+ {
+ JarFile jarFile = null;
+ final List<FaceletTaglibDefn> tagLibsFound = new ArrayList<FaceletTaglibDefn>();
+
+ try
+ {
+ jarFile = getJarFileFromCPE(entry);
+
+ if (jarFile != null)
+ {
+ final Enumeration<JarEntry> jarEntries = jarFile.entries();
+ while (jarEntries.hasMoreElements())
+ {
+ JarEntry jarEntry = jarEntries.nextElement();
+
+ jarEntry = _finder.perform(jarEntry);
+
+ if (jarEntry != null && jarEntry != _finder.getNoResult())
+ {
+ // 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$
+ {
+ InputStream is = null;
+ try
+ {
+ is = jarFile.getInputStream(jarEntry);
+
+ FaceletTaglibDefn tagLib = TagModelParser
+ .loadFromInputStream(is, null);
+
+ if (tagLib != null)
+ {
+ 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)
+ {
+ // is.close();
+ }
+ }
+ }
+ }
+ }
+ }
+ } catch (final IOException e)
+ {
+ FaceletCorePlugin.log(
+ "Error opening classpath jar file: " + entry, e); //$NON-NLS-1$
+ } finally
+ {
+ if (jarFile != null)
+ {
+ try
+ {
+ jarFile.close();
+ } catch (final IOException ioe)
+ {
+ FaceletCorePlugin.log("Error closing jar file", ioe); //$NON-NLS-1$
+ }
+ }
+ }
+ return tagLibsFound;
+ }
+}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/taglib/LibraryClassBasedTagRecord.java b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/taglib/LibraryClassBasedTagRecord.java
new file mode 100644
index 000000000..107828ca2
--- /dev/null
+++ b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/taglib/LibraryClassBasedTagRecord.java
@@ -0,0 +1,546 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Oracle Corporation.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Cameron Bateman - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jst.jsf.facelet.core.internal.registry.taglib;
+
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.concurrent.atomic.AtomicBoolean;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.jem.internal.proxy.core.IBeanProxy;
+import org.eclipse.jem.internal.proxy.core.IBeanTypeProxy;
+import org.eclipse.jem.internal.proxy.core.IBooleanBeanProxy;
+import org.eclipse.jem.internal.proxy.core.IFieldProxy;
+import org.eclipse.jem.internal.proxy.core.IMethodProxy;
+import org.eclipse.jem.internal.proxy.core.IStringBeanProxy;
+import org.eclipse.jem.internal.proxy.core.ProxyFactoryRegistry;
+import org.eclipse.jem.internal.proxy.core.ThrowableProxy;
+import org.eclipse.jst.jsf.core.internal.JSFCorePlugin;
+import org.eclipse.jst.jsf.core.internal.jem.BeanProxyUtil;
+import org.eclipse.jst.jsf.core.internal.jem.BeanProxyUtil.BeanProxyWrapper;
+import org.eclipse.jst.jsf.core.internal.jem.BeanProxyUtil.ProxyException;
+import org.eclipse.jst.jsf.facelet.core.internal.FaceletCorePlugin;
+import org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.ComponentTagDefn;
+import org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.ConverterTagDefn;
+import org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.FaceletLibraryClassTagLib;
+import org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.FaceletTaglibFactory;
+import org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.TagDefn;
+import org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.ValidatorTagDefn;
+
+/**
+ * @author cbateman
+ *
+ */
+/* package */class LibraryClassBasedTagRecord extends FaceletTagRecord
+{
+ private static final String METHOD_NAME_GET_VALUE = "getValue"; //$NON-NLS-1$
+ private static final String METHOD_NAME_GET_KEY = "getKey"; //$NON-NLS-1$
+ private static final String METHOD_NAME_HAS_NEXT = "hasNext"; //$NON-NLS-1$
+ private static final String METHOD_NAME_NEXT = "next"; //$NON-NLS-1$
+ private static final String METHOD_NAME_ITERATOR = "iterator"; //$NON-NLS-1$
+ private static final String METHOD_NAME_ENTRY_SET = "entrySet"; //$NON-NLS-1$
+ private static final String PROPERTY_NAME_FACTORIES = "factories"; //$NON-NLS-1$
+ private static final String QUALIFIED_CLASS_NAME__COM_SUN_FACELETS_TAG_ABSTRACT_TAG_LIBRARY = "com.sun.facelets.tag.AbstractTagLibrary"; //$NON-NLS-1$
+ private static final String QUALIFIED_CLASS_NAME_JAVA_UTIL_MAP = "java.util.Map"; //$NON-NLS-1$
+
+ private static final String COM_SUN_FACELETS_TAG_ABSTRACT_TAG_LIBRARY$_HANDLER_FACTORY = "com.sun.facelets.tag.AbstractTagLibrary$HandlerFactory"; //$NON-NLS-1$
+ private static final String COM_SUN_FACELETS_TAG_ABSTRACT_TAG_LIBRARY$_USER_CONVERTER_HANDLER_FACTORY = "com.sun.facelets.tag.AbstractTagLibrary$UserConverterHandlerFactory"; //$NON-NLS-1$
+ private static final String COM_SUN_FACELETS_TAG_ABSTRACT_TAG_LIBRARY$_CONVERTER_HANDLER_FACTORY = "com.sun.facelets.tag.AbstractTagLibrary$ConverterHandlerFactory"; //$NON-NLS-1$
+ private static final String COM_SUN_FACELETS_TAG_ABSTRACT_TAG_LIBRARY$_USER_VALIDATOR_HANDLER_FACTORY = "com.sun.facelets.tag.AbstractTagLibrary$UserValidatorHandlerFactory"; //$NON-NLS-1$
+ private static final String COM_SUN_FACELETS_TAG_ABSTRACT_TAG_LIBRARY$_VALIDATOR_HANDLER_FACTORY = "com.sun.facelets.tag.AbstractTagLibrary$ValidatorHandlerFactory"; //$NON-NLS-1$
+ private static final String COM_SUN_FACELETS_TAG_ABSTRACT_TAG_LIBRARY$_USER_COMPONENT_HANDLER_FACTORY = "com.sun.facelets.tag.AbstractTagLibrary$UserComponentHandlerFactory"; //$NON-NLS-1$
+ private static final String COM_SUN_FACELETS_TAG_ABSTRACT_TAG_LIBRARY$_COMPONENT_HANDLER_FACTORY = "com.sun.facelets.tag.AbstractTagLibrary$ComponentHandlerFactory"; //$NON-NLS-1$
+
+ private static final String FIELD_NAME_CONVERTER_ID = "converterId"; //$NON-NLS-1$
+ private static final String FIELD_NAME_VALIDATOR_ID = "validatorId"; //$NON-NLS-1$
+ private static final String FIELD_NAME_RENDER_TYPE = "renderType"; //$NON-NLS-1$
+ private static final String FIELD_NAME_COMPONENT_TYPE = "componentType"; //$NON-NLS-1$
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = 4174629773250721041L;
+ private static final String STATIC_MEMBER_NAMESPACE = "Namespace"; //$NON-NLS-1$
+ private static final String METHOD_NAME_GET_NAMESPACE = "getNamespace"; //$NON-NLS-1$
+
+ private final IProject _project;
+ private final FaceletLibraryClassTagLib _model;
+ private final ProxyFactoryRegistry _registry;
+ private final AtomicBoolean _isInitialized = new AtomicBoolean(
+ false);
+
+ private String _uri;
+ private BeanProxyWrapper _classTypeWrapper;
+ private Map<String, TagDefn> _tags;
+
+ /**
+ * @param registry
+ * @param model
+ * @param project
+ */
+ public LibraryClassBasedTagRecord(final ProxyFactoryRegistry registry,
+ final FaceletLibraryClassTagLib model, final IProject project)
+ {
+ _registry = registry;
+ _model = model;
+ _project = project;
+ }
+
+ public void initURI() throws CoreException
+ {
+ if (_isInitialized.get())
+ {
+ throw new CoreException(
+ new Status(
+ IStatus.ERROR,
+ JSFCorePlugin.PLUGIN_ID,
+ "Cannot initURI once the library is initialized for: " + _model.getLibraryClass())); //$NON-NLS-1$
+ }
+
+ final IBeanTypeProxy libFactoryTypeProxy = _registry
+ .getBeanTypeProxyFactory().getBeanTypeProxy(
+ _model.getLibraryClass());
+
+ if (libFactoryTypeProxy == null)
+ {
+ throw new CoreException(new Status(IStatus.ERROR,
+ JSFCorePlugin.PLUGIN_ID,
+ "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
+ {
+ _classTypeWrapper.init();
+ }
+ catch (final ProxyException e)
+ {
+ throw new CoreException(new Status(IStatus.ERROR,
+ JSFCorePlugin.PLUGIN_ID,
+ "Couldn't load class: " + _model.getLibraryClass(), e)); //$NON-NLS-1$
+ }
+
+ final String namespace = resolveNS(_classTypeWrapper);
+ System.out.println(namespace);
+
+ if (namespace == null)
+ {
+ throw new CoreException(new Status(IStatus.ERROR,
+ JSFCorePlugin.PLUGIN_ID,
+ "Couldn't load uri: " + _model.getLibraryClass())); //$NON-NLS-1$
+
+ }
+ _uri = namespace;
+ }
+
+ @Override
+ public synchronized TagDefn getTag(final String name)
+ {
+ initializeIfNecessary();
+ return _tags.get(name);
+ }
+
+ @Override
+ public synchronized Collection<? extends TagDefn> getTags()
+ {
+ initializeIfNecessary();
+ return Collections.unmodifiableCollection(_tags.values());
+ }
+
+ private void initializeIfNecessary()
+ {
+ if (_isInitialized.compareAndSet(false, true))
+ {
+ if (_tags == null)
+ {
+ _tags = resolveTags();
+ }
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.FaceletTagRecord
+ * #getURI()
+ */
+ @Override
+ public String getURI()
+ {
+ return _uri;
+ }
+
+ private Map<String, TagDefn> resolveTags()
+ {
+ final Map<String, TagDefn> tags = new HashMap<String, TagDefn>();
+
+ // if the tag factory is a child of AbstractTagFactory, then we
+ // can try to get our hands on its private parts ...
+ final IBeanTypeProxy mapTypeProxy = _registry.getBeanTypeProxyFactory()
+ .getBeanTypeProxy(QUALIFIED_CLASS_NAME_JAVA_UTIL_MAP);
+ final IBeanTypeProxy componentFactoryTypeProxy = _registry
+ .getBeanTypeProxyFactory()
+ .getBeanTypeProxy(
+ QUALIFIED_CLASS_NAME__COM_SUN_FACELETS_TAG_ABSTRACT_TAG_LIBRARY);
+
+ if (mapTypeProxy != null && componentFactoryTypeProxy != null)
+ {
+ final IFieldProxy fieldProxy = componentFactoryTypeProxy
+ .getDeclaredFieldProxy(PROPERTY_NAME_FACTORIES);
+
+ if (fieldProxy != null)
+ {
+ if (fieldProxy.getFieldType().isKindOf(mapTypeProxy))
+ {
+ IBeanProxy factories = null;
+
+ try
+ {
+ // need to turn off security checking on the private
+ // field
+ fieldProxy.setAccessible(true);
+ factories = fieldProxy.get(_classTypeWrapper
+ .getInstance());
+ }
+ catch (final ThrowableProxy e)
+ {
+ FaceletCorePlugin.log(
+ "Error getting factories from bean instance", //$NON-NLS-1$
+ e);
+ }
+
+ if (factories != null)
+ {
+ final IMethodProxy entrySetMethod = fieldProxy
+ .getFieldType().getMethodProxy(
+ METHOD_NAME_ENTRY_SET);
+ if (entrySetMethod != null)
+ {
+ try
+ {
+ entrySetMethod.setAccessible(true);
+ final IBeanProxy entrySetProxy = entrySetMethod
+ .invoke(factories);
+
+ if (entrySetProxy != null)
+ {
+ final IMethodProxy iteratorMethod = entrySetProxy
+ .getTypeProxy().getMethodProxy(
+ METHOD_NAME_ITERATOR);
+ iteratorMethod.setAccessible(true);
+ final IBeanProxy iteratorProxy = iteratorMethod
+ .invoke(entrySetProxy);
+
+ if (iteratorProxy != null)
+ {
+ final IMethodProxy nextMethod = iteratorProxy
+ .getTypeProxy().getMethodProxy(
+ METHOD_NAME_NEXT);
+ nextMethod.setAccessible(true);
+ final IMethodProxy hasNextMethod = iteratorProxy
+ .getTypeProxy().getMethodProxy(
+ METHOD_NAME_HAS_NEXT);
+ hasNextMethod.setAccessible(true);
+
+ while (((IBooleanBeanProxy) hasNextMethod
+ .invoke(iteratorProxy))
+ .booleanValue())
+ {
+ final IBeanProxy entryProxy = nextMethod
+ .invoke(iteratorProxy);
+ final IMethodProxy getKeyProxy = entryProxy
+ .getTypeProxy()
+ .getMethodProxy(
+ METHOD_NAME_GET_KEY);
+ final IMethodProxy getValueProxy = entryProxy
+ .getTypeProxy()
+ .getMethodProxy(
+ METHOD_NAME_GET_VALUE);
+ if (getKeyProxy != null
+ && getValueProxy != null)
+ {
+ getKeyProxy.setAccessible(true);
+ final IBeanProxy key = getKeyProxy
+ .invoke(entryProxy);
+
+ if (key instanceof IStringBeanProxy)
+ {
+ final String name = ((IStringBeanProxy) key)
+ .stringValue();
+ getValueProxy
+ .setAccessible(true);
+ final IBeanProxy value = getValueProxy
+ .invoke(entryProxy);
+
+ if (value != null)
+ {
+ final TagDefn tagDefn = createTagDefn(
+ name,
+ value);
+ if (tagDefn != null)
+ {
+ tags.put(name,
+ tagDefn);
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ catch (final ThrowableProxy e)
+ {
+ FaceletCorePlugin.log(
+ "Error invoking entrySet", e); //$NON-NLS-1$
+ }
+ }
+ }
+
+ }
+ }
+ }
+ return tags;
+ }
+
+ private TagDefn createTagDefn(final String name,
+ final IBeanProxy handlerValueProxy)
+ {
+ final IBeanTypeProxy handlerTypeProxy = handlerValueProxy.getTypeProxy();
+ final FaceletTaglibFactory TAGDEFN_FACTORY = FaceletTaglibFactory.eINSTANCE;
+
+ final IBeanTypeProxy componentHandlerFactory = _registry
+ .getBeanTypeProxyFactory()
+ .getBeanTypeProxy(
+ COM_SUN_FACELETS_TAG_ABSTRACT_TAG_LIBRARY$_COMPONENT_HANDLER_FACTORY);
+ final IBeanTypeProxy userComponentHandlerFactory = _registry
+ .getBeanTypeProxyFactory()
+ .getBeanTypeProxy(
+ COM_SUN_FACELETS_TAG_ABSTRACT_TAG_LIBRARY$_USER_COMPONENT_HANDLER_FACTORY);
+ final IBeanTypeProxy validatorHandlerFactory = _registry
+ .getBeanTypeProxyFactory()
+ .getBeanTypeProxy(
+ COM_SUN_FACELETS_TAG_ABSTRACT_TAG_LIBRARY$_VALIDATOR_HANDLER_FACTORY);
+ final IBeanTypeProxy userValidatorHandlerFactory = _registry
+ .getBeanTypeProxyFactory()
+ .getBeanTypeProxy(
+ COM_SUN_FACELETS_TAG_ABSTRACT_TAG_LIBRARY$_USER_VALIDATOR_HANDLER_FACTORY);
+ final IBeanTypeProxy converterHandlerFactory = _registry
+ .getBeanTypeProxyFactory()
+ .getBeanTypeProxy(
+ COM_SUN_FACELETS_TAG_ABSTRACT_TAG_LIBRARY$_CONVERTER_HANDLER_FACTORY);
+ final IBeanTypeProxy userConverterHandlerFactory = _registry
+ .getBeanTypeProxyFactory()
+ .getBeanTypeProxy(
+ COM_SUN_FACELETS_TAG_ABSTRACT_TAG_LIBRARY$_USER_CONVERTER_HANDLER_FACTORY);
+ final IBeanTypeProxy handlerFactory = _registry
+ .getBeanTypeProxyFactory()
+ .getBeanTypeProxy(
+ COM_SUN_FACELETS_TAG_ABSTRACT_TAG_LIBRARY$_HANDLER_FACTORY);
+ final IBeanTypeProxy userTagFactory = _registry
+ .getBeanTypeProxyFactory()
+ .getBeanTypeProxy(
+ COM_SUN_FACELETS_TAG_ABSTRACT_TAG_LIBRARY$_HANDLER_FACTORY);
+
+ TagDefn tagDefn = null;
+
+ if (handlerTypeProxy.isKindOf(componentHandlerFactory)
+ || handlerTypeProxy.isKindOf(userComponentHandlerFactory))
+ {
+ final IFieldProxy componentTypeProxy = handlerTypeProxy
+ .getDeclaredFieldProxy(FIELD_NAME_COMPONENT_TYPE);
+ final IFieldProxy rendererTypeProxy = handlerTypeProxy
+ .getDeclaredFieldProxy(FIELD_NAME_RENDER_TYPE);
+ try
+ {
+ if (componentTypeProxy != null)
+ {
+ componentTypeProxy.setAccessible(true);
+ rendererTypeProxy.setAccessible(true);
+ final IBeanProxy componentType = componentTypeProxy
+ .get(handlerValueProxy);
+ // final IBeanProxy rendererType = rendererTypeProxy
+ // .get(handlerValueProxy);
+
+ // render type is optional, but must have component type
+ if (componentType instanceof IStringBeanProxy)
+ {
+ final String componentTypeValue = getMeaningfulString(((IStringBeanProxy) componentType)
+ .stringValue());
+
+ if (componentTypeValue != null)
+ {
+ final ComponentTagDefn compTagDefn = TAGDEFN_FACTORY
+ .createComponentTagDefn();
+ compTagDefn.setComponentType(componentTypeValue);
+ // if (rendererType instanceof IStringBeanProxy)
+ // {
+ // compTagDefn
+ // .setRendererType(getMeaningfulString(((
+ // IStringBeanProxy) rendererType)
+ // .stringValue()));
+ // }
+ tagDefn = compTagDefn;
+ }
+ }
+ }
+ }
+ catch (final ThrowableProxy e)
+ {
+ FaceletCorePlugin.log("Error get component info", e); //$NON-NLS-1$
+ }
+ }
+ else if (handlerTypeProxy.isKindOf(validatorHandlerFactory)
+ || handlerTypeProxy.isKindOf(userValidatorHandlerFactory))
+ {
+ final IFieldProxy validatorIdProxy = handlerTypeProxy
+ .getDeclaredFieldProxy(FIELD_NAME_VALIDATOR_ID);
+
+ try
+ {
+ if (validatorIdProxy != null)
+ {
+ validatorIdProxy.setAccessible(true);
+ final IBeanProxy validatorId = validatorIdProxy
+ .get(handlerValueProxy);
+
+ final ValidatorTagDefn valTagDefn = TAGDEFN_FACTORY
+ .createValidatorTagDefn();
+ tagDefn = valTagDefn;
+
+ if (validatorId instanceof IStringBeanProxy)
+ {
+ final String validatorIdValue = getMeaningfulString(((IStringBeanProxy) validatorId)
+ .stringValue());
+
+ if (validatorIdValue != null)
+ {
+ valTagDefn.setValidatorId(validatorIdValue);
+ }
+ }
+ }
+ }
+ catch (final ThrowableProxy e)
+ {
+ FaceletCorePlugin.log("Error getting validator info", e); //$NON-NLS-1$
+ }
+ }
+ else if (handlerTypeProxy.isKindOf(converterHandlerFactory)
+ || handlerTypeProxy.isKindOf(userConverterHandlerFactory))
+ {
+ final IFieldProxy converterIdProxy = handlerTypeProxy
+ .getDeclaredFieldProxy(FIELD_NAME_CONVERTER_ID);
+
+ try
+ {
+ if (converterIdProxy != null)
+ {
+ converterIdProxy.setAccessible(true);
+ final IBeanProxy converterId = converterIdProxy
+ .get(handlerValueProxy);
+
+ final ConverterTagDefn converterTagDefn = TAGDEFN_FACTORY
+ .createConverterTagDefn();
+ tagDefn = converterTagDefn;
+
+ if (converterId instanceof IStringBeanProxy)
+ {
+ final String converterIdValue = getMeaningfulString(((IStringBeanProxy) converterId)
+ .stringValue());
+
+ if (converterIdValue != null)
+ {
+ converterTagDefn.setConverterId(converterIdValue);
+ }
+ }
+ }
+ }
+ catch (final ThrowableProxy e)
+ {
+ FaceletCorePlugin.log("Error getting validator info", e); //$NON-NLS-1$
+ }
+ }
+ else if (handlerTypeProxy.isKindOf(handlerFactory)
+ || handlerTypeProxy.isKindOf(userTagFactory))
+ {
+ tagDefn = TAGDEFN_FACTORY.createHandlerTagDefn();
+ }
+
+ if (tagDefn != null)
+ {
+ tagDefn.setName(name);
+ }
+ return tagDefn;
+ }
+
+ private String getMeaningfulString(final String value)
+ {
+ if (value == null)
+ {
+ return null;
+ }
+
+ String retValue = value.trim();
+
+ if ("".equals(retValue)) //$NON-NLS-1$
+ {
+ retValue = null;
+ }
+ return retValue;
+ }
+
+ private String resolveNS(final BeanProxyWrapper beanProxy)
+ {
+ IBeanProxy resultProxy = null;
+ try
+ {
+ resultProxy = beanProxy.call(METHOD_NAME_GET_NAMESPACE);
+
+ if (resultProxy instanceof IStringBeanProxy)
+ {
+ return ((IStringBeanProxy) resultProxy).stringValue();
+ }
+ }
+ catch (final BeanProxyUtil.ProxyException e)
+ {
+ // fall through
+ }
+
+ return resolveNSAggressively(beanProxy);
+ }
+
+ private String resolveNSAggressively(final BeanProxyWrapper beanProxy)
+ {
+ try
+ {
+ return beanProxy.getStringFieldValue(STATIC_MEMBER_NAMESPACE);
+ }
+ catch (final ProxyException e)
+ {
+ // fall through
+ }
+ return null;
+ }
+
+ public synchronized int getNumTags()
+ {
+ initializeIfNecessary();
+ return _tags.size();
+ }
+}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/taglib/Listener.java b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/taglib/Listener.java
new file mode 100644
index 000000000..07de09aef
--- /dev/null
+++ b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/taglib/Listener.java
@@ -0,0 +1,112 @@
+package org.eclipse.jst.jsf.facelet.core.internal.registry.taglib;
+
+import org.eclipse.jst.jsf.common.internal.locator.ILocatorChangeListener;
+
+/**
+ * A listener for locator detected tag library changes
+ * @author cbateman
+ *
+ */
+public abstract class Listener implements ILocatorChangeListener
+{
+ /**
+ * Indicates that a tag library has changed
+ * @author cbateman
+ *
+ */
+ public static class TaglibChangedEvent extends LocatorChangeEvent
+ {
+ /**
+ * TODO: what happens if one locator has a namespace collision with
+ * another one?
+ */
+ public enum CHANGE_TYPE
+ {
+ /**
+ * Indicates that the library is new
+ */
+ ADDED,
+
+ /**
+ * Indicates that the library was removed.
+ */
+ REMOVED,
+
+ /**
+ * Indicates that the library is not new, but it's content
+ * has changed
+ */
+ CHANGED
+ }
+
+ private final TaglibChangedEvent.CHANGE_TYPE _changeType;
+ private final IFaceletTagRecord _oldValue;
+ private final IFaceletTagRecord _newValue;
+
+ /**
+ * @param source
+ * @param oldValue
+ * @param newValue
+ * @param changeType
+ */
+ public TaglibChangedEvent(
+ final AbstractFaceletTaglibLocator source,
+ final IFaceletTagRecord oldValue,
+ final IFaceletTagRecord newValue,
+ TaglibChangedEvent.CHANGE_TYPE changeType)
+ {
+ super(source);
+ _changeType = changeType;
+ _oldValue = oldValue;
+ _newValue = newValue;
+ }
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = -4060018031568577836L;
+
+ @Override
+ public AbstractFaceletTaglibLocator getSource()
+ {
+ return (AbstractFaceletTaglibLocator) super.getSource();
+ }
+
+ /**
+ * @return the type of the change
+ */
+ public final TaglibChangedEvent.CHANGE_TYPE getChangeType()
+ {
+ return _changeType;
+ }
+
+ /**
+ * @return the old value. This is null if the event is ADDED
+ */
+ public final IFaceletTagRecord getOldValue()
+ {
+ return _oldValue;
+ }
+
+ /**
+ * @return the new value. This is null if the event is REMOVED
+ */
+ public final IFaceletTagRecord getNewValue()
+ {
+ return _newValue;
+ }
+ }
+
+
+ public final void changed(final LocatorChangeEvent event)
+ {
+ changed((TaglibChangedEvent)event);
+ }
+
+
+ /**
+ * @param event
+ *
+ */
+ public abstract void changed(Listener.TaglibChangedEvent event);
+} \ No newline at end of file
diff --git a/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/taglib/Messages.java b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/taglib/Messages.java
new file mode 100644
index 000000000..0ebb73d4a
--- /dev/null
+++ b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/taglib/Messages.java
@@ -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.
+ }
+}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/taglib/ProjectTaglibDescriptor.java b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/taglib/ProjectTaglibDescriptor.java
new file mode 100644
index 000000000..3f87846f3
--- /dev/null
+++ b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/taglib/ProjectTaglibDescriptor.java
@@ -0,0 +1,191 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Oracle Corporation.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Cameron Bateman - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jst.jsf.facelet.core.internal.registry.taglib;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.atomic.AtomicInteger;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.ISafeRunnable;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.SafeRunner;
+import org.eclipse.jem.internal.proxy.core.IConfigurationContributor;
+import org.eclipse.jem.internal.proxy.core.ProxyFactoryRegistry;
+import org.eclipse.jem.internal.proxy.ide.IDERegistration;
+import org.eclipse.jst.jsf.core.JSFVersion;
+import org.eclipse.jst.jsf.facelet.core.internal.FaceletCorePlugin;
+import org.eclipse.jst.jsf.facelet.core.internal.registry.ELProxyContributor;
+import org.eclipse.jst.jsf.facelet.core.internal.registry.ServletBeanProxyContributor;
+
+class ProjectTaglibDescriptor implements IProjectTaglibDescriptor
+{
+
+ private ProxyFactoryRegistry _registry;
+ private final AtomicInteger _isInitialized = new AtomicInteger(
+ 0);
+ private final IProject _project;
+ private final List<AbstractFaceletTaglibLocator> _locators;
+ private final MyChangeListener _libChangeListener;
+ private final Map<String, IFaceletTagRecord> _tagRecords;
+
+ public ProjectTaglibDescriptor(final IProject project)
+ {
+ _project = project;
+ _locators = new ArrayList<AbstractFaceletTaglibLocator>();
+ _tagRecords = new HashMap<String, IFaceletTagRecord>();
+
+ try
+ {
+ _registry = createProxyRegistry(_project);
+ }
+ catch (final CoreException e)
+ {
+ FaceletCorePlugin.log("While creatinng proxy", e); //$NON-NLS-1$
+ }
+
+ final TagRecordFactory factory = new TagRecordFactory(project,
+ _registry);
+ _locators.add(new JarFileFaceletTaglibLocator(factory));
+ _locators.add(new ContextParamSpecifiedFaceletTaglibLocator(_project,
+ factory));
+
+ _libChangeListener = new MyChangeListener();
+ }
+
+ private static ProxyFactoryRegistry createProxyRegistry(
+ final IProject project) throws CoreException
+ {
+ final IConfigurationContributor[] contributor = new IConfigurationContributor[]
+ { new ServletBeanProxyContributor(JSFVersion.V1_1),
+ new ELProxyContributor(project) };
+
+ return IDERegistration.startAnImplementation(contributor, false,
+ project, project.getName(), FaceletCorePlugin.PLUGIN_ID,
+ new NullProgressMonitor());
+ }
+
+ private void initialize()
+ {
+ if (_isInitialized.addAndGet(1) == 1)
+ {
+ synchronized (this)
+ {
+
+ for (final AbstractFaceletTaglibLocator locator : _locators)
+ {
+ SafeRunner.run(new ISafeRunnable()
+ {
+ public void handleException(final Throwable exception)
+ {
+ FaceletCorePlugin
+ .log(
+ "While locating facelet libraries on project: " + _project.getName(), new Exception(exception)); //$NON-NLS-1$
+ }
+
+ public void run() throws Exception
+ {
+ locator.addListener(_libChangeListener);
+ locator.start(_project);
+ _tagRecords.putAll(locator.locate(_project));
+ }
+ });
+ }
+ }
+ }
+ }
+
+ public Collection<? extends IFaceletTagRecord> getTagLibraries()
+ {
+ initialize();
+ return Collections.unmodifiableCollection(_tagRecords.values());
+ }
+
+ void maybeLog(final Exception e)
+ {
+ if (_isInitialized.get() <= 1)
+ {
+ FaceletCorePlugin.log("Failed initializing taglib descriptor", e); //$NON-NLS-1$
+ }
+ }
+
+ public IFaceletTagRecord getTagLibrary(final String uri)
+ {
+ initialize();
+ return _tagRecords.get(uri);
+ }
+
+ public void addListener(final Listener listener)
+ {
+ for (final AbstractFaceletTaglibLocator locator : _locators)
+ {
+ locator.addListener(listener);
+ }
+ }
+
+ public void removeListener(final Listener listener)
+ {
+ for (final AbstractFaceletTaglibLocator locator : _locators)
+ {
+ locator.removeListener(listener);
+ }
+ }
+
+ public void checkpoint()
+ {
+ // TODO Auto-generated method stub
+ }
+
+ public void destroy()
+ {
+ // TODO Auto-generated method stub
+ }
+
+ public void dispose()
+ {
+ if (_registry != null)
+ {
+ _registry.terminateRegistry(false);
+
+ for (final AbstractFaceletTaglibLocator locator : _locators)
+ {
+ locator.stop();
+ }
+ }
+ }
+
+ private class MyChangeListener extends Listener
+ {
+ @Override
+ public void changed(final TaglibChangedEvent event)
+ {
+ switch (event.getChangeType())
+ {
+ case ADDED:
+ _tagRecords.put(event.getNewValue().getURI(), event
+ .getNewValue());
+ break;
+ case CHANGED:
+ _tagRecords.put(event.getNewValue().getURI(), event
+ .getNewValue());
+ break;
+ case REMOVED:
+ _tagRecords.remove(event.getOldValue());
+ break;
+ }
+ }
+ }
+}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/taglib/TagModelParser.java b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/taglib/TagModelParser.java
new file mode 100644
index 000000000..efb1ed0a3
--- /dev/null
+++ b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/taglib/TagModelParser.java
@@ -0,0 +1,461 @@
+package org.eclipse.jst.jsf.facelet.core.internal.registry.taglib;
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+
+import org.eclipse.jst.jsf.facelet.core.internal.FaceletCorePlugin;
+import org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.ComponentTagDefn;
+import org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.ConverterTagDefn;
+import org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.FaceletLibraryClassTagLib;
+import org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.FaceletTaglibDefn;
+import org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.FaceletTaglibFactory;
+import org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.FaceletXMLDefnTaglib;
+import org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.HandlerTagDefn;
+import org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.SourceTagDefn;
+import org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.TagDefn;
+import org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.ValidatorTagDefn;
+import org.w3c.dom.Document;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
+import org.xml.sax.helpers.DefaultHandler;
+
+/**
+ * A Facelet tag library document parser (dtd 1.0).
+ *
+ * @author cbateman
+ *
+ */
+public class TagModelParser
+{
+ private static final String FACELET_TAGLIB_DTD_PATH = "/dtd/facelet-taglib_1_0.dtd"; //$NON-NLS-1$
+
+
+ private static final String ELEMENT_NAME_VALIDATOR_ID = "validator-id"; //$NON-NLS-1$
+ private static final String ELEMENT_NAME_CONVERTER_ID = "converter-id"; //$NON-NLS-1$
+ private static final String ELEMENT_NAME_RENDERER_TYPE = "renderer-type"; //$NON-NLS-1$
+ private static final String ELEMENT_NAME_COMPONENT_TYPE = "component-type"; //$NON-NLS-1$
+ private static final String ELEMENT_NAME_VALIDATOR = "validator"; //$NON-NLS-1$
+ private static final String ELEMENT_NAME_CONVERTER = "converter"; //$NON-NLS-1$
+ private static final String ELEMENT_NAME_COMPONENT = "component"; //$NON-NLS-1$
+ private static final String ELEMENT_NAME_HANDLER_CLASS = "handler-class"; //$NON-NLS-1$
+ private static final String ELEMENT_NAME_SOURCE = "source"; //$NON-NLS-1$
+ private static final String ELEMENT_NAME_TAG_NAME = "tag-name"; //$NON-NLS-1$
+ private static final String ELEMENT_NAME_TAG = "tag"; //$NON-NLS-1$
+ private static final String ELEMENT_NAME_NAMESPACE = "namespace"; //$NON-NLS-1$
+ private static final String ELEMENT_NAME_LIBRARY_CLASS = "library-class"; //$NON-NLS-1$
+ private static final String ELEMENT_NAME_FACELET_TAGLIB = "facelet-taglib"; //$NON-NLS-1$
+ private static final String URI_FACELET_TAGLIB_1_0_DTD = "facelet-taglib_1_0.dtd"; //$NON-NLS-1$
+ private static final String PUBLIC_DTD_FACELET_TAGLIB_1_0_DTD = "-//Sun Microsystems, Inc.//DTD Facelet Taglib 1.0//EN"; //$NON-NLS-1$
+
+ /**
+ * @param is
+ * @param dtdSourcePath
+ * @return the taglib definition or null
+ * @throws IOException
+ * @throws ParserConfigurationException
+ * @throws SAXException
+ */
+ public static FaceletTaglibDefn loadFromInputStream(final InputStream is, final String dtdSourcePath) throws IOException, ParserConfigurationException, SAXException
+ {
+ final byte[] buffer = getBufferForEntry(is);
+ final InputStream dtdSource = getDefaultDTDSource(dtdSourcePath != null ? dtdSourcePath : FACELET_TAGLIB_DTD_PATH);
+ final FaceletTaglibDefn taglib = loadFromBuffer(buffer, dtdSource);
+ return taglib;
+
+ }
+ /**
+ * @param buffer
+ * @param defaultDtdStream
+ * @return the tag library definition (loaded EMF model) for the buffer
+ * @throws IOException
+ * @throws ParserConfigurationException
+ * @throws SAXException
+ */
+ public static FaceletTaglibDefn loadFromBuffer(final byte[] buffer,
+ final InputStream defaultDtdStream) throws IOException,
+ ParserConfigurationException, SAXException
+ {
+ final InputSource inputSource = new InputSource(
+ new ByteArrayInputStream(buffer));
+
+ final Document doc = TagModelParser.getDefaultTaglibDocument(
+ inputSource, new InputSource(defaultDtdStream));
+ final FaceletTaglibDefn tagLib = TagModelParser.processDocument(doc);
+ return tagLib;
+ }
+
+ /**
+ * @param path
+ * @return the input stream for the default bundle Facelet dtd.
+ * @throws IOException
+ */
+ protected static InputStream getDefaultDTDSource(final String path) throws IOException
+ {
+ final URL url = FaceletCorePlugin.getDefault().getBundle().getEntry(path);
+
+ if (url != null)
+ {
+ return url.openStream();
+ }
+ return null;
+ }
+
+ /**
+ * @param is must be open. Caller is responsible for closing.
+ * @return load the stream into a byte buffer.
+ */
+ protected static byte[] getBufferForEntry(final InputStream is)
+ {
+ final ByteArrayOutputStream stream = new ByteArrayOutputStream();
+ final byte[] buffer = new byte[2048];
+
+ int bytesRead = 0;
+
+ try
+ {
+ while (((bytesRead = is.read(buffer))) != -1)
+ {
+ stream.write(buffer, 0, bytesRead);
+ }
+ }
+ catch (final IOException e)
+ {
+ FaceletCorePlugin.log("Error loading buffer", e); //$NON-NLS-1$
+ return null;
+ }
+
+ return stream.toByteArray();
+ }
+
+ /**
+ * @param taglibFile
+ * @param defaultDTDSource
+ * @return the default taglib dom Document
+ * @throws IOException
+ * @throws ParserConfigurationException
+ * @throws SAXException
+ */
+ public static Document getDefaultTaglibDocument(
+ final InputSource taglibFile, final InputSource defaultDTDSource)
+ throws IOException, ParserConfigurationException, SAXException
+ {
+ final DocumentBuilderFactory factory = DocumentBuilderFactory
+ .newInstance();
+ factory.setValidating(false);
+ factory.setIgnoringComments(true);
+
+ final DocumentBuilder builder = factory.newDocumentBuilder();
+
+ final DefaultHandler handler = new DefaultHandler()
+ {
+ @Override
+ public InputSource resolveEntity(final String publicId,
+ final String systemId) throws IOException, SAXException
+ {
+ if (PUBLIC_DTD_FACELET_TAGLIB_1_0_DTD.equals(publicId)
+ || (systemId != null && systemId
+ .endsWith(URI_FACELET_TAGLIB_1_0_DTD)))
+
+ {
+ return defaultDTDSource;
+ }
+ return super.resolveEntity(publicId, systemId);
+ }
+ };
+
+ builder.setEntityResolver(handler);
+ return builder.parse(taglibFile);
+ }
+
+ /**
+ * @param doc
+ * @return the facelet tag library or null
+ */
+ public static FaceletTaglibDefn processDocument(final Document doc)
+ {
+ Node curNode = null;
+
+ for (int i = 0; i < doc.getChildNodes().getLength(); i++)
+ {
+ curNode = doc.getChildNodes().item(i);
+
+ if (curNode.getNodeType() == Node.ELEMENT_NODE
+ && ELEMENT_NAME_FACELET_TAGLIB
+ .equals(curNode.getNodeName()))
+ {
+ break;
+ }
+ }
+
+ if (curNode == null)
+ {
+ throw new IllegalArgumentException(
+ "Couldn't find facelet-taglib node"); //$NON-NLS-1$
+ }
+
+ for (int i = 0; i < curNode.getChildNodes().getLength(); i++)
+ {
+ final Node node = curNode.getChildNodes().item(i);
+
+ if (node.getNodeType() == Node.ELEMENT_NODE)
+ {
+ if (ELEMENT_NAME_LIBRARY_CLASS.equals(node.getNodeName()))
+ {
+ final FaceletLibraryClassTagLib faceletLibraryClassTagLib = FaceletTaglibFactory.eINSTANCE
+ .createFaceletLibraryClassTagLib();
+ faceletLibraryClassTagLib.setLibraryClass(node
+ .getTextContent().trim());
+ return faceletLibraryClassTagLib;
+ }
+ return processFaceletTaglibWithTags(curNode);
+ }
+ }
+
+ return null;
+ }
+
+ private static FaceletXMLDefnTaglib processFaceletTaglibWithTags(
+ final Node node)
+ {
+ String namespace = null;
+ final List<Node> tagNodes = new ArrayList<Node>();
+
+ for (int i = 0; i < node.getChildNodes().getLength(); i++)
+ {
+ final Node childNode = node.getChildNodes().item(i);
+
+ if (childNode.getNodeType() == Node.ELEMENT_NODE)
+ {
+ if (ELEMENT_NAME_NAMESPACE.equals(childNode.getNodeName()))
+ {
+ namespace = childNode.getTextContent();
+ }
+ else if (ELEMENT_NAME_TAG.equals(childNode.getNodeName()))
+ {
+ tagNodes.add(childNode);
+ }
+ }
+ }
+
+ if (namespace != null)
+ {
+ final FaceletXMLDefnTaglib xmlDefnTaglib = FaceletTaglibFactory.eINSTANCE
+ .createFaceletXMLDefnTaglib();
+ xmlDefnTaglib.setNamespace(namespace);
+
+ for (final Node tagNode : tagNodes)
+ {
+ final TagDefn tag = createTagFromNode(namespace, tagNode);
+
+ if (tag != null)
+ {
+ xmlDefnTaglib.getTags().add(tag);
+ }
+ }
+
+ return xmlDefnTaglib;
+ }
+ return null;
+ }
+
+ private static TagDefn createTagFromNode(final String namespace,
+ final Node tagNode)
+ {
+ final Map<String, Node> children = indexChildren(tagNode);
+
+ Node node = children.get(ELEMENT_NAME_TAG_NAME);
+
+ if (node != null)
+ {
+ final String name = safeGetTextContext(node);
+
+ if (name == null)
+ {
+ return null;
+ }
+
+ node = children.get(ELEMENT_NAME_HANDLER_CLASS);
+
+ if (node != null)
+ {
+ final HandlerTagDefn handlerTag = FaceletTaglibFactory.eINSTANCE
+ .createHandlerTagDefn();
+ handlerTag.setHandlerClass(safeGetTextContext(node));
+ handlerTag.setName(name);
+ return handlerTag;
+ }
+
+ node = children.get(ELEMENT_NAME_SOURCE);
+
+ if (node != null)
+ {
+ final SourceTagDefn sourceTag = FaceletTaglibFactory.eINSTANCE
+ .createSourceTagDefn();
+ sourceTag.setSource(safeGetTextContext(node));
+ sourceTag.setName(name);
+ return sourceTag;
+ }
+
+ node = children.get(ELEMENT_NAME_COMPONENT);
+
+ if (node != null)
+ {
+ return createTagWithComponentType(namespace, name, node);
+ }
+
+ node = children.get(ELEMENT_NAME_CONVERTER);
+
+ if (node != null)
+ {
+ return createTagWithConverter(namespace, name, node);
+ }
+
+ node = children.get(ELEMENT_NAME_VALIDATOR);
+
+ if (node != null)
+ {
+ return createValidatorTag(namespace, name, node);
+ }
+ }
+
+ return null;
+ }
+
+ private static ComponentTagDefn createTagWithComponentType(
+ final String uri, final String tagName, final Node paramNode)
+ {
+ final Map<String, Node> componentChildren = indexChildren(paramNode);
+ Node node = componentChildren.get(ELEMENT_NAME_COMPONENT_TYPE);
+
+ if (node != null)
+ {
+ final String componentType = safeGetTextContext(node);
+ String rendererType = null;
+ String handlerClass = null;
+
+ node = componentChildren.get(ELEMENT_NAME_RENDERER_TYPE);
+ if (node != null)
+ {
+ rendererType = safeGetTextContext(node);
+ }
+
+ node = componentChildren.get(ELEMENT_NAME_HANDLER_CLASS);
+ if (node != null)
+ {
+ handlerClass = safeGetTextContext(node);
+ }
+
+ final ComponentTagDefn componentTag = FaceletTaglibFactory.eINSTANCE
+ .createComponentTagDefn();
+ componentTag.setName(tagName);
+ componentTag.setComponentType(componentType);
+ componentTag.setHandlerClass(handlerClass);
+ componentTag.setRendererType(rendererType);
+ return componentTag;
+ }
+ return null;
+ }
+
+ private static ConverterTagDefn createTagWithConverter(final String uri,
+ final String tagName, final Node paramNode)
+ {
+ final Map<String, Node> converterChildren = indexChildren(paramNode);
+ Node node = converterChildren.get(ELEMENT_NAME_CONVERTER_ID);
+
+ if (node != null)
+ {
+ final String converterId = safeGetTextContext(node);
+ String handlerClass = null;
+
+ node = converterChildren.get(ELEMENT_NAME_HANDLER_CLASS);
+ if (node != null)
+ {
+ handlerClass = safeGetTextContext(node);
+ }
+
+ final ConverterTagDefn converterTag = FaceletTaglibFactory.eINSTANCE
+ .createConverterTagDefn();
+ converterTag.setName(tagName);
+ converterTag.setConverterId(converterId);
+ converterTag.setHandlerClass(handlerClass);
+ return converterTag;
+ }
+ return null;
+ }
+
+ private static ValidatorTagDefn createValidatorTag(final String uri,
+ final String tagName, final Node paramNode)
+ {
+ final Map<String, Node> converterChildren = indexChildren(paramNode);
+ Node node = converterChildren.get(ELEMENT_NAME_VALIDATOR_ID);
+
+ if (node != null)
+ {
+ final String validatorId = safeGetTextContext(node);
+ String handlerClass = null;
+
+ node = converterChildren.get(ELEMENT_NAME_HANDLER_CLASS);
+ if (node != null)
+ {
+ handlerClass = safeGetTextContext(node);
+ }
+
+ final ValidatorTagDefn validatorTag = FaceletTaglibFactory.eINSTANCE
+ .createValidatorTagDefn();
+ validatorTag.setName(tagName);
+ validatorTag.setHandlerClass(handlerClass);
+ validatorTag.setValidatorId(validatorId);
+ return validatorTag;
+ }
+ return null;
+ }
+
+ private static Map<String, Node> indexChildren(final Node node)
+ {
+ final Map<String, Node> children = new HashMap<String, Node>();
+ final NodeList nodeList = node.getChildNodes();
+
+ for (int i = 0; i < nodeList.getLength(); i++)
+ {
+ final Node childNode = nodeList.item(i);
+
+ if (childNode.getNodeType() == Node.ELEMENT_NODE)
+ {
+ children.put(childNode.getNodeName(), childNode);
+ }
+ }
+
+ return children;
+ }
+
+ private static String safeGetTextContext(final Node node)
+ {
+ String textContent = node.getTextContent();
+ if (textContent == null)
+ {
+ return null;
+ }
+
+ textContent = textContent.trim();
+
+ if ("".equals(textContent)) //$NON-NLS-1$
+ {
+ return null;
+ }
+
+ return textContent;
+ }
+}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/taglib/TagRecordFactory.java b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/taglib/TagRecordFactory.java
new file mode 100644
index 000000000..a096f6236
--- /dev/null
+++ b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/taglib/TagRecordFactory.java
@@ -0,0 +1,81 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Oracle Corporation.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Cameron Bateman - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jst.jsf.facelet.core.internal.registry.taglib;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.jem.internal.proxy.core.ICallbackRegistry;
+import org.eclipse.jem.internal.proxy.core.ProxyFactoryRegistry;
+import org.eclipse.jst.jsf.facelet.core.internal.FaceletCorePlugin;
+import org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.FaceletLibraryClassTagLib;
+import org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.FaceletTaglibDefn;
+import org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.FaceletXMLDefnTaglib;
+
+/*package*/class TagRecordFactory
+{
+ private final ProxyFactoryRegistry _registry;
+ private final IProject _project;
+
+ public TagRecordFactory(final IProject project,
+ final ProxyFactoryRegistry registry)
+ {
+ _registry = registry;
+ _project = project;
+ }
+
+ public IFaceletTagRecord createRecords(final FaceletTaglibDefn taglibDefn)
+ {
+ IFaceletTagRecord retValue = null;
+
+ if (taglibDefn instanceof FaceletLibraryClassTagLib)
+ {
+ if (_registry != NULL_REGISTRY)
+ {
+ final LibraryClassBasedTagRecord record = new LibraryClassBasedTagRecord(
+ _registry, (FaceletLibraryClassTagLib) taglibDefn, _project);
+ try
+ {
+ record.initURI();
+ retValue = record;
+ }
+ catch (CoreException e)
+ {
+ FaceletCorePlugin.log("While creating record: "+record, e); //$NON-NLS-1$
+ }
+ }
+ }
+ else if (taglibDefn instanceof FaceletXMLDefnTaglib)
+ {
+ final XMLBasedTagRecord record = new XMLBasedTagRecord(
+ (FaceletXMLDefnTaglib) taglibDefn);
+ retValue = record;
+ }
+ return retValue;
+ }
+
+ private final static NullProxyFactoryRegistry NULL_REGISTRY = new NullProxyFactoryRegistry();
+
+ private static class NullProxyFactoryRegistry extends ProxyFactoryRegistry
+ {
+
+ @Override
+ public ICallbackRegistry getCallbackRegistry()
+ {
+ throw new UnsupportedOperationException("This is null proxy"); //$NON-NLS-1$
+ }
+
+ @Override
+ protected void registryTerminated(final boolean wait)
+ {
+ throw new UnsupportedOperationException("This is null proxy"); //$NON-NLS-1$
+ }
+ }
+} \ No newline at end of file
diff --git a/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/taglib/TaglibFinder.java b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/taglib/TaglibFinder.java
new file mode 100644
index 000000000..492e83a03
--- /dev/null
+++ b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/taglib/TaglibFinder.java
@@ -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
diff --git a/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/taglib/TaglibJarEntryFinder.java b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/taglib/TaglibJarEntryFinder.java
new file mode 100644
index 000000000..17bb024ba
--- /dev/null
+++ b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/taglib/TaglibJarEntryFinder.java
@@ -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
diff --git a/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/taglib/WebappConfiguration.java b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/taglib/WebappConfiguration.java
new file mode 100644
index 000000000..e65ba9a4d
--- /dev/null
+++ b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/taglib/WebappConfiguration.java
@@ -0,0 +1,696 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Oracle Corporation.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Cameron Bateman - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jst.jsf.facelet.core.internal.registry.taglib;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.List;
+import java.util.StringTokenizer;
+import java.util.concurrent.CopyOnWriteArrayList;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.common.notify.impl.AdapterImpl;
+import org.eclipse.emf.common.util.EList;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.jst.j2ee.common.ParamValue;
+import org.eclipse.jst.j2ee.internal.J2EEVersionConstants;
+import org.eclipse.jst.j2ee.model.IModelProvider;
+import org.eclipse.jst.j2ee.model.ModelProviderManager;
+import org.eclipse.jst.j2ee.web.componentcore.util.WebArtifactEdit;
+import org.eclipse.jst.j2ee.webapplication.ContextParam;
+import org.eclipse.jst.j2ee.webapplication.WebApp;
+import org.eclipse.jst.jsf.core.internal.JSFCorePlugin;
+import org.eclipse.jst.jsf.core.jsfappconfig.JSFAppConfigUtils;
+import org.eclipse.jst.jsf.facelet.core.internal.FaceletCorePlugin;
+import org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.WebappConfiguration.WebappListener.WebappChangeEvent;
+import org.eclipse.wst.common.componentcore.resources.IVirtualFile;
+import org.eclipse.wst.common.componentcore.resources.IVirtualFolder;
+
+/**
+ * Manages the web.xml elements of interest to Facelet tag libraries
+ *
+ * @author cbateman
+ *
+ */
+public class WebappConfiguration
+{
+ // 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.
+ */
+ private final ContextParamAdapter _contextParamAdapter;
+ private List<IFile> _cachedFiles;
+
+ /**
+ * @param project
+ */
+ /*package*/ WebappConfiguration(final IProject project)
+ {
+ _project = project;
+ _contextParamAdapter = new ContextParamAdapter();
+ }
+
+ /**
+ * @param listener
+ */
+ public void addListener(final WebappListener listener)
+ {
+ _contextParamAdapter.addListener(listener);
+ }
+
+ /**
+ * @param listener
+ */
+ public void removeListener(final WebappListener listener)
+ {
+ _contextParamAdapter.removeListener(listener);
+ }
+
+ /**
+ * @return the list of IFile's
+ */
+ public List<IFile> getFiles()
+ {
+ final IVirtualFolder folder = JSFAppConfigUtils
+ .getWebContentFolder(_project);
+
+ if (folder == null)
+ {
+ return Collections.emptyList();
+ }
+
+ final List<String> filenames = getConfigFilesFromContextParam(_project);
+ final List<IFile> files = new ArrayList<IFile>();
+
+ for (final String filename : filenames)
+ {
+ final IVirtualFile vfile = folder.getFile(new Path(filename));
+ if (vfile != null)
+ {
+ files.add(vfile.getUnderlyingFile());
+ }
+ }
+ _cachedFiles = files;
+ return Collections.unmodifiableList(files);
+ }
+
+ private Object getModelObject()
+ {
+ final IModelProvider provider = ModelProviderManager
+ .getModelProvider(_project);
+ return provider.getModelObject();
+ }
+
+ /**
+ *
+ */
+ public void start()
+ {
+ final Object webAppObj = getModelObject();
+ if (webAppObj != null)
+ {
+ if (webAppObj instanceof WebApp)
+ {
+ startLocatingJ2EEConfigs((WebApp) webAppObj);
+ }
+ else if (webAppObj instanceof org.eclipse.jst.javaee.web.WebApp)
+ {
+ startLocatingJEEConfigs((org.eclipse.jst.javaee.web.WebApp) webAppObj);
+ }
+ }
+ else
+ {
+ FaceletCorePlugin
+ .log(
+ "Could not get webApp for project: " + _project, new Exception()); //$NON-NLS-1$
+ }
+ }
+
+ /**
+ *
+ */
+ public void dispose()
+ {
+ if (_contextParamAdapter != null)
+ {
+ final Object webAppObj = getModelObject();
+ if (webAppObj != null)
+ {
+ if (webAppObj instanceof WebApp)
+ {
+ stopLocatingJ2EEConfigs((WebApp) webAppObj);
+ }
+ else if (webAppObj instanceof org.eclipse.jst.javaee.web.WebApp)
+ {
+ stopLocatingJEEConfigs((org.eclipse.jst.javaee.web.WebApp) webAppObj);
+ }
+ }
+ else
+ {
+ FaceletCorePlugin
+ .log(
+ "Failed stopping locator for project: " + _project.getName() //$NON-NLS-1$
+ , new Exception());
+ }
+ //_contextParamAdapter.dispose();
+ }
+ }
+
+ private void startLocatingJ2EEConfigs(final WebApp webApp)
+ {
+ webApp.eAdapters().add(_contextParamAdapter);
+ final EList contexts = webApp.getContexts();
+ if (contexts != null)
+ {
+ final Iterator itContexts = contexts.iterator();
+ while (itContexts.hasNext())
+ {
+ final ContextParam contextParam = (ContextParam) itContexts
+ .next();
+ contextParam.eAdapters().add(_contextParamAdapter);
+ }
+ }
+ final EList contextParams = webApp.getContextParams();
+ if (contextParams != null)
+ {
+ final Iterator itContextParams = contextParams.iterator();
+ while (itContextParams.hasNext())
+ {
+ final ParamValue paramValue = (ParamValue) itContextParams
+ .next();
+ paramValue.eAdapters().add(_contextParamAdapter);
+ }
+ }
+ }
+
+ private void startLocatingJEEConfigs(
+ final org.eclipse.jst.javaee.web.WebApp webApp)
+ {
+ ((EObject) webApp).eAdapters().add(_contextParamAdapter);
+ // System.out.println(((EObject)webApp).eDeliver());
+ final List params = webApp.getContextParams();
+ if (params != null)
+ {
+ final Iterator itContexts = params.iterator();
+ while (itContexts.hasNext())
+ {
+ final EObject contextParam = (EObject) itContexts.next();
+ contextParam.eAdapters().add(_contextParamAdapter);
+ }
+ }
+ }
+
+ private void stopLocatingJ2EEConfigs(final WebApp webApp)
+ {
+ webApp.eAdapters().remove(_contextParamAdapter);
+ final EList contexts = webApp.getContexts();
+ if (contexts != null)
+ {
+ final Iterator itContexts = contexts.iterator();
+ while (itContexts.hasNext())
+ {
+ final ContextParam contextParam = (ContextParam) itContexts
+ .next();
+ contextParam.eAdapters().remove(_contextParamAdapter);
+ }
+ }
+ final EList contextParams = webApp.getContextParams();
+ if (contextParams != null)
+ {
+ final Iterator itContextParams = contextParams.iterator();
+ while (itContextParams.hasNext())
+ {
+ final ParamValue paramValue = (ParamValue) itContextParams
+ .next();
+ paramValue.eAdapters().remove(_contextParamAdapter);
+ }
+ }
+ }
+
+ private void stopLocatingJEEConfigs(
+ final org.eclipse.jst.javaee.web.WebApp webApp)
+ {
+ ((EObject) webApp).eAdapters().remove(_contextParamAdapter);
+ final List contextParams = webApp.getContextParams();
+ if (contextParams != null)
+ {
+ final Iterator itContextParams = contextParams.iterator();
+ while (itContextParams.hasNext())
+ {
+ final EObject paramValue = (EObject) itContextParams.next();
+ paramValue.eAdapters().remove(_contextParamAdapter);
+ }
+ }
+ }
+
+ /**
+ * Gets list of application configuration file names as listed in the JSF
+ * CONFIG_FILES context parameter ("javax.faces.CONFIG_FILES"). Will return
+ * an empty list if WebArtifactEdit is null, if WebApp is null, if context
+ * parameter does not exist, or if trimmed context parameter's value is an
+ * empty String.
+ *
+ * @param project
+ * IProject instance for which to get the context parameter's
+ * value.
+ * @return List of application configuration file names as listed in the JSF
+ * CONFIG_FILES context parameter ("javax.faces.CONFIG_FILES"); list
+ * may be empty.
+ */
+ public static List<String> getConfigFilesFromContextParam(
+ final IProject project)
+ {
+ List<String> filesList = Collections.EMPTY_LIST;
+ if (JSFAppConfigUtils.isValidJSFProject(project))
+ {
+ final IModelProvider provider = ModelProviderManager
+ .getModelProvider(project);
+ final Object webAppObj = provider.getModelObject();
+ if (webAppObj != null)
+ {
+ if (webAppObj instanceof WebApp)
+ {
+ filesList = getConfigFilesForJ2EEApp(project);
+ }
+ else if (webAppObj instanceof org.eclipse.jst.javaee.web.WebApp)
+ {
+ filesList = getConfigFilesForJEEApp((org.eclipse.jst.javaee.web.WebApp) webAppObj);
+ }
+ }
+
+ }
+ return filesList;
+ }
+
+ private static List<String> getConfigFilesForJEEApp(
+ final org.eclipse.jst.javaee.web.WebApp webApp)
+ {
+ String filesString = null;
+ final List contextParams = webApp.getContextParams();
+ final Iterator itContextParams = contextParams.iterator();
+ while (itContextParams.hasNext())
+ {
+ final org.eclipse.jst.javaee.core.ParamValue paramValue = (org.eclipse.jst.javaee.core.ParamValue) itContextParams
+ .next();
+ if (paramValue.getParamName().equals(
+ FACELET_10_LIBRARIES_CONTEXT_PARAM_NAME)||
+ paramValue.getParamName().equals(
+ JSF20_FACELET_LIBRARIES_CONTEXT_PARAM_NAME))
+ {
+ filesString = paramValue.getParamValue();
+ break;
+ }
+ }
+ return parseFilesString(filesString);
+ }
+
+ private static List<String> getConfigFilesForJ2EEApp(final IProject project)
+ {
+ List filesList = new ArrayList();
+ final WebArtifactEdit webArtifactEdit = WebArtifactEdit
+ .getWebArtifactEditForRead(project);
+ if (webArtifactEdit != null)
+ {
+ try
+ {
+ WebApp webApp = null;
+ try
+ {
+ webApp = webArtifactEdit.getWebApp();
+ }
+ catch (final ClassCastException cce)
+ {
+ // occasionally thrown from WTP code in RC3 and possibly
+ // later
+ JSFCorePlugin.log(IStatus.ERROR, cce.getLocalizedMessage(),
+ cce);
+ return filesList;
+ }
+ if (webApp != null)
+ {
+ String filesString = null;
+ // need to branch here due to model version differences
+ // (BugZilla #119442)
+ if (webApp.getVersionID() == J2EEVersionConstants.WEB_2_3_ID)
+ {
+ final EList contexts = webApp.getContexts();
+ final Iterator itContexts = contexts.iterator();
+ while (itContexts.hasNext())
+ {
+ final ContextParam contextParam = (ContextParam) itContexts
+ .next();
+ if (contextParam.getParamName().equals(
+ 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;
+ }
+ }
+ }
+ else
+ {
+ final EList contextParams = webApp.getContextParams();
+ final Iterator itContextParams = contextParams
+ .iterator();
+ while (itContextParams.hasNext())
+ {
+ final ParamValue paramValue = (ParamValue) itContextParams
+ .next();
+ if (paramValue.getName().equals(
+ 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;
+ }
+ }
+ }
+ filesList = parseFilesString(filesString);
+ }
+ }
+ finally
+ {
+ webArtifactEdit.dispose();
+ }
+ }
+
+ return filesList;
+ }
+
+ private static List parseFilesString(final String filesString)
+ {
+ final List filesList = new ArrayList();
+ if (filesString != null && filesString.trim().length() > 0)
+ {
+ final StringTokenizer stFilesString = new StringTokenizer(
+ filesString, ";"); //$NON-NLS-1$
+ while (stFilesString.hasMoreTokens())
+ {
+ final String configFile = stFilesString.nextToken().trim();
+ filesList.add(configFile);
+ }
+ }
+ return filesList;
+ }
+
+ /**
+ * Adapter implementation used to monitor addition/removal of context-param
+ * nodes and change in name of existing nodes in order to respond to changes
+ * to the JSF CONFIG_FILES context-param.
+ *
+ * @author Ian Trimble - Oracle
+ */
+ private class ContextParamAdapter extends AdapterImpl
+ {
+ private final CopyOnWriteArrayList<WebappListener> _listeners = new CopyOnWriteArrayList<WebappListener>();
+
+ public void addListener(final WebappListener listener)
+ {
+ _listeners.addIfAbsent(listener);
+ }
+
+ public void removeListener(final WebappListener listener)
+ {
+ _listeners.remove(listener);
+ }
+
+ private void fireEvent(final WebappChangeEvent event)
+ {
+ for (final WebappListener listener : _listeners)
+ {
+ listener.webappChanged(event);
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.emf.common.notify.impl.AdapterImpl#notifyChanged(org.
+ * eclipse.emf.common.notify.Notification)
+ */
+ @Override
+ public void notifyChanged(final Notification notification)
+ {
+ final Object objNotifier = notification.getNotifier();
+ // System.out.println(objNotifier.toString());
+ if (objNotifier instanceof WebApp
+ || objNotifier instanceof org.eclipse.jst.javaee.web.WebApp)
+ {
+ final int eventType = notification.getEventType();
+ switch (eventType)
+ {
+ case Notification.ADD:
+ final Object objNewValue = notification.getNewValue();
+ if (objNewValue instanceof ContextParam
+ || objNewValue instanceof org.eclipse.jst.javaee.core.ParamValue)
+ {
+ contextParamAdded((EObject) objNewValue);
+ }
+ else if (objNewValue instanceof ParamValue)
+ {
+ paramValueAdded((EObject) objNewValue);
+ }
+ break;
+ case Notification.REMOVE:
+ final Object objOldValue = notification.getOldValue();
+ if (objOldValue instanceof ContextParam
+ || objOldValue instanceof org.eclipse.jst.javaee.core.ParamValue)
+ {
+ contextParamRemoved((EObject) objOldValue);
+ }
+ else if (objOldValue instanceof ParamValue)
+ {
+ paramValueRemoved((EObject) objOldValue);
+ }
+ break;
+ }
+ }
+ // else if (objNotifier instanceof ContextParam
+ // || objNotifier instanceof org.eclipse.jst.javaee.core.ParamValue)
+ // {
+ // if (notification.getEventType() != Notification.REMOVING_ADAPTER)
+ // {
+ // _listener
+ // .tagLibChanged(ContextParamSpecifiedFaceletTaglibLocator.this);
+ // }
+ // }
+ // else if (objNotifier instanceof ParamValue)
+ // {
+ // if (notification.getEventType() != Notification.REMOVING_ADAPTER)
+ // {
+ // _listener
+ // .tagLibChanged(ContextParamSpecifiedFaceletTaglibLocator.this);
+ // }
+ // }
+ }
+
+ /**
+ * Called when a new ContextParam instance is added.
+ *
+ * @param contextParam
+ * ContextParam instance.
+ */
+ protected void contextParamAdded(final EObject contextParam)
+ {
+ if (isConfigFilesContextParam(contextParam))
+ {
+ checkAndFireFileChanges();
+ }
+ contextParam.eAdapters().add(this);
+ }
+
+ private void checkAndFireFileChanges()
+ {
+ final List<IFile> oldFiles = _cachedFiles;
+ final List<IFile> newFiles = getFiles();
+
+ final List<IFile> filesAdded = new ArrayList<IFile>();
+ final List<IFile> filesRemoved = new ArrayList<IFile>();
+
+ for (final IFile oldFile : oldFiles)
+ {
+ if (!newFiles.contains(oldFile))
+ {
+ filesRemoved.add(oldFile);
+ }
+ }
+
+ for (final IFile newFile : newFiles)
+ {
+ if (!oldFiles.contains(newFile))
+ {
+ filesAdded.add(newFile);
+ }
+ }
+
+ if (filesAdded.size() > 0 || filesRemoved.size() > 0)
+ {
+ fireEvent(new WebappChangeEvent(filesRemoved, filesAdded));
+ }
+ }
+
+ /**
+ * Called when a new ParamValue instance is added.
+ *
+ * @param paramValue
+ * ParamValue instance.
+ */
+ protected void paramValueAdded(final EObject paramValue)
+ {
+ if (isConfigFilesParamValue(paramValue))
+ {
+ checkAndFireFileChanges();
+ }
+ paramValue.eAdapters().add(this);
+ }
+
+ /**
+ * Called when a ContextParam instance is removed.
+ *
+ * @param contextParam
+ * ContextParam instance.
+ */
+ protected void contextParamRemoved(final EObject contextParam)
+ {
+ if (isConfigFilesContextParam(contextParam))
+ {
+ checkAndFireFileChanges();
+ }
+ contextParam.eAdapters().remove(this);
+ }
+
+ /**
+ * Called when a ParamValue instance is removed.
+ *
+ * @param paramValue
+ * ParamValue instance.
+ */
+ protected void paramValueRemoved(final EObject paramValue)
+ {
+ if (isConfigFilesParamValue(paramValue))
+ {
+ checkAndFireFileChanges();
+ }
+ paramValue.eAdapters().remove(this);
+ }
+
+ /**
+ * Tests if the passed ContextParam instance is the JSF CONFIG_FILES
+ * context parameter.
+ *
+ * @param contextParam
+ * ContextParam instance.
+ * @return true if the passed ContextParam instance is the JSF
+ * CONFIG_FILES context parameter, else false
+ */
+ protected boolean isConfigFilesContextParam(final EObject contextParam)
+ {
+ boolean isConfigFiles = false;
+ if (contextParam != null)
+ {
+ String name = null;
+ if (contextParam instanceof ContextParam)
+ {
+ name = ((ContextParam) contextParam).getParamName();
+ }
+ else if (contextParam instanceof org.eclipse.jst.javaee.core.ParamValue)
+ {
+ name = ((org.eclipse.jst.javaee.core.ParamValue) contextParam)
+ .getParamName();
+ }
+
+ if (FACELET_10_LIBRARIES_CONTEXT_PARAM_NAME.equals(name)||
+ JSF20_FACELET_LIBRARIES_CONTEXT_PARAM_NAME.equals(name))
+ {
+ isConfigFiles = true;
+ }
+ }
+ return isConfigFiles;
+ }
+
+ /**
+ * Tests if the passed ParamValue instance is the JSF CONFIG_FILES
+ * context parameter.
+ *
+ * @param paramVal
+ * as EObject ParamValue instance.
+ * @return true if the passed ParamValue instance is the JSF
+ * CONFIG_FILES context parameter, else false
+ */
+ protected boolean isConfigFilesParamValue(final EObject paramVal)
+ {
+ boolean isConfigFiles = false;
+ if (paramVal != null)
+ {
+ String name = null;
+ if (paramVal instanceof ParamValue)
+ {
+ name = ((ParamValue) paramVal).getName();
+ }
+ else if (paramVal instanceof org.eclipse.jst.javaee.core.ParamValue)
+ {
+ name = ((org.eclipse.jst.javaee.core.ParamValue) paramVal)
+ .getParamName();
+ }
+
+ if (FACELET_10_LIBRARIES_CONTEXT_PARAM_NAME.equals(name)||
+ JSF20_FACELET_LIBRARIES_CONTEXT_PARAM_NAME.equals(name))
+ {
+ isConfigFiles = true;
+ }
+ }
+ return isConfigFiles;
+ }
+ }
+
+ abstract static class WebappListener
+ {
+ public static class WebappChangeEvent
+ {
+ private final List<IFile> _removed;
+ private final List<IFile> _added;
+
+ WebappChangeEvent(final List<IFile> removed, final List<IFile> added)
+ {
+ _removed = Collections.unmodifiableList(removed);
+ _added = Collections.unmodifiableList(added);
+ }
+
+ public final List<IFile> getRemoved()
+ {
+ return _removed;
+ }
+
+ public final List<IFile> getAdded()
+ {
+ return _added;
+ }
+ }
+
+ public abstract void webappChanged(final WebappChangeEvent event);
+ }
+}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/taglib/XMLBasedTagRecord.java b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/taglib/XMLBasedTagRecord.java
new file mode 100644
index 000000000..bd17f51df
--- /dev/null
+++ b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/taglib/XMLBasedTagRecord.java
@@ -0,0 +1,99 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Oracle Corporation.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Cameron Bateman - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jst.jsf.facelet.core.internal.registry.taglib;
+
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.FaceletXMLDefnTaglib;
+import org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.TagDefn;
+
+/**
+ * A tag record based on an xml tag defined Facelet taglib.xml
+ * @author cbateman
+ *
+ */
+public class XMLBasedTagRecord extends FaceletTagRecord
+{
+ /**
+ *
+ */
+ private static final long serialVersionUID = 1411551451386954263L;
+ private final FaceletXMLDefnTaglib _taglibDefn;
+ private Map<String, TagDefn> _tagIndexByName;
+
+ /**
+ * @param taglibDefn
+ */
+ public XMLBasedTagRecord(final FaceletXMLDefnTaglib taglibDefn)
+ {
+ _taglibDefn = taglibDefn;
+ }
+
+ @Override
+ public String getURI()
+ {
+ return _taglibDefn.getNamespace();
+ }
+
+
+ @Override
+ public TagDefn getTag(final String name)
+ {
+ return getAndIndexElementDeclaration(name);
+ }
+
+ private synchronized TagDefn getAndIndexElementDeclaration(final String name)
+ {
+ TagDefn tagDefn = null;
+
+ if (_tagIndexByName == null)
+ {
+ _tagIndexByName = new HashMap<String, TagDefn>();
+ }
+ else
+ {
+ tagDefn = _tagIndexByName.get(name);
+ }
+
+ if (tagDefn == null && _tagIndexByName.size() < _taglibDefn.getTags().size())
+ {
+ tagDefn = findTag(name);
+ }
+
+ return tagDefn;
+ }
+
+ private TagDefn findTag(final String name)
+ {
+ for (final TagDefn tag : _taglibDefn.getTags())
+ {
+ if (name.equals(tag.getName()))
+ {
+ return tag;
+ }
+ }
+ return null;
+ }
+
+ @Override
+ public List<TagDefn> getTags()
+ {
+ return Collections.unmodifiableList(_taglibDefn.getTags());
+ }
+
+ public int getNumTags()
+ {
+ return _taglibDefn.getTags().size();
+ }
+}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/taglib/faceletTaglib/ComponentTagDefn.java b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/taglib/faceletTaglib/ComponentTagDefn.java
new file mode 100644
index 000000000..36f961f98
--- /dev/null
+++ b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/taglib/faceletTaglib/ComponentTagDefn.java
@@ -0,0 +1,81 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id: ComponentTagDefn.java,v 1.1 2010/03/08 18:49:40 cbateman Exp $
+ */
+package org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib;
+
+
+/**
+ * <!-- begin-user-doc -->
+ * A representation of the model object '<em><b>Component Tag Defn</b></em>'.
+ * <!-- end-user-doc -->
+ *
+ * <p>
+ * The following features are supported:
+ * <ul>
+ * <li>{@link org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.ComponentTagDefn#getComponentType <em>Component Type</em>}</li>
+ * <li>{@link org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.ComponentTagDefn#getRendererType <em>Renderer Type</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @see org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.FaceletTaglibPackage#getComponentTagDefn()
+ * @model
+ * @generated
+ */
+public interface ComponentTagDefn extends HandlerTagDefn
+{
+ /**
+ * Returns the value of the '<em><b>Component Type</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Component Type</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Component Type</em>' attribute.
+ * @see #setComponentType(String)
+ * @see org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.FaceletTaglibPackage#getComponentTagDefn_ComponentType()
+ * @model
+ * @generated
+ */
+ String getComponentType();
+
+ /**
+ * Sets the value of the '{@link org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.ComponentTagDefn#getComponentType <em>Component Type</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Component Type</em>' attribute.
+ * @see #getComponentType()
+ * @generated
+ */
+ void setComponentType(String value);
+
+ /**
+ * Returns the value of the '<em><b>Renderer Type</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Renderer Type</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Renderer Type</em>' attribute.
+ * @see #setRendererType(String)
+ * @see org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.FaceletTaglibPackage#getComponentTagDefn_RendererType()
+ * @model
+ * @generated
+ */
+ String getRendererType();
+
+ /**
+ * Sets the value of the '{@link org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.ComponentTagDefn#getRendererType <em>Renderer Type</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Renderer Type</em>' attribute.
+ * @see #getRendererType()
+ * @generated
+ */
+ void setRendererType(String value);
+
+} // ComponentTagDefn
diff --git a/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/taglib/faceletTaglib/ConverterTagDefn.java b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/taglib/faceletTaglib/ConverterTagDefn.java
new file mode 100644
index 000000000..ed13c8c22
--- /dev/null
+++ b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/taglib/faceletTaglib/ConverterTagDefn.java
@@ -0,0 +1,54 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id: ConverterTagDefn.java,v 1.1 2010/03/08 18:49:39 cbateman Exp $
+ */
+package org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib;
+
+
+/**
+ * <!-- begin-user-doc -->
+ * A representation of the model object '<em><b>Converter Tag Defn</b></em>'.
+ * <!-- end-user-doc -->
+ *
+ * <p>
+ * The following features are supported:
+ * <ul>
+ * <li>{@link org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.ConverterTagDefn#getConverterId <em>Converter Id</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @see org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.FaceletTaglibPackage#getConverterTagDefn()
+ * @model
+ * @generated
+ */
+public interface ConverterTagDefn extends HandlerTagDefn
+{
+ /**
+ * Returns the value of the '<em><b>Converter Id</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Converter Id</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Converter Id</em>' attribute.
+ * @see #setConverterId(String)
+ * @see org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.FaceletTaglibPackage#getConverterTagDefn_ConverterId()
+ * @model
+ * @generated
+ */
+ String getConverterId();
+
+ /**
+ * Sets the value of the '{@link org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.ConverterTagDefn#getConverterId <em>Converter Id</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Converter Id</em>' attribute.
+ * @see #getConverterId()
+ * @generated
+ */
+ void setConverterId(String value);
+
+} // ConverterTagDefn
diff --git a/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/taglib/faceletTaglib/FaceletLibraryClassTagLib.java b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/taglib/faceletTaglib/FaceletLibraryClassTagLib.java
new file mode 100644
index 000000000..9e7c6fd3b
--- /dev/null
+++ b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/taglib/faceletTaglib/FaceletLibraryClassTagLib.java
@@ -0,0 +1,54 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id: FaceletLibraryClassTagLib.java,v 1.1 2010/03/08 18:49:40 cbateman Exp $
+ */
+package org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib;
+
+
+/**
+ * <!-- begin-user-doc -->
+ * A representation of the model object '<em><b>Facelet Library Class Tag Lib</b></em>'.
+ * <!-- end-user-doc -->
+ *
+ * <p>
+ * The following features are supported:
+ * <ul>
+ * <li>{@link org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.FaceletLibraryClassTagLib#getLibraryClass <em>Library Class</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @see org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.FaceletTaglibPackage#getFaceletLibraryClassTagLib()
+ * @model
+ * @generated
+ */
+public interface FaceletLibraryClassTagLib extends FaceletTaglibDefn
+{
+ /**
+ * Returns the value of the '<em><b>Library Class</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Library Class</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Library Class</em>' attribute.
+ * @see #setLibraryClass(String)
+ * @see org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.FaceletTaglibPackage#getFaceletLibraryClassTagLib_LibraryClass()
+ * @model
+ * @generated
+ */
+ String getLibraryClass();
+
+ /**
+ * Sets the value of the '{@link org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.FaceletLibraryClassTagLib#getLibraryClass <em>Library Class</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Library Class</em>' attribute.
+ * @see #getLibraryClass()
+ * @generated
+ */
+ void setLibraryClass(String value);
+
+} // FaceletLibraryClassTagLib
diff --git a/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/taglib/faceletTaglib/FaceletTaglibDefn.java b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/taglib/faceletTaglib/FaceletTaglibDefn.java
new file mode 100644
index 000000000..7eea852c8
--- /dev/null
+++ b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/taglib/faceletTaglib/FaceletTaglibDefn.java
@@ -0,0 +1,24 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id: FaceletTaglibDefn.java,v 1.1 2010/03/08 18:49:40 cbateman Exp $
+ */
+package org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib;
+
+import org.eclipse.emf.ecore.EObject;
+
+/**
+ * <!-- begin-user-doc -->
+ * A representation of the model object '<em><b>Defn</b></em>'.
+ * <!-- end-user-doc -->
+ *
+ *
+ * @see org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.FaceletTaglibPackage#getFaceletTaglibDefn()
+ * @model
+ * @generated
+ */
+public interface FaceletTaglibDefn extends EObject
+{
+ // nuthin'
+} // FaceletTaglibDefn
diff --git a/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/taglib/faceletTaglib/FaceletTaglibFactory.java b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/taglib/faceletTaglib/FaceletTaglibFactory.java
new file mode 100644
index 000000000..b5905304a
--- /dev/null
+++ b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/taglib/faceletTaglib/FaceletTaglibFactory.java
@@ -0,0 +1,128 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id: FaceletTaglibFactory.java,v 1.1 2010/03/08 18:49:39 cbateman Exp $
+ */
+package org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib;
+
+import org.eclipse.emf.ecore.EFactory;
+
+/**
+ * <!-- begin-user-doc -->
+ * The <b>Factory</b> for the model.
+ * It provides a create method for each non-abstract class of the model.
+ * <!-- end-user-doc -->
+ * @see org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.FaceletTaglibPackage
+ * @generated
+ */
+public interface FaceletTaglibFactory extends EFactory
+{
+ /**
+ * The singleton instance of the factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ FaceletTaglibFactory eINSTANCE = org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.impl.FaceletTaglibFactoryImpl.init();
+
+ /**
+ * Returns a new object of class '<em>Facelet Library Class Tag Lib</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return a new object of class '<em>Facelet Library Class Tag Lib</em>'.
+ * @generated
+ */
+ FaceletLibraryClassTagLib createFaceletLibraryClassTagLib();
+
+ /**
+ * Returns a new object of class '<em>Facelet XML Defn Taglib</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return a new object of class '<em>Facelet XML Defn Taglib</em>'.
+ * @generated
+ */
+ FaceletXMLDefnTaglib createFaceletXMLDefnTaglib();
+
+ /**
+ * Returns a new object of class '<em>Defn</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return a new object of class '<em>Defn</em>'.
+ * @generated
+ */
+ FaceletTaglibDefn createFaceletTaglibDefn();
+
+ /**
+ * Returns a new object of class '<em>Component Tag Defn</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return a new object of class '<em>Component Tag Defn</em>'.
+ * @generated
+ */
+ ComponentTagDefn createComponentTagDefn();
+
+ /**
+ * Returns a new object of class '<em>Validator Tag Defn</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return a new object of class '<em>Validator Tag Defn</em>'.
+ * @generated
+ */
+ ValidatorTagDefn createValidatorTagDefn();
+
+ /**
+ * Returns a new object of class '<em>Converter Tag Defn</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return a new object of class '<em>Converter Tag Defn</em>'.
+ * @generated
+ */
+ ConverterTagDefn createConverterTagDefn();
+
+ /**
+ * Returns a new object of class '<em>Handler Tag Defn</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return a new object of class '<em>Handler Tag Defn</em>'.
+ * @generated
+ */
+ HandlerTagDefn createHandlerTagDefn();
+
+ /**
+ * Returns a new object of class '<em>Source Tag Defn</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return a new object of class '<em>Source Tag Defn</em>'.
+ * @generated
+ */
+ SourceTagDefn createSourceTagDefn();
+
+ /**
+ * Returns a new object of class '<em>Tag Defn</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return a new object of class '<em>Tag Defn</em>'.
+ * @generated
+ */
+ TagDefn createTagDefn();
+
+ /**
+ * Returns a new object of class '<em>Function Defn</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return a new object of class '<em>Function Defn</em>'.
+ * @generated
+ */
+ FunctionDefn createFunctionDefn();
+
+ /**
+ * Returns the package supported by this factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the package supported by this factory.
+ * @generated
+ */
+ FaceletTaglibPackage getFaceletTaglibPackage();
+
+} //FaceletTaglibFactory
diff --git a/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/taglib/faceletTaglib/FaceletTaglibPackage.java b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/taglib/faceletTaglib/FaceletTaglibPackage.java
new file mode 100644
index 000000000..d4ce6f247
--- /dev/null
+++ b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/taglib/faceletTaglib/FaceletTaglibPackage.java
@@ -0,0 +1,944 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id: FaceletTaglibPackage.java,v 1.1 2010/03/08 18:49:40 cbateman Exp $
+ */
+package org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib;
+
+import org.eclipse.emf.ecore.EAttribute;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.emf.ecore.EReference;
+
+/**
+ * <!-- begin-user-doc -->
+ * The <b>Package</b> for the model.
+ * It contains accessors for the meta objects to represent
+ * <ul>
+ * <li>each class,</li>
+ * <li>each feature of each class,</li>
+ * <li>each enum,</li>
+ * <li>and each data type</li>
+ * </ul>
+ * <!-- end-user-doc -->
+ * @see org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.FaceletTaglibFactory
+ * @model kind="package"
+ * @generated
+ */
+public interface FaceletTaglibPackage extends EPackage
+{
+ /**
+ * The package name.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ String eNAME = "faceletTaglib"; //$NON-NLS-1$
+
+ /**
+ * The package namespace URI.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ String eNS_URI = "http://org.eclipse.jst.jsf.facelet.core/faceletTaglib.ecore"; //$NON-NLS-1$
+
+ /**
+ * The package namespace name.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ String eNS_PREFIX = "faceletTaglib"; //$NON-NLS-1$
+
+ /**
+ * The singleton instance of the package.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ FaceletTaglibPackage eINSTANCE = org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.impl.FaceletTaglibPackageImpl.init();
+
+ /**
+ * The meta object id for the '{@link org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.impl.FaceletTaglibDefnImpl <em>Defn</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.impl.FaceletTaglibDefnImpl
+ * @see org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.impl.FaceletTaglibPackageImpl#getFaceletTaglibDefn()
+ * @generated
+ */
+ int FACELET_TAGLIB_DEFN = 2;
+
+ /**
+ * The number of structural features of the '<em>Defn</em>' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int FACELET_TAGLIB_DEFN_FEATURE_COUNT = 0;
+
+ /**
+ * The meta object id for the '{@link org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.impl.FaceletLibraryClassTagLibImpl <em>Facelet Library Class Tag Lib</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.impl.FaceletLibraryClassTagLibImpl
+ * @see org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.impl.FaceletTaglibPackageImpl#getFaceletLibraryClassTagLib()
+ * @generated
+ */
+ int FACELET_LIBRARY_CLASS_TAG_LIB = 0;
+
+ /**
+ * The feature id for the '<em><b>Library Class</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int FACELET_LIBRARY_CLASS_TAG_LIB__LIBRARY_CLASS = FACELET_TAGLIB_DEFN_FEATURE_COUNT + 0;
+
+ /**
+ * The number of structural features of the '<em>Facelet Library Class Tag Lib</em>' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int FACELET_LIBRARY_CLASS_TAG_LIB_FEATURE_COUNT = FACELET_TAGLIB_DEFN_FEATURE_COUNT + 1;
+
+ /**
+ * The meta object id for the '{@link org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.impl.FaceletXMLDefnTaglibImpl <em>Facelet XML Defn Taglib</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.impl.FaceletXMLDefnTaglibImpl
+ * @see org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.impl.FaceletTaglibPackageImpl#getFaceletXMLDefnTaglib()
+ * @generated
+ */
+ int FACELET_XML_DEFN_TAGLIB = 1;
+
+ /**
+ * The feature id for the '<em><b>Namespace</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int FACELET_XML_DEFN_TAGLIB__NAMESPACE = FACELET_TAGLIB_DEFN_FEATURE_COUNT + 0;
+
+ /**
+ * The feature id for the '<em><b>Tags</b></em>' reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int FACELET_XML_DEFN_TAGLIB__TAGS = FACELET_TAGLIB_DEFN_FEATURE_COUNT + 1;
+
+ /**
+ * The feature id for the '<em><b>Functions</b></em>' reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int FACELET_XML_DEFN_TAGLIB__FUNCTIONS = FACELET_TAGLIB_DEFN_FEATURE_COUNT + 2;
+
+ /**
+ * The number of structural features of the '<em>Facelet XML Defn Taglib</em>' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int FACELET_XML_DEFN_TAGLIB_FEATURE_COUNT = FACELET_TAGLIB_DEFN_FEATURE_COUNT + 3;
+
+ /**
+ * The meta object id for the '{@link org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.impl.TagDefnImpl <em>Tag Defn</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.impl.TagDefnImpl
+ * @see org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.impl.FaceletTaglibPackageImpl#getTagDefn()
+ * @generated
+ */
+ int TAG_DEFN = 8;
+
+ /**
+ * The feature id for the '<em><b>Name</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int TAG_DEFN__NAME = 0;
+
+ /**
+ * The number of structural features of the '<em>Tag Defn</em>' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int TAG_DEFN_FEATURE_COUNT = 1;
+
+ /**
+ * The meta object id for the '{@link org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.impl.HandlerTagDefnImpl <em>Handler Tag Defn</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.impl.HandlerTagDefnImpl
+ * @see org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.impl.FaceletTaglibPackageImpl#getHandlerTagDefn()
+ * @generated
+ */
+ int HANDLER_TAG_DEFN = 6;
+
+ /**
+ * The feature id for the '<em><b>Name</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int HANDLER_TAG_DEFN__NAME = TAG_DEFN__NAME;
+
+ /**
+ * The feature id for the '<em><b>Handler Class</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int HANDLER_TAG_DEFN__HANDLER_CLASS = TAG_DEFN_FEATURE_COUNT + 0;
+
+ /**
+ * The number of structural features of the '<em>Handler Tag Defn</em>' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int HANDLER_TAG_DEFN_FEATURE_COUNT = TAG_DEFN_FEATURE_COUNT + 1;
+
+ /**
+ * The meta object id for the '{@link org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.impl.ComponentTagDefnImpl <em>Component Tag Defn</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.impl.ComponentTagDefnImpl
+ * @see org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.impl.FaceletTaglibPackageImpl#getComponentTagDefn()
+ * @generated
+ */
+ int COMPONENT_TAG_DEFN = 3;
+
+ /**
+ * The feature id for the '<em><b>Name</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int COMPONENT_TAG_DEFN__NAME = HANDLER_TAG_DEFN__NAME;
+
+ /**
+ * The feature id for the '<em><b>Handler Class</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int COMPONENT_TAG_DEFN__HANDLER_CLASS = HANDLER_TAG_DEFN__HANDLER_CLASS;
+
+ /**
+ * The feature id for the '<em><b>Component Type</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int COMPONENT_TAG_DEFN__COMPONENT_TYPE = HANDLER_TAG_DEFN_FEATURE_COUNT + 0;
+
+ /**
+ * The feature id for the '<em><b>Renderer Type</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int COMPONENT_TAG_DEFN__RENDERER_TYPE = HANDLER_TAG_DEFN_FEATURE_COUNT + 1;
+
+ /**
+ * The number of structural features of the '<em>Component Tag Defn</em>' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int COMPONENT_TAG_DEFN_FEATURE_COUNT = HANDLER_TAG_DEFN_FEATURE_COUNT + 2;
+
+ /**
+ * The meta object id for the '{@link org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.impl.ValidatorTagDefnImpl <em>Validator Tag Defn</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.impl.ValidatorTagDefnImpl
+ * @see org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.impl.FaceletTaglibPackageImpl#getValidatorTagDefn()
+ * @generated
+ */
+ int VALIDATOR_TAG_DEFN = 4;
+
+ /**
+ * The feature id for the '<em><b>Name</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int VALIDATOR_TAG_DEFN__NAME = HANDLER_TAG_DEFN__NAME;
+
+ /**
+ * The feature id for the '<em><b>Handler Class</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int VALIDATOR_TAG_DEFN__HANDLER_CLASS = HANDLER_TAG_DEFN__HANDLER_CLASS;
+
+ /**
+ * The feature id for the '<em><b>Validator Id</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int VALIDATOR_TAG_DEFN__VALIDATOR_ID = HANDLER_TAG_DEFN_FEATURE_COUNT + 0;
+
+ /**
+ * The number of structural features of the '<em>Validator Tag Defn</em>' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int VALIDATOR_TAG_DEFN_FEATURE_COUNT = HANDLER_TAG_DEFN_FEATURE_COUNT + 1;
+
+ /**
+ * The meta object id for the '{@link org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.impl.ConverterTagDefnImpl <em>Converter Tag Defn</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.impl.ConverterTagDefnImpl
+ * @see org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.impl.FaceletTaglibPackageImpl#getConverterTagDefn()
+ * @generated
+ */
+ int CONVERTER_TAG_DEFN = 5;
+
+ /**
+ * The feature id for the '<em><b>Name</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int CONVERTER_TAG_DEFN__NAME = HANDLER_TAG_DEFN__NAME;
+
+ /**
+ * The feature id for the '<em><b>Handler Class</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int CONVERTER_TAG_DEFN__HANDLER_CLASS = HANDLER_TAG_DEFN__HANDLER_CLASS;
+
+ /**
+ * The feature id for the '<em><b>Converter Id</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int CONVERTER_TAG_DEFN__CONVERTER_ID = HANDLER_TAG_DEFN_FEATURE_COUNT + 0;
+
+ /**
+ * The number of structural features of the '<em>Converter Tag Defn</em>' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int CONVERTER_TAG_DEFN_FEATURE_COUNT = HANDLER_TAG_DEFN_FEATURE_COUNT + 1;
+
+ /**
+ * The meta object id for the '{@link org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.impl.SourceTagDefnImpl <em>Source Tag Defn</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.impl.SourceTagDefnImpl
+ * @see org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.impl.FaceletTaglibPackageImpl#getSourceTagDefn()
+ * @generated
+ */
+ int SOURCE_TAG_DEFN = 7;
+
+ /**
+ * The feature id for the '<em><b>Name</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int SOURCE_TAG_DEFN__NAME = TAG_DEFN__NAME;
+
+ /**
+ * The feature id for the '<em><b>Source</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int SOURCE_TAG_DEFN__SOURCE = TAG_DEFN_FEATURE_COUNT + 0;
+
+ /**
+ * The number of structural features of the '<em>Source Tag Defn</em>' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int SOURCE_TAG_DEFN_FEATURE_COUNT = TAG_DEFN_FEATURE_COUNT + 1;
+
+ /**
+ * The meta object id for the '{@link org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.impl.FunctionDefnImpl <em>Function Defn</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.impl.FunctionDefnImpl
+ * @see org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.impl.FaceletTaglibPackageImpl#getFunctionDefn()
+ * @generated
+ */
+ int FUNCTION_DEFN = 9;
+
+ /**
+ * The feature id for the '<em><b>Function Name</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int FUNCTION_DEFN__FUNCTION_NAME = 0;
+
+ /**
+ * The feature id for the '<em><b>Function Class</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int FUNCTION_DEFN__FUNCTION_CLASS = 1;
+
+ /**
+ * The feature id for the '<em><b>Function Signature</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int FUNCTION_DEFN__FUNCTION_SIGNATURE = 2;
+
+ /**
+ * The number of structural features of the '<em>Function Defn</em>' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int FUNCTION_DEFN_FEATURE_COUNT = 3;
+
+
+ /**
+ * Returns the meta object for class '{@link org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.FaceletLibraryClassTagLib <em>Facelet Library Class Tag Lib</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for class '<em>Facelet Library Class Tag Lib</em>'.
+ * @see org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.FaceletLibraryClassTagLib
+ * @generated
+ */
+ EClass getFaceletLibraryClassTagLib();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.FaceletLibraryClassTagLib#getLibraryClass <em>Library Class</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Library Class</em>'.
+ * @see org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.FaceletLibraryClassTagLib#getLibraryClass()
+ * @see #getFaceletLibraryClassTagLib()
+ * @generated
+ */
+ EAttribute getFaceletLibraryClassTagLib_LibraryClass();
+
+ /**
+ * Returns the meta object for class '{@link org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.FaceletXMLDefnTaglib <em>Facelet XML Defn Taglib</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for class '<em>Facelet XML Defn Taglib</em>'.
+ * @see org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.FaceletXMLDefnTaglib
+ * @generated
+ */
+ EClass getFaceletXMLDefnTaglib();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.FaceletXMLDefnTaglib#getNamespace <em>Namespace</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Namespace</em>'.
+ * @see org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.FaceletXMLDefnTaglib#getNamespace()
+ * @see #getFaceletXMLDefnTaglib()
+ * @generated
+ */
+ EAttribute getFaceletXMLDefnTaglib_Namespace();
+
+ /**
+ * Returns the meta object for the reference list '{@link org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.FaceletXMLDefnTaglib#getTags <em>Tags</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the reference list '<em>Tags</em>'.
+ * @see org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.FaceletXMLDefnTaglib#getTags()
+ * @see #getFaceletXMLDefnTaglib()
+ * @generated
+ */
+ EReference getFaceletXMLDefnTaglib_Tags();
+
+ /**
+ * Returns the meta object for the reference list '{@link org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.FaceletXMLDefnTaglib#getFunctions <em>Functions</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the reference list '<em>Functions</em>'.
+ * @see org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.FaceletXMLDefnTaglib#getFunctions()
+ * @see #getFaceletXMLDefnTaglib()
+ * @generated
+ */
+ EReference getFaceletXMLDefnTaglib_Functions();
+
+ /**
+ * Returns the meta object for class '{@link org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.FaceletTaglibDefn <em>Defn</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for class '<em>Defn</em>'.
+ * @see org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.FaceletTaglibDefn
+ * @generated
+ */
+ EClass getFaceletTaglibDefn();
+
+ /**
+ * Returns the meta object for class '{@link org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.ComponentTagDefn <em>Component Tag Defn</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for class '<em>Component Tag Defn</em>'.
+ * @see org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.ComponentTagDefn
+ * @generated
+ */
+ EClass getComponentTagDefn();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.ComponentTagDefn#getComponentType <em>Component Type</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Component Type</em>'.
+ * @see org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.ComponentTagDefn#getComponentType()
+ * @see #getComponentTagDefn()
+ * @generated
+ */
+ EAttribute getComponentTagDefn_ComponentType();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.ComponentTagDefn#getRendererType <em>Renderer Type</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Renderer Type</em>'.
+ * @see org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.ComponentTagDefn#getRendererType()
+ * @see #getComponentTagDefn()
+ * @generated
+ */
+ EAttribute getComponentTagDefn_RendererType();
+
+ /**
+ * Returns the meta object for class '{@link org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.ValidatorTagDefn <em>Validator Tag Defn</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for class '<em>Validator Tag Defn</em>'.
+ * @see org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.ValidatorTagDefn
+ * @generated
+ */
+ EClass getValidatorTagDefn();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.ValidatorTagDefn#getValidatorId <em>Validator Id</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Validator Id</em>'.
+ * @see org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.ValidatorTagDefn#getValidatorId()
+ * @see #getValidatorTagDefn()
+ * @generated
+ */
+ EAttribute getValidatorTagDefn_ValidatorId();
+
+ /**
+ * Returns the meta object for class '{@link org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.ConverterTagDefn <em>Converter Tag Defn</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for class '<em>Converter Tag Defn</em>'.
+ * @see org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.ConverterTagDefn
+ * @generated
+ */
+ EClass getConverterTagDefn();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.ConverterTagDefn#getConverterId <em>Converter Id</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Converter Id</em>'.
+ * @see org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.ConverterTagDefn#getConverterId()
+ * @see #getConverterTagDefn()
+ * @generated
+ */
+ EAttribute getConverterTagDefn_ConverterId();
+
+ /**
+ * Returns the meta object for class '{@link org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.HandlerTagDefn <em>Handler Tag Defn</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for class '<em>Handler Tag Defn</em>'.
+ * @see org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.HandlerTagDefn
+ * @generated
+ */
+ EClass getHandlerTagDefn();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.HandlerTagDefn#getHandlerClass <em>Handler Class</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Handler Class</em>'.
+ * @see org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.HandlerTagDefn#getHandlerClass()
+ * @see #getHandlerTagDefn()
+ * @generated
+ */
+ EAttribute getHandlerTagDefn_HandlerClass();
+
+ /**
+ * Returns the meta object for class '{@link org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.SourceTagDefn <em>Source Tag Defn</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for class '<em>Source Tag Defn</em>'.
+ * @see org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.SourceTagDefn
+ * @generated
+ */
+ EClass getSourceTagDefn();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.SourceTagDefn#getSource <em>Source</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Source</em>'.
+ * @see org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.SourceTagDefn#getSource()
+ * @see #getSourceTagDefn()
+ * @generated
+ */
+ EAttribute getSourceTagDefn_Source();
+
+ /**
+ * Returns the meta object for class '{@link org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.TagDefn <em>Tag Defn</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for class '<em>Tag Defn</em>'.
+ * @see org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.TagDefn
+ * @generated
+ */
+ EClass getTagDefn();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.TagDefn#getName <em>Name</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Name</em>'.
+ * @see org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.TagDefn#getName()
+ * @see #getTagDefn()
+ * @generated
+ */
+ EAttribute getTagDefn_Name();
+
+ /**
+ * Returns the meta object for class '{@link org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.FunctionDefn <em>Function Defn</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for class '<em>Function Defn</em>'.
+ * @see org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.FunctionDefn
+ * @generated
+ */
+ EClass getFunctionDefn();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.FunctionDefn#getFunctionName <em>Function Name</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Function Name</em>'.
+ * @see org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.FunctionDefn#getFunctionName()
+ * @see #getFunctionDefn()
+ * @generated
+ */
+ EAttribute getFunctionDefn_FunctionName();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.FunctionDefn#getFunctionClass <em>Function Class</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Function Class</em>'.
+ * @see org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.FunctionDefn#getFunctionClass()
+ * @see #getFunctionDefn()
+ * @generated
+ */
+ EAttribute getFunctionDefn_FunctionClass();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.FunctionDefn#getFunctionSignature <em>Function Signature</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Function Signature</em>'.
+ * @see org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.FunctionDefn#getFunctionSignature()
+ * @see #getFunctionDefn()
+ * @generated
+ */
+ EAttribute getFunctionDefn_FunctionSignature();
+
+ /**
+ * Returns the factory that creates the instances of the model.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the factory that creates the instances of the model.
+ * @generated
+ */
+ FaceletTaglibFactory getFaceletTaglibFactory();
+
+ /**
+ * <!-- begin-user-doc -->
+ * Defines literals for the meta objects that represent
+ * <ul>
+ * <li>each class,</li>
+ * <li>each feature of each class,</li>
+ * <li>each enum,</li>
+ * <li>and each data type</li>
+ * </ul>
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @SuppressWarnings("hiding")
+ interface Literals
+ {
+ /**
+ * The meta object literal for the '{@link org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.impl.FaceletLibraryClassTagLibImpl <em>Facelet Library Class Tag Lib</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.impl.FaceletLibraryClassTagLibImpl
+ * @see org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.impl.FaceletTaglibPackageImpl#getFaceletLibraryClassTagLib()
+ * @generated
+ */
+ EClass FACELET_LIBRARY_CLASS_TAG_LIB = eINSTANCE.getFaceletLibraryClassTagLib();
+
+ /**
+ * The meta object literal for the '<em><b>Library Class</b></em>' attribute feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute FACELET_LIBRARY_CLASS_TAG_LIB__LIBRARY_CLASS = eINSTANCE.getFaceletLibraryClassTagLib_LibraryClass();
+
+ /**
+ * The meta object literal for the '{@link org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.impl.FaceletXMLDefnTaglibImpl <em>Facelet XML Defn Taglib</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.impl.FaceletXMLDefnTaglibImpl
+ * @see org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.impl.FaceletTaglibPackageImpl#getFaceletXMLDefnTaglib()
+ * @generated
+ */
+ EClass FACELET_XML_DEFN_TAGLIB = eINSTANCE.getFaceletXMLDefnTaglib();
+
+ /**
+ * The meta object literal for the '<em><b>Namespace</b></em>' attribute feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute FACELET_XML_DEFN_TAGLIB__NAMESPACE = eINSTANCE.getFaceletXMLDefnTaglib_Namespace();
+
+ /**
+ * The meta object literal for the '<em><b>Tags</b></em>' reference list feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EReference FACELET_XML_DEFN_TAGLIB__TAGS = eINSTANCE.getFaceletXMLDefnTaglib_Tags();
+
+ /**
+ * The meta object literal for the '<em><b>Functions</b></em>' reference list feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EReference FACELET_XML_DEFN_TAGLIB__FUNCTIONS = eINSTANCE.getFaceletXMLDefnTaglib_Functions();
+
+ /**
+ * The meta object literal for the '{@link org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.impl.FaceletTaglibDefnImpl <em>Defn</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.impl.FaceletTaglibDefnImpl
+ * @see org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.impl.FaceletTaglibPackageImpl#getFaceletTaglibDefn()
+ * @generated
+ */
+ EClass FACELET_TAGLIB_DEFN = eINSTANCE.getFaceletTaglibDefn();
+
+ /**
+ * The meta object literal for the '{@link org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.impl.ComponentTagDefnImpl <em>Component Tag Defn</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.impl.ComponentTagDefnImpl
+ * @see org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.impl.FaceletTaglibPackageImpl#getComponentTagDefn()
+ * @generated
+ */
+ EClass COMPONENT_TAG_DEFN = eINSTANCE.getComponentTagDefn();
+
+ /**
+ * The meta object literal for the '<em><b>Component Type</b></em>' attribute feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute COMPONENT_TAG_DEFN__COMPONENT_TYPE = eINSTANCE.getComponentTagDefn_ComponentType();
+
+ /**
+ * The meta object literal for the '<em><b>Renderer Type</b></em>' attribute feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute COMPONENT_TAG_DEFN__RENDERER_TYPE = eINSTANCE.getComponentTagDefn_RendererType();
+
+ /**
+ * The meta object literal for the '{@link org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.impl.ValidatorTagDefnImpl <em>Validator Tag Defn</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.impl.ValidatorTagDefnImpl
+ * @see org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.impl.FaceletTaglibPackageImpl#getValidatorTagDefn()
+ * @generated
+ */
+ EClass VALIDATOR_TAG_DEFN = eINSTANCE.getValidatorTagDefn();
+
+ /**
+ * The meta object literal for the '<em><b>Validator Id</b></em>' attribute feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute VALIDATOR_TAG_DEFN__VALIDATOR_ID = eINSTANCE.getValidatorTagDefn_ValidatorId();
+
+ /**
+ * The meta object literal for the '{@link org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.impl.ConverterTagDefnImpl <em>Converter Tag Defn</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.impl.ConverterTagDefnImpl
+ * @see org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.impl.FaceletTaglibPackageImpl#getConverterTagDefn()
+ * @generated
+ */
+ EClass CONVERTER_TAG_DEFN = eINSTANCE.getConverterTagDefn();
+
+ /**
+ * The meta object literal for the '<em><b>Converter Id</b></em>' attribute feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute CONVERTER_TAG_DEFN__CONVERTER_ID = eINSTANCE.getConverterTagDefn_ConverterId();
+
+ /**
+ * The meta object literal for the '{@link org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.impl.HandlerTagDefnImpl <em>Handler Tag Defn</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.impl.HandlerTagDefnImpl
+ * @see org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.impl.FaceletTaglibPackageImpl#getHandlerTagDefn()
+ * @generated
+ */
+ EClass HANDLER_TAG_DEFN = eINSTANCE.getHandlerTagDefn();
+
+ /**
+ * The meta object literal for the '<em><b>Handler Class</b></em>' attribute feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute HANDLER_TAG_DEFN__HANDLER_CLASS = eINSTANCE.getHandlerTagDefn_HandlerClass();
+
+ /**
+ * The meta object literal for the '{@link org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.impl.SourceTagDefnImpl <em>Source Tag Defn</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.impl.SourceTagDefnImpl
+ * @see org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.impl.FaceletTaglibPackageImpl#getSourceTagDefn()
+ * @generated
+ */
+ EClass SOURCE_TAG_DEFN = eINSTANCE.getSourceTagDefn();
+
+ /**
+ * The meta object literal for the '<em><b>Source</b></em>' attribute feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute SOURCE_TAG_DEFN__SOURCE = eINSTANCE.getSourceTagDefn_Source();
+
+ /**
+ * The meta object literal for the '{@link org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.impl.TagDefnImpl <em>Tag Defn</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.impl.TagDefnImpl
+ * @see org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.impl.FaceletTaglibPackageImpl#getTagDefn()
+ * @generated
+ */
+ EClass TAG_DEFN = eINSTANCE.getTagDefn();
+
+ /**
+ * The meta object literal for the '<em><b>Name</b></em>' attribute feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute TAG_DEFN__NAME = eINSTANCE.getTagDefn_Name();
+
+ /**
+ * The meta object literal for the '{@link org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.impl.FunctionDefnImpl <em>Function Defn</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.impl.FunctionDefnImpl
+ * @see org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.impl.FaceletTaglibPackageImpl#getFunctionDefn()
+ * @generated
+ */
+ EClass FUNCTION_DEFN = eINSTANCE.getFunctionDefn();
+
+ /**
+ * The meta object literal for the '<em><b>Function Name</b></em>' attribute feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute FUNCTION_DEFN__FUNCTION_NAME = eINSTANCE.getFunctionDefn_FunctionName();
+
+ /**
+ * The meta object literal for the '<em><b>Function Class</b></em>' attribute feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute FUNCTION_DEFN__FUNCTION_CLASS = eINSTANCE.getFunctionDefn_FunctionClass();
+
+ /**
+ * The meta object literal for the '<em><b>Function Signature</b></em>' attribute feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute FUNCTION_DEFN__FUNCTION_SIGNATURE = eINSTANCE.getFunctionDefn_FunctionSignature();
+
+ }
+
+} //FaceletTaglibPackage
diff --git a/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/taglib/faceletTaglib/FaceletXMLDefnTaglib.java b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/taglib/faceletTaglib/FaceletXMLDefnTaglib.java
new file mode 100644
index 000000000..98b45a41a
--- /dev/null
+++ b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/taglib/faceletTaglib/FaceletXMLDefnTaglib.java
@@ -0,0 +1,89 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id: FaceletXMLDefnTaglib.java,v 1.1 2010/03/08 18:49:40 cbateman Exp $
+ */
+package org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib;
+
+import org.eclipse.emf.common.util.EList;
+
+/**
+ * <!-- begin-user-doc -->
+ * A representation of the model object '<em><b>Facelet XML Defn Taglib</b></em>'.
+ * <!-- end-user-doc -->
+ *
+ * <p>
+ * The following features are supported:
+ * <ul>
+ * <li>{@link org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.FaceletXMLDefnTaglib#getNamespace <em>Namespace</em>}</li>
+ * <li>{@link org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.FaceletXMLDefnTaglib#getTags <em>Tags</em>}</li>
+ * <li>{@link org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.FaceletXMLDefnTaglib#getFunctions <em>Functions</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @see org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.FaceletTaglibPackage#getFaceletXMLDefnTaglib()
+ * @model
+ * @generated
+ */
+public interface FaceletXMLDefnTaglib extends FaceletTaglibDefn
+{
+ /**
+ * Returns the value of the '<em><b>Namespace</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Namespace</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Namespace</em>' attribute.
+ * @see #setNamespace(String)
+ * @see org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.FaceletTaglibPackage#getFaceletXMLDefnTaglib_Namespace()
+ * @model
+ * @generated
+ */
+ String getNamespace();
+
+ /**
+ * Sets the value of the '{@link org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.FaceletXMLDefnTaglib#getNamespace <em>Namespace</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Namespace</em>' attribute.
+ * @see #getNamespace()
+ * @generated
+ */
+ void setNamespace(String value);
+
+ /**
+ * Returns the value of the '<em><b>Tags</b></em>' reference list.
+ * The list contents are of type {@link org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.TagDefn}.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Tags</em>' reference list isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Tags</em>' reference list.
+ * @see org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.FaceletTaglibPackage#getFaceletXMLDefnTaglib_Tags()
+ * @model
+ * @generated
+ */
+ EList<TagDefn> getTags();
+
+ /**
+ * Returns the value of the '<em><b>Functions</b></em>' reference list.
+ * The list contents are of type {@link org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.FunctionDefn}.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Functions</em>' reference list isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Functions</em>' reference list.
+ * @see org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.FaceletTaglibPackage#getFaceletXMLDefnTaglib_Functions()
+ * @model
+ * @generated
+ */
+ EList<FunctionDefn> getFunctions();
+
+} // FaceletXMLDefnTaglib
diff --git a/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/taglib/faceletTaglib/FunctionDefn.java b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/taglib/faceletTaglib/FunctionDefn.java
new file mode 100644
index 000000000..463612023
--- /dev/null
+++ b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/taglib/faceletTaglib/FunctionDefn.java
@@ -0,0 +1,109 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id: FunctionDefn.java,v 1.1 2010/03/08 18:49:40 cbateman Exp $
+ */
+package org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib;
+
+import org.eclipse.emf.ecore.EObject;
+
+/**
+ * <!-- begin-user-doc -->
+ * A representation of the model object '<em><b>Function Defn</b></em>'.
+ * <!-- end-user-doc -->
+ *
+ * <p>
+ * The following features are supported:
+ * <ul>
+ * <li>{@link org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.FunctionDefn#getFunctionName <em>Function Name</em>}</li>
+ * <li>{@link org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.FunctionDefn#getFunctionClass <em>Function Class</em>}</li>
+ * <li>{@link org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.FunctionDefn#getFunctionSignature <em>Function Signature</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @see org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.FaceletTaglibPackage#getFunctionDefn()
+ * @model
+ * @generated
+ */
+public interface FunctionDefn extends EObject
+{
+ /**
+ * Returns the value of the '<em><b>Function Name</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Function Name</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Function Name</em>' attribute.
+ * @see #setFunctionName(String)
+ * @see org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.FaceletTaglibPackage#getFunctionDefn_FunctionName()
+ * @model
+ * @generated
+ */
+ String getFunctionName();
+
+ /**
+ * Sets the value of the '{@link org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.FunctionDefn#getFunctionName <em>Function Name</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Function Name</em>' attribute.
+ * @see #getFunctionName()
+ * @generated
+ */
+ void setFunctionName(String value);
+
+ /**
+ * Returns the value of the '<em><b>Function Class</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Function Class</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Function Class</em>' attribute.
+ * @see #setFunctionClass(String)
+ * @see org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.FaceletTaglibPackage#getFunctionDefn_FunctionClass()
+ * @model
+ * @generated
+ */
+ String getFunctionClass();
+
+ /**
+ * Sets the value of the '{@link org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.FunctionDefn#getFunctionClass <em>Function Class</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Function Class</em>' attribute.
+ * @see #getFunctionClass()
+ * @generated
+ */
+ void setFunctionClass(String value);
+
+ /**
+ * Returns the value of the '<em><b>Function Signature</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Function Signature</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Function Signature</em>' attribute.
+ * @see #setFunctionSignature(String)
+ * @see org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.FaceletTaglibPackage#getFunctionDefn_FunctionSignature()
+ * @model
+ * @generated
+ */
+ String getFunctionSignature();
+
+ /**
+ * Sets the value of the '{@link org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.FunctionDefn#getFunctionSignature <em>Function Signature</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Function Signature</em>' attribute.
+ * @see #getFunctionSignature()
+ * @generated
+ */
+ void setFunctionSignature(String value);
+
+} // FunctionDefn
diff --git a/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/taglib/faceletTaglib/HandlerTagDefn.java b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/taglib/faceletTaglib/HandlerTagDefn.java
new file mode 100644
index 000000000..d191bccc7
--- /dev/null
+++ b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/taglib/faceletTaglib/HandlerTagDefn.java
@@ -0,0 +1,54 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id: HandlerTagDefn.java,v 1.1 2010/03/08 18:49:40 cbateman Exp $
+ */
+package org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib;
+
+
+/**
+ * <!-- begin-user-doc -->
+ * A representation of the model object '<em><b>Handler Tag Defn</b></em>'.
+ * <!-- end-user-doc -->
+ *
+ * <p>
+ * The following features are supported:
+ * <ul>
+ * <li>{@link org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.HandlerTagDefn#getHandlerClass <em>Handler Class</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @see org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.FaceletTaglibPackage#getHandlerTagDefn()
+ * @model
+ * @generated
+ */
+public interface HandlerTagDefn extends TagDefn
+{
+ /**
+ * Returns the value of the '<em><b>Handler Class</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Handler Class</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Handler Class</em>' attribute.
+ * @see #setHandlerClass(String)
+ * @see org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.FaceletTaglibPackage#getHandlerTagDefn_HandlerClass()
+ * @model
+ * @generated
+ */
+ String getHandlerClass();
+
+ /**
+ * Sets the value of the '{@link org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.HandlerTagDefn#getHandlerClass <em>Handler Class</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Handler Class</em>' attribute.
+ * @see #getHandlerClass()
+ * @generated
+ */
+ void setHandlerClass(String value);
+
+} // HandlerTagDefn
diff --git a/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/taglib/faceletTaglib/SourceTagDefn.java b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/taglib/faceletTaglib/SourceTagDefn.java
new file mode 100644
index 000000000..8add55e6c
--- /dev/null
+++ b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/taglib/faceletTaglib/SourceTagDefn.java
@@ -0,0 +1,54 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id: SourceTagDefn.java,v 1.1 2010/03/08 18:49:40 cbateman Exp $
+ */
+package org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib;
+
+
+/**
+ * <!-- begin-user-doc -->
+ * A representation of the model object '<em><b>Source Tag Defn</b></em>'.
+ * <!-- end-user-doc -->
+ *
+ * <p>
+ * The following features are supported:
+ * <ul>
+ * <li>{@link org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.SourceTagDefn#getSource <em>Source</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @see org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.FaceletTaglibPackage#getSourceTagDefn()
+ * @model
+ * @generated
+ */
+public interface SourceTagDefn extends TagDefn
+{
+ /**
+ * Returns the value of the '<em><b>Source</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Source</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Source</em>' attribute.
+ * @see #setSource(String)
+ * @see org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.FaceletTaglibPackage#getSourceTagDefn_Source()
+ * @model
+ * @generated
+ */
+ String getSource();
+
+ /**
+ * Sets the value of the '{@link org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.SourceTagDefn#getSource <em>Source</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Source</em>' attribute.
+ * @see #getSource()
+ * @generated
+ */
+ void setSource(String value);
+
+} // SourceTagDefn
diff --git a/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/taglib/faceletTaglib/TagDefn.java b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/taglib/faceletTaglib/TagDefn.java
new file mode 100644
index 000000000..ead8988f0
--- /dev/null
+++ b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/taglib/faceletTaglib/TagDefn.java
@@ -0,0 +1,55 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id: TagDefn.java,v 1.1 2010/03/08 18:49:40 cbateman Exp $
+ */
+package org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib;
+
+import org.eclipse.emf.ecore.EObject;
+
+/**
+ * <!-- begin-user-doc -->
+ * A representation of the model object '<em><b>Tag Defn</b></em>'.
+ * <!-- end-user-doc -->
+ *
+ * <p>
+ * The following features are supported:
+ * <ul>
+ * <li>{@link org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.TagDefn#getName <em>Name</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @see org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.FaceletTaglibPackage#getTagDefn()
+ * @model
+ * @generated
+ */
+public interface TagDefn extends EObject
+{
+ /**
+ * Returns the value of the '<em><b>Name</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Name</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Name</em>' attribute.
+ * @see #setName(String)
+ * @see org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.FaceletTaglibPackage#getTagDefn_Name()
+ * @model
+ * @generated
+ */
+ String getName();
+
+ /**
+ * Sets the value of the '{@link org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.TagDefn#getName <em>Name</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Name</em>' attribute.
+ * @see #getName()
+ * @generated
+ */
+ void setName(String value);
+
+} // TagDefn
diff --git a/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/taglib/faceletTaglib/ValidatorTagDefn.java b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/taglib/faceletTaglib/ValidatorTagDefn.java
new file mode 100644
index 000000000..16688103e
--- /dev/null
+++ b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/taglib/faceletTaglib/ValidatorTagDefn.java
@@ -0,0 +1,54 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id: ValidatorTagDefn.java,v 1.1 2010/03/08 18:49:40 cbateman Exp $
+ */
+package org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib;
+
+
+/**
+ * <!-- begin-user-doc -->
+ * A representation of the model object '<em><b>Validator Tag Defn</b></em>'.
+ * <!-- end-user-doc -->
+ *
+ * <p>
+ * The following features are supported:
+ * <ul>
+ * <li>{@link org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.ValidatorTagDefn#getValidatorId <em>Validator Id</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @see org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.FaceletTaglibPackage#getValidatorTagDefn()
+ * @model
+ * @generated
+ */
+public interface ValidatorTagDefn extends HandlerTagDefn
+{
+ /**
+ * Returns the value of the '<em><b>Validator Id</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Validator Id</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Validator Id</em>' attribute.
+ * @see #setValidatorId(String)
+ * @see org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.FaceletTaglibPackage#getValidatorTagDefn_ValidatorId()
+ * @model
+ * @generated
+ */
+ String getValidatorId();
+
+ /**
+ * Sets the value of the '{@link org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.ValidatorTagDefn#getValidatorId <em>Validator Id</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Validator Id</em>' attribute.
+ * @see #getValidatorId()
+ * @generated
+ */
+ void setValidatorId(String value);
+
+} // ValidatorTagDefn
diff --git a/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/taglib/faceletTaglib/impl/ComponentTagDefnImpl.java b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/taglib/faceletTaglib/impl/ComponentTagDefnImpl.java
new file mode 100644
index 000000000..3efb5195a
--- /dev/null
+++ b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/taglib/faceletTaglib/impl/ComponentTagDefnImpl.java
@@ -0,0 +1,236 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id: ComponentTagDefnImpl.java,v 1.1 2010/03/08 18:49:42 cbateman Exp $
+ */
+package org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.impl;
+
+import org.eclipse.emf.common.notify.Notification;
+
+import org.eclipse.emf.ecore.EClass;
+
+import org.eclipse.emf.ecore.impl.ENotificationImpl;
+
+import org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.ComponentTagDefn;
+import org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.FaceletTaglibPackage;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model object '<em><b>Component Tag Defn</b></em>'.
+ * <!-- end-user-doc -->
+ * <p>
+ * The following features are implemented:
+ * <ul>
+ * <li>{@link org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.impl.ComponentTagDefnImpl#getComponentType <em>Component Type</em>}</li>
+ * <li>{@link org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.impl.ComponentTagDefnImpl#getRendererType <em>Renderer Type</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @generated
+ */
+public class ComponentTagDefnImpl extends HandlerTagDefnImpl implements ComponentTagDefn
+{
+ /**
+ * The default value of the '{@link #getComponentType() <em>Component Type</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getComponentType()
+ * @generated
+ * @ordered
+ */
+ protected static final String COMPONENT_TYPE_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getComponentType() <em>Component Type</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getComponentType()
+ * @generated
+ * @ordered
+ */
+ protected String componentType = COMPONENT_TYPE_EDEFAULT;
+
+ /**
+ * The default value of the '{@link #getRendererType() <em>Renderer Type</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getRendererType()
+ * @generated
+ * @ordered
+ */
+ protected static final String RENDERER_TYPE_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getRendererType() <em>Renderer Type</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getRendererType()
+ * @generated
+ * @ordered
+ */
+ protected String rendererType = RENDERER_TYPE_EDEFAULT;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected ComponentTagDefnImpl()
+ {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected EClass eStaticClass()
+ {
+ return FaceletTaglibPackage.Literals.COMPONENT_TAG_DEFN;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String getComponentType()
+ {
+ return componentType;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setComponentType(String newComponentType)
+ {
+ String oldComponentType = componentType;
+ componentType = newComponentType;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, FaceletTaglibPackage.COMPONENT_TAG_DEFN__COMPONENT_TYPE, oldComponentType, componentType));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String getRendererType()
+ {
+ return rendererType;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setRendererType(String newRendererType)
+ {
+ String oldRendererType = rendererType;
+ rendererType = newRendererType;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, FaceletTaglibPackage.COMPONENT_TAG_DEFN__RENDERER_TYPE, oldRendererType, rendererType));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object eGet(int featureID, boolean resolve, boolean coreType)
+ {
+ switch (featureID)
+ {
+ case FaceletTaglibPackage.COMPONENT_TAG_DEFN__COMPONENT_TYPE:
+ return getComponentType();
+ case FaceletTaglibPackage.COMPONENT_TAG_DEFN__RENDERER_TYPE:
+ return getRendererType();
+ }
+ return super.eGet(featureID, resolve, coreType);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void eSet(int featureID, Object newValue)
+ {
+ switch (featureID)
+ {
+ case FaceletTaglibPackage.COMPONENT_TAG_DEFN__COMPONENT_TYPE:
+ setComponentType((String)newValue);
+ return;
+ case FaceletTaglibPackage.COMPONENT_TAG_DEFN__RENDERER_TYPE:
+ setRendererType((String)newValue);
+ return;
+ }
+ super.eSet(featureID, newValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void eUnset(int featureID)
+ {
+ switch (featureID)
+ {
+ case FaceletTaglibPackage.COMPONENT_TAG_DEFN__COMPONENT_TYPE:
+ setComponentType(COMPONENT_TYPE_EDEFAULT);
+ return;
+ case FaceletTaglibPackage.COMPONENT_TAG_DEFN__RENDERER_TYPE:
+ setRendererType(RENDERER_TYPE_EDEFAULT);
+ return;
+ }
+ super.eUnset(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public boolean eIsSet(int featureID)
+ {
+ switch (featureID)
+ {
+ case FaceletTaglibPackage.COMPONENT_TAG_DEFN__COMPONENT_TYPE:
+ return COMPONENT_TYPE_EDEFAULT == null ? componentType != null : !COMPONENT_TYPE_EDEFAULT.equals(componentType);
+ case FaceletTaglibPackage.COMPONENT_TAG_DEFN__RENDERER_TYPE:
+ return RENDERER_TYPE_EDEFAULT == null ? rendererType != null : !RENDERER_TYPE_EDEFAULT.equals(rendererType);
+ }
+ return super.eIsSet(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public String toString()
+ {
+ if (eIsProxy()) return super.toString();
+
+ StringBuffer result = new StringBuffer(super.toString());
+ result.append(" (componentType: "); //$NON-NLS-1$
+ result.append(componentType);
+ result.append(", rendererType: "); //$NON-NLS-1$
+ result.append(rendererType);
+ result.append(')');
+ return result.toString();
+ }
+
+} //ComponentTagDefnImpl
diff --git a/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/taglib/faceletTaglib/impl/ConverterTagDefnImpl.java b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/taglib/faceletTaglib/impl/ConverterTagDefnImpl.java
new file mode 100644
index 000000000..d5b83610d
--- /dev/null
+++ b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/registry/taglib/faceletTaglib/impl/ConverterTagDefnImpl.java
@@ -0,0 +1,180 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id: ConverterTagDefnImpl.java,v 1.1 2010/03/08 18:49:43 cbateman Exp $
+ */
+package org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.impl;
+
+import org.eclipse.emf.common.notify.Notification;
+
+import org.eclipse.emf.ecore.EClass;
+
+import org.eclipse.emf.ecore.impl.ENotificationImpl;
+
+import org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.ConverterTagDefn;
+import org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.FaceletTaglibPackage;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model object '<em><b>Converter Tag Defn</b></em>'.
+ * <!-- end-user-doc -->
+ * <p>
+ * The following features are implemented:
+ * <ul>
+ * <li>{@link org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.impl.ConverterTagDefnImpl#getConverterId <em>Converter Id</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @generated
+ */
+public class ConverterTagDefnImpl extends HandlerTagDefnImpl implements ConverterTagDefn
+{
+ /**
+ * The default value of the '{@link #getConverterId() <em>Converter Id</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getConverterId()
+ * @generated
+ * @ordered
+ */
+ protected static final String CONVERTER_ID_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getConverterId() <em>Converter Id</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getConverterId()
+ * @generated
+ * @ordered
+ */
+ protected String converterId = CONVERTER_ID_EDEFAULT;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected ConverterTagDefnImpl()
+ {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected EClass eStaticClass()
+ {
+ return FaceletTaglibPackage.Literals.CONVERTER_TAG_DEFN;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String getConverterId()
+ {
+ return converterId;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setConverterId(String newConverterId)
+ {
+ String oldConverterId = converterId;
+ converterId = newConverterId;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, FaceletTaglibPackage.CONVERTER_TAG_DEFN__CONVERTER_ID, oldConverterId, converterId));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object eGet(int featureID, boolean resolve, boolean coreType)
+ {
+ switch (featureID)
+ {
+ case FaceletTaglibPackage.CONVERTER_TAG_DEFN__CONVERTER_ID:
+ return getConverterId();
+ }