Author: scabanovich
Date: 2009-10-08 11:28:23 -0400 (Thu, 08 Oct 2009)
New Revision: 17983
Added:
trunk/jsf/plugins/org.jboss.tools.jsf/resources/meta/jsf2-components.meta
trunk/jsf/plugins/org.jboss.tools.jsf/schemas/
trunk/jsf/plugins/org.jboss.tools.jsf/schemas/web-facesuicomponent_2_0.xsd
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/model/
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/model/CompositeComponentConstants.java
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/model/CompositeComponentNamespaces.java
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/model/FileCompositeComponentLoader.java
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/model/FileCompositeComponentRecognizer.java
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf/META-INF/MANIFEST.MF
trunk/jsf/plugins/org.jboss.tools.jsf/plugin.xml
Log:
https://jira.jboss.org/jira/browse/JBIDE-4970
Modified: trunk/jsf/plugins/org.jboss.tools.jsf/META-INF/MANIFEST.MF
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/META-INF/MANIFEST.MF 2009-10-08 15:26:52 UTC
(rev 17982)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/META-INF/MANIFEST.MF 2009-10-08 15:28:23 UTC
(rev 17983)
@@ -26,7 +26,8 @@
org.jboss.tools.jsf.project.capabilities,
org.jboss.tools.jsf.web,
org.jboss.tools.jsf.web.helpers.context,
- org.jboss.tools.jsf.web.pattern
+ org.jboss.tools.jsf.web.pattern,
+ org.jboss.tools.jsf.jsf2.model
Require-Bundle: org.jboss.tools.jst.web;visibility:=reexport,
org.jboss.tools.jst.web.kb;visibility:=reexport,
org.jboss.tools.common.el.core,
Modified: trunk/jsf/plugins/org.jboss.tools.jsf/plugin.xml
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/plugin.xml 2009-10-08 15:26:52 UTC (rev 17982)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/plugin.xml 2009-10-08 15:28:23 UTC (rev 17983)
@@ -12,6 +12,7 @@
<meta path="meta/jsfwizards.meta">
</meta>
<meta path="meta/facelet-taglib.meta"/>
+ <meta path="meta/jsf2-components.meta"/>
</extension>
<extension point="org.jboss.tools.common.model.keys">
<keys path="help/keys-jsf.properties"/>
@@ -372,6 +373,10 @@
<xclass id="org.jboss.tools.jsf.facelet.model.AddTagHandler"
class="org.jboss.tools.jsf.facelet.model.AddTagHandler"/>
+ <xclass id="org.jboss.tools.jsf.jsf2.model.FileCompositeComponentLoader"
+ class="org.jboss.tools.jsf.jsf2.model.FileCompositeComponentLoader"/>
+ <xclass
id="org.jboss.tools.jsf.jsf2.model.FileCompositeComponentRecognizer"
+ class="org.jboss.tools.jsf.jsf2.model.FileCompositeComponentRecognizer"/>
</extension>
<extension
point="org.eclipse.wst.common.project.facet.core.facets">
Added: trunk/jsf/plugins/org.jboss.tools.jsf/resources/meta/jsf2-components.meta
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/resources/meta/jsf2-components.meta
(rev 0)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/resources/meta/jsf2-components.meta 2009-10-08
15:28:23 UTC (rev 17983)
@@ -0,0 +1,402 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE XModelEntityGroup PUBLIC "-//Red Hat, Inc.//DTD Meta 1.0//EN"
+ "meta.dtd">
+<XModelEntityGroup>
+ <VERSION DEPENDS="Model:1.0" MODULE="JSF"
VERSION="1.0"/>
+ <MAPPINGS>
+ <MAPPING name="FileVersions">
+ <PAIR name="JSF2Component2.0" value="FileJSF2Component"/>
+ </MAPPING>
+ <MAPPING name="Handlers"/>
+ <MAPPING name="JSF2CompositeNamespaces">
+ <PAIR name="composite"
value="http://java.sun.com/jsf/composite"/>
+ </MAPPING>
+ <MAPPING name="Recognizers">
+ <PAIR name="xhtml$4"
value="org.jboss.tools.jsf.jsf2.model.FileCompositeComponentRecognizer"/>
+ </MAPPING>
+ </MAPPINGS>
+ <ICONS>
+ <GROUP name="action">
+ <GROUP name="new">
+ <GROUP name="jsf2"/>
+ </GROUP>
+ </GROUP>
+ <GROUP name="main">
+ <GROUP name="jsf2">
+ <ICON name="attribute" path="images/jsf/attribute.gif"/>
+ <ICON name="bean" path="images/struts/form_bean.gif"/>
+ <ICON name="component" path="images/struts/plug_in.gif"/>
+ <ICON name="components"
path="images/struts/plug_in_folder.gif"/>
+ <ICON name="file" path="images/jsf/jsf-config.gif"/>
+ </GROUP>
+ </GROUP>
+ </ICONS>
+ <GlobalActions kind="list"/>
+ <XModelEntity
+
ImplementationLoadingClass="org.jboss.tools.jsf.jsf2.model.FileCompositeComponentLoader"
+
ImplementingClass="org.jboss.tools.common.model.filesystems.impl.SimpleFileImpl"
+ ObjectEditorClass="%XML%" XMLSUBPATH="html"
name="FileJSF2Component">
+ <XChildrenEntities>
+ <XChildEntity name="JSF2ComponentInterface"/>
+ <XChildEntity name="JSF2ComponentImplementation"/>
+ </XChildrenEntities>
+ <XEntityRenderer>
+ <ICONS>
+ <ICON info="main.jsf2.file" type="main"/>
+ </ICONS>
+ </XEntityRenderer>
+ <XModelAttributes>
+ <XModelAttribute default="jsf2 component" loader="ElementType"
name="element type">
+ <Editor name="Uneditable"/>
+ </XModelAttribute>
+ <XModelAttribute PROPERTIES="category=general" name="name"
xmlname="NAME"/>
+ <XModelAttribute default="xhtml" name="extension"
xmlname="EXTENSION">
+ <Editor name="Uneditable"/>
+ </XModelAttribute>
+ <XModelAttribute TRIM="no" name="comment"
visibility="false" xmlname="#comment">
+ <Editor name="Note"/>
+ </XModelAttribute>
+ <XModelAttribute loader="ElementType" name="_lateload"
visibility="false">
+ <Editor name="Uneditable"/>
+ </XModelAttribute>
+ <XModelAttribute default="no" name="isIncorrect"
visibility="false">
+ <Constraint loader="List">
+ <value name="yes"/>
+ <value name="no"/>
+ </Constraint>
+ <Editor name="Uneditable"/>
+ </XModelAttribute>
+ <XModelAttribute name="incorrectBody" visibility="false"/>
+ <XModelAttribute PROPERTIES="save=always"
+
default="http://www.w3.org/1999/xhtml" name="xmlns"
xmlname="xmlns"/>
+ <XModelAttribute name="xmlns:xsi" xmlname="xmlns:xsi"/>
+ <XModelAttribute name="xsi:schemaLocation"
xmlname="xsi:schemaLocation"/>
+ <XModelAttribute name="namespaceMapping"/>
+ <XModelAttribute name="encoding">
+ <Constraint loader="ListString">
+ <value name="ISO-8859-1"/>
+ <value name="UTF-8"/>
+ </Constraint>
+ <Editor name="ListString"/>
+ </XModelAttribute>
+ <XModelAttribute default="-//W3C//DTD XHTML 1.0 Transitional//EN"
+ name="publicId" visibility="false"/>
+ <XModelAttribute
+
default="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
+ name="systemId" visibility="false"/>
+ </XModelAttributes>
+ <XActionItem kind="list">
+ <XActionItem BaseActionName="Open" HandlerClassName="%Open%"
+ ICON="action.empty" displayName="Open" kind="action"
name="Open"/>
+ <XActionItem displayName="Open With" group="1"
kind="list" name="OpenWith">
+ <XActionItem HIDE="always"
+
HandlerClassName="org.jboss.tools.common.meta.action.impl.handlers.OpenWithExternalHandler"
+ ICON="action.empty" PROPERTIES="extension=struts-config"
+ displayName="Open with External Program" kind="action"
name="OpenWithSelected"/>
+ <XActionItem HIDE="always"
+
HandlerClassName="org.jboss.tools.common.meta.action.impl.handlers.OpenWithChoiceHandler"
+ ICON="action.empty" PROPERTIES="extension=struts-config"
+ displayName="Choose Program..." kind="action"
name="OpenWithChoice">
+ <EntityData EntityName="OpenWithHelper">
+ <AttributeData AttributeName="name"/>
+ <AttributeData AttributeName="default"/>
+ </EntityData>
+ </XActionItem>
+ </XActionItem>
+ <XActionItem kind="list" name="EditActions">
+ <XActionItem HIDE="always"
+
HandlerClassName="org.jboss.tools.jsf.model.handlers.RenameFacesConfigHandler"
+ ICON="action.empty" PROPERTIES="validator.edit=true"
+ WizardClassName="%Default%" displayName="Rename..."
kind="action" name="Rename">
+ <EntityData EntityName="FacesConfig">
+ <AttributeData AttributeName="name"/>
+ </EntityData>
+ </XActionItem>
+ <XActionItem
+
HandlerClassName="org.jboss.tools.common.model.filesystems.impl.handlers.RenameEclipseFileHandler"
+ ICON="action.empty" displayName="Rename..."
kind="action" name="RenameEclipse"/>
+ </XActionItem>
+ <XActionItem kind="list" name="SaveActions">
+ <XActionItem HIDE="always" HandlerClassName="%SaveFile%"
+ ICON="action.save" displayName="Save" kind="action"
name="Save"/>
+ </XActionItem>
+ <XActionItem ICON="action.empty" displayName="New"
group="1"
+ kind="list" name="CreateActions">
+ <XActionItem HandlerClassName="%Create%"
+ ICON="action.new.struts.webapp.res_ref"
+ PROPERTIES="validator.add=true" WizardClassName="%Default%"
+ displayName="Component..." kind="action"
name="AddComponent">
+ <EntityData EntityName="SeamComponent20">
+ <AttributeData AttributeName="name"/>
+ <AttributeData AttributeName="class" Mandatory="no"/>
+ </EntityData>
+ </XActionItem>
+ <XActionItem HandlerClassName="%Create%"
+ ICON="action.new.struts.webapp.res_ref"
+ PROPERTIES="validator.add=true" WizardClassName="%Default%"
+ displayName="Factory..." kind="action"
name="AddFactory">
+ <EntityData EntityName="SeamFactory20">
+ <AttributeData AttributeName="name"/>
+ <AttributeData AttributeName="value" Mandatory="no"/>
+ </EntityData>
+ </XActionItem>
+ <XActionItem HandlerClassName="%Create%" ICON="action.empty"
+ PROPERTIES="validator.add=true" WizardClassName="%Default%"
+ displayName="Event..." kind="action"
name="AddEvent">
+ <EntityData EntityName="SeamEvent20">
+ <AttributeData AttributeName="type"/>
+ </EntityData>
+ </XActionItem>
+ <XActionItem HandlerClassName="%Create%" ICON="action.empty"
+ PROPERTIES="validator.add=true" WizardClassName="%Default%"
+ displayName="Import..." kind="action"
name="AddImport">
+ <EntityData EntityName="SeamImport">
+ <AttributeData AttributeName="import"/>
+ </EntityData>
+ </XActionItem>
+ </XActionItem>
+ <XActionItem ICON="action.copy" displayName="Copy"
kind="list" name="CopyActions">
+ <XActionItem BaseActionName="Copy" HandlerClassName="%Copy%"
+ ICON="action.copy" displayName="Copy" kind="action"
name="Copy"/>
+ <XActionItem BaseActionName="Cut" HandlerClassName="%Cut%"
+ ICON="action.cut" displayName="Cut" kind="action"
name="Cut"/>
+ <XActionItem BaseActionName="Paste"
HandlerClassName="%Paste%"
+ ICON="action.paste" displayName="Paste" kind="action"
name="Paste"/>
+ </XActionItem>
+ <XActionItem ICON="action.delete" displayName="Delete"
kind="list" name="DeleteActions">
+ <XActionItem BaseActionName="Delete"
+
HandlerClassName="org.jboss.tools.jsf.model.handlers.DeleteFacesConfigHandler"
+ ICON="action.delete" displayName="Delete"
kind="action" name="Delete"/>
+ </XActionItem>
+ <XActionItem ICON="action.empty" kind="list"
name="Properties">
+ <XActionItem HandlerClassName="%Properties%"
ICON="action.empty"
+ displayName="Properties..." kind="action"
name="Properties"/>
+ </XActionItem>
+ <XActionItem kind="list" name="DiscardActions">
+ <XActionItem HIDE="always"
+
HandlerClassName="org.jboss.tools.jsf.model.handlers.DiscardConfigHandler"
+ ICON="action.delete"
+
PROPERTIES="significanceMessageClass=org.jboss.tools.common.model.filesystems.impl.DiscardFileSignificanceMessage"
+ displayName="Discard Changes" kind="action"
name="Discard"/>
+ </XActionItem>
+ </XActionItem>
+ <XDependencies/>
+ </XModelEntity>
+ <XModelEntity name="FileJSF2Component_EditorActionList">
+ <XChildrenEntities/>
+ <XEntityRenderer/>
+ <XModelAttributes/>
+ <XActionItem kind="list">
+ <XActionItemReference entity="FileSeamComponents20"
+ name="CreateActions" path="CreateActions"/>
+ <XActionItemReference entity="FileSeamComponents20"
name="Properties" path="Properties"/>
+ <XActionItem kind="list" name="VerifyActions">
+ <XActionItem kind="list" name="StaticActions"/>
+ </XActionItem>
+ </XActionItem>
+ <XDependencies/>
+ </XModelEntity>
+ <XModelEntity ImplementingClass="%Custom%"
+ XMLSUBPATH="composite:attribute" name="JSF2ComponentAttribute">
+ <XChildrenEntities/>
+ <XEntityRenderer>
+ <ICONS>
+ <ICON info="main.jsf2.attribute" type="main"/>
+ </ICONS>
+ </XEntityRenderer>
+ <XModelAttributes>
+ <XModelAttribute default="attribute" loader="ElementType"
name="element type">
+ <Editor name="Uneditable"/>
+ </XModelAttribute>
+ <XModelAttribute PROPERTIES="id=true;save=always;category=general"
+ name="name" xmlname="name"/>
+ <XModelAttribute PROPERTIES="category=general"
+ name="method-signature" xmlname="method-signature"/>
+ <XModelAttribute PROPERTIES="category=general" name="default"
xmlname="default"/>
+ <XModelAttribute PROPERTIES="category=general" default="false"
+ name="required" xmlname="required">
+ <Constraint loader="List">
+ <value name="true"/>
+ <value name="false"/>
+ </Constraint>
+ <Editor name="List"/>
+ </XModelAttribute>
+ <XModelAttribute TRIM="no" name="comment"
visibility="false" xmlname="#comment">
+ <Editor name="Note"/>
+ </XModelAttribute>
+ </XModelAttributes>
+ <XActionItem kind="list">
+ <XActionItem kind="list" name="CreateActions"/>
+ <XActionItem ICON="action.empty" displayName="Create"
kind="list" name="EditActions"/>
+ <XActionItem ICON="action.copy" displayName="Copy"
kind="list" name="CopyActions">
+ <XActionItem BaseActionName="Copy" HandlerClassName="%Copy%"
+ ICON="action.copy" displayName="Copy" kind="action"
name="Copy"/>
+ <XActionItem BaseActionName="Cut" HandlerClassName="%Cut%"
+ ICON="action.cut" displayName="Cut" kind="action"
name="Cut"/>
+ </XActionItem>
+ <XActionItem ICON="action.delete" displayName="Delete"
kind="list" name="DeleteActions">
+ <XActionItem BaseActionName="Delete"
HandlerClassName="%Delete%"
+ ICON="action.delete" displayName="Delete"
kind="action" name="Delete"/>
+ </XActionItem>
+ <XActionItem ICON="action.empty" kind="list"
name="Properties">
+ <XActionItem HandlerClassName="%Properties%"
ICON="action.empty"
+ displayName="Properties..." kind="action"
name="Properties"/>
+ </XActionItem>
+ <XActionItem displayName="move" kind="list"
name="MoveActions">
+ <XActionItem HIDE="always" HandlerClassName="%Move%"
+ ICON="action.move" displayName="Move" kind="action"
name="Move"/>
+ </XActionItem>
+ </XActionItem>
+ <XDependencies/>
+ </XModelEntity>
+ <XModelEntity ImplementingClass="%Custom%"
+ XMLSUBPATH="composite:implementation"
name="JSF2ComponentImplementation">
+ <XChildrenEntities>
+ <XChildEntity name="AnyElement"/>
+ </XChildrenEntities>
+ <XEntityRenderer>
+ <ICONS>
+ <ICON info="main.jsf2.component" type="main"/>
+ </ICONS>
+ </XEntityRenderer>
+ <XModelAttributes>
+ <XModelAttribute default="implementation" loader="ElementType"
name="element type">
+ <Editor name="Uneditable"/>
+ </XModelAttribute>
+ <XModelAttribute PROPERTIES="id=true" default="Implementation"
name="name"/>
+ <XModelAttribute TRIM="no" name="comment"
visibility="false" xmlname="#comment">
+ <Editor name="Note"/>
+ </XModelAttribute>
+ </XModelAttributes>
+ <XActionItem kind="list">
+ <XActionItem kind="list" name="CreateActions"/>
+ <XActionItem ICON="action.empty" displayName="Create"
kind="list" name="EditActions"/>
+ <XActionItem ICON="action.copy" displayName="Copy"
kind="list" name="CopyActions">
+ <XActionItem BaseActionName="Copy" HandlerClassName="%Copy%"
+ ICON="action.copy" displayName="Copy" kind="action"
name="Copy"/>
+ <XActionItem BaseActionName="Cut" HandlerClassName="%Cut%"
+ ICON="action.cut" displayName="Cut" kind="action"
name="Cut"/>
+ </XActionItem>
+ <XActionItem ICON="action.delete" displayName="Delete"
kind="list" name="DeleteActions">
+ <XActionItem BaseActionName="Delete"
HandlerClassName="%Delete%"
+ ICON="action.delete" displayName="Delete"
kind="action" name="Delete"/>
+ </XActionItem>
+ <XActionItem ICON="action.empty" kind="list"
name="Properties">
+ <XActionItem HandlerClassName="%Properties%"
ICON="action.empty"
+ displayName="Properties..." kind="action"
name="Properties"/>
+ </XActionItem>
+ <XActionItem displayName="move" kind="list"
name="MoveActions">
+ <XActionItem HIDE="always" HandlerClassName="%Move%"
+ ICON="action.move" displayName="Move" kind="action"
name="Move"/>
+ </XActionItem>
+ </XActionItem>
+ <XDependencies/>
+ </XModelEntity>
+ <XModelEntity ImplementingClass="%Custom%"
+ XMLSUBPATH="composite:interface" name="JSF2ComponentInterface">
+ <XChildrenEntities>
+ <XChildEntity name="JSF2ComponentAttribute"/>
+ </XChildrenEntities>
+ <XEntityRenderer>
+ <ICONS>
+ <ICON info="main.jsf2.component" type="main"/>
+ </ICONS>
+ </XEntityRenderer>
+ <XModelAttributes>
+ <XModelAttribute default="action" loader="ElementType"
name="element type">
+ <Editor name="Uneditable"/>
+ </XModelAttribute>
+ <XModelAttribute PROPERTIES="id=true" default="Interface"
name="name"/>
+ <XModelAttribute TRIM="no" name="comment"
visibility="false" xmlname="#comment">
+ <Editor name="Note"/>
+ </XModelAttribute>
+ </XModelAttributes>
+ <XActionItem kind="list">
+ <XActionItem kind="list" name="CreateActions"/>
+ <XActionItem ICON="action.empty" displayName="Create"
kind="list" name="EditActions"/>
+ <XActionItem ICON="action.copy" displayName="Copy"
kind="list" name="CopyActions">
+ <XActionItem BaseActionName="Copy" HandlerClassName="%Copy%"
+ ICON="action.copy" displayName="Copy" kind="action"
name="Copy"/>
+ <XActionItem BaseActionName="Cut" HandlerClassName="%Cut%"
+ ICON="action.cut" displayName="Cut" kind="action"
name="Cut"/>
+ </XActionItem>
+ <XActionItem ICON="action.delete" displayName="Delete"
kind="list" name="DeleteActions">
+ <XActionItem BaseActionName="Delete"
HandlerClassName="%Delete%"
+ ICON="action.delete" displayName="Delete"
kind="action" name="Delete"/>
+ </XActionItem>
+ <XActionItem ICON="action.empty" kind="list"
name="Properties">
+ <XActionItem HandlerClassName="%Properties%"
ICON="action.empty"
+ displayName="Properties..." kind="action"
name="Properties"/>
+ </XActionItem>
+ <XActionItem displayName="move" kind="list"
name="MoveActions">
+ <XActionItem HIDE="always" HandlerClassName="%Move%"
+ ICON="action.move" displayName="Move" kind="action"
name="Move"/>
+ </XActionItem>
+ </XActionItem>
+ <XDependencies/>
+ </XModelEntity>
+ <XEntityExtension name="FileFolder">
+ <XChildrenEntities>
+ <XChildEntity name="FileJSF2Component"/>
+ </XChildrenEntities>
+ <XActionItem kind="list">
+ <XActionItem ICON="action.empty" displayName="New"
group="1"
+ kind="list" name="CreateActions">
+ <XActionItem ICON="action.newattribute" displayName="File"
group="1"
+ kind="list" name="CreateFiles">
+ <XActionItem displayName="Web" kind="list"
name="Web">
+ <XActionItem HandlerClassName="%SpecialWizard%"
+ ICON="action.new.seam.faces-config"
+
PROPERTIES="entity=FileJSF2Component;extensions=.xml.;validator.addfile=true;support=org.jboss.tools.common.model.files.handlers.CreateFileSupport;extension=xhtml;entityVersion=JSF2Component"
+ displayName="JSF 2 Component File..." kind="action"
name="CreateFileJSF2Component">
+ <EntityData EntityName="NewFileWizard">
+ <AttributeData AttributeName="folder"/>
+ <AttributeData AttributeName="separator"
Mandatory="no"/>
+ <AttributeData AttributeName="name"/>
+ <AttributeData AttributeName="version"/>
+ </EntityData>
+ </XActionItem>
+ </XActionItem>
+ </XActionItem>
+ </XActionItem>
+ </XActionItem>
+ </XEntityExtension>
+ <XEntityExtension name="FileSystemFolder">
+ <XChildrenEntities>
+ <XChildEntity name="FileJSF2Component"/>
+ </XChildrenEntities>
+ <XActionItem kind="list">
+ <XActionItem ICON="action.empty" displayName="New"
group="1"
+ kind="list" name="CreateActions">
+ <XActionItem ICON="action.newattribute" displayName="File"
group="1"
+ kind="list" name="CreateFiles">
+ <XActionItem displayName="Web" kind="list"
name="Web">
+ <XActionItem HandlerClassName="%SpecialWizard%"
+ ICON="action.new.seam.faces-config"
+
PROPERTIES="entity=FileJSF2Component;extensions=.xml.;validator.addfile=true;support=org.jboss.tools.common.model.files.handlers.CreateFileSupport;extension=xhtml;entityVersion=JSF2Component"
+ displayName="JSF 2 Component File..." kind="action"
name="CreateFileJSF2Component">
+ <EntityData EntityName="NewFileWizard">
+ <AttributeData AttributeName="folder"/>
+ <AttributeData AttributeName="separator"
Mandatory="no"/>
+ <AttributeData AttributeName="name"/>
+ <AttributeData AttributeName="version"/>
+ </EntityData>
+ </XActionItem>
+ </XActionItem>
+ </XActionItem>
+ </XActionItem>
+ </XActionItem>
+ </XEntityExtension>
+ <XEntityExtension name="FileSystemJar">
+ <XChildrenEntities>
+ <XChildEntity name="FileJSF2Component"/>
+ </XChildrenEntities>
+ <XActionItem kind="list"/>
+ </XEntityExtension>
+ <XEntityExtension name="JarFolder">
+ <XChildrenEntities>
+ <XChildEntity name="FileJSF2Component"/>
+ </XChildrenEntities>
+ <XActionItem kind="list"/>
+ </XEntityExtension>
+</XModelEntityGroup>
Added: trunk/jsf/plugins/org.jboss.tools.jsf/schemas/web-facesuicomponent_2_0.xsd
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/schemas/web-facesuicomponent_2_0.xsd
(rev 0)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/schemas/web-facesuicomponent_2_0.xsd 2009-10-08
15:28:23 UTC (rev 17983)
@@ -0,0 +1,253 @@
+<?xml version = "1.0" encoding = "UTF-8"?>
+
+<!--
+ DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+
+ Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
+
+ The contents of this file are subject to the terms of either the GNU
+ General Public License Version 2 only ("GPL") or the Common Development
+ and Distribution License("CDDL") (collectively, the "License").
You
+ may not use this file except in compliance with the License. You can obtain
+ a copy of the License at
https://glassfish.dev.java.net/public/CDDL+GPL.html
+ or glassfish/bootstrap/legal/LICENSE.txt. See the License for the specific
+ language governing permissions and limitations under the License.
+
+ When distributing the software, include this License Header Notice in each
+ file and include the License file at glassfish/bootstrap/legal/LICENSE.txt.
+ Sun designates this particular file as subject to the "Classpath" exception
+ as provided by Sun in the GPL Version 2 section of the License file that
+ accompanied this code. If applicable, add the following below the License
+ Header, with the fields enclosed by brackets [] replaced by your own
+ identifying information: "Portions Copyrighted [year]
+ [name of copyright owner]"
+
+ Contributor(s):
+
+ If you wish your version of this file to be governed by only the CDDL or
+ only the GPL Version 2, indicate your decision by adding "[Contributor]
+ elects to include this software in this distribution under the [CDDL or GPL
+ Version 2] license." If you don't indicate a single choice of license, a
+ recipient has the option to distribute your version of this file under
+ either the CDDL, the GPL Version 2 or to extend the choice of license to
+ its licensees as provided above. However, if you add GPL Version 2 code
+ and therefore, elected the GPL Version 2 license, then the option applies
+ only if the new code is made subject to such option by the copyright
+ holder.
+-->
+
+
+<xsd:schema
+
targetNamespace="http://java.sun.com/xml/ns/javaee"
+
xmlns:javaee="http://java.sun.com/xml/ns/javaee"
+
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+
xmlns:xml="http://www.w3.org/XML/1998/namespace"
+ elementFormDefault="qualified"
+ attributeFormDefault="unqualified"
+ version="2.0">
+
+ <xsd:annotation>
+ <xsd:documentation>
+ $Id: web-facesuicomponent_2_0.xsd,v 1.1.8.2 2008/03/20 21:12:50 edburns Exp
$
+ </xsd:documentation>
+ </xsd:annotation>
+
+ <xsd:annotation>
+ <xsd:documentation>
+
+ Copyright 2007 Sun Microsystems, Inc.,
+ 901 San Antonio Road,
+ Palo Alto, California 94303, U.S.A.
+ All rights reserved.
+
+ Sun Microsystems, Inc. has intellectual property
+ rights relating to technology described in this document. In
+ particular, and without limitation, these intellectual
+ property rights may include one or more of the U.S. patents
+ listed at
http://www.sun.com/patents and one or more
+ additional patents or pending patent applications in the
+ U.S. and other countries.
+
+ This document and the technology which it describes are
+ distributed under licenses restricting their use, copying,
+ distribution, and decompilation. No part of this document
+ may be reproduced in any form by any means without prior
+ written authorization of Sun and its licensors, if any.
+
+ Third-party software, including font technology, is
+ copyrighted and licensed from Sun suppliers.
+
+ Sun, Sun Microsystems, the Sun logo, Solaris, Java, Java EE,
+ JavaServer Pages, Enterprise JavaBeans and the Java Coffee
+ Cup logo are trademarks or registered trademarks of Sun
+ Microsystems, Inc. in the U.S. and other countries.
+
+ Federal Acquisitions: Commercial Software - Government Users
+ Subject to Standard License Terms and Conditions.
+
+ </xsd:documentation>
+ </xsd:annotation>
+
+ <xsd:annotation>
+ <xsd:documentation>
+
+ <![CDATA[
+
+ The XML Schema for a JavaServer Faces UIComponent (Version 2.0).
+
+ The elements in this schema may be used in an XHTML page for
+ a composite component, by pulling in the composite namespace:
+
+<html
xmlns="http://www.w3.org/1999/xhtml"
+
xmlns:composite="http://java.sun.com/jsf/composite">
+
+ <composite:interface>
+ <composite:attribute name="foo" default="bar" />
+ </composite:/interface>
+ <!-- the rest omitted -->
+</html>
+
+ The elements in this schema may also be used in a facelet taglibrary
+ file in the same manner:
+
+<facelet-taglib
xmlns="http://java.sun.com/xml/ns/javaee"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xmlns:composite="http://java.sun.com/jsf/composite"
+
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-facelettaglibary_2_0.xsd"
+ version="2.0">
+ <
namespace>http://domain.com/test_schema</namespace>
+ <tag>
+ <tag-name>testSchema</tag-name>
+ <component>
+ <component-type>javax.faces.Input</component-type>
+ <renderer-type>javax.faces.Text</renderer-type>
+
<handler-class>com.sun.faces.facelets.tag.jsf.ComponentHandler</handler-class>
+ <component-extension>
+
+ <composite:attribute name="foo" default="bar" />
+
+ </component-extension>
+ </component>
+ </tag>
+</facelet-taglib>
+
+ The instance documents may indicate the published
+ version of the schema using xsi:schemaLocation attribute
+ for javaee namespace with the following location:
+
+
http://java.sun.com/xml/ns/javaee/web-facesuicomponent_2_0.xsd
+
+ ]]>
+
+ </xsd:documentation>
+ </xsd:annotation>
+
+ <xsd:include schemaLocation="javaee_5.xsd"/>
+
+ <!-- **************************************************** -->
+
+ <xsd:element name = "attribute"
type="javaee:uicomponent-attributeType">
+ </xsd:element>
+
+ <!-- **************************************************** -->
+
+ <xsd:complexType name="uicomponent-attributeType">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ The "attribute" element declares an attribute of this
+ ui component.
+
+ </xsd:documentation>
+ </xsd:annotation>
+
+ <xsd:choice minOccurs="0" maxOccurs="unbounded">
+ <xsd:element name="attribute"
+ type="javaee:uicomponent-attributeType"/>
+ </xsd:choice>
+
+ <xsd:attribute name="name"
+ type="xsd:string"
+ use="required"/>
+
+ <xsd:attribute name="displayName"
+ type="xsd:string"
+ use="optional"/>
+
+ <xsd:attribute name="shortDescription"
+ type="xsd:string"
+ use="optional"/>
+
+ <xsd:attribute name="default"
+ type="xsd:string"
+ use="optional"/>
+
+ <xsd:attribute name="method-signature"
+ type="xsd:string"
+ use="optional">
+
+ <xsd:annotation>
+ <xsd:documentation>
+ <![CDATA[
+
+ Provides the signature of the Java method. The syntax of
+ the method-signature element is as follows (taken from
+ function-signature in web-jsptaglibrary_2_1.xsd):
+
+ MethodSignature ::= ReturnType S MethodName S?
+ '(' S? Parameters? S? ')'
+
+ ReturnType ::= Type
+
+ MethodName ::= Identifier
+
+ Parameters ::= Parameter
+ | ( Parameter S? ',' S? Parameters )
+
+ Parameter ::= Type
+
+ Where:
+
+ * Type is a basic type or a fully qualified
+ Java class name (including package name),
+ as per the 'Type' production in the Java
+ Language Specification, Second Edition,
+ Chapter 18.
+
+ * Identifier is a Java identifier, as per
+ the 'Identifier' production in the Java
+ Language Specification, Second
+ Edition, Chapter 18.
+
+ Example:
+
+ java.lang.String nickName( java.lang.String, int )
+
+ ]]>
+ </xsd:documentation>
+ </xsd:annotation>
+
+ </xsd:attribute>
+
+ <xsd:attribute name="applyTo"
+ type="xsd:string"
+ use="optional"/>
+
+ <xsd:attribute name="required"
+ type="xsd:boolean"
+ use="optional"/>
+
+ <xsd:attribute name="preferred"
+ type="xsd:boolean"
+ use="optional"/>
+
+ <xsd:attribute name="expert"
+ type="xsd:boolean"
+ use="optional"/>
+
+
+ </xsd:complexType>
+
+ <!-- **************************************************** -->
+
+</xsd:schema>
Property changes on:
trunk/jsf/plugins/org.jboss.tools.jsf/schemas/web-facesuicomponent_2_0.xsd
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/model/CompositeComponentConstants.java
===================================================================
---
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/model/CompositeComponentConstants.java
(rev 0)
+++
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/model/CompositeComponentConstants.java 2009-10-08
15:28:23 UTC (rev 17983)
@@ -0,0 +1,10 @@
+package org.jboss.tools.jsf.jsf2.model;
+
+public interface CompositeComponentConstants {
+ public String PUBLIC_ID = "-//W3C//DTD XHTML 1.0 Transitional//EN";
//$NON-NLS-1$
+ public String SYSTEM_ID =
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"; //$NON-NLS-1$
+ public String COMPOSITE_XMLNS = "http://java.sun.com/jsf/composite";
//$NON-NLS-1$
+
+ public String ENT_FILE_COMPONENT = "FileJSF2Component"; //$NON-NLS-1$
+
+}
Property changes on:
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/model/CompositeComponentConstants.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/model/CompositeComponentNamespaces.java
===================================================================
---
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/model/CompositeComponentNamespaces.java
(rev 0)
+++
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/model/CompositeComponentNamespaces.java 2009-10-08
15:28:23 UTC (rev 17983)
@@ -0,0 +1,122 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is 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:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jsf.jsf2.model;
+
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+
+import org.jboss.tools.common.meta.XMapping;
+import org.jboss.tools.common.meta.XModelMetaData;
+import org.jboss.tools.common.model.XModelObject;
+import org.jboss.tools.common.model.util.NamespaceMapping;
+import org.w3c.dom.Element;
+import org.w3c.dom.NamedNodeMap;
+import org.w3c.dom.Node;
+
+public class CompositeComponentNamespaces {
+ private static Map<String,CompositeComponentNamespaces> map = new
HashMap<String, CompositeComponentNamespaces>();
+
+ public static CompositeComponentNamespaces getInstance(XModelMetaData meta, String
version) {
+ CompositeComponentNamespaces instance = map.get(version);
+ if(instance == null) {
+ instance = new CompositeComponentNamespaces(meta, version);
+ }
+ return instance;
+ }
+
+ String versionSuffix = null;
+
+ private Map<String, String> uriToNamespace = new HashMap<String, String>();
+
+ private CompositeComponentNamespaces(XModelMetaData meta, String versionSuffix) {
+ XMapping m = meta.getMapping("JSF2CompositeNamespaces"); //$NON-NLS-1$
+ if(m == null) return;
+ this.versionSuffix = versionSuffix;
+ String[] keys = m.getKeys();
+ for (int i = 0; i < keys.length; i++) {
+ String v = m.getValue(keys[i]);
+ uriToNamespace.put(v, keys[i]);
+ }
+ }
+
+ static String XMLNS_PREFIX = "xmlns:"; //$NON-NLS-1$
+
+ public NamespaceMapping getNamespaceMapping(Element element) {
+ NamespaceMapping mapping = new NamespaceMapping();
+ NamedNodeMap as = element.getAttributes();
+ for (int i = 0; i < as.getLength(); i++) {
+ Node n = as.item(i);
+ String name = n.getNodeName();
+ if(name.startsWith(XMLNS_PREFIX)) {
+ String actualNamespace = name.substring(XMLNS_PREFIX.length());
+ String uri = n.getNodeValue();
+ String defaultNamespace = getDefaultNamespace(uri);
+ if(defaultNamespace == null) {
+ defaultNamespace = name.substring(XMLNS_PREFIX.length());
+ }
+ mapping.addNamespace(defaultNamespace, actualNamespace, uri);
+ }
+ }
+ return mapping;
+ }
+
+ public String getDefaultNamespace(String uri) {
+ return uriToNamespace.get(uri);
+ }
+
+ public void validateNamespaces(XModelObject object, Element element) {
+ NamespaceMapping namespaceMapping = NamespaceMapping.load(object);
+ if(namespaceMapping == null) namespaceMapping = new NamespaceMapping();
+// StringBuffer loc = new StringBuffer();
+// loc.append(object.getAttributeValue("xsi:schemaLocation")); //$NON-NLS-1$
+ XModelObject[] cs = object.getChildren();
+ Set<String> ns = new HashSet<String>();
+ for (int i = 0; i < cs.length; i++) {
+ String n = cs[i].getModelEntity().getXMLSubPath();
+ int k = n.indexOf(':');
+ if(k < 0) continue;
+ String defaultNamespace = n.substring(0, k);
+ if(ns.contains(defaultNamespace)) continue;
+ ns.add(defaultNamespace);
+ String uri = namespaceMapping.getURIForDefaultNamespace(defaultNamespace);
+ if(uri == null) continue;
+ String actualNamespace = namespaceMapping.getActualNamespace(defaultNamespace);
+ if(actualNamespace == null) actualNamespace = defaultNamespace;
+ element.setAttribute(XMLNS_PREFIX + actualNamespace, uri);
+// String schema = getSchema(defaultNamespace);
+// if(loc.indexOf(uri) < 0) {
+// loc.append(' ').append(uri).append(' ').append(schema);
+// }
+
+ }
+
+ XModelObject im = object.getChildByPath("Implementation");
+ if(im != null) {
+ XModelObject[] cs2 = im.getChildren();
+ for (int i = 0; i < cs2.length; i++) {
+ String n = cs2[i].getAttributeValue("tag");
+ int k = n.indexOf(':');
+ if(k < 0) continue;
+ String defaultNamespace = n.substring(0, k);
+ if(ns.contains(defaultNamespace)) continue;
+ ns.add(defaultNamespace);
+ String uri = namespaceMapping.getURIForDefaultNamespace(defaultNamespace);
+ if(uri == null) continue;
+ String actualNamespace = namespaceMapping.getActualNamespace(defaultNamespace);
+ if(actualNamespace == null) actualNamespace = defaultNamespace;
+ element.setAttribute(XMLNS_PREFIX + actualNamespace, uri);
+ }
+ }
+// object.setAttributeValue("xsi:schemaLocation", loc.toString());
//$NON-NLS-1$
+ }
+}
Property changes on:
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/model/CompositeComponentNamespaces.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/model/FileCompositeComponentLoader.java
===================================================================
---
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/model/FileCompositeComponentLoader.java
(rev 0)
+++
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/model/FileCompositeComponentLoader.java 2009-10-08
15:28:23 UTC (rev 17983)
@@ -0,0 +1,73 @@
+package org.jboss.tools.jsf.jsf2.model;
+
+import org.jboss.tools.common.meta.XAttribute;
+import org.jboss.tools.common.meta.XModelEntity;
+import org.jboss.tools.common.model.XModelObject;
+import org.jboss.tools.common.model.loaders.impl.SimpleWebFileLoader;
+import org.jboss.tools.common.model.util.NamespaceMapping;
+import org.jboss.tools.common.model.util.XModelObjectLoaderUtil;
+import org.w3c.dom.Element;
+
+public class FileCompositeComponentLoader extends SimpleWebFileLoader {
+
+ public FileCompositeComponentLoader() {}
+
+ protected XModelObjectLoaderUtil createUtil() {
+ return new FileCompositeComponentUtil();
+ }
+
+ protected boolean isCheckingDTD() {
+ return false;
+ }
+
+ protected boolean isCheckingSchema() {
+ return false;
+ }
+
+ protected String loadNamespace(Element element, XModelObject object) {
+ NamespaceMapping namespaceMapping =
CompositeComponentNamespaces.getInstance(object.getModel().getMetaData(),
"").getNamespaceMapping(element);
+ object.set(NamespaceMapping.ATTR_NAMESPACE_MAPPING, namespaceMapping.toString());
//$NON-NLS-1$
+ util.setNamespaceMapping(namespaceMapping);
+
+ return super.loadNamespace(element, object);
+ }
+
+ public String serializeObject(XModelObject object) {
+ String systemId = object.getAttributeValue("systemId"); //$NON-NLS-1$
+ String publicId = object.getAttributeValue("publicId"); //$NON-NLS-1$
+ String rootName = getRootName(object);
+ Element element = createRootElement(rootName, publicId, systemId);
+ CompositeComponentNamespaces.getInstance(object.getModel().getMetaData(),
"").validateNamespaces(object, element);
+ NamespaceMapping namespaceMapping = NamespaceMapping.load(object);
+ util.setNamespaceMapping(namespaceMapping);
+ return serializeToElement(element, object);
+ }
+
+}
+
+class FileCompositeComponentUtil extends XModelObjectLoaderUtil {
+
+ protected boolean isSaveable(XModelEntity entity, String n, String v, String dv) {
+ if(v == null) return false;
+ if(v.length() == 0 || v.equals(dv)) {
+ XAttribute attr = entity.getAttribute(n);
+ return (attr != null &&
"always".equals(attr.getProperty("save"))); //$NON-NLS-1$
//$NON-NLS-2$
+ }
+ return super.isSaveable(entity, n, v, dv);
+ }
+
+
+ public boolean save(Element parent, XModelObject o) {
+ if(!needToSave(o)) return true;
+ return super.save(parent, o);
+ }
+
+ protected boolean needToSave(XModelObject o) {
+ String s = o.getModelEntity().getProperty("saveDefault"); //$NON-NLS-1$
+ if(!"false".equals(s)) return true; //$NON-NLS-1$
+// if(hasSetAttributes(o)) return true;
+ if(o.getChildren().length > 0) return true;
+ return false;
+ }
+
+}
\ No newline at end of file
Property changes on:
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/model/FileCompositeComponentLoader.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/model/FileCompositeComponentRecognizer.java
===================================================================
---
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/model/FileCompositeComponentRecognizer.java
(rev 0)
+++
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/model/FileCompositeComponentRecognizer.java 2009-10-08
15:28:23 UTC (rev 17983)
@@ -0,0 +1,26 @@
+package org.jboss.tools.jsf.jsf2.model;
+
+import org.jboss.tools.common.model.loaders.EntityRecognizer;
+
+public class FileCompositeComponentRecognizer implements EntityRecognizer,
CompositeComponentConstants {
+
+ public FileCompositeComponentRecognizer() {}
+
+ public String getEntityName(String ext, String body) {
+ if(body == null) return null;
+ if(isComponents(body)) {
+ return ENT_FILE_COMPONENT;
+ }
+ return null;
+ }
+
+ private boolean isComponents(String body) {
+ int i = body.indexOf("<html"); //$NON-NLS-1$
+ if(i < 0) return false;
+ int j = body.indexOf(">", i); //$NON-NLS-1$
+ if(j < 0) return false;
+ String s = body.substring(i, j);
+ return s.indexOf(COMPOSITE_XMLNS) > 0;
+ }
+
+}
Property changes on:
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/model/FileCompositeComponentRecognizer.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain