Author: konstantin.mishin
Date: 2010-11-12 11:43:29 -0500 (Fri, 12 Nov 2010)
New Revision: 20038
Added:
sandbox/trunk/ui/fileupload/ui/src/main/resources/META-INF/resources/org.richfaces/fileupload.ecss
sandbox/trunk/ui/fileupload/ui/src/main/resources/META-INF/resources/org.richfaces/fu-add.gif
sandbox/trunk/ui/fileupload/ui/src/main/resources/META-INF/resources/org.richfaces/fu-clr.gif
sandbox/trunk/ui/fileupload/ui/src/main/resources/META-INF/resources/org.richfaces/fu-uld.gif
sandbox/trunk/ui/fileupload/ui/src/main/resources/META-INF/richfaces/
sandbox/trunk/ui/fileupload/ui/src/main/resources/META-INF/richfaces/resource-mappings.properties
Modified:
sandbox/trunk/ui/fileupload/ui/pom.xml
sandbox/trunk/ui/fileupload/ui/src/main/java/org/richfaces/component/AbstractFileUpload.java
sandbox/trunk/ui/fileupload/ui/src/main/templates/fileupload.template.xml
Log:
RF-9496
Modified: sandbox/trunk/ui/fileupload/ui/pom.xml
===================================================================
--- sandbox/trunk/ui/fileupload/ui/pom.xml 2010-11-11 11:26:14 UTC (rev 20037)
+++ sandbox/trunk/ui/fileupload/ui/pom.xml 2010-11-12 16:43:29 UTC (rev 20038)
@@ -56,6 +56,10 @@
<artifactId>richfaces-ui-common-ui</artifactId>
</dependency>
<dependency>
+ <groupId>org.richfaces.ui.output</groupId>
+ <artifactId>richfaces-ui-output-ui</artifactId>
+ </dependency>
+ <dependency>
<groupId>org.richfaces.ui.fileupload</groupId>
<artifactId>richfaces-ui-fileupload-api</artifactId>
<version>${project.version}</version>
Modified:
sandbox/trunk/ui/fileupload/ui/src/main/java/org/richfaces/component/AbstractFileUpload.java
===================================================================
---
sandbox/trunk/ui/fileupload/ui/src/main/java/org/richfaces/component/AbstractFileUpload.java 2010-11-11
11:26:14 UTC (rev 20037)
+++
sandbox/trunk/ui/fileupload/ui/src/main/java/org/richfaces/component/AbstractFileUpload.java 2010-11-12
16:43:29 UTC (rev 20038)
@@ -21,8 +21,16 @@
*/
package org.richfaces.component;
+import java.util.Map;
+
+import javax.faces.component.UIComponent;
import javax.faces.component.UIComponentBase;
import javax.faces.context.FacesContext;
+import javax.faces.event.AbortProcessingException;
+import javax.faces.event.ComponentSystemEvent;
+import javax.faces.event.ComponentSystemEventListener;
+import javax.faces.event.ListenerFor;
+import javax.faces.event.PostAddToViewEvent;
import org.richfaces.cdk.annotations.JsfComponent;
import org.richfaces.cdk.annotations.JsfRenderer;
@@ -37,7 +45,8 @@
*/
@JsfComponent(tag = @Tag(handler =
"org.richfaces.view.facelets.FileUploadHandler"),
renderer = @JsfRenderer(type = "org.richfaces.FileUploadRenderer"))
-public abstract class AbstractFileUpload extends UIComponentBase {
+@ListenerFor(systemEventClass = PostAddToViewEvent.class)
+public abstract class AbstractFileUpload extends UIComponentBase implements
ComponentSystemEventListener {
@Override
public void decode(FacesContext context) {
@@ -49,6 +58,20 @@
}
}
+ public boolean isListenerForSource(Object source) {
+ return true;
+ }
+
+ public void processEvent(ComponentSystemEvent event) throws AbortProcessingException
{
+ Map<String, UIComponent> facets = getFacets();
+ UIComponent component = facets.get("progress");
+ if (component == null) {
+ FacesContext context = getFacesContext();
+ UIComponent pb = context.getApplication().createComponent(context,
AbstractProgressBar.COMPONENT_TYPE, "org.richfaces.ProgressBarRenderer");
+ pb.setId(getId() + "_pb");
+ facets.put("progress", pb);
+ }
+ }
/**
* <p>Add a new {@link FileUploadListener} to the set of listeners
* interested in being notified when {@link UploadEvent}s occur.</p>
Added:
sandbox/trunk/ui/fileupload/ui/src/main/resources/META-INF/resources/org.richfaces/fileupload.ecss
===================================================================
---
sandbox/trunk/ui/fileupload/ui/src/main/resources/META-INF/resources/org.richfaces/fileupload.ecss
(rev 0)
+++
sandbox/trunk/ui/fileupload/ui/src/main/resources/META-INF/resources/org.richfaces/fileupload.ecss 2010-11-12
16:43:29 UTC (rev 20038)
@@ -0,0 +1,75 @@
+.rf-fu {
+ background: '#{richSkin.tableBackgroundColor}';
+ border-color: '#{richSkin.tableBorderColor}';
+ border-style: solid;
+ border-width: 1px;
+ width: 400px; /*TODO Remove it*/
+}
+
+.rf-fu-hdr {
+ background-color: '#{richSkin.additionalBackgroundColor}';
+ border-bottom-color: '#{richSkin.tableBorderColor}';
+ border-bottom-style: solid;
+ border-bottom-width: 1px;
+ border-left-color: '#{richSkin.tableBackgroundColor}';
+ border-left-style: solid;
+ border-left-width: 1px;
+ border-top-color: '#{richSkin.tableBackgroundColor}';
+ border-top-style: solid;
+ border-top-width: 1px;
+ white-space: nowrap;
+}
+
+.rf-fu-lst {
+ height: 210px; /*TODO Remove it*/
+ overflow-x: hidden;
+ overflow-y: auto;
+}
+
+.rf-fu-btns-lft, .rf-fu-btns-rgh {
+ display: inline-block;
+ overflow: hidden;
+}
+
+.rf-fu-btns-lft {
+ width: 66%;
+}
+
+.rf-fu-btns-rgh {
+ text-align: right;
+ width: 34%;
+}
+
+.rf-fu-btn {
+ background-color: '#{richSkin.trimColor}';
+ background-image:
url("#{resource['org.richfaces.images:fuBtnGrad.png']}");
+ background-position:left top;
+ background-repeat:repeat-x;
+ border-color: '#{richSkin.tableBorderColor}';
+ border-style: solid;
+ border-width: 1px;
+ margin: 4px;
+ padding: 0px;
+}
+
+.rf-fu-btn-add, .rf-fu-btn-uld, .rf-fu-btn-clr {
+ background-repeat: no-repeat;
+ color: '#{richSkin.generalTextColor}';
+ display: inline-block;
+ font-family: '#{richSkin.generalFamilyFont}';
+ font-size: '#{richSkin.generalSizeFont}';
+ padding: 2px 2px 2px 19px;
+}
+
+.rf-fu-btn-add {
+ background-image: url("#{resource['org.richfaces:fu-add.gif']}");
+}
+
+.rf-fu-btn-uld {
+ background-image: url("#{resource['org.richfaces:fu-uld.gif']}");
+ font-weight: bold;
+}
+
+.rf-fu-btn-clr {
+ background-image: url("#{resource['org.richfaces:fu-clr.gif']}");
+}
\ No newline at end of file
Added:
sandbox/trunk/ui/fileupload/ui/src/main/resources/META-INF/resources/org.richfaces/fu-add.gif
===================================================================
(Binary files differ)
Property changes on:
sandbox/trunk/ui/fileupload/ui/src/main/resources/META-INF/resources/org.richfaces/fu-add.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added:
sandbox/trunk/ui/fileupload/ui/src/main/resources/META-INF/resources/org.richfaces/fu-clr.gif
===================================================================
(Binary files differ)
Property changes on:
sandbox/trunk/ui/fileupload/ui/src/main/resources/META-INF/resources/org.richfaces/fu-clr.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added:
sandbox/trunk/ui/fileupload/ui/src/main/resources/META-INF/resources/org.richfaces/fu-uld.gif
===================================================================
(Binary files differ)
Property changes on:
sandbox/trunk/ui/fileupload/ui/src/main/resources/META-INF/resources/org.richfaces/fu-uld.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added:
sandbox/trunk/ui/fileupload/ui/src/main/resources/META-INF/richfaces/resource-mappings.properties
===================================================================
---
sandbox/trunk/ui/fileupload/ui/src/main/resources/META-INF/richfaces/resource-mappings.properties
(rev 0)
+++
sandbox/trunk/ui/fileupload/ui/src/main/resources/META-INF/richfaces/resource-mappings.properties 2010-11-12
16:43:29 UTC (rev 20038)
@@ -0,0 +1,2 @@
+org.richfaces.images\:fuBtnGrad.png=org.richfaces.renderkit.html.BaseGradient\
+ {baseColorParam=additionalBackgroundColor, gradientColorParam=trimColor, height=18,
width=1}
\ No newline at end of file
Modified: sandbox/trunk/ui/fileupload/ui/src/main/templates/fileupload.template.xml
===================================================================
--- sandbox/trunk/ui/fileupload/ui/src/main/templates/fileupload.template.xml 2010-11-11
11:26:14 UTC (rev 20037)
+++ sandbox/trunk/ui/fileupload/ui/src/main/templates/fileupload.template.xml 2010-11-12
16:43:29 UTC (rev 20038)
@@ -31,9 +31,27 @@
<cdk:superclass>org.richfaces.renderkit.RendererBase</cdk:superclass>
<cdk:component-family>org.richfaces.FileUpload</cdk:component-family>
<cdk:renderer-type>org.richfaces.FileUploadRenderer</cdk:renderer-type>
+ <cdk:resource-dependency library="org.richfaces"
name="fileupload.ecss" />
<cdk:resource-dependency library="org.richfaces"
name="base-component.reslib" />
</cc:interface>
<cc:implementation>
- <input name="#{clientId}" type="file" />
+ <div class="rf-fu">
+ <div class="rf-fu-hdr">
+ <span class="rf-fu-btns-lft">
+ <button class="rf-fu-btn">
+ <span class="rf-fu-btn-add">Add...</span>
+ </button>
+ <button class="rf-fu-btn">
+ <span class="rf-fu-btn-uld">Upload</span>
+ </button>
+ </span>
+ <span class="rf-fu-btns-rgh">
+ <button class="rf-fu-btn">
+ <span class="rf-fu-btn-clr">Clear All</span>
+ </button>
+ </span>
+ </div>
+ <div class="rf-fu-lst" />
+ </div>
</cc:implementation>
</cdk:root>
Show replies by date