You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by bo...@apache.org on 2008/04/03 00:31:28 UTC

svn commit: r644090 - in /myfaces/tobago/trunk/core: ./ src/main/java/org/apache/myfaces/tobago/component/

Author: bommel
Date: Wed Apr  2 15:31:26 2008
New Revision: 644090

URL: http://svn.apache.org/viewvc?rev=644090&view=rev
Log:
(TOBAGO-637) Generate Components, JSP Tags from annotations

Modified:
    myfaces/tobago/trunk/core/pom.xml
    myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/CreateComponentUtils.java
    myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/UIDefaultLayout.java
    myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/UITreeOld.java

Modified: myfaces/tobago/trunk/core/pom.xml
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/core/pom.xml?rev=644090&r1=644089&r2=644090&view=diff
==============================================================================
--- myfaces/tobago/trunk/core/pom.xml (original)
+++ myfaces/tobago/trunk/core/pom.xml Wed Apr  2 15:31:26 2008
@@ -134,6 +134,7 @@
           <!-- <compilerArgument>-Xlint:all,-serial,-fallthrough</compilerArgument>-->
           <excludes>
             <exclude>org/apache/myfaces/tobago/tablib/extension/*</exclude>
+            <exclude>org/apache/myfaces/tobago/component/CreateComponentUtils*</exclude>
             <exclude>org/apache/myfaces/tobago/component/UITreeListbox*</exclude>
             <exclude>org/apache/myfaces/tobago/component/UIDatePicker*</exclude>
           </excludes>

Modified: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/CreateComponentUtils.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/CreateComponentUtils.java?rev=644090&r1=644089&r2=644090&view=diff
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/CreateComponentUtils.java (original)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/CreateComponentUtils.java Wed Apr  2 15:31:26 2008
@@ -73,7 +73,7 @@
   }
 
   public static UIComponent createUISelectBooleanFacet(FacesContext facesContext, UICommand command) {
-    UIComponent checkbox = createComponent(facesContext, AbstractUISelectBoolean.COMPONENT_TYPE,
+    UIComponent checkbox = createComponent(facesContext, UISelectBoolean.COMPONENT_TYPE,
         TobagoConstants.RENDERER_TYPE_SELECT_BOOLEAN_CHECKBOX);
     command.getFacets().put(TobagoConstants.FACET_ITEMS, checkbox);
     ValueBinding valueBinding = command.getValueBinding(TobagoConstants.ATTR_VALUE);

Modified: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/UIDefaultLayout.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/UIDefaultLayout.java?rev=644090&r1=644089&r2=644090&view=diff
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/UIDefaultLayout.java (original)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/UIDefaultLayout.java Wed Apr  2 15:31:26 2008
@@ -39,8 +39,9 @@
 
   public static synchronized UIDefaultLayout getInstance() {
     if (instance == null) {
-      instance = (UIDefaultLayout)
-          CreateComponentUtils.createComponent(COMPONENT_TYPE, RENDERER_TYPE_DEFAULT_LAYOUT);
+      final FacesContext facesContext = FacesContext.getCurrentInstance();
+      instance = (UIDefaultLayout) facesContext.getApplication().createComponent(COMPONENT_TYPE);
+      instance.setRendererType(RENDERER_TYPE_DEFAULT_LAYOUT);
       instance.setId("UIDefaultLayout");
     }
     return instance;

Modified: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/UITreeOld.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/UITreeOld.java?rev=644090&r1=644089&r2=644090&view=diff
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/UITreeOld.java (original)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/UITreeOld.java Wed Apr  2 15:31:26 2008
@@ -186,9 +186,10 @@
   // TODO move this to renderkit
   public void createDefaultToolbar(FacesContext facesContext) {
 
-    UIComponent toolbar = CreateComponentUtils.createComponent(
-        facesContext, UIPanel.COMPONENT_TYPE,
-        TobagoConstants.RENDERER_TYPE_TOOL_BAR);
+    // TODO 
+    UIComponent component  = facesContext.getApplication().createComponent(UIPanel.COMPONENT_TYPE);
+    component.setRendererType(TobagoConstants.RENDERER_TYPE_TOOL_BAR);
+    UIComponent toolbar = component;
     toolbar.getAttributes().put(TobagoConstants.ATTR_ICON_SIZE, AbstractUIToolBar.ICON_SMALL);
     toolbar.getAttributes().put(TobagoConstants.ATTR_LABEL_POSITION, AbstractUIToolBar.LABEL_OFF);
     ActionListener[] handlers = getActionListeners();
@@ -199,9 +200,8 @@
 
     UITreeOld.Command[] commands = getCommands();
     for (int i = 0; i < commands.length; i++) {
-      UICommand command = (UICommand) CreateComponentUtils.createComponent(
-          facesContext, UICommand.COMPONENT_TYPE,
-          TobagoConstants.RENDERER_TYPE_LINK);
+      UICommand command = (UICommand) facesContext.getApplication().createComponent(UICommand.COMPONENT_TYPE);
+      command.setRendererType(TobagoConstants.RENDERER_TYPE_LINK);
       toolbar.getChildren().add(command);
       command.setId(commands[i].getCommand());