JBoss Rich Faces SVN: r20537 - branches.
by richfaces-svn-commits@lists.jboss.org
Author: alexsmirnov
Date: 2010-12-13 13:43:17 -0500 (Mon, 13 Dec 2010)
New Revision: 20537
Removed:
branches/RF-8742-1/
Log:
remove working branch
14 years, 1 month
JBoss Rich Faces SVN: r20536 - in trunk: ui/dnd/api and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: alexsmirnov
Date: 2010-12-13 12:11:04 -0500 (Mon, 13 Dec 2010)
New Revision: 20536
Modified:
trunk/examples/push-demo/
trunk/ui/dnd/api/
trunk/ui/dnd/ui/
Log:
ignore working files in dnd project
Property changes on: trunk/examples/push-demo
___________________________________________________________________
Name: svn:ignore
+ target
.settings
.project
.classpath
.clover
.externalToolBuilders
Property changes on: trunk/ui/dnd/api
___________________________________________________________________
Name: svn:ignore
+ target
.settings
.project
.classpath
.clover
.externalToolBuilders
Property changes on: trunk/ui/dnd/ui
___________________________________________________________________
Name: svn:ignore
+ target
.settings
.project
.classpath
.clover
.externalToolBuilders
14 years, 1 month
JBoss Rich Faces SVN: r20535 - trunk/examples/richfaces-showcase/src/main/java/org/richfaces/demo/fileupload.
by richfaces-svn-commits@lists.jboss.org
Author: konstantin.mishin
Date: 2010-12-13 11:50:31 -0500 (Mon, 13 Dec 2010)
New Revision: 20535
Modified:
trunk/examples/richfaces-showcase/src/main/java/org/richfaces/demo/fileupload/FileUploadBean.java
Log:
RF-9988
Modified: trunk/examples/richfaces-showcase/src/main/java/org/richfaces/demo/fileupload/FileUploadBean.java
===================================================================
--- trunk/examples/richfaces-showcase/src/main/java/org/richfaces/demo/fileupload/FileUploadBean.java 2010-12-13 16:48:37 UTC (rev 20534)
+++ trunk/examples/richfaces-showcase/src/main/java/org/richfaces/demo/fileupload/FileUploadBean.java 2010-12-13 16:50:31 UTC (rev 20535)
@@ -1,6 +1,6 @@
package org.richfaces.demo.fileupload;
-import org.richfaces.event.UploadEvent;
+import org.richfaces.event.FileUploadEvent;
import org.richfaces.model.UploadedFile;
import javax.faces.bean.ManagedBean;
@@ -35,7 +35,7 @@
stream.write(getFiles().get((Integer) object).getData());
}
- public void listener(UploadEvent event) throws Exception {
+ public void listener(FileUploadEvent event) throws Exception {
UploadedFile item = event.getUploadedFile();
UploadedImage file = new UploadedImage();
file.setLength(item.getData().length);
14 years, 1 month
JBoss Rich Faces SVN: r20534 - in trunk: examples/input-demo/src/main/java/org/richfaces/demo and 4 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: konstantin.mishin
Date: 2010-12-13 11:48:37 -0500 (Mon, 13 Dec 2010)
New Revision: 20534
Added:
trunk/ui/input/api/src/main/java/org/richfaces/event/FileUploadEvent.java
Removed:
trunk/core/api/src/main/java/org/richfaces/model/UploadItem.java
trunk/ui/input/api/src/main/java/org/richfaces/event/UploadEvent.java
Modified:
trunk/examples/input-demo/src/main/java/org/richfaces/demo/FileUploadBean.java
trunk/ui/input/api/src/main/java/org/richfaces/event/FileUploadListener.java
trunk/ui/input/ui/src/main/java/org/richfaces/component/AbstractFileUpload.java
trunk/ui/input/ui/src/main/java/org/richfaces/renderkit/FileUploadRendererBase.java
trunk/ui/input/ui/src/main/java/org/richfaces/view/facelets/FileUploadHandler.java
Log:
RF-9988
Deleted: trunk/core/api/src/main/java/org/richfaces/model/UploadItem.java
===================================================================
--- trunk/core/api/src/main/java/org/richfaces/model/UploadItem.java 2010-12-13 16:24:19 UTC (rev 20533)
+++ trunk/core/api/src/main/java/org/richfaces/model/UploadItem.java 2010-12-13 16:48:37 UTC (rev 20534)
@@ -1,125 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-
-
-package org.richfaces.model;
-
-import java.io.File;
-import java.io.Serializable;
-
-/**
- * Class provides object holder for file uploaded.
- * Instance of this type will be returned by UploadEvent after appropriate listener called after uploading has been
- * completed.
- *
- * @author "Andrey Markavtsov"
- *
- */
-public class UploadItem implements Serializable {
-
- /**
- * Serial id
- */
- private static final long serialVersionUID = -111723029745124147L;
-
- /** File byte content */
- private byte[] bytes;
-
- /** Content type */
- private String contentType;
-
- /** java.io.File instance */
- private File file;
-
- /** Users file name */
- private String fileName;
-
- /** File size */
- private int fileSize;
-
- /**
- * Constructor for the UploadItem
- */
- public UploadItem(String fileName, int fileSize, String contentType, Object file) {
- this.fileName = fileName;
- this.contentType = contentType;
- this.fileSize = fileSize;
-
- if (null != file) {
- if (file.getClass().isAssignableFrom(File.class)) {
- this.file = (File) file;
- } else if (file.getClass().isAssignableFrom(byte[].class)) {
- this.bytes = (byte[]) file;
- }
- }
- }
-
- /**
- * Return true if file is holding as java.io.File type.
- * If true getFile method should be invoked to get file uploaded.
- * In another case getData method should be invoked to get file's bytes.
- * @return
- */
- public boolean isTempFile() {
- return null != file;
- }
-
- /**
- * This method should called only in case of TRUE value returned by {@link #isTempFile()} method.
- * Otherwise null value will be returned by this method.
- * @return the file
- */
- public File getFile() {
- return file;
- }
-
- /**
- * This method should called only in case of FALSE value returned by {@link #isTempFile()} method.
- * Otherwise null value will be returned by this method.
- * @return the bytes
- * @throws Exception
- */
- public byte[] getData() {
- return bytes;
- }
-
- /**
- * @return the fileName
- */
- public String getFileName() {
- return fileName;
- }
-
- /**
- * @return the contentType
- */
- public String getContentType() {
- return contentType;
- }
-
- /**
- * @return the fileSize
- */
- public int getFileSize() {
- return fileSize;
- }
-}
Modified: trunk/examples/input-demo/src/main/java/org/richfaces/demo/FileUploadBean.java
===================================================================
--- trunk/examples/input-demo/src/main/java/org/richfaces/demo/FileUploadBean.java 2010-12-13 16:24:19 UTC (rev 20533)
+++ trunk/examples/input-demo/src/main/java/org/richfaces/demo/FileUploadBean.java 2010-12-13 16:48:37 UTC (rev 20534)
@@ -27,7 +27,7 @@
import javax.faces.event.AbortProcessingException;
import javax.faces.event.AjaxBehaviorEvent;
-import org.richfaces.event.UploadEvent;
+import org.richfaces.event.FileUploadEvent;
import org.richfaces.model.UploadedFile;
/**
@@ -51,7 +51,7 @@
// stream.write(item.getData());
// }
- public void listener(UploadEvent event) throws Exception {
+ public void listener(FileUploadEvent event) throws Exception {
file = event.getUploadedFile();
}
Copied: trunk/ui/input/api/src/main/java/org/richfaces/event/FileUploadEvent.java (from rev 20520, trunk/ui/input/api/src/main/java/org/richfaces/event/UploadEvent.java)
===================================================================
--- trunk/ui/input/api/src/main/java/org/richfaces/event/FileUploadEvent.java (rev 0)
+++ trunk/ui/input/api/src/main/java/org/richfaces/event/FileUploadEvent.java 2010-12-13 16:48:37 UTC (rev 20534)
@@ -0,0 +1,55 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright ${year}, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.richfaces.event;
+
+import javax.faces.component.UIComponent;
+import javax.faces.event.FacesEvent;
+import javax.faces.event.FacesListener;
+
+import org.richfaces.model.UploadedFile;
+
+/**
+ * @author Konstantin Mishin
+ *
+ */
+public class FileUploadEvent extends FacesEvent {
+
+ private static final long serialVersionUID = -7645197191376210068L;
+ private UploadedFile uploadedFile = null;
+
+ public FileUploadEvent(UIComponent component, UploadedFile uploadedFile) {
+ super(component);
+ this.uploadedFile = uploadedFile;
+ }
+
+ public boolean isAppropriateListener(FacesListener listener) {
+ return listener instanceof FileUploadListener;
+ }
+
+ public void processListener(FacesListener listener) {
+ ((FileUploadListener) listener).processUpload(this);
+ }
+
+ public UploadedFile getUploadedFile() {
+ return uploadedFile;
+ }
+}
Modified: trunk/ui/input/api/src/main/java/org/richfaces/event/FileUploadListener.java
===================================================================
--- trunk/ui/input/api/src/main/java/org/richfaces/event/FileUploadListener.java 2010-12-13 16:24:19 UTC (rev 20533)
+++ trunk/ui/input/api/src/main/java/org/richfaces/event/FileUploadListener.java 2010-12-13 16:48:37 UTC (rev 20534)
@@ -25,5 +25,5 @@
public interface FileUploadListener extends FacesListener {
- public void processUpload(UploadEvent event);
+ public void processUpload(FileUploadEvent event);
}
Deleted: trunk/ui/input/api/src/main/java/org/richfaces/event/UploadEvent.java
===================================================================
--- trunk/ui/input/api/src/main/java/org/richfaces/event/UploadEvent.java 2010-12-13 16:24:19 UTC (rev 20533)
+++ trunk/ui/input/api/src/main/java/org/richfaces/event/UploadEvent.java 2010-12-13 16:48:37 UTC (rev 20534)
@@ -1,55 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright ${year}, Red Hat, Inc. and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.richfaces.event;
-
-import javax.faces.component.UIComponent;
-import javax.faces.event.FacesEvent;
-import javax.faces.event.FacesListener;
-
-import org.richfaces.model.UploadedFile;
-
-/**
- * @author Konstantin Mishin
- *
- */
-public class UploadEvent extends FacesEvent {
-
- private static final long serialVersionUID = -7645197191376210068L;
- private UploadedFile uploadedFile = null;
-
- public UploadEvent(UIComponent component, UploadedFile uploadedFile) {
- super(component);
- this.uploadedFile = uploadedFile;
- }
-
- public boolean isAppropriateListener(FacesListener listener) {
- return listener instanceof FileUploadListener;
- }
-
- public void processListener(FacesListener listener) {
- ((FileUploadListener) listener).processUpload(this);
- }
-
- public UploadedFile getUploadedFile() {
- return uploadedFile;
- }
-}
Modified: trunk/ui/input/ui/src/main/java/org/richfaces/component/AbstractFileUpload.java
===================================================================
--- trunk/ui/input/ui/src/main/java/org/richfaces/component/AbstractFileUpload.java 2010-12-13 16:24:19 UTC (rev 20533)
+++ trunk/ui/input/ui/src/main/java/org/richfaces/component/AbstractFileUpload.java 2010-12-13 16:48:37 UTC (rev 20534)
@@ -91,7 +91,7 @@
/**
* <p>Add a new {@link FileUploadListener} to the set of listeners
- * interested in being notified when {@link org.richfaces.UploadEvent}s occur.</p>
+ * interested in being notified when {@link org.richfaces.FileUploadEvent}s occur.</p>
*
* @param listener The {@link FileUploadListener} to be added
* @throws NullPointerException if <code>listener</code>
Modified: trunk/ui/input/ui/src/main/java/org/richfaces/renderkit/FileUploadRendererBase.java
===================================================================
--- trunk/ui/input/ui/src/main/java/org/richfaces/renderkit/FileUploadRendererBase.java 2010-12-13 16:24:19 UTC (rev 20533)
+++ trunk/ui/input/ui/src/main/java/org/richfaces/renderkit/FileUploadRendererBase.java 2010-12-13 16:48:37 UTC (rev 20534)
@@ -25,7 +25,7 @@
import javax.faces.context.ExternalContext;
import javax.faces.context.FacesContext;
-import org.richfaces.event.UploadEvent;
+import org.richfaces.event.FileUploadEvent;
import org.richfaces.model.UploadedFile;
import org.richfaces.request.MultipartRequest;
@@ -42,7 +42,7 @@
if (request instanceof MultipartRequest) {
UploadedFile file = ((MultipartRequest) request).getUploadedFile(component.getClientId(context));
if (file != null) {
- component.queueEvent(new UploadEvent(component, file));
+ component.queueEvent(new FileUploadEvent(component, file));
}
}
}
Modified: trunk/ui/input/ui/src/main/java/org/richfaces/view/facelets/FileUploadHandler.java
===================================================================
--- trunk/ui/input/ui/src/main/java/org/richfaces/view/facelets/FileUploadHandler.java 2010-12-13 16:24:19 UTC (rev 20533)
+++ trunk/ui/input/ui/src/main/java/org/richfaces/view/facelets/FileUploadHandler.java 2010-12-13 16:48:37 UTC (rev 20534)
@@ -33,7 +33,7 @@
import org.richfaces.component.AbstractFileUpload;
import org.richfaces.event.FileUploadListener;
-import org.richfaces.event.UploadEvent;
+import org.richfaces.event.FileUploadEvent;
/**
* @author Konstantin Mishin
@@ -54,12 +54,12 @@
public Metadata applyRule(String name, TagAttribute attribute, MetadataTarget meta) {
if (meta.isTargetInstanceOf(AbstractFileUpload.class)) {
if ("fileUploadListener".equals(name)) {
- return new MethodMetadata(attribute, UploadEvent.class) {
+ return new MethodMetadata(attribute, FileUploadEvent.class) {
@Override
public void applyMetadata(final FaceletContext ctx, Object instance) {
final MethodExpression expression = getMethodExpression(ctx);
((AbstractFileUpload) instance).addFileUploadListener(new FileUploadListener(){
- public void processUpload(UploadEvent event) {
+ public void processUpload(FileUploadEvent event) {
expression.invoke(ctx.getFacesContext().getELContext(), new Object[] {event});
}
});
14 years, 1 month
JBoss Rich Faces SVN: r20533 - trunk/ui/input/ui/src/test/java/org/richfaces/renderkit.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2010-12-13 11:24:19 -0500 (Mon, 13 Dec 2010)
New Revision: 20533
Modified:
trunk/ui/input/ui/src/test/java/org/richfaces/renderkit/InplaceInputRendererTest.java
Log:
fix test
Modified: trunk/ui/input/ui/src/test/java/org/richfaces/renderkit/InplaceInputRendererTest.java
===================================================================
--- trunk/ui/input/ui/src/test/java/org/richfaces/renderkit/InplaceInputRendererTest.java 2010-12-13 16:06:34 UTC (rev 20532)
+++ trunk/ui/input/ui/src/test/java/org/richfaces/renderkit/InplaceInputRendererTest.java 2010-12-13 16:24:19 UTC (rev 20533)
@@ -62,7 +62,7 @@
HtmlElement span = page.getFirstByXPath("//*[@id = '"+ withControlsComponentId +"']");
assertNotNull(span);
- assertEquals("rf-ii-d-s", span.getAttribute(HtmlConstants.CLASS_ATTRIBUTE));
+ assertEquals("rf-ii-d-s rf-ii-c-s", span.getAttribute(HtmlConstants.CLASS_ATTRIBUTE));
edit(page, withControlsComponentId, "Another Test String");
14 years, 1 month
JBoss Rich Faces SVN: r20532 - in modules/tests/metamer/trunk/application/src/main: webapp/components/richInplaceSelect and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: ppitonak(a)redhat.com
Date: 2010-12-13 11:06:34 -0500 (Mon, 13 Dec 2010)
New Revision: 20532
Modified:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichInplaceSelectBean.java
modules/tests/metamer/trunk/application/src/main/webapp/components/richInplaceSelect/simple.xhtml
modules/tests/metamer/trunk/application/src/main/webapp/components/richTogglePanel/simple.xhtml
Log:
* sample for inplace select fixed
Modified: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichInplaceSelectBean.java
===================================================================
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichInplaceSelectBean.java 2010-12-13 15:51:32 UTC (rev 20531)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichInplaceSelectBean.java 2010-12-13 16:06:34 UTC (rev 20532)
@@ -28,7 +28,7 @@
import javax.annotation.PostConstruct;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.ManagedProperty;
-import javax.faces.bean.SessionScoped;
+import javax.faces.bean.ViewScoped;
import javax.faces.event.ValueChangeEvent;
import javax.faces.model.SelectItem;
import org.richfaces.component.UIInplaceSelect;
@@ -45,7 +45,7 @@
* @version $Revision$
*/
@ManagedBean(name = "richInplaceSelectBean")
-@SessionScoped
+@ViewScoped
public class RichInplaceSelectBean implements Serializable {
private static final long serialVersionUID = -1L;
Modified: modules/tests/metamer/trunk/application/src/main/webapp/components/richInplaceSelect/simple.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/richInplaceSelect/simple.xhtml 2010-12-13 15:51:32 UTC (rev 20531)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richInplaceSelect/simple.xhtml 2010-12-13 16:06:34 UTC (rev 20532)
@@ -41,10 +41,13 @@
<ui:define name="component">
<rich:inplaceSelect id="inplaceSelect"
+ changedStateClass="#{richInplaceSelectBean.attributes['changedStateClass'].value}"
converterMessage="#{richInplaceSelectBean.attributes['converterMessage'].value}"
defaultLabel="#{richInplaceSelectBean.attributes['defaultLabel'].value}"
+ disabled="#{richInplaceSelectBean.attributes['disabled'].value}"
+ disabledStateClass="#{richInplaceSelectBean.attributes['disabledStateClass'].value}"
editEvent="#{richInplaceSelectBean.attributes['editEvent'].value}"
- enableManualInput="#{richInplaceSelectBean.attributes['enableManualInput'].value}"
+ editStateClass="#{richInplaceSelectBean.attributes['editStateClass'].value}"
immediate="#{richInplaceSelectBean.attributes['immediate'].value}"
itemClass="#{richInplaceSelectBean.attributes['itemClass'].value}"
listClass="#{richInplaceSelectBean.attributes['listClass'].value}"
@@ -55,10 +58,8 @@
onclick="#{richInplaceSelectBean.attributes['onclick'].value}"
ondblclick="#{richInplaceSelectBean.attributes['ondblclick'].value}"
onfocus="#{richInplaceSelectBean.attributes['onfocus'].value}"
- oninputblur="#{richInplaceSelectBean.attributes['oninputblur'].value}"
oninputclick="#{richInplaceSelectBean.attributes['oninputclick'].value}"
oninputdblclick="#{richInplaceSelectBean.attributes['oninputdblclick'].value}"
- oninputfocus="#{richInplaceSelectBean.attributes['oninputfocus'].value}"
oninputkeydown="#{richInplaceSelectBean.attributes['oninputkeydown'].value}"
oninputkeypress="#{richInplaceSelectBean.attributes['oninputkeypress'].value}"
oninputkeyup="#{richInplaceSelectBean.attributes['oninputkeyup'].value}"
@@ -86,27 +87,27 @@
onmouseout="#{richInplaceSelectBean.attributes['onmouseout'].value}"
onmouseover="#{richInplaceSelectBean.attributes['onmouseover'].value}"
onmouseup="#{richInplaceSelectBean.attributes['onmouseup'].value}"
- onselect="#{richInplaceSelectBean.attributes['onselect'].value}"
+ onselectitem="#{richInplaceSelectBean.attributes['onselectitem'].value}"
openOnEdit="#{richInplaceSelectBean.attributes['openOnEdit'].value}"
+ readyStateClass="#{richInplaceSelectBean.attributes['readyStateClass'].value}"
rendered="#{richInplaceSelectBean.attributes['rendered'].value}"
required="#{richInplaceSelectBean.attributes['required'].value}"
requiredMessage="#{richInplaceSelectBean.attributes['requiredMessage'].value}"
saveOnBlur="#{richInplaceSelectBean.attributes['saveOnBlur'].value}"
saveOnSelect="#{richInplaceSelectBean.attributes['saveOnSelect'].value}"
- selectFirst="#{richInplaceSelectBean.attributes['selectFirst'].value}"
selectItemClass="#{richInplaceSelectBean.attributes['selectItemClass'].value}"
- showButton="#{richInplaceSelectBean.attributes['showButton'].value}"
showControls="#{richInplaceSelectBean.attributes['showControls'].value}"
state="#{richInplaceSelectBean.attributes['state'].value}"
+ tabindex="#{richInplaceSelectBean.attributes['tabindex'].value}"
validatorMessage="#{richInplaceSelectBean.attributes['validatorMessage'].value}"
value="#{richInplaceSelectBean.attributes['value'].value}"
valueChangeListener="#{richInplaceSelectBean.listener}"
>
<f:selectItems value="#{richInplaceSelectBean.capitalsOptions}" />
- <!-- TODO change event to "change" as soon as implemented -->
- <a4j:ajax event="select" render="output"/>
+ <a4j:ajax event="change" render="output"/>
+
</rich:inplaceSelect>
<br/><br/>
Modified: modules/tests/metamer/trunk/application/src/main/webapp/components/richTogglePanel/simple.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/richTogglePanel/simple.xhtml 2010-12-13 15:51:32 UTC (rev 20531)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richTogglePanel/simple.xhtml 2010-12-13 16:06:34 UTC (rev 20532)
@@ -2,7 +2,7 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core"
xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:metamer="http://java.sun.com/jsf/composite/metamer"
- xmlns:rich="http://richfaces.org/rich" xmlns:a4j="http://richfaces.org/a4j">
+ xmlns:rich="http://richfaces.org/rich" >
<!--
JBoss, Home of Professional Open Source
14 years, 1 month
JBoss Rich Faces SVN: r20531 - trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2010-12-13 10:51:32 -0500 (Mon, 13 Dec 2010)
New Revision: 20531
Modified:
trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceBase.js
trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceInput.js
Log:
RF-9870
Modified: trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceBase.js
===================================================================
--- trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceBase.js 2010-12-13 15:17:39 UTC (rev 20530)
+++ trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceBase.js 2010-12-13 15:51:32 UTC (rev 20531)
@@ -71,7 +71,6 @@
this.isSaved = true;
this.__applyChangedStyles();
- this.__hide();
this.onsave();
},
@@ -82,7 +81,6 @@
}
this.setValue(text);
this.isSaved = true;
- this.__hide();
this.oncancel();
},
Modified: trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceInput.js
===================================================================
--- trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceInput.js 2010-12-13 15:17:39 UTC (rev 20530)
+++ trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceInput.js 2010-12-13 15:51:32 UTC (rev 20531)
@@ -65,14 +65,8 @@
__blurHandler: function(e) {
this.onblur(e);
},
-
- __changeHandler: function(e) {
- if(!this.isValueSaved()) {
- this.save();
- }
- },
-
- __isSaveOnBlur: function() {
+
+ __isSaveOnBlur: function() {
return this.saveOnBlur;
},
@@ -131,12 +125,14 @@
this.__setFocused(false);
this.invokeEvent.call(this, "blur", document.getElementById(this.id + 'Input'), e);
- if(!this.isValueSaved() && this.__isSaveOnBlur()) {
+ if(this.isValueSaved() || this.__isSaveOnBlur()) {
this.save();
} else {
- this.__hide();
+ this.cancel();
}
+ this.__hide();
+
if(!this.cancelButton) {
if(this.__isValueChanged()) {
this.invokeEvent.call(this, "change", document.getElementById(this.id + 'Input'), e);
14 years, 1 month
JBoss Rich Faces SVN: r20530 - modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean.
by richfaces-svn-commits@lists.jboss.org
Author: ppitonak(a)redhat.com
Date: 2010-12-13 10:17:39 -0500 (Mon, 13 Dec 2010)
New Revision: 20530
Modified:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichTogglePanelBean.java
Log:
* unnecessary import removed
Modified: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichTogglePanelBean.java
===================================================================
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichTogglePanelBean.java 2010-12-13 14:34:34 UTC (rev 20529)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichTogglePanelBean.java 2010-12-13 15:17:39 UTC (rev 20530)
@@ -28,7 +28,6 @@
import javax.faces.bean.ViewScoped;
import org.richfaces.component.html.HtmlTogglePanel;
-import org.richfaces.event.ItemChangeEvent;
import org.richfaces.tests.metamer.Attributes;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
14 years, 1 month
JBoss Rich Faces SVN: r20529 - trunk/ui/iteration/ui/src/main/java/org/richfaces/component.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2010-12-13 09:34:34 -0500 (Mon, 13 Dec 2010)
New Revision: 20529
Modified:
trunk/ui/iteration/ui/src/main/java/org/richfaces/component/AbstractTree.java
Log:
https://issues.jboss.org/browse/RF-9992
Modified: trunk/ui/iteration/ui/src/main/java/org/richfaces/component/AbstractTree.java
===================================================================
--- trunk/ui/iteration/ui/src/main/java/org/richfaces/component/AbstractTree.java 2010-12-13 14:10:29 UTC (rev 20528)
+++ trunk/ui/iteration/ui/src/main/java/org/richfaces/component/AbstractTree.java 2010-12-13 14:34:34 UTC (rev 20529)
@@ -102,6 +102,8 @@
private static final String DEFAULT_TREE_NODE_CREATED = AbstractTree.class.getName() + ":DEFAULT_TREE_NODE_CREATED";
+ private static final String DEFAULT_TREE_NODE_ID = "__defaultTreeNode";
+
private static final class MatchingTreeNodePredicate implements Predicate<UIComponent> {
private String type;
@@ -268,20 +270,32 @@
return this;
}
+ private boolean isDefaultTreeNode(AbstractTreeNode node) {
+ return DEFAULT_TREE_NODE_ID.equals(node.getId());
+ }
+
public AbstractTreeNode findTreeNodeComponent() {
FacesContext facesContext = getFacesContext();
String nodeType = getNodeType();
Iterator<UIComponent> nodesItr = findMatchingTreeNodeComponent(nodeType, getCurrentComponent());
-
- if (nodesItr.hasNext()) {
- Iterator<UIComponent> renderedNodesItr = Iterators.filter(nodesItr, ComponentPredicates.isRendered());
- if (renderedNodesItr.hasNext()) {
- return (AbstractTreeNode) renderedNodesItr.next();
+ boolean hasOnlyDefaultNodes = true;
+ while (nodesItr.hasNext()) {
+
+ AbstractTreeNode node = (AbstractTreeNode) nodesItr.next();
+
+ if (!isDefaultTreeNode(node)) {
+ hasOnlyDefaultNodes = false;
}
- return null;
+ if (!node.isRendered()) {
+ continue;
+ }
+
+ if (!isDefaultTreeNode(node) || hasOnlyDefaultNodes) {
+ return node;
+ }
}
if (Strings.isNullOrEmpty(nodeType)) {
@@ -292,7 +306,7 @@
//TODO default TreeNode is created when getRowKey() == null but it's not used for presentational purposes
Application application = facesContext.getApplication();
AbstractTreeNode treeNode = (AbstractTreeNode) application.createComponent(AbstractTreeNode.COMPONENT_TYPE);
- treeNode.setId("__defaultTreeNode");
+ treeNode.setId(DEFAULT_TREE_NODE_ID);
getChildren().add(treeNode);
14 years, 1 month
JBoss Rich Faces SVN: r20528 - in trunk/ui/input: ui/src/main/java/org/richfaces/component and 3 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2010-12-13 09:10:29 -0500 (Mon, 13 Dec 2010)
New Revision: 20528
Modified:
trunk/ui/input/api/src/main/java/org/richfaces/component/InplaceComponent.java
trunk/ui/input/api/src/main/java/org/richfaces/component/InplaceState.java
trunk/ui/input/ui/src/main/java/org/richfaces/component/AbstractInplaceInput.java
trunk/ui/input/ui/src/main/java/org/richfaces/component/AbstractInplaceSelect.java
trunk/ui/input/ui/src/main/java/org/richfaces/component/AbstractSelectComponent.java
trunk/ui/input/ui/src/main/java/org/richfaces/renderkit/InplaceInputRendererBase.java
trunk/ui/input/ui/src/main/java/org/richfaces/renderkit/InplaceSelectRendererBase.java
trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceBase.js
trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceInput.js
trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceSelect.js
trunk/ui/input/ui/src/main/templates/inplaceInput.template.xml
trunk/ui/input/ui/src/main/templates/inplaceSelect.template.xml
Log:
Rf-9874, RF-9896
Modified: trunk/ui/input/api/src/main/java/org/richfaces/component/InplaceComponent.java
===================================================================
--- trunk/ui/input/api/src/main/java/org/richfaces/component/InplaceComponent.java 2010-12-13 13:53:13 UTC (rev 20527)
+++ trunk/ui/input/api/src/main/java/org/richfaces/component/InplaceComponent.java 2010-12-13 14:10:29 UTC (rev 20528)
@@ -29,6 +29,8 @@
*/
public interface InplaceComponent {
+ public boolean isDisabled();
+
public String getDefaultLabel();
public String getEditEvent();
Modified: trunk/ui/input/api/src/main/java/org/richfaces/component/InplaceState.java
===================================================================
--- trunk/ui/input/api/src/main/java/org/richfaces/component/InplaceState.java 2010-12-13 13:53:13 UTC (rev 20527)
+++ trunk/ui/input/api/src/main/java/org/richfaces/component/InplaceState.java 2010-12-13 14:10:29 UTC (rev 20528)
@@ -31,6 +31,5 @@
public enum InplaceState {
ready,
edit,
- changed,
- disable
+ changed
}
Modified: trunk/ui/input/ui/src/main/java/org/richfaces/component/AbstractInplaceInput.java
===================================================================
--- trunk/ui/input/ui/src/main/java/org/richfaces/component/AbstractInplaceInput.java 2010-12-13 13:53:13 UTC (rev 20527)
+++ trunk/ui/input/ui/src/main/java/org/richfaces/component/AbstractInplaceInput.java 2010-12-13 14:10:29 UTC (rev 20528)
@@ -45,8 +45,11 @@
public static final String COMPONENT_TYPE = "org.richfaces.InplaceInput";
public static final String COMPONENT_FAMILY = "org.richfaces.InplaceInput";
-
+
@Attribute
+ public abstract boolean isDisabled();
+
+ @Attribute
public abstract String getDefaultLabel();
@Attribute(defaultValue="true")
Modified: trunk/ui/input/ui/src/main/java/org/richfaces/component/AbstractInplaceSelect.java
===================================================================
--- trunk/ui/input/ui/src/main/java/org/richfaces/component/AbstractInplaceSelect.java 2010-12-13 13:53:13 UTC (rev 20527)
+++ trunk/ui/input/ui/src/main/java/org/richfaces/component/AbstractInplaceSelect.java 2010-12-13 14:10:29 UTC (rev 20528)
@@ -50,6 +50,9 @@
@Attribute(defaultValue="InplaceState.ready")
public abstract InplaceState getState();
+ @Attribute
+ public abstract boolean isDisabled();
+
@Attribute(defaultValue="true")
public abstract boolean isOpenOnEdit();
Modified: trunk/ui/input/ui/src/main/java/org/richfaces/component/AbstractSelectComponent.java
===================================================================
--- trunk/ui/input/ui/src/main/java/org/richfaces/component/AbstractSelectComponent.java 2010-12-13 13:53:13 UTC (rev 20527)
+++ trunk/ui/input/ui/src/main/java/org/richfaces/component/AbstractSelectComponent.java 2010-12-13 14:10:29 UTC (rev 20528)
@@ -50,6 +50,18 @@
public abstract String getSelectItemClass();
@Attribute
+ public abstract String getReadyStateClass();
+
+ @Attribute
+ public abstract String getEditStateClass();
+
+ @Attribute
+ public abstract String getChangedStateClass();
+
+ @Attribute
+ public abstract String getDisabledStateClass();
+
+ @Attribute
public abstract String getListClass();
@Attribute(events=@EventName("blur"))
Modified: trunk/ui/input/ui/src/main/java/org/richfaces/renderkit/InplaceInputRendererBase.java
===================================================================
--- trunk/ui/input/ui/src/main/java/org/richfaces/renderkit/InplaceInputRendererBase.java 2010-12-13 13:53:13 UTC (rev 20527)
+++ trunk/ui/input/ui/src/main/java/org/richfaces/renderkit/InplaceInputRendererBase.java 2010-12-13 14:10:29 UTC (rev 20528)
@@ -30,6 +30,7 @@
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
+import org.richfaces.component.AbstractInplaceInput;
import org.richfaces.component.InplaceComponent;
import org.richfaces.component.InplaceState;
@@ -130,9 +131,10 @@
}
public String getValue(FacesContext facesContext, UIComponent component) throws IOException {
- String value = getInputValue(facesContext, component);
- if (!isDisable(getInplaceState(component)) && (value == null || "".equals(value)) ) {
- value = ((InplaceComponent) component).getDefaultLabel();
+ AbstractInplaceInput inplaceInput = (AbstractInplaceInput)component;
+ String value = getInputValue(facesContext, inplaceInput);
+ if (!inplaceInput.isDisabled() && (value == null || "".equals(value)) ) {
+ value = inplaceInput.getDefaultLabel();
}
return value;
}
@@ -144,29 +146,22 @@
public String getStateStyleClass(UIComponent component, InplaceState inplaceState) {
InplaceComponent inplaceComponent = (InplaceComponent)component;
String style = getReadyStateCss(inplaceComponent);
- switch (inplaceState) {
- case edit:
- style = concatClasses(style, getEditStateCss(inplaceComponent));
- break;
-
- case changed:
- style = concatClasses(style, getChangedStateCss(inplaceComponent));
- break;
-
- case disable:
- style = getDisableStateCss(inplaceComponent);
- break;
-
- default:
- break;
+ if(!inplaceComponent.isDisabled()) {
+ switch (inplaceState) {
+ case edit:
+ style = concatClasses(style, getEditStateCss(inplaceComponent));
+ break;
+ case changed:
+ style = concatClasses(style, getChangedStateCss(inplaceComponent));
+ break;
+ default:
+ break;
+ }
+ } else {
+ style = getDisableStateCss(inplaceComponent);
}
-
return style;
}
-
- public boolean isDisable(InplaceState currentState) {
- return (InplaceState.disable == currentState);
- }
public String getEditStyleClass(UIComponent component, InplaceState inplaceState) {
InplaceComponent inplaceComponent = (InplaceComponent)component;
Modified: trunk/ui/input/ui/src/main/java/org/richfaces/renderkit/InplaceSelectRendererBase.java
===================================================================
--- trunk/ui/input/ui/src/main/java/org/richfaces/renderkit/InplaceSelectRendererBase.java 2010-12-13 13:53:13 UTC (rev 20527)
+++ trunk/ui/input/ui/src/main/java/org/richfaces/renderkit/InplaceSelectRendererBase.java 2010-12-13 14:10:29 UTC (rev 20528)
@@ -89,7 +89,7 @@
public String getSelectLabel(FacesContext facesContext, UIComponent component) {
AbstractInplaceSelect select = (AbstractInplaceSelect) component;
String label = getSelectInputLabel(facesContext, select);
- if (!isDisable(getInplaceState(component)) && (label == null)) {
+ if (!select.isDisabled() && (label == null)) {
label = select.getDefaultLabel();
}
return label;
@@ -124,4 +124,11 @@
String css = component.getNoneClass();
return concatClasses("rf-is-none", css);
}
+
+ public String getListCss(UIComponent component) {
+ AbstractInplaceSelect inplaceSelect = (AbstractInplaceSelect)component;
+ String css = inplaceSelect.getListClass();
+ css = (css != null) ? concatClasses("rf-is-lst-cord", css) : "rf-is-lst-cord";
+ return css;
+ }
}
Modified: trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceBase.js
===================================================================
--- trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceBase.js 2010-12-13 13:53:13 UTC (rev 20527)
+++ trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceBase.js 2010-12-13 14:10:29 UTC (rev 20528)
@@ -8,6 +8,7 @@
this.editEvent = mergedOptions.editEvent;
this.noneCss = mergedOptions.noneCss;
this.changedCss = mergedOptions.changedCss;
+ this.editCss = mergedOptions.editCss;
this.defaultLabel = mergedOptions.defaultLabel;
this.state = mergedOptions.state;
@@ -114,11 +115,13 @@
}
this.editState = false;
this.editContainer.addClass(this.noneCss);
+ this.element.removeClass(this.editCss);
this.onhide();
},
__editHandler: function(e) {
this.isSaved = false;
+ this.element.addClass(this.editCss);
this.editContainer.removeClass(this.noneCss);
this.__show();
},
Modified: trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceInput.js
===================================================================
--- trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceInput.js 2010-12-13 13:53:13 UTC (rev 20527)
+++ trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceInput.js 2010-12-13 14:10:29 UTC (rev 20528)
@@ -28,12 +28,9 @@
defaultLabel: "",
saveOnBlur: true,
showControl: true,
- itemCss: "rf-ii-opt",
- selectItemCss: "rf-ii-sel",
- listCss: "rf-ii-lst-cord",
noneCss: "rf-ii-none",
- //not used in inputBase?
- editCss: "rf-ii-edit",
+ readyCss: "rf-ii-d-s",
+ editCss: "rf-ii-e-s",
changedCss: "rf-ii-c-s"
};
Modified: trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceSelect.js
===================================================================
--- trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceSelect.js 2010-12-13 13:53:13 UTC (rev 20527)
+++ trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceSelect.js 2010-12-13 14:10:29 UTC (rev 20528)
@@ -101,7 +101,7 @@
processItem: function(item) {
var label = this.getItemLabel(item);
this.setValue(label);
-
+
this.__setInputFocus();
this.hidePopup();
Modified: trunk/ui/input/ui/src/main/templates/inplaceInput.template.xml
===================================================================
--- trunk/ui/input/ui/src/main/templates/inplaceInput.template.xml 2010-12-13 13:53:13 UTC (rev 20527)
+++ trunk/ui/input/ui/src/main/templates/inplaceInput.template.xml 2010-12-13 14:10:29 UTC (rev 20528)
@@ -47,7 +47,7 @@
#{inplaceValue}
</span>
- <c:if test="#{!isDisable(inplaceState)}">
+ <c:if test="#{!component.attributes['disabled']}">
<input id="#{clientId}Focus" type="image" style="position: absolute; top: 0px; left: 0px; outline-style: none;" class="rf-ii-none"/>
<span id="#{clientId}Edit" class="#{getEditStyleClass(component, inplaceState)}">
<input id="#{clientId}Input" autocomplete="off" name="#{clientId}"
@@ -83,9 +83,10 @@
</span>
<script type="text/javascript">
<cdk:scriptObject name="options">
- <cdk:scriptOption name="noneCss" value="#{concatClasses('rf-ii-none', component.attributes['noneClass'])}"/>
- <cdk:scriptOption name="changedCss" value="#{concatClasses('rf-ii-c-s', component.attributes['changedClass'])}"/>
- <cdk:scriptOption name="editCss" value="#{concatClasses('rf-ii-e-s', component.attributes['editClass'])}"/>
+ <cdk:scriptOption name="readyCss" value="#{concatClasses('rf-ii-d-s', component.attributes['readyStateClass'])}"/>
+ <cdk:scriptOption name="noneCss" value="#{concatClasses('rf-ii-none', component.attributes['noneStateClass'])}"/>
+ <cdk:scriptOption name="changedCss" value="#{concatClasses('rf-ii-c-s', component.attributes['changedStateClass'])}"/>
+ <cdk:scriptOption name="editCss" value="#{concatClasses('rf-ii-e-s', component.attributes['editStateClass'])}"/>
<cdk:scriptOption attributes="editEvent state defaultLabel saveOnBlur showControls" />
<cdk:scriptOption attributes="onbegin oncomplete onerror onbeforedomupdate onselectitem onchange onblur onfocus" wrapper="eventHandler"/>
</cdk:scriptObject>
Modified: trunk/ui/input/ui/src/main/templates/inplaceSelect.template.xml
===================================================================
--- trunk/ui/input/ui/src/main/templates/inplaceSelect.template.xml 2010-12-13 13:53:13 UTC (rev 20527)
+++ trunk/ui/input/ui/src/main/templates/inplaceSelect.template.xml 2010-12-13 14:10:29 UTC (rev 20528)
@@ -43,7 +43,7 @@
#{inplaceValue}
</span>
- <c:if test="#{!isDisable(inplaceState)}">
+ <c:if test="#{!component.attributes['disabled']}">
<input id="#{clientId}Focus" type="image" name="#{clientId}Focus" style="position: absolute; top: 0px; left: 0px; outline-style: none;" class="rf-is-none" />
<span id="#{clientId}Edit" class="#{getEditStyleClass(component, inplaceState)}">
@@ -78,7 +78,7 @@
</span>
</span>
</c:if>
- <span id="#{clientId}List" style="display: none" class="rf-is-lst-cord">
+ <span id="#{clientId}List" style="display: none" class="#{getListCss(component)}">
<cdk:call expression="renderListHandlers(facesContext, component);"/>
<span class="rf-is-lst-pos" style="width: #{component.attributes['listWidth']}">
<span class="rf-is-shdw">
@@ -100,9 +100,10 @@
<script type="text/javascript">
<cdk:scriptObject name="options">
<cdk:scriptOption name="items" value="#{clientSelectItems}" />
- <cdk:scriptOption name="noneCss" value="#{concatClasses('rf-is-none', component.attributes['noneClass'])}"/>
- <cdk:scriptOption name="changedCss" value="#{concatClasses('rf-is-c-s', component.attributes['changedClass'])}"/>
- <cdk:scriptOption name="editCss" value="#{concatClasses('rf-is-e-s', component.attributes['editClass'])}"/>
+ <cdk:scriptOption name="noneCss" value="#{concatClasses('rf-is-none', component.attributes['noneStateClass'])}"/>
+ <cdk:scriptOption name="changedCss" value="#{concatClasses('rf-is-c-s', component.attributes['changedStateClass'])}"/>
+ <cdk:scriptOption name="editCss" value="#{concatClasses('rf-is-e-s', component.attributes['editStateClass'])}"/>
+ <cdk:scriptOption name="selectItemCss" value="#{concatClasses('rf-is-sel', component.attributes['selectItemClass'])}"/>
<cdk:scriptOption attributes="editEvent state defaultLabel saveOnBlur showControls openOnEdit saveOnSelect" />
<cdk:scriptOption attributes="onbegin oncomplete onerror onbeforedomupdate onselectitem onchange onblur onfocus" wrapper="eventHandler"/>
</cdk:scriptObject>
14 years, 1 month