You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by lo...@apache.org on 2012/06/19 18:03:08 UTC

svn commit: r1351756 - in /myfaces/tobago/trunk: src/site/apt/ tobago-core/src/main/java/org/apache/myfaces/tobago/component/ tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/ tobago-core/src/main/java/org/apache/myfaces/tobago/in...

Author: lofwyr
Date: Tue Jun 19 16:03:08 2012
New Revision: 1351756

URL: http://svn.apache.org/viewvc?rev=1351756&view=rev
Log:
TOBAGO-1156: Rename UIFileInput to UIFile to satisfy naming conventions

Added:
    myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/component/UIFileInput.java
    myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUIFile.java
      - copied, changed from r1351674, myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUIFileInput.java
Removed:
    myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUIFileInput.java
Modified:
    myfaces/tobago/trunk/src/site/apt/migration-1.6.apt
    myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/FileTagDeclaration.java
    myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/validator/FileItemValidator.java
    myfaces/tobago/trunk/tobago-extension/tobago-facelets/src/main/java/org/apache/myfaces/tobago/facelets/extension/FileExtensionHandler.java
    myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/FileRenderer.java

Modified: myfaces/tobago/trunk/src/site/apt/migration-1.6.apt
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/src/site/apt/migration-1.6.apt?rev=1351756&r1=1351755&r2=1351756&view=diff
==============================================================================
--- myfaces/tobago/trunk/src/site/apt/migration-1.6.apt (original)
+++ myfaces/tobago/trunk/src/site/apt/migration-1.6.apt Tue Jun 19 16:03:08 2012
@@ -28,6 +28,9 @@ Java-API
    The class org.apache.myfaces.tobago.model.TreeState which has been deprecated in 1.5.x is
    used in 1.6.x with a changed API. Please check the occurrences.
 
+   Class <<<org.apache.myfaces.tobago.component.UIFileInput>>> has been renamed to
+   <<<org.apache.myfaces.tobago.component.UIFile>>>.
+
 Deprecated
 
    There are also <<<...@Deprecated>>> annotations in the code and some
@@ -52,4 +55,4 @@ Configuration
   The content of tobago-theme.xml is a subset of the tobago-config.xml, you have only to
   change the root node.
 
-  Please use the tobago-config-1.5.xsd to validate the configuration.
+  Please use the tobago-config-1.6.xsd to validate the configuration.

Added: myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/component/UIFileInput.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/component/UIFileInput.java?rev=1351756&view=auto
==============================================================================
--- myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/component/UIFileInput.java (added)
+++ myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/component/UIFileInput.java Tue Jun 19 16:03:08 2012
@@ -0,0 +1,25 @@
+package org.apache.myfaces.tobago.component;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+/**
+ * @deprecated since 1.6.0. Please use {@link UIFile}
+ */
+@Deprecated
+public interface UIFileInput {
+}

Copied: myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUIFile.java (from r1351674, myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUIFileInput.java)
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUIFile.java?p2=myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUIFile.java&p1=myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUIFileInput.java&r1=1351674&r2=1351756&rev=1351756&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUIFileInput.java (original)
+++ myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUIFile.java Tue Jun 19 16:03:08 2012
@@ -18,6 +18,7 @@ package org.apache.myfaces.tobago.intern
  */
 
 import org.apache.commons.fileupload.FileItem;
+import org.apache.myfaces.tobago.component.UIFileInput;
 import org.apache.myfaces.tobago.layout.LayoutComponent;
 import org.apache.myfaces.tobago.util.MessageUtils;
 
@@ -25,7 +26,7 @@ import javax.faces.application.FacesMess
 import javax.faces.component.UIInput;
 import javax.faces.context.FacesContext;
 
