JBoss Rich Faces SVN: r11563 - in trunk/test-applications/jsp/src/main: webapp/WEB-INF and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: adubovsky
Date: 2008-12-04 13:02:17 -0500 (Thu, 04 Dec 2008)
New Revision: 11563
Added:
trunk/test-applications/jsp/src/main/java/tTree/TTreeDND.java
Modified:
trunk/test-applications/jsp/src/main/java/tTree/PVisability.java
trunk/test-applications/jsp/src/main/java/tTree/TTreeRNA.java
trunk/test-applications/jsp/src/main/webapp/WEB-INF/faces-config-tTree.xml
trunk/test-applications/jsp/src/main/webapp/tTree/tTree.jsp
trunk/test-applications/jsp/src/main/webapp/tTree/tTreeProperty.jsp
trunk/test-applications/jsp/src/main/webapp/tTree/tTreeStraightforward.jsp
Log:
+ to tTree
Modified: trunk/test-applications/jsp/src/main/java/tTree/PVisability.java
===================================================================
--- trunk/test-applications/jsp/src/main/java/tTree/PVisability.java 2008-12-04 17:52:59 UTC (rev 11562)
+++ trunk/test-applications/jsp/src/main/java/tTree/PVisability.java 2008-12-04 18:02:17 UTC (rev 11563)
@@ -4,13 +4,23 @@
private boolean tTreeSubviewID;
private boolean tTreePropertySubviewID;
private boolean tTreeStraightforwardSubviewID;
+ private boolean tTreeDefaultSubviewID;
public PVisability() {
- tTreeSubviewID = true;
+ tTreeSubviewID = false;
tTreePropertySubviewID = false;
tTreeStraightforwardSubviewID = false;
+ tTreeDefaultSubviewID = true;
}
+ public boolean istTreeDefaultSubviewID() {
+ return tTreeDefaultSubviewID;
+ }
+
+ public void settTreeDefaultSubviewID(boolean treeDefaultSubviewID) {
+ tTreeDefaultSubviewID = treeDefaultSubviewID;
+ }
+
public boolean istTreeSubviewID() {
return tTreeSubviewID;
}
Added: trunk/test-applications/jsp/src/main/java/tTree/TTreeDND.java
===================================================================
--- trunk/test-applications/jsp/src/main/java/tTree/TTreeDND.java (rev 0)
+++ trunk/test-applications/jsp/src/main/java/tTree/TTreeDND.java 2008-12-04 18:02:17 UTC (rev 11563)
@@ -0,0 +1,249 @@
+package tTree;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Properties;
+
+import javax.faces.FacesException;
+import javax.faces.context.ExternalContext;
+import javax.faces.context.FacesContext;
+
+import org.ajax4jsf.context.AjaxContext;
+import org.richfaces.component.UITree;
+import org.richfaces.component.UITreeNode;
+import org.richfaces.event.DragEvent;
+import org.richfaces.event.DropEvent;
+import org.richfaces.event.NodeExpandedEvent;
+import org.richfaces.event.NodeSelectedEvent;
+import org.richfaces.model.TreeNode;
+import org.richfaces.model.TreeNodeImpl;
+import org.richfaces.model.TreeRowKey;
+
+public class TTreeDND {
+ private static final String DATA_PATH = "org/richfaces/simpleTreeData.properties";
+
+ private TreeNode<String> treeNodeLeft;
+ private UITree leftTree;
+ private String leftSelectedNodeTitle;
+ private String rightSelectedNodeTitle;
+ private TreeNode<String> treeNodeRight;
+ private UITree rightTree;
+
+ private void addNodes(String path, TreeNode<String> node,
+ Properties properties) {
+ boolean end = false;
+ int counter = 1;
+ while (!end) {
+ String key = path != null ? path + '.' + counter : String
+ .valueOf(counter);
+ String value = properties.getProperty(key);
+ if (value != null) {
+ TreeNodeImpl<String> nodeImpl = new TreeNodeImpl<String>();
+ nodeImpl.setData(value);
+ node.addChild(new Integer(counter), nodeImpl);
+ addNodes(key, nodeImpl, properties);
+ counter++;
+ } else {
+ end = true;
+ }
+ }
+ }
+
+ private TreeNode<String> initPaneTree() {
+ TreeNode<String> rootNode = null;
+ FacesContext facesContext = FacesContext.getCurrentInstance();
+ ExternalContext externalContext = facesContext.getExternalContext();
+
+ InputStream dataStream = this.getClass().getClassLoader()
+ .getResourceAsStream(DATA_PATH);
+
+ try {
+ Properties properties = new Properties();
+ properties.load(dataStream);
+ rootNode = new TreeNodeImpl<String>();
+ addNodes(null, rootNode, properties);
+ } catch (IOException e) {
+
+ throw new FacesException(e.getMessage(), e);
+
+ } finally {
+ if (dataStream != null) {
+ try {
+ dataStream.close();
+ } catch (IOException e) {
+ externalContext.log(e.getMessage(), e);
+ }
+ }
+ }
+ return rootNode;
+ }
+
+ private Object getNewId(TreeNode parentNode) {
+ Map<Object, TreeNode> childs = new HashMap<Object, TreeNode>();
+ Iterator<Map.Entry<Object, TreeNode>> iter = parentNode.getChildren();
+ while (iter != null && iter.hasNext()) {
+ Map.Entry<Object, TreeNode> entry = iter.next();
+ childs.put(entry.getKey(), entry.getValue());
+ }
+
+ Integer index = 1;
+ while (childs.containsKey(index)) {
+ index++;
+ }
+ return index;
+ }
+
+ public void onDrop(DropEvent dropEvent) {
+ System.out.println("onDrop occured.");
+ System.out.println("DragValue: " + dropEvent.getDragValue());
+ System.out.println("DropValue: " + dropEvent.getDropValue());
+
+ // resolve drag source attributes
+ UITreeNode srcNode = (dropEvent.getDraggableSource() instanceof UITreeNode) ? (UITreeNode) dropEvent
+ .getDraggableSource()
+ : null;
+ UITree srcTree = srcNode != null ? srcNode.getUITree() : null;
+ TreeRowKey dragNodeKey = (dropEvent.getDragValue() instanceof TreeRowKey) ? (TreeRowKey) dropEvent
+ .getDragValue()
+ : null;
+
+ // resolve drag destination attributes
+ UITreeNode destNode = (dropEvent.getSource() instanceof UITreeNode) ? (UITreeNode) dropEvent
+ .getSource()
+ : null;
+ UITree destTree = destNode != null ? destNode.getUITree()
+ : (UITree) dropEvent.getComponent();
+ TreeRowKey dropNodeKey = (dropEvent.getDropValue() instanceof TreeRowKey) ? (TreeRowKey) dropEvent
+ .getDropValue()
+ : null;
+
+ FacesContext context = FacesContext.getCurrentInstance();
+
+ if (dropNodeKey != null) {
+ // add destination node for rerender
+ destTree.addRequestKey(dropNodeKey);
+
+ Object state = null;
+ TreeNode draggedNode = null;
+ if (dragNodeKey != null) { // Drag from this or other tree
+ draggedNode = srcTree.getModelTreeNode(dragNodeKey);
+
+ TreeNode parentNode = draggedNode.getParent();
+ // 1. remove node from tree
+ state = srcTree.removeNode(dragNodeKey);
+ // 2. add parent for rerender
+ Object rowKey = srcTree.getTreeNodeRowKey(parentNode);
+ srcTree.addRequestKey(rowKey);
+ } else if (dropEvent.getDragValue() != null) { // Drag from some
+ // drag source
+ draggedNode = new TreeNodeImpl<String>();
+ draggedNode.setData(dropEvent.getDragValue().toString());
+ }
+
+ // generate new node id
+ Object id = getNewId(destTree.getTreeNode(dropNodeKey));
+ destTree.addNode(dropNodeKey, draggedNode, id, state);
+ }
+
+ AjaxContext ac = AjaxContext.getCurrentInstance();
+ // Add destination tree to reRender
+ try {
+ ac.addComponentToAjaxRender(destTree);
+ } catch (Exception e) {
+ System.err.print(e.getMessage());
+ }
+
+ // Add source tree to reRender
+ try {
+ ac.addComponentToAjaxRender(srcTree);
+ } catch (Exception e) {
+ System.err.print(e.getMessage());
+ }
+
+ System.out.println("+++++");
+ }
+
+ public void onExpand(NodeExpandedEvent event) {
+ UITree tree = (UITree) event.getComponent();
+ System.out.println("Tree ('" + tree.getId() + "') node "
+ + (tree.isExpanded() ? "expanded" : "collapsed") + " "
+ + tree.getRowKey());
+ }
+
+ public void onDrag(DragEvent dragEvent) {
+ System.out.println("onDrag occured.");
+ System.out.println("DragValue: " + dragEvent.getDragValue());
+ System.out.println("DropValue: " + dragEvent.getDropValue());
+ }
+
+ public void processLSelection(NodeSelectedEvent event) {
+ UITree tree = (UITree) event.getComponent();
+ if (tree != null) {
+ leftSelectedNodeTitle = (String) tree.getRowData();
+ }
+ }
+
+ public void processRSelection(NodeSelectedEvent event) {
+ UITree tree = (UITree) event.getComponent();
+ if (tree != null) {
+ rightSelectedNodeTitle = (String) tree.getRowData();
+ }
+ }
+
+ public TreeNode<String> getTreeNodeLeft() {
+ if (treeNodeLeft == null) {
+ treeNodeLeft = initPaneTree();
+ }
+ return treeNodeLeft;
+ }
+
+ public void setTreeNodeLeft(TreeNode<String> treeNodeLeft) {
+ this.treeNodeLeft = treeNodeLeft;
+ }
+
+ public UITree getLeftTree() {
+ return leftTree;
+ }
+
+ public void setLeftTree(UITree leftTree) {
+ this.leftTree = leftTree;
+ }
+
+ public String getRightSelectedNodeTitle() {
+ return rightSelectedNodeTitle;
+ }
+
+ public void setRightSelectedNodeTitle(String rightSelectedNodeTitle) {
+ this.rightSelectedNodeTitle = rightSelectedNodeTitle;
+ }
+
+ public String getLeftSelectedNodeTitle() {
+ return leftSelectedNodeTitle;
+ }
+
+ public void setLeftSelectedNodeTitle(String leftSelectedNodeTitle) {
+ this.leftSelectedNodeTitle = leftSelectedNodeTitle;
+ }
+
+ public UITree getRightTree() {
+ return rightTree;
+ }
+
+ public void setRightTree(UITree rightTree) {
+ this.rightTree = rightTree;
+ }
+
+ public TreeNode<String> getTreeNodeRight() {
+ if (treeNodeRight == null) {
+ treeNodeRight = initPaneTree();
+ }
+ return treeNodeRight;
+ }
+
+ public void setTreeNodeRight(TreeNode<String> treeNodeRight) {
+ this.treeNodeRight = treeNodeRight;
+ }
+}
Modified: trunk/test-applications/jsp/src/main/java/tTree/TTreeRNA.java
===================================================================
--- trunk/test-applications/jsp/src/main/java/tTree/TTreeRNA.java 2008-12-04 17:52:59 UTC (rev 11562)
+++ trunk/test-applications/jsp/src/main/java/tTree/TTreeRNA.java 2008-12-04 18:02:17 UTC (rev 11563)
@@ -16,25 +16,26 @@
ArrayList<Package> subPackArr = new ArrayList<Package>();
treeRNAroots.clear();
- for (int i = 0; i < 3; i++) {
- dirsArr.clear();
- for (int j = 0; j < 4; j++) {
- packArr.clear();
- subDirsArr.clear();
- for (int k = 0; k < 5; k++) {
- packArr.add(new Package("package #" + i + " " + j + " " + k));
+ dirsArr.clear();
+ for (int j = 0; j < 4; j++) {
+ packArr.clear();
+ subDirsArr.clear();
+ for (int k = 0; k < 5; k++) {
+ packArr.add(new Package("package #" + j + " " + k));
+ }
+ for (int f = 0; f < 4; f++) {
+ subPackArr.clear();
+ for (int l = 0; l < 5; l++) {
+ subPackArr.add(new Package("subPackage #" + j + " " + f
+ + " " + l));
}
- for (int f = 0; f < 4; f++) {
- subPackArr.clear();
- for (int l = 0; l < 5; l++) {
- subPackArr.add(new Package("subPackage #" + i + " " + j + " "+ f + " " + l));
- }
- subDirsArr.add(new Dir("subDir #" + i + " " + j + " " + f, new ArrayList<Package>(subPackArr)));
- }
- dirsArr.add(new Dir("dir #" + i + " " + j, new ArrayList<Package>(packArr), new ArrayList<Dir>(subDirsArr)));
+ subDirsArr.add(new Dir("subDir #" + j + " " + f,
+ new ArrayList<Package>(subPackArr)));
}
+ dirsArr.add(new Dir("dir #" + j, new ArrayList<Package>(packArr),
+ new ArrayList<Dir>(subDirsArr)));
}
- treeRNAroots.addAll(dirsArr);
+ treeRNAroots.add(new Dir("*** root ***", null, dirsArr));
}
public ArrayList<Dir> getTreeRNAroots() {
Modified: trunk/test-applications/jsp/src/main/webapp/WEB-INF/faces-config-tTree.xml
===================================================================
--- trunk/test-applications/jsp/src/main/webapp/WEB-INF/faces-config-tTree.xml 2008-12-04 17:52:59 UTC (rev 11562)
+++ trunk/test-applications/jsp/src/main/webapp/WEB-INF/faces-config-tTree.xml 2008-12-04 18:02:17 UTC (rev 11563)
@@ -22,4 +22,9 @@
<managed-bean-class>tTree.TTreeRNA</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
</managed-bean>
+ <managed-bean>
+ <managed-bean-name>tTreeDND</managed-bean-name>
+ <managed-bean-class>tTree.TTreeDND</managed-bean-class>
+ <managed-bean-scope>session</managed-bean-scope>
+ </managed-bean>
</faces-config>
Modified: trunk/test-applications/jsp/src/main/webapp/tTree/tTree.jsp
===================================================================
--- trunk/test-applications/jsp/src/main/webapp/tTree/tTree.jsp 2008-12-04 17:52:59 UTC (rev 11562)
+++ trunk/test-applications/jsp/src/main/webapp/tTree/tTree.jsp 2008-12-04 18:02:17 UTC (rev 11563)
@@ -18,10 +18,15 @@
<h:selectBooleanCheckbox
value="#{pVisability.tTreeStraightforwardSubviewID}"
onchange="submit();" />
+ <h:outputText value="Tree with Drag and Drop functionality: " />
+ <h:selectBooleanCheckbox
+ value="#{pVisability.tTreeDefaultSubviewID}"
+ onchange="submit();" />
</h:panelGrid>
<rich:spacer height="10" />
-
+
<h:panelGrid columns="1" rendered="#{pVisability.tTreeSubviewID}">
+ <h:outputText value="default Tree" style="color: red"/>
<rich:tree id="dTree" switchType="#{tTree.switchType}"
value="#{tTree.data}" var="defTree" binding="#{tTree.tree}"
ajaxSubmitSelection="false" immediate="false">
@@ -45,4 +50,6 @@
</h:selectOneRadio>
</h:panelGrid>
</h:panelGrid>
+
+ <rich:spacer height="10" />
</f:subview>
Modified: trunk/test-applications/jsp/src/main/webapp/tTree/tTreeProperty.jsp
===================================================================
--- trunk/test-applications/jsp/src/main/webapp/tTree/tTreeProperty.jsp 2008-12-04 17:52:59 UTC (rev 11562)
+++ trunk/test-applications/jsp/src/main/webapp/tTree/tTreeProperty.jsp 2008-12-04 18:02:17 UTC (rev 11563)
@@ -6,6 +6,7 @@
<f:subview id="tTreePropertySubviewID"
rendered="#{pVisability.tTreePropertySubviewID}">
+ <h:outputText value="Tree with treeNodesAdaptor" style="color: red"/>
<rich:tree>
<rich:treeNodesAdaptor nodes="#{tTreeNA.treeNA}" var="project">
<rich:treeNode>
@@ -23,4 +24,5 @@
</rich:treeNodesAdaptor>
</rich:treeNodesAdaptor>
</rich:tree>
+ <rich:spacer height="10" />
</f:subview>
Modified: trunk/test-applications/jsp/src/main/webapp/tTree/tTreeStraightforward.jsp
===================================================================
--- trunk/test-applications/jsp/src/main/webapp/tTree/tTreeStraightforward.jsp 2008-12-04 17:52:59 UTC (rev 11562)
+++ trunk/test-applications/jsp/src/main/webapp/tTree/tTreeStraightforward.jsp 2008-12-04 18:02:17 UTC (rev 11563)
@@ -3,20 +3,108 @@
<%@ taglib uri="http://richfaces.org/a4j" prefix="a4j"%>
<%@ taglib uri="http://richfaces.org/rich" prefix="rich"%>
-<f:subview id="tTreeStraightforwardSubviewID"
- rendered="#{pVisability.tTreeStraightforwardSubviewID}">
+<f:subview id="tTreeStraightforwardSubviewID">
+<style type="text/css">
+.LeftTreePane {
+
+}
- <rich:tree>
- <rich:recursiveTreeNodesAdaptor var="dir" roots="#{tTreeRNA.treeRNAroots}"
- nodes="#{dir.dirs}">
- <rich:treeNode>
- <h:outputText value="#{dir.name}" />
- </rich:treeNode>
- <rich:treeNodesAdaptor nodes="#{dir.packages}" var="package">
+.RightTreePane {
+
+}
+
+.TreeContainer {
+ overflow: auto;
+ height: 400px;
+ border: 3px inset gray;
+}
+</style>
+
+ <h:panelGrid columns="1"
+ rendered="#{pVisability.tTreeStraightforwardSubviewID}">
+ <h:outputText value="Tree with recursiveTreeNodesAdaptor"
+ style="color: red" />
+ <rich:tree>
+ <rich:treeNodesAdaptor nodes="#{tTreeRNA.treeRNAroots}" var="root">
<rich:treeNode>
- <h:outputText value="#{package.name}" />
+ <h:outputText value="#{root.name}" />
</rich:treeNode>
+ <rich:recursiveTreeNodesAdaptor var="dir" roots="#{root.dirs}"
+ nodes="#{dir.dirs}">
+ <rich:treeNodesAdaptor nodes="#{dir.packages}" var="package">
+ <rich:treeNode>
+ <h:outputText value="#{package.name}" />
+ </rich:treeNode>
+ </rich:treeNodesAdaptor>
+ <rich:treeNode>
+ <h:outputText value="#{dir.name}" />
+ </rich:treeNode>
+ </rich:recursiveTreeNodesAdaptor>
</rich:treeNodesAdaptor>
- </rich:recursiveTreeNodesAdaptor>
- </rich:tree>
+ </rich:tree>
+ </h:panelGrid>
+ <rich:spacer height="10" />
+ <h:panelGrid columns="1"
+ rendered="#{pVisability.tTreeDefaultSubviewID}">
+ <h:outputText value="Tree with Drag and Drop functionality"
+ style="color: red" />
+
+ <rich:dragIndicator id="treeIndicator">
+ <f:facet name="single">
+ <f:verbatim>{marker} {nodeParam}({treeParam})</f:verbatim>
+ </f:facet>
+ </rich:dragIndicator>
+
+ <h:panelGrid columns="2" columnClasses="LeftTreePane,RightTreePane">
+
+ <h:panelGroup id="leftContainer" layout="block"
+ styleClass="TreeContainer">
+ <h:outputText escape="false"
+ value="Selected Node: <b>#{tTreeDND.leftSelectedNodeTitle}</b>"
+ id="selectedNodeL" />
+
+ <rich:tree id="leftTree" style="width:300px"
+ nodeSelectListener="#{tTreeDND.processLSelection}"
+ reRender="selectedNodeL, leftContainer" ajaxSubmitSelection="true"
+ switchType="client" value="#{tTreeDND.treeNodeLeft}"
+ changeExpandListener="#{tTreeDND.onExpand}"
+ binding="#{tTreeDND.leftTree}"
+ onselected="window.status='selectedNode: '+event.selectedNode;"
+ onexpand="window.status='expandedNode: '+event.expandedNode"
+ oncollapse="window.status='collapsedNode: '+event.collapsedNode"
+ dropListener="#{tTreeDND.onDrop}" dragListener="#{tTreeDND.onDrag}"
+ dragIndicator="treeIndicator" acceptedTypes="treeNodeR"
+ dragType="treeNodeL" rowKeyVar="key" var="item">
+
+ <rich:dndParam name="treeParam" value="leftTree" />
+ </rich:tree>
+
+ </h:panelGroup>
+
+ <h:panelGroup id="rightContainer" layout="block"
+ styleClass="TreeContainer">
+ <h:outputText escape="false"
+ value="Selected Node: <b>#{tTreeDND.rightSelectedNodeTitle}</b>"
+ id="selectedNodeR" />
+
+ <rich:tree id="rightTree" style="width:300px"
+ nodeSelectListener="#{tTreeDND.processRSelection}"
+ reRender="selectedNodeR,rightContainer" ajaxSubmitSelection="true"
+ switchType="client" value="#{tTreeDND.treeNodeRight}"
+ changeExpandListener="#{tTreeDND.onExpand}"
+ binding="#{tTreeDND.rightTree}"
+ onselected="window.status='selectedNode: '+event.selectedNode;"
+ onexpand="window.status='expandedNode: '+event.expandedNode"
+ oncollapse="window.status='collapsedNode: '+event.collapsedNode"
+ rowKeyVar="key" dropListener="#{tTreeDND.onDrop}"
+ dragListener="#{tTreeDND.onDrag}" dragIndicator="treeIndicator"
+ acceptedTypes="treeNodeL" dragType="treeNodeR" var="item">
+
+ <rich:dndParam name="treeParam" value="rightTree" />
+ </rich:tree>
+ </h:panelGroup>
+
+ </h:panelGrid>
+ </h:panelGrid>
+ <rich:spacer height="10" />
</f:subview>
\ No newline at end of file
16 years, 9 months
JBoss Rich Faces SVN: r11562 - trunk/framework/impl/src/main/resources/org/richfaces/renderkit/html/scripts.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2008-12-04 12:52:59 -0500 (Thu, 04 Dec 2008)
New Revision: 11562
Modified:
trunk/framework/impl/src/main/resources/org/richfaces/renderkit/html/scripts/utils.js
Log:
Richfaces.mergeObjects function added
Modified: trunk/framework/impl/src/main/resources/org/richfaces/renderkit/html/scripts/utils.js
===================================================================
--- trunk/framework/impl/src/main/resources/org/richfaces/renderkit/html/scripts/utils.js 2008-12-04 17:47:30 UTC (rev 11561)
+++ trunk/framework/impl/src/main/resources/org/richfaces/renderkit/html/scripts/utils.js 2008-12-04 17:52:59 UTC (rev 11562)
@@ -442,4 +442,20 @@
element.removeAttributeNode(node);
}
}
+};
+
+Richfaces.mergeObjects = function() {
+ var target = arguments[0];
+ if (target) {
+ for (var i = 1; i < arguments.length; i++) {
+ var source = arguments[i];
+ if (source) {
+ for (var name in source) {
+ if (!target[name]) {
+ target[name] = source[name];
+ }
+ }
+ }
+ }
+ }
};
\ No newline at end of file
16 years, 9 months
JBoss Rich Faces SVN: r11561 - trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces.
by richfaces-svn-commits@lists.jboss.org
Author: konstantin.mishin
Date: 2008-12-04 12:47:30 -0500 (Thu, 04 Dec 2008)
New Revision: 11561
Modified:
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/SeleniumTestBase.java
Log:
RF-5197
only for test
Modified: trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/SeleniumTestBase.java
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/SeleniumTestBase.java 2008-12-04 17:42:52 UTC (rev 11560)
+++ trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/SeleniumTestBase.java 2008-12-04 17:47:30 UTC (rev 11561)
@@ -141,6 +141,31 @@
@BeforeClass
@Parameters({"browser", "filterPrefix"})
public void startSelenium(String browser, String filterPrefix) {
+ String[] paths = {"/usr/lib/firefox-1.0.4/firefox",
+ "/usr/lib/firefox-1.5.0.10/firefox",
+ "/usr/lib/firefox-1.5.0.12/firefox",
+ "/usr/lib64/firefox-1.5.0.12/firefox",
+ "/usr/lib/firefox-3.0b5/firefox",
+ "/usr/lib64/firefox-3.0b5/firefox",
+ "/usr/lib/firefox-3.0.1/firefox",
+ "/usr/lib64/firefox-3.0.1/firefox",
+ "/usr/lib/firefox/firefox",
+ "/opt/MozillaFirefox/lib/firefox"
+ };
+ if ("*firefox".equals(browser)) {
+ for (int i = 0; i < paths.length && "*firefox".equals(browser); i++) {
+ String path = paths[i];
+ File file = new File(path);
+ if (file.isFile()) {
+ browser += " " + path;
+ } else {
+ file = new File(path + "-bin");
+ if (file.isFile()) {
+ browser += " " + path + "-bin";
+ }
+ }
+ }
+ }
synchronized (MUTEX) {
this.filterPrefix = filterPrefix;
selenium = createSeleniumClient(protocol + "://" + host + ":" + port + "/", browser);
16 years, 9 months
JBoss Rich Faces SVN: r11560 - trunk/framework/impl/src/main/java/org/ajax4jsf/javascript.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2008-12-04 12:42:52 -0500 (Thu, 04 Dec 2008)
New Revision: 11560
Modified:
trunk/framework/impl/src/main/java/org/ajax4jsf/javascript/JSMin.java
Log:
https://jira.jboss.org/jira/browse/RF-5241
Modified: trunk/framework/impl/src/main/java/org/ajax4jsf/javascript/JSMin.java
===================================================================
--- trunk/framework/impl/src/main/java/org/ajax4jsf/javascript/JSMin.java 2008-12-04 17:38:23 UTC (rev 11559)
+++ trunk/framework/impl/src/main/java/org/ajax4jsf/javascript/JSMin.java 2008-12-04 17:42:52 UTC (rev 11560)
@@ -42,9 +42,10 @@
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PushbackInputStream;
-import org.ajax4jsf.io.FastBufferOutputStream;
+
+
public class JSMin {
private static final int EOF = -1;
@@ -59,7 +60,7 @@
private int column;
public JSMin(InputStream in, OutputStream out) {
- this.in = new PushbackInputStream(in,2);
+ this.in = new PushbackInputStream(in);
this.out = out;
this.line = 0;
this.column = 0;
@@ -116,10 +117,6 @@
in.unread(lookaheadChar);
return lookaheadChar;
}
-
- void back(byte[] b) throws IOException {
- in.unread(b);
- }
/**
* next -- get the next character, excluding comments. peek() is used to see
@@ -136,6 +133,7 @@
return c;
}
}
+
case '*':
get();
for (;;) {
@@ -146,14 +144,6 @@
return ' ';
}
break;
- case '@':
- // TODO: add spaces skipping
- FastBufferOutputStream bs = new FastBufferOutputStream();
- bs.write('*');
- bs.write('@');
- back(bs.toByteArray());
- bs.close();
- return c;
case EOF:
throw new UnterminatedCommentException(line,column);
}
16 years, 9 months
JBoss Rich Faces SVN: r11559 - trunk/ui/fileUpload/src/main/resources/org/richfaces/renderkit/html/js.
by richfaces-svn-commits@lists.jboss.org
Author: alevkovsky
Date: 2008-12-04 12:38:23 -0500 (Thu, 04 Dec 2008)
New Revision: 11559
Modified:
trunk/ui/fileUpload/src/main/resources/org/richfaces/renderkit/html/js/FileUpload.js
Log:
https://jira.jboss.org/jira/browse/RF-4487
Modified: trunk/ui/fileUpload/src/main/resources/org/richfaces/renderkit/html/js/FileUpload.js
===================================================================
--- trunk/ui/fileUpload/src/main/resources/org/richfaces/renderkit/html/js/FileUpload.js 2008-12-04 17:12:26 UTC (rev 11558)
+++ trunk/ui/fileUpload/src/main/resources/org/richfaces/renderkit/html/js/FileUpload.js 2008-12-04 17:38:23 UTC (rev 11559)
@@ -1147,6 +1147,7 @@
_flashSetComponent: function() {
var flashId = this.id+":flashContainer";
this.flashComponent = (document[flashId]) ? document[flashId] : (window[flashId] ? window[flashId] : $(flashId));
+ this.flashComponent.style.display = 'none';
this.flashComponent.setProperties({
acceptedTypes: this.acceptedTypes,
noDuplicate: this.options.noDuplicate,
16 years, 9 months
JBoss Rich Faces SVN: r11558 - trunk/test-applications/seleniumTest.
by richfaces-svn-commits@lists.jboss.org
Author: konstantin.mishin
Date: 2008-12-04 12:12:26 -0500 (Thu, 04 Dec 2008)
New Revision: 11558
Modified:
trunk/test-applications/seleniumTest/pom.xml
Log:
RF-5197
only for test
Modified: trunk/test-applications/seleniumTest/pom.xml
===================================================================
--- trunk/test-applications/seleniumTest/pom.xml 2008-12-04 17:06:54 UTC (rev 11557)
+++ trunk/test-applications/seleniumTest/pom.xml 2008-12-04 17:12:26 UTC (rev 11558)
@@ -108,13 +108,13 @@
<artifactId>selenium-maven-plugin</artifactId>
<version>1.0-beta-2</version>
<executions>
- <execution>
+ <!--execution>
<id>xvfb</id>
<phase>pre-integration-test</phase>
<goals>
<goal>xvfb</goal>
</goals>
- </execution>
+ </execution-->
<execution>
<phase>pre-integration-test</phase>
16 years, 9 months
JBoss Rich Faces SVN: r11557 - in trunk/test-applications/seleniumTest: richfaces/src/test/java/org/richfaces and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: konstantin.mishin
Date: 2008-12-04 12:06:54 -0500 (Thu, 04 Dec 2008)
New Revision: 11557
Modified:
trunk/test-applications/seleniumTest/pom.xml
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/SeleniumTestBase.java
Log:
RF-5197
only for test
Modified: trunk/test-applications/seleniumTest/pom.xml
===================================================================
--- trunk/test-applications/seleniumTest/pom.xml 2008-12-04 16:54:58 UTC (rev 11556)
+++ trunk/test-applications/seleniumTest/pom.xml 2008-12-04 17:06:54 UTC (rev 11557)
@@ -15,7 +15,7 @@
<version>3.3.0-SNAPSHOT</version>
<url>http://maven.apache.org</url>
<properties>
- <http.port>8080</http.port>
+ <http.port>8085</http.port>
</properties>
<repositories>
<repository>
Modified: trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/SeleniumTestBase.java
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/SeleniumTestBase.java 2008-12-04 16:54:58 UTC (rev 11556)
+++ trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/SeleniumTestBase.java 2008-12-04 17:06:54 UTC (rev 11557)
@@ -59,7 +59,7 @@
/** Specifies the time to wait for ajax processing */
protected static final int ajaxCompletionTime = 3000;
- protected static final String serverPort = "8080";
+ protected static final String serverPort = "8085";
protected static final String WINDOW_JS_RESOLVER = "selenium.browserbot.getCurrentWindow().";
16 years, 9 months
JBoss Rich Faces SVN: r11556 - trunk/ui/message/src/main/config/component.
by richfaces-svn-commits@lists.jboss.org
Author: smukhina
Date: 2008-12-04 11:54:58 -0500 (Thu, 04 Dec 2008)
New Revision: 11556
Modified:
trunk/ui/message/src/main/config/component/message.xml
Log:
https://jira.jboss.org/jira/browse/RF-696 default values of 2 attributes area changed
Modified: trunk/ui/message/src/main/config/component/message.xml
===================================================================
--- trunk/ui/message/src/main/config/component/message.xml 2008-12-04 16:53:40 UTC (rev 11555)
+++ trunk/ui/message/src/main/config/component/message.xml 2008-12-04 16:54:58 UTC (rev 11556)
@@ -68,18 +68,18 @@
<property>
<name>showDetail</name>
<classname>boolean</classname>
- <defaultvalue>true</defaultvalue>
+ <defaultvalue>false</defaultvalue>
<description>
- Flag indicating whether the summary portion of displayed messages should be included. Default value is "true".
+ Flag indicating whether the summary portion of displayed messages should be included. Default value is "false".
</description>
</property>
<property>
<name>showSummary</name>
<classname>boolean</classname>
- <defaultvalue>false</defaultvalue>
+ <defaultvalue>true</defaultvalue>
<description>
- Flag indicating whether the summary portion of displayed messages should be included. Default value is "false".
+ Flag indicating whether the summary portion of displayed messages should be included. Default value is "true".
</description>
</property>
@@ -341,18 +341,18 @@
<property>
<name>showDetail</name>
<classname>boolean</classname>
- <defaultvalue>true</defaultvalue>
+ <defaultvalue>false</defaultvalue>
<description>
- Flag indicating whether the summary portion of displayed messages should be included. Default value is "true"
+ Flag indicating whether the summary portion of displayed messages should be included. Default value is "false"
</description>
</property>
<property>
<name>showSummary</name>
<classname>boolean</classname>
- <defaultvalue>false</defaultvalue>
+ <defaultvalue>true</defaultvalue>
<description> Flag indicating whether the summary portion of displayed
- messages should be included. Default value is "false" </description>
+ messages should be included. Default value is "true" </description>
</property>
<property>
<name>title</name>
16 years, 9 months
JBoss Rich Faces SVN: r11555 - management/design/message/funcspec.
by richfaces-svn-commits@lists.jboss.org
Author: smukhina
Date: 2008-12-04 11:53:40 -0500 (Thu, 04 Dec 2008)
New Revision: 11555
Modified:
management/design/message/funcspec/FuncSpec - RF Message Component.doc
management/design/message/funcspec/FuncSpec - RF Messages Component.doc
Log:
https://jira.jboss.org/jira/browse/RF-696 default values of 2 attributes area changed in spec
Modified: management/design/message/funcspec/FuncSpec - RF Message Component.doc
===================================================================
(Binary files differ)
Modified: management/design/message/funcspec/FuncSpec - RF Messages Component.doc
===================================================================
(Binary files differ)
16 years, 9 months
JBoss Rich Faces SVN: r11554 - in trunk/samples/orderingListDemo/src/main: webapp/WEB-INF and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2008-12-04 11:43:07 -0500 (Thu, 04 Dec 2008)
New Revision: 11554
Added:
trunk/samples/orderingListDemo/src/main/java/org/richfaces/ConvertableDemoBean.java
trunk/samples/orderingListDemo/src/main/java/org/richfaces/ConvertableDemoBeanConverter.java
Modified:
trunk/samples/orderingListDemo/src/main/java/org/richfaces/Bean.java
trunk/samples/orderingListDemo/src/main/webapp/WEB-INF/faces-config.xml
trunk/samples/orderingListDemo/src/main/webapp/pages/index.jsp
Log:
https://jira.jboss.org/jira/browse/RF-4539
Modified: trunk/samples/orderingListDemo/src/main/java/org/richfaces/Bean.java
===================================================================
--- trunk/samples/orderingListDemo/src/main/java/org/richfaces/Bean.java 2008-12-04 16:12:22 UTC (rev 11553)
+++ trunk/samples/orderingListDemo/src/main/java/org/richfaces/Bean.java 2008-12-04 16:43:07 UTC (rev 11554)
@@ -24,7 +24,6 @@
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
-import java.util.Random;
import javax.faces.component.UIComponent;
import javax.faces.component.UIOutput;
@@ -37,6 +36,9 @@
*/
public class Bean {
private List lists = new ArrayList();
+
+ private List<ConvertableDemoBean> genericLists = new ArrayList<ConvertableDemoBean>();
+
private String [] simpleItems = new String [] {
"First", "Second", "Third", "Fourth"
};
@@ -48,6 +50,10 @@
lists.add(new OrderingListDemoBean());
}
+ for (int i = 0; i < 10; i++) {
+ genericLists.add(new ConvertableDemoBean("#" + i, i));
+ }
+
for (int i = 0; i < 6; i++) {
zebraItems.add(String.valueOf(i));
}
@@ -61,6 +67,14 @@
this.lists = lists;
}
+ public List<ConvertableDemoBean> getGenericList() {
+ return this.genericLists;
+ }
+
+ public void setGenericList(List<ConvertableDemoBean> list) {
+ this.genericLists = list;
+ }
+
public String[] getSimpleItems() {
return simpleItems;
}
Added: trunk/samples/orderingListDemo/src/main/java/org/richfaces/ConvertableDemoBean.java
===================================================================
--- trunk/samples/orderingListDemo/src/main/java/org/richfaces/ConvertableDemoBean.java (rev 0)
+++ trunk/samples/orderingListDemo/src/main/java/org/richfaces/ConvertableDemoBean.java 2008-12-04 16:43:07 UTC (rev 11554)
@@ -0,0 +1,96 @@
+/**
+ * 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;
+
+import java.io.Serializable;
+
+/**
+ * @author Nick Belaevski
+ * @since 3.3.0
+ */
+public class ConvertableDemoBean implements Serializable {
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = 6202523836189784862L;
+
+ private String name;
+
+ private int value;
+
+ /**
+ * @return the name
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * @return the value
+ */
+ public int getValue() {
+ return value;
+ }
+
+ /* (non-Javadoc)
+ * @see java.lang.Object#hashCode()
+ */
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((name == null) ? 0 : name.hashCode());
+ result = prime * result + value;
+ return result;
+ }
+
+ /* (non-Javadoc)
+ * @see java.lang.Object#equals(java.lang.Object)
+ */
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (getClass() != obj.getClass())
+ return false;
+ ConvertableDemoBean other = (ConvertableDemoBean) obj;
+ if (name == null) {
+ if (other.name != null)
+ return false;
+ } else if (!name.equals(other.name))
+ return false;
+ if (value != other.value)
+ return false;
+ return true;
+ }
+
+ public ConvertableDemoBean(String name, int value) {
+ super();
+ this.name = name;
+ this.value = value;
+ }
+
+}
Added: trunk/samples/orderingListDemo/src/main/java/org/richfaces/ConvertableDemoBeanConverter.java
===================================================================
--- trunk/samples/orderingListDemo/src/main/java/org/richfaces/ConvertableDemoBeanConverter.java (rev 0)
+++ trunk/samples/orderingListDemo/src/main/java/org/richfaces/ConvertableDemoBeanConverter.java 2008-12-04 16:43:07 UTC (rev 11554)
@@ -0,0 +1,58 @@
+/**
+ * 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;
+
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+import javax.faces.convert.Converter;
+
+/**
+ * @author Nick Belaevski
+ * @since 3.3.0
+ */
+public class ConvertableDemoBeanConverter implements Converter {
+
+ public Object getAsObject(FacesContext context, UIComponent component,
+ String value) {
+
+ if (value == null || value.length() == 0) {
+ return null;
+ }
+
+ String[] split = value.split(":");
+
+ return new ConvertableDemoBean(split[0], Integer.valueOf(split[1]));
+ }
+
+ public String getAsString(FacesContext context, UIComponent component,
+ Object value) {
+
+ if (value == null) {
+ return "";
+ }
+
+ ConvertableDemoBean convertableDemoBean = (ConvertableDemoBean) value;
+ return convertableDemoBean.getName() + ":" + convertableDemoBean.getValue();
+ }
+
+}
Modified: trunk/samples/orderingListDemo/src/main/webapp/WEB-INF/faces-config.xml
===================================================================
--- trunk/samples/orderingListDemo/src/main/webapp/WEB-INF/faces-config.xml 2008-12-04 16:12:22 UTC (rev 11553)
+++ trunk/samples/orderingListDemo/src/main/webapp/WEB-INF/faces-config.xml 2008-12-04 16:43:07 UTC (rev 11554)
@@ -26,5 +26,10 @@
<managed-bean-name>converter</managed-bean-name>
<managed-bean-class>org.richfaces.OptionItemConverter</managed-bean-class>
<managed-bean-scope>application</managed-bean-scope>
- </managed-bean>
+ </managed-bean>
+
+ <converter>
+ <converter-for-class>org.richfaces.ConvertableDemoBean</converter-for-class>
+ <converter-class>org.richfaces.ConvertableDemoBeanConverter</converter-class>
+ </converter>
</faces-config>
Modified: trunk/samples/orderingListDemo/src/main/webapp/pages/index.jsp
===================================================================
--- trunk/samples/orderingListDemo/src/main/webapp/pages/index.jsp 2008-12-04 16:12:22 UTC (rev 11553)
+++ trunk/samples/orderingListDemo/src/main/webapp/pages/index.jsp 2008-12-04 16:43:07 UTC (rev 11554)
@@ -227,6 +227,13 @@
</h:column>
</ol:orderingList>
</h:panelGroup>
+
+ <h:panelGroup>
+ <ol:orderingList value="#{bean.genericList}" var="var">
+ <h:column><h:outputText value="#{var.name}" /></h:column>
+ <h:column><h:outputText value="#{var.value}" /></h:column>
+ </ol:orderingList>
+ </h:panelGroup>
</h:panelGrid>
<a4j:commandButton value="Ajax Submit" reRender="orderingList1" />
<h:commandButton value="Add item" action="#{demoBean.addItem}" />
16 years, 9 months