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 2006/11/15 22:18:42 UTC

svn commit: r475432 - in /myfaces/tobago/trunk: core/src/main/java/org/apache/myfaces/tobago/component/ core/src/main/java/org/apache/myfaces/tobago/renderkit/ core/src/main/java/org/apache/myfaces/tobago/taglib/component/ theme/scarborough/src/main/re...

Author: bommel
Date: Wed Nov 15 13:18:40 2006
New Revision: 475432

URL: http://svn.apache.org/viewvc?view=rev&rev=475432
Log:
TOBAGO-54 markup support for in example is number markup

Modified:
    myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/UIInput.java
    myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/renderkit/RendererBase.java
    myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/InTag.java
    myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/InTagDeclaration.java
    myfaces/tobago/trunk/theme/scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/style/style.css
    myfaces/tobago/trunk/theme/standard/src/main/resources/META-INF/tobago-theme.xml

Modified: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/UIInput.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/UIInput.java?view=diff&rev=475432&r1=475431&r2=475432
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/UIInput.java (original)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/UIInput.java Wed Nov 15 13:18:40 2006
@@ -24,19 +24,21 @@
 import org.apache.myfaces.tobago.ajax.api.AjaxUtils;
 import static org.apache.myfaces.tobago.TobagoConstants.ATTR_READONLY;
 import static org.apache.myfaces.tobago.TobagoConstants.ATTR_PASSWORD;
+import static org.apache.myfaces.tobago.TobagoConstants.ATTR_MARKUP;
 
 import javax.faces.context.FacesContext;
 import javax.faces.el.MethodBinding;
 import javax.faces.el.ValueBinding;
 import java.io.IOException;
 