-public abstract class AbstractUIFileInput extends UIInput implements LayoutComponent {
+public abstract class AbstractUIFile extends UIInput implements LayoutComponent, UIFileInput {
 
   public void validate(FacesContext facesContext) {
     if (isRequired()) {
@@ -47,4 +48,10 @@ public abstract class AbstractUIFileInpu
     MessageUtils.addMessage(
         facesContext, this, FacesMessage.SEVERITY_ERROR, REQUIRED_MESSAGE_ID, new Object[]{getId()});
   }
+
+  public abstract boolean isDisabled();
+
+  public abstract boolean isReadonly();
+
+  public abstract Integer getTabIndex();
 }

Modified: myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/FileTagDeclaration.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/FileTagDeclaration.java?rev=1351756&r1=1351755&r2=1351756&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/FileTagDeclaration.java (original)
+++ myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/FileTagDeclaration.java Tue Jun 19 16:03:08 2012
@@ -51,8 +51,8 @@ import org.apache.myfaces.tobago.interna
  */
 @Tag(name = "file")
 @UIComponentTag(
-    uiComponent = "org.apache.myfaces.tobago.component.UIFileInput",
-    uiComponentBaseClass = "org.apache.myfaces.tobago.internal.component.AbstractUIFileInput",
+    uiComponent = "org.apache.myfaces.tobago.component.UIFile",
+    uiComponentBaseClass = "org.apache.myfaces.tobago.internal.component.AbstractUIFile",
     rendererType = RendererTypes.FILE,
     allowedChildComponenents = "NONE")
 public interface FileTagDeclaration

Modified: myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/validator/FileItemValidator.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/validator/FileItemValidator.java?rev=1351756&r1=1351755&r2=1351756&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/validator/FileItemValidator.java (original)
+++ myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/validator/FileItemValidator.java Tue Jun 19 16:03:08 2012
@@ -18,7 +18,7 @@ package org.apache.myfaces.tobago.valida
  */
 
 import org.apache.commons.fileupload.FileItem;
-import org.apache.myfaces.tobago.internal.component.AbstractUIFileInput;
+import org.apache.myfaces.tobago.internal.component.AbstractUIFile;
 import org.apache.myfaces.tobago.internal.util.ContentType;
 import org.apache.myfaces.tobago.util.MessageUtils;
 
@@ -50,7 +50,7 @@ public class FileItemValidator implement
   private boolean transientValue;
 
   public void validate(FacesContext facesContext, UIComponent component, Object value) throws ValidatorException {
-    if (value != null && component instanceof AbstractUIFileInput) {
+    if (value != null && component instanceof AbstractUIFile) {
       FileItem file = (FileItem) value;
       if (maxSize != null && file.getSize() > maxSize) {
         FacesMessage facesMessage = MessageUtils.getMessage(

Modified: myfaces/tobago/trunk/tobago-extension/tobago-facelets/src/main/java/org/apache/myfaces/tobago/facelets/extension/FileExtensionHandler.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-extension/tobago-facelets/src/main/java/org/apache/myfaces/tobago/facelets/extension/FileExtensionHandler.java?rev=1351756&r1=1351755&r2=1351756&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-extension/tobago-facelets/src/main/java/org/apache/myfaces/tobago/facelets/extension/FileExtensionHandler.java (original)
+++ myfaces/tobago/trunk/tobago-extension/tobago-facelets/src/main/java/org/apache/myfaces/tobago/facelets/extension/FileExtensionHandler.java Tue Jun 19 16:03:08 2012
@@ -19,12 +19,8 @@ package org.apache.myfaces.tobago.facele
 
 import com.sun.facelets.tag.jsf.ComponentConfig;
 import org.apache.myfaces.tobago.component.RendererTypes;
-import org.apache.myfaces.tobago.component.UIFileInput;
+import org.apache.myfaces.tobago.component.UIFile;
 
-/*
- * Date: Aug 8, 2007
- * Time: 5:45:16 PM
- */
 public class FileExtensionHandler extends TobagoLabelExtensionHandler {
 
   public FileExtensionHandler(ComponentConfig config) {
@@ -32,7 +28,7 @@ public class FileExtensionHandler extend
   }
 
   protected String getSubComponentType() {
-    return UIFileInput.COMPONENT_TYPE;
+    return UIFile.COMPONENT_TYPE;
   }
 
   protected String getSubRendererType() {

Modified: myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/FileRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/FileRenderer.java?rev=1351756&r1=1351755&r2=1351756&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/FileRenderer.java (original)
+++ myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/FileRenderer.java Tue Jun 19 16:03:08 2012
@@ -18,8 +18,8 @@ package org.apache.myfaces.tobago.render
  */
 
 import org.apache.commons.fileupload.FileItem;
-import org.apache.myfaces.tobago.component.UIFileInput;
 import org.apache.myfaces.tobago.context.ClientProperties;
+import org.apache.myfaces.tobago.internal.component.AbstractUIFile;
 import org.apache.myfaces.tobago.internal.util.FacesContextUtils;
 import org.apache.myfaces.tobago.internal.webapp.TobagoMultipartFormdataRequest;
 import org.apache.myfaces.tobago.layout.Measure;
@@ -55,16 +55,11 @@ public class FileRenderer extends InputR
   }
 
   public void decode(FacesContext facesContext, UIComponent component) {
-    if (!(component instanceof UIFileInput)) {
-      LOG.error("Wrong type: Need " + UIFileInput.class.getName() + ", but was " + component.getClass().getName());
-      return;
-    }
-
     if (ComponentUtils.isOutputOnly(component)) {
       return;
     }
 
-    UIFileInput input = (UIFileInput) component;
+    AbstractUIFile input = (AbstractUIFile) component;
 
     TobagoMultipartFormdataRequest request = null;
     Object requestObject = facesContext.getExternalContext().getRequest();
@@ -98,12 +93,8 @@ public class FileRenderer extends InputR
   }
 
   public void encodeEnd(FacesContext facesContext, UIComponent component) throws IOException {
-    if (!(component instanceof UIFileInput)) {
-      LOG.error("Wrong type: Need " + UIFileInput.class.getName() + ", but was " + component.getClass().getName());
-      return;
-    }
 
-    final UIFileInput file = (UIFileInput) component;
+    final AbstractUIFile file = (AbstractUIFile) component;
     final String clientId = file.getClientId(facesContext);
     final Style style = new Style(facesContext, file);
 
@@ -150,4 +141,3 @@ public class FileRenderer extends InputR
     writer.endElement(HtmlElements.DIV);
   }
 }
-