-public class UIInput extends javax.faces.component.UIInput implements AjaxComponent {
+public class UIInput extends javax.faces.component.UIInput implements AjaxComponent, SupportsMarkup {
 
   private static final Log LOG = LogFactory.getLog(UIInput.class);
   public static final String COMPONENT_TYPE = "org.apache.myfaces.tobago.Input";
 
   private Boolean readonly;
   private Boolean password;
+  private String markup;
   private javax.faces.el.MethodBinding suggestMethod;
 
   public void restoreState(FacesContext context, Object state) {
@@ -45,15 +47,33 @@
     suggestMethod = (MethodBinding) restoreAttachedState(context, values[1]);
     readonly = (Boolean) values[2];
     password = (Boolean) values[3];
+    markup = (String) values[4];
   }
 
   public Object saveState(FacesContext context) {
-    Object[] values = new Object[4];
+    Object[] values = new Object[5];
     values[0] = super.saveState(context);
     values[1] = saveAttachedState(context, suggestMethod);
     values[2] = readonly;
     values[3] = password;
+    values[4] = markup;
     return values;
+  }
+
+  public String getMarkup() {
+    if (markup != null) {
+      return markup;
+    }
+    ValueBinding vb = getValueBinding(ATTR_MARKUP);
+    if (vb != null) {
+      return (String) vb.getValue(getFacesContext());
+    } else {
+      return null;
+    }
+  }
+
+  public void setMarkup(String markup) {
+    this.markup = markup;
   }
 
   public boolean isReadonly() {

Modified: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/renderkit/RendererBase.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/renderkit/RendererBase.java?view=diff&rev=475432&r1=475431&r2=475432
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/renderkit/RendererBase.java (original)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/renderkit/RendererBase.java Wed Nov 15 13:18:40 2006
@@ -24,7 +24,6 @@
 import static org.apache.myfaces.tobago.TobagoConstants.FACET_MENUBAR;
 import static org.apache.myfaces.tobago.TobagoConstants.RENDERER_TYPE_OUT;
 import org.apache.myfaces.tobago.component.ComponentUtil;
-import org.apache.myfaces.tobago.component.UIPage;
 import org.apache.myfaces.tobago.component.UICell;
 import org.apache.myfaces.tobago.component.UICommand;
 import org.apache.myfaces.tobago.config.ThemeConfig;
@@ -54,68 +53,6 @@
 
   private static final Log LOG = LogFactory.getLog(RendererBase.class);
 
-  public void encodeBegin(FacesContext facesContext, UIComponent component)
-      throws IOException {
-    if (LOG.isDebugEnabled()) {
-      LOG.debug("*** begin    " + component);
-    }
-    try {
-      super.encodeBegin(facesContext, component);
-    } catch (IOException e) {
-      throw e;
-    } catch (RuntimeException e) {
-      LOG.error("catched RuntimeException :", e);
-      throw e;
-    } catch (Throwable e) {
-      LOG.error("catched Throwable :", e);
-      throw new RuntimeException(e);
-    }
-
-    if (LOG.isDebugEnabled()) {
-      LOG.debug("*   begin    " + component);
-    }
-  }
-
-  public void encodeChildren(FacesContext facesContext, UIComponent component)
-      throws IOException {
-
-    if (LOG.isDebugEnabled()) {
-      LOG.debug("*** children " + component);
-    }
-    if (component instanceof UIPage) {
-      LOG.info("UUUUUUUUUUUUUUUUUUUUU UIPage XXXXXXXXXXXXXXXXXXXXXXXXXXXXxx");
-    }
-
-    super.encodeChildren(facesContext, component);
-
-    if (LOG.isDebugEnabled()) {
-      LOG.debug("*   children " + component);
-    }
-  }
-
-  public void encodeEnd(FacesContext facesContext, UIComponent component)
-      throws IOException {
-    if (LOG.isDebugEnabled()) {
-      LOG.debug("*** end      " + component);
-    }
-    try {
-      super.encodeEnd(facesContext, component);
-    } catch (IOException e) {
-      throw e;
-    } catch (RuntimeException e) {
-      LOG.error("catched " + e + " :" + e.getMessage(), e);
-      throw e;
-    } catch (Throwable e) {
-      LOG.error("catched Throwable :", e);
-      throw new RuntimeException(e);
-    }
-    if (LOG.isDebugEnabled()) {
-      LOG.debug("*   end      " + component);
-    }
-  }
-
-
-
   public void decode(FacesContext facesContext, UIComponent component) {
     // nothing to do
 
@@ -125,8 +62,6 @@
           + this.getClass().getName());
     }
   }
-
-
 
   public String getRendererName(String rendererType) {
     String name;

Modified: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/InTag.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/InTag.java?view=diff&rev=475432&r1=475431&r2=475432
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/InTag.java (original)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/InTag.java Wed Nov 15 13:18:40 2006
@@ -25,6 +25,7 @@
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import static org.apache.myfaces.tobago.TobagoConstants.ATTR_PASSWORD;
+import static org.apache.myfaces.tobago.TobagoConstants.ATTR_MARKUP;
 import org.apache.myfaces.tobago.component.ComponentUtil;
 import org.apache.myfaces.tobago.component.UIInput;
 
@@ -36,12 +37,15 @@
 
   private String password;
   private String suggestMethod;
+  private String markup;
+
 
   @Override
   public void release() {
     super.release();
     password = null;
     suggestMethod = null;
+    markup = null;
   }
 
   @Override
@@ -56,6 +60,7 @@
     if (component instanceof UIInput) {
       ComponentUtil.setSuggestMethodBinding((UIInput) component, suggestMethod);
     }
+    ComponentUtil.setStringProperty(component, ATTR_MARKUP, markup);
   }
 
   public String getPassword() {
@@ -72,5 +77,14 @@
 
   public void setSuggestMethod(String suggestMethod) {
     this.suggestMethod = suggestMethod;
+  }
+
+
+  public String getMarkup() {
+    return markup;
+  }
+
+  public void setMarkup(String markup) {
+    this.markup = markup;
   }
 }

Modified: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/InTagDeclaration.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/InTagDeclaration.java?view=diff&rev=475432&r1=475431&r2=475432
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/InTagDeclaration.java (original)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/InTagDeclaration.java Wed Nov 15 13:18:40 2006
@@ -20,6 +20,8 @@
 import org.apache.myfaces.tobago.apt.annotation.BodyContentDescription;
 import org.apache.myfaces.tobago.apt.annotation.Tag;
 import org.apache.myfaces.tobago.apt.annotation.UIComponentTag;
+import org.apache.myfaces.tobago.apt.annotation.TagAttribute;
+import org.apache.myfaces.tobago.apt.annotation.UIComponentTagAttribute;
 import org.apache.myfaces.tobago.taglib.decl.HasConverter;
 import org.apache.myfaces.tobago.taglib.decl.HasDeprecatedWidth;
 import org.apache.myfaces.tobago.taglib.decl.HasIdBindingAndRendered;
@@ -51,4 +53,12 @@
     HasConverter, IsReadonly, IsDisabled, HasDeprecatedWidth,
     IsInline, IsFocus, IsRequired, HasTip, HasLabelAndAccessKey,
     IsPassword, HasSuggestMethod {
+
+  /**
+   * Indicate markup of this component.
+   * Possible value is 'none'. But this can be overridden in the theme.
+   */
+  @TagAttribute
+  @UIComponentTagAttribute(defaultValue = "none")
+  void setMarkup(String markup);
 }

Modified: myfaces/tobago/trunk/theme/scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/style/style.css
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/theme/scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/style/style.css?view=diff&rev=475432&r1=475431&r2=475432
==============================================================================
--- myfaces/tobago/trunk/theme/scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/style/style.css (original)
+++ myfaces/tobago/trunk/theme/scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/style/style.css Wed Nov 15 13:18:40 2006
@@ -12,7 +12,7 @@
  * 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.e.
+ * limitations under the License.
  */
 
 /*

Modified: myfaces/tobago/trunk/theme/standard/src/main/resources/META-INF/tobago-theme.xml
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/theme/standard/src/main/resources/META-INF/tobago-theme.xml?view=diff&rev=475432&r1=475431&r2=475432
==============================================================================
--- myfaces/tobago/trunk/theme/standard/src/main/resources/META-INF/tobago-theme.xml (original)
+++ myfaces/tobago/trunk/theme/standard/src/main/resources/META-INF/tobago-theme.xml Wed Nov 15 13:18:40 2006
@@ -27,6 +27,13 @@
       <supported-markup>
         <markup>strong</markup>
         <markup>deleted</markup>
+        <markup>number</markup>
+      </supported-markup>
+    </renderer>
+    <renderer>
+      <name>In</name>
+      <supported-markup>
+        <markup>number</markup>
       </supported-markup>
     </renderer>
   </renderers>