JBoss Rich Faces SVN: r4127 - branches/3.1.x/ui/orderingList/src/main/java/org/richfaces/component.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2007-11-20 22:49:37 -0500 (Tue, 20 Nov 2007)
New Revision: 4127
Modified:
branches/3.1.x/ui/orderingList/src/main/java/org/richfaces/component/UIOrderingBaseComponent.java
branches/3.1.x/ui/orderingList/src/main/java/org/richfaces/component/UIOrderingList.java
Log:
orderingList refactored
Modified: branches/3.1.x/ui/orderingList/src/main/java/org/richfaces/component/UIOrderingBaseComponent.java
===================================================================
--- branches/3.1.x/ui/orderingList/src/main/java/org/richfaces/component/UIOrderingBaseComponent.java 2007-11-21 03:49:02 UTC (rev 4126)
+++ branches/3.1.x/ui/orderingList/src/main/java/org/richfaces/component/UIOrderingBaseComponent.java 2007-11-21 03:49:37 UTC (rev 4127)
@@ -4,6 +4,7 @@
package org.richfaces.component;
import java.util.ArrayList;
+import java.util.Collections;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
@@ -14,6 +15,9 @@
import javax.faces.context.FacesContext;
import javax.faces.el.MethodBinding;
import javax.faces.el.ValueBinding;
+import javax.faces.model.ArrayDataModel;
+import javax.faces.model.DataModel;
+import javax.faces.model.ListDataModel;
import javax.faces.validator.Validator;
import org.ajax4jsf.component.UIDataAdaptor;
@@ -236,4 +240,19 @@
this.localValueSet = localValueSet;
}
+ protected DataModel createDataModel(Object value) {
+ DataModel dataModel;
+
+ if (value == null) {
+ dataModel = new ListDataModel(Collections.EMPTY_LIST);
+ } else if (value instanceof List) {
+ dataModel = new ListDataModel((List) value);
+ } else if (Object[].class.isAssignableFrom(value.getClass())) {
+ dataModel = new ArrayDataModel((Object[]) value);
+ } else {
+ throw new IllegalArgumentException();
+ }
+
+ return dataModel;
+ }
}
Modified: branches/3.1.x/ui/orderingList/src/main/java/org/richfaces/component/UIOrderingList.java
===================================================================
--- branches/3.1.x/ui/orderingList/src/main/java/org/richfaces/component/UIOrderingList.java 2007-11-21 03:49:02 UTC (rev 4126)
+++ branches/3.1.x/ui/orderingList/src/main/java/org/richfaces/component/UIOrderingList.java 2007-11-21 03:49:37 UTC (rev 4127)
@@ -41,7 +41,7 @@
public abstract class UIOrderingList extends UIOrderingBaseComponent {
- public static final class ValueHolder {
+ protected static final class ValueHolder {
private Collection selection;
private boolean selectionSet;
@@ -49,7 +49,7 @@
private boolean activeItemSet;
}
- public static final class SubmittedValue {
+ protected static final class SubmittedValue {
private int[] permutationOrder;
private Set selectedItems = new HashSet();
private Integer activeItem;
@@ -138,11 +138,11 @@
}
}
- private final class CommonItemState implements ItemState {
+ private final class ModelItemState implements ItemState {
private Collection selectedItems;
private Object activeItem;
- public CommonItemState(Collection selectedItems, Object activeItem) {
+ public ModelItemState(Collection selectedItems, Object activeItem) {
super();
this.selectedItems = selectedItems;
this.activeItem = activeItem;
@@ -158,17 +158,7 @@
}
protected ExtendedDataModel createDataModel() {
- DataModel dataModel;
- Object current = getValue();
- if (current == null) {
- dataModel = new ListDataModel(Collections.EMPTY_LIST);
- } else if (current instanceof List) {
- dataModel = new ListDataModel((List) current);
- } else if (Object[].class.isAssignableFrom(current.getClass())) {
- dataModel = new ArrayDataModel((Object[]) current);
- } else {
- throw new IllegalArgumentException();
- }
+ DataModel dataModel = createDataModel(getValue());
if (isTranslatedRenderingState() || isTranslatedState()) {
return new TranslatedSequenceDataModel(dataModel, isTranslatedState(), submittedValueHolder != null ? submittedValueHolder.permutationOrder : null);
@@ -954,7 +944,7 @@
if (submittedValueHolder != null) {
return new SubmittedItemState(submittedValueHolder.selectedItems, submittedValueHolder.activeItem);
} else {
- return new CommonItemState(getSelection(), getActiveItem());
+ return new ModelItemState(getSelection(), getActiveItem());
}
}
18 years, 5 months
JBoss Rich Faces SVN: r4126 - branches/3.1.x/ui/dataTable/src/main/java/org/richfaces/renderkit.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2007-11-20 22:49:02 -0500 (Tue, 20 Nov 2007)
New Revision: 4126
Modified:
branches/3.1.x/ui/dataTable/src/main/java/org/richfaces/renderkit/AbstractRowsRenderer.java
Log:
AbstractRowsRenderer refactored to use custom TableHolder classes
Modified: branches/3.1.x/ui/dataTable/src/main/java/org/richfaces/renderkit/AbstractRowsRenderer.java
===================================================================
--- branches/3.1.x/ui/dataTable/src/main/java/org/richfaces/renderkit/AbstractRowsRenderer.java 2007-11-21 01:16:33 UTC (rev 4125)
+++ branches/3.1.x/ui/dataTable/src/main/java/org/richfaces/renderkit/AbstractRowsRenderer.java 2007-11-21 03:49:02 UTC (rev 4126)
@@ -88,6 +88,10 @@
holder.nextRow();
}
+ public void encodeRows(FacesContext context, UIComponent component) throws IOException {
+ encodeRows(context, component, new TableHolder((UIDataAdaptor) component));
+ }
+
/**
* Iterate over all rows for this table.
*
@@ -95,12 +99,11 @@
* @param component
* @throws IOException
*/
- public void encodeRows(FacesContext context, UIComponent component)
+ protected void encodeRows(FacesContext context, UIComponent component, TableHolder tableHolder)
throws IOException {
UIDataAdaptor table = (UIDataAdaptor) component;
Object key = table.getRowKey();
table.captureOrigValue(context);
- TableHolder tableHolder = new TableHolder(table);
table.walk(context, this, tableHolder);
doCleanup(context, tableHolder);
table.setRowKey(key);
18 years, 5 months
JBoss Rich Faces SVN: r4125 - in trunk: extensions/portlet/src/test/java/javax/portlet/faces and 4 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: alexsmirnov
Date: 2007-11-20 20:16:33 -0500 (Tue, 20 Nov 2007)
New Revision: 4125
Added:
trunk/extensions/portlet/src/test/resources/META-INF/
trunk/extensions/portlet/src/test/resources/META-INF/services/
trunk/extensions/portlet/src/test/resources/META-INF/services/javax.faces.context.FacesContextFactory
Modified:
trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/context/ContextMap.java
trunk/extensions/portlet/src/test/java/javax/portlet/faces/GenericPortletTest.java
trunk/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/WEB-INF/pages.xml
Log:
Continue to implement JSR-301 bridge. Finish requrements from PLT 6.
Create Seam portlet example, based on the Seam booking store.
Modified: trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/context/ContextMap.java
===================================================================
--- trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/context/ContextMap.java 2007-11-21 00:20:57 UTC (rev 4124)
+++ trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/context/ContextMap.java 2007-11-21 01:16:33 UTC (rev 4125)
@@ -44,139 +44,142 @@
*
*/
abstract class ContextMap extends AbstractMap {
- private transient volatile Set keySet;
+ private transient volatile Set keySet;
- /*
- *
- * (non-Javadoc)
- *
- *
- *
- * @see java.util.Map#entrySet()
- *
- */
- public Set entrySet() {
- Set entries = new HashSet();
- for (Enumeration e = getEnumeration(); e.hasMoreElements();) {
- String paramName = (String) e.nextElement();
- if (isValidParameter(paramName)) {
- entries.add(new Entry(paramName, get(paramName)));
- }
+ /*
+ *
+ * (non-Javadoc)
+ *
+ *
+ *
+ * @see java.util.Map#entrySet()
+ *
+ */
+ public Set entrySet() {
+ Set entries = new HashSet();
+ for (Enumeration e = getEnumeration(); e.hasMoreElements();) {
+ String paramName = (String) e.nextElement();
+ if (isValidParameter(paramName)) {
+ entries.add(new Entry(paramName, get(paramName)));
+ }
+ }
+ return entries;
}
- return entries;
- }
- protected boolean isValidParameter(String paramName) {
- return true;
- }
+ protected boolean isValidParameter(String paramName) {
+ return true;
+ }
- public Set keySet() {
- if (this.keySet == null) {
- this.keySet = new AbstractSet() {
- public Iterator iterator() {
- return new EnumerationIterator(getEnumeration());
- }
+ public Set keySet() {
+ if (this.keySet == null) {
+ this.keySet = new AbstractSet() {
+ public Iterator iterator() {
+ return new EnumerationIterator(getEnumeration());
+ }
- public int size() {
- Enumeration enumeration = getEnumeration();
- int size = 0;
- while (enumeration.hasMoreElements()) {
- size++;
- }
- ;
- return size;
+ public int size() {
+ Enumeration enumeration = getEnumeration();
+ int size = 0;
+ while (enumeration.hasMoreElements()) {
+ enumeration.nextElement();
+ size++;
+ }
+ ;
+ return size;
+ }
+ };
}
- };
+ return this.keySet;
}
- return this.keySet;
- }
- public Collection values() {
- return super.values();
- }
+ public Collection values() {
+ return super.values();
+ }
- /**
- *
- *
- *
- * Template metod - all maps in ExternalFacesContext creates Set from
- *
- * parameters <code>Enumeration</code>
- *
- *
- *
- * @return enumeration for current map.
- *
- */
- protected abstract Enumeration getEnumeration();
+ /**
+ *
+ *
+ *
+ * Template metod - all maps in ExternalFacesContext creates Set from
+ *
+ * parameters <code>Enumeration</code>
+ *
+ *
+ *
+ * @return enumeration for current map.
+ *
+ */
+ protected abstract Enumeration getEnumeration();
- // Unsupported by all Maps.
- public void clear() {
- throw new UnsupportedOperationException();
- }
+ // Unsupported by all Maps.
+ public void clear() {
+ throw new UnsupportedOperationException();
+ }
-// public void putAll(Map t) {
-// for (Iterator entries = t.entrySet().iterator(); entries.hasNext();) {
-// Map.Entry entry = (Entry) entries.next();
-// put(entry.getKey(),entry.getValue());
-// }
-// }
+ // public void putAll(Map t) {
+ // for (Iterator entries = t.entrySet().iterator(); entries.hasNext();) {
+ // Map.Entry entry = (Entry) entries.next();
+ // put(entry.getKey(),entry.getValue());
+ // }
+ // }
- // Supported by maps if overridden
- public Object remove(Object key) {
- throw new UnsupportedOperationException();
- }
+ // Supported by maps if overridden
+ public Object remove(Object key) {
+ throw new UnsupportedOperationException();
+ }
- static class Entry implements Map.Entry {
- // immutable Entry
- private final Object key;
+ static class Entry implements Map.Entry {
+ // immutable Entry
+ private final Object key;
- private final Object value;
+ private final Object value;
- Entry(Object key, Object value) {
- this.key = key;
- this.value = value;
- }
+ Entry(Object key, Object value) {
+ this.key = key;
+ this.value = value;
+ }
- public Object getKey() {
- return this.key;
- }
+ public Object getKey() {
+ return this.key;
+ }
- public Object getValue() {
- return this.value;
- }
+ public Object getValue() {
+ return this.value;
+ }
- // No support of setting the value
- public Object setValue(Object value) {
- throw new UnsupportedOperationException();
- }
+ // No support of setting the value
+ public Object setValue(Object value) {
+ throw new UnsupportedOperationException();
+ }
- public int hashCode() {
- return ((this.key == null ? 0 : this.key.hashCode()) ^ (this.value == null ? 0
- : this.value.hashCode()));
+ public int hashCode() {
+ return ((this.key == null ? 0 : this.key.hashCode()) ^ (this.value == null ? 0
+ : this.value.hashCode()));
+ }
+
+ public boolean equals(Object obj) {
+ if ((obj == null) || !(obj instanceof Map.Entry)) {
+ return false;
+ }
+ Map.Entry input = (Map.Entry) obj;
+ Object inputKey = input.getKey();
+ Object inputValue = input.getValue();
+ if ((inputKey == this.key)
+ || ((inputKey != null) && inputKey.equals(this.key))) {
+ if ((inputValue == this.value)
+ || ((inputValue != null) && inputValue
+ .equals(this.value))) {
+ return true;
+ }
+ }
+ return false;
+ }
}
public boolean equals(Object obj) {
- if ((obj == null) || !(obj instanceof Map.Entry)) {
- return false;
- }
- Map.Entry input = (Map.Entry) obj;
- Object inputKey = input.getKey();
- Object inputValue = input.getValue();
- if ((inputKey == this.key) || ((inputKey != null) && inputKey.equals(this.key))) {
- if ((inputValue == this.value)
- || ((inputValue != null) && inputValue.equals(this.value))) {
- return true;
+ if ((obj == null) || !(obj instanceof ContextMap)) {
+ return false;
}
- }
- return false;
+ return super.equals(obj);
}
- }
-
- public boolean equals(Object obj) {
- if ((obj == null) || !(obj instanceof ContextMap)) {
- return false;
- }
- return super.equals(obj);
- }
}
\ No newline at end of file
Modified: trunk/extensions/portlet/src/test/java/javax/portlet/faces/GenericPortletTest.java
===================================================================
--- trunk/extensions/portlet/src/test/java/javax/portlet/faces/GenericPortletTest.java 2007-11-21 00:20:57 UTC (rev 4124)
+++ trunk/extensions/portlet/src/test/java/javax/portlet/faces/GenericPortletTest.java 2007-11-21 01:16:33 UTC (rev 4125)
@@ -115,7 +115,7 @@
portletConfig.setPortletName("foo");
GenericFacesPortlet portlet = new GenericFacesPortlet();
portlet.init(portletConfig);
- assertEquals(AjaxFacesPortlet.class.getName(), portlet
+ assertEquals(AjaxPortletBridge.class.getName(), portlet
.getBrigeClassName());
assertEquals(Boolean.TRUE, portletContext
.getAttribute("javax.portlet.faces.foo.preserveActionParams"));
Added: trunk/extensions/portlet/src/test/resources/META-INF/services/javax.faces.context.FacesContextFactory
===================================================================
--- trunk/extensions/portlet/src/test/resources/META-INF/services/javax.faces.context.FacesContextFactory (rev 0)
+++ trunk/extensions/portlet/src/test/resources/META-INF/services/javax.faces.context.FacesContextFactory 2007-11-21 01:16:33 UTC (rev 4125)
@@ -0,0 +1 @@
+org.apache.shale.test.mock.MockFacesContextFactory
Modified: trunk/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/WEB-INF/pages.xml
===================================================================
--- trunk/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/WEB-INF/pages.xml 2007-11-21 00:20:57 UTC (rev 4124)
+++ trunk/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/WEB-INF/pages.xml 2007-11-21 01:16:33 UTC (rev 4125)
@@ -13,7 +13,7 @@
<navigation>
<rule if="#{register.registered}">
- <redirect view-id="/home.xhtml"/>
+ <render view-id="/home.xhtml"/>
</rule>
</navigation>
@@ -23,7 +23,7 @@
<navigation>
<rule if="#{identity.loggedIn}">
- <redirect view-id="/main.xhtml"/>
+ <render view-id="/main.xhtml"/>
</rule>
</navigation>
@@ -34,7 +34,7 @@
<navigation>
<rule if="#{changePassword.changed}">
- <redirect view-id="/main.xhtml"/>
+ <render view-id="/main.xhtml"/>
</rule>
</navigation>
@@ -44,11 +44,11 @@
login-required="true">
<navigation from-action="#{hotelBooking.selectHotel(hot)}">
- <redirect view-id="/hotel.xhtml"/>
+ <render view-id="/hotel.xhtml"/>
</navigation>
<navigation from-action="#{bookingList.cancel}">
- <redirect/>
+ <render/>
</navigation>
</page>
@@ -60,7 +60,7 @@
<description>View hotel: #{hotel.name}</description>
<navigation from-action="#{hotelBooking.bookHotel}">
- <redirect view-id="/book.xhtml"/>
+ <render view-id="/book.xhtml"/>
</navigation>
</page>
@@ -73,7 +73,7 @@
<navigation from-action="#{hotelBooking.setBookingDetails}">
<rule if="#{hotelBooking.bookingValid}">
- <redirect view-id="/confirm.xhtml"/>
+ <render view-id="/confirm.xhtml"/>
</rule>
</navigation>
@@ -86,7 +86,7 @@
<description>Confirm booking: #{booking.description}</description>
<navigation from-action="#{hotelBooking.confirm}">
- <redirect view-id="/main.xhtml"/>
+ <render view-id="/main.xhtml"/>
</navigation>
</page>
@@ -94,11 +94,11 @@
<page view-id="*">
<navigation from-action="#{identity.logout}">
- <redirect view-id="/home.xhtml"/>
+ <render view-id="/home.xhtml"/>
</navigation>
<navigation from-action="#{hotelBooking.cancel}">
- <redirect view-id="/main.xhtml"/>
+ <render view-id="/main.xhtml"/>
</navigation>
</page>
18 years, 5 months
JBoss Rich Faces SVN: r4124 - trunk/sandbox/samples/rex-demo/src/main/webapp.
by richfaces-svn-commits@lists.jboss.org
Author: SergeySmirnov
Date: 2007-11-20 19:20:57 -0500 (Tue, 20 Nov 2007)
New Revision: 4124
Modified:
trunk/sandbox/samples/rex-demo/src/main/webapp/welcome.xhtml
Log:
Modified: trunk/sandbox/samples/rex-demo/src/main/webapp/welcome.xhtml
===================================================================
--- trunk/sandbox/samples/rex-demo/src/main/webapp/welcome.xhtml 2007-11-21 00:20:21 UTC (rev 4123)
+++ trunk/sandbox/samples/rex-demo/src/main/webapp/welcome.xhtml 2007-11-21 00:20:57 UTC (rev 4124)
@@ -38,20 +38,7 @@
production unless the legal issues with <a href="http://extjs.com/license">Ext JS license</a>
is resolved.
</p>
- <button onclick="resizePic(500,427)">100% of Size</button>
- <button onclick="resizePic(250,212)">50% of Size</button>
- <script>
- function resizePic(w,h) {
- window.pic.resizeTo(w,h);
- }
- </script>
- <rexr:resizable wrap="true" name="window.pic" easing="easingInStrong"
- pinned="false" handles="s se e" preserveRatio = "true" transparent="true"
- minWidth="50" width="204" height="176" styleClass="res">
- <h:graphicImage id="gm2" width="204" height="176" value="/images/bfly.jpg" />
- </rexr:resizable>
-
</ui:define>
</ui:composition>
18 years, 5 months
JBoss Rich Faces SVN: r4123 - trunk/sandbox/samples/rex-demo/src/main/webapp/templates.
by richfaces-svn-commits@lists.jboss.org
Author: SergeySmirnov
Date: 2007-11-20 19:20:21 -0500 (Tue, 20 Nov 2007)
New Revision: 4123
Added:
trunk/sandbox/samples/rex-demo/src/main/webapp/templates/main.xhtml
Log:
Added: trunk/sandbox/samples/rex-demo/src/main/webapp/templates/main.xhtml
===================================================================
--- trunk/sandbox/samples/rex-demo/src/main/webapp/templates/main.xhtml (rev 0)
+++ trunk/sandbox/samples/rex-demo/src/main/webapp/templates/main.xhtml 2007-11-21 00:20:21 UTC (rev 4123)
@@ -0,0 +1,125 @@
+<!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:ui="http://java.sun.com/jsf/facelets"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:rex="http://labs.jboss.com/jbossrichfaces/ui/ui/rex-button"
+ xmlns:a4j="http://richfaces.org/a4j"
+ xmlns:rich="http://richfaces.org/rich">
+
+<head>
+ <style>
+ .displaynone {
+ display:none;
+ }
+ </style>
+ <link rel="STYLESHEET" type="text/css" href="${facesContext.externalContext.requestContextPath}/css/common.css"/>
+ <ui:include src="/templates/include/dynamic-css.xhtml" />
+ <script type="text/javascript">
+ Ext.onReady(function(){
+
+ Ext.state.Manager.setProvider(new Ext.state.CookieProvider());
+
+ var viewport = new Ext.Viewport({
+ layout:'border',
+ items:[
+ new Ext.BoxComponent({ // raw
+ region:'north',
+ el: 'north',
+ split:false,
+ height:55
+ })
+ /*{ region:'north',
+ contentEl: 'north',
+ height: 35,
+ minSize: 100,
+ maxSize: 200,
+ margins:'0 0 3 0'
+ }*/
+ ,
+ /*{
+ region:'south',
+ contentEl: 'south',
+ split:true,
+ height: 100,
+ minSize: 100,
+ maxSize: 200,
+ collapsible: true,
+ title:'South',
+ margins:'0 0 0 0'
+ },*/
+ /*{
+ region:'east',
+ id:'east-panel',
+ title:'East',
+ split:true,
+ contentEl: 'east',
+ width: 200,
+ minSize: 175,
+ maxSize: 400,
+ collapsible: true,
+ margins:'0 0 0 0',
+
+ }, */
+
+ {
+ region:'west',
+ id:'west-panel',
+ title:'Navigator',
+ split:true,
+ contentEl: 'west',
+ width: 200,
+ minSize: 175,
+ maxSize: 400,
+ collapsible: true,
+ margins:'0 0 0 0'
+
+ },
+ {
+ region:'center',
+ contentEl:'center2',
+ layout:'fit',
+ _title: 'Center Panel',
+ autoScroll:true
+ }
+
+ ]
+ });
+ });
+ Ext.onReady(function(){
+ Ext.get('west').removeClass("displaynone");
+ Ext.get('north-body').removeClass("displaynone");
+ Ext.get('center2').removeClass("displaynone");
+ });
+ </script>
+
+</head>
+<body>
+<f:view contentType="text/html">
+
+
+
+
+
+ <div id="west" class="displaynone">
+ <ui:include src="/templates/include/components-navigation.xhtml" />
+ </div>
+ <div id="north">
+ <div id="north-body" class="displaynone">
+ <ui:include src="/templates/include/header.xhtml" />
+ </div>
+ </div>
+ <div id="center2" class="displaynone">
+ <div style="padding:10px;">
+ <ui:insert name="body">Body</ui:insert>
+ <div style="display:none" >
+ <rex:button id="mb4" value="Just forcing the loading of ext css and js for time being" />
+ </div>
+ </div>
+ </div>
+
+</f:view>
+</body>
+
+
+</html>
18 years, 5 months
JBoss Rich Faces SVN: r4122 - in trunk/sandbox: samples/contextMenuDemo and 13 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: SergeySmirnov
Date: 2007-11-20 18:40:43 -0500 (Tue, 20 Nov 2007)
New Revision: 4122
Added:
trunk/sandbox/samples/contextMenuDemo/
trunk/sandbox/samples/listShuttleDemo/
trunk/sandbox/samples/orderingListDemo/
trunk/sandbox/samples/rex-demo/src/main/webapp/WEB-INF/faces-config.xml.l4t
trunk/sandbox/samples/rex-demo/src/main/webapp/images/bfly.jpg
trunk/sandbox/samples/rex-demo/src/main/webapp/richfaces/resizable/examples/pictures.xhtml
trunk/sandbox/samples/rex-demo/src/main/webapp/richfaces/resizable/examples/richpanel.xhtml
trunk/sandbox/samples/rex-demo/src/main/webapp/templates/main_old.xhtml
Removed:
trunk/sandbox/samples/rex-demo/src/main/webapp/templates/main.xhtml
Modified:
trunk/sandbox/samples/rex-demo/src/main/webapp/WEB-INF/faces-config.xml
trunk/sandbox/samples/rex-demo/src/main/webapp/css/common.css
trunk/sandbox/samples/rex-demo/src/main/webapp/images/tabpanel_custom/tabpanel_bg.jpg
trunk/sandbox/samples/rex-demo/src/main/webapp/richfaces/resizable/examples/simple.xhtml
trunk/sandbox/samples/rex-demo/src/main/webapp/richfaces/resizable/usage.xhtml
trunk/sandbox/samples/rex-demo/src/main/webapp/templates/include/dynamic-css.xhtml
trunk/sandbox/samples/rex-demo/src/main/webapp/welcome.xhtml
trunk/sandbox/ui/rex-resizable/src/main/config/component/resizable.xml
trunk/sandbox/ui/rex-resizable/src/main/templates/resizable.jspx
Log:
rex demo + ext js
Property changes on: trunk/sandbox/samples/contextMenuDemo
___________________________________________________________________
Name: svn:ignore
+ target
Property changes on: trunk/sandbox/samples/listShuttleDemo
___________________________________________________________________
Name: svn:ignore
+ .classpath
.project
.settings
target
Property changes on: trunk/sandbox/samples/orderingListDemo
___________________________________________________________________
Name: svn:ignore
+ .classpath
.project
.settings
target
Modified: trunk/sandbox/samples/rex-demo/src/main/webapp/WEB-INF/faces-config.xml
===================================================================
--- trunk/sandbox/samples/rex-demo/src/main/webapp/WEB-INF/faces-config.xml 2007-11-20 23:08:20 UTC (rev 4121)
+++ trunk/sandbox/samples/rex-demo/src/main/webapp/WEB-INF/faces-config.xml 2007-11-20 23:40:43 UTC (rev 4122)
@@ -285,6 +285,5 @@
</navigation-case>
</navigation-rule>
<lifecycle>
- <phase-listener>org.richfaces.treemodeladaptor.PostbackPhaseListener</phase-listener>
</lifecycle>
</faces-config>
Added: trunk/sandbox/samples/rex-demo/src/main/webapp/WEB-INF/faces-config.xml.l4t
===================================================================
--- trunk/sandbox/samples/rex-demo/src/main/webapp/WEB-INF/faces-config.xml.l4t (rev 0)
+++ trunk/sandbox/samples/rex-demo/src/main/webapp/WEB-INF/faces-config.xml.l4t 2007-11-20 23:40:43 UTC (rev 4122)
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<PROCESS ENTITY="JSFProcess">
+ <PROCESS-ITEM ENTITY="JSFProcessGroup"
+ NAME="rules:#richfaces#include#examples#wstep1.xhtml"
+ PATH="/richfaces/include/examples/wstep1.xhtml" SHAPE="32,17,0,0">
+ <PROCESS-ITEM ENTITY="JSFProcessItem"
+ ID="rules:#richfaces#include#examples#wstep1.xhtml:0" NAME="item" PATH="/richfaces/include/examples/wstep1.xhtml">
+ <PROCESS-ITEM-OUTPUT ENTITY="JSFProcessItemOutput"
+ ID="next::#richfaces#include#examples#wstep2.xhtml" NAME="output"
+ PATH="/richfaces/include/examples/wstep2.xhtml"
+ TARGET="rules:#richfaces#include#examples#wstep2.xhtml" TITLE="next"/>
+ </PROCESS-ITEM>
+ </PROCESS-ITEM>
+ <PROCESS-ITEM ENTITY="JSFProcessGroup"
+ NAME="rules:#richfaces#include#examples#wstep2.xhtml"
+ PATH="/richfaces/include/examples/wstep2.xhtml" SHAPE="256,33,0,0">
+ <PROCESS-ITEM ENTITY="JSFProcessItem"
+ ID="rules:#richfaces#include#examples#wstep2.xhtml:0" NAME="item" PATH="/richfaces/include/examples/wstep2.xhtml">
+ <PROCESS-ITEM-OUTPUT ENTITY="JSFProcessItemOutput"
+ ID="previous::#richfaces#include#examples#wstep1.xhtml"
+ NAME="output" PATH="/richfaces/include/examples/wstep1.xhtml"
+ TARGET="rules:#richfaces#include#examples#wstep1.xhtml" TITLE="previous"/>
+ <PROCESS-ITEM-OUTPUT ENTITY="JSFProcessItemOutput"
+ ID="next::#richfaces#include#examples#finalStep.xhtml"
+ NAME="output1" PATH="/richfaces/include/examples/finalStep.xhtml"
+ TARGET="rules:#richfaces#include#examples#finalStep.xhtml" TITLE="next"/>
+ </PROCESS-ITEM>
+ </PROCESS-ITEM>
+ <PROCESS-ITEM ENTITY="JSFProcessGroup"
+ NAME="rules:#richfaces#include#examples#finalStep.xhtml"
+ PATH="/richfaces/include/examples/finalStep.xhtml" SHAPE="480,17,0,0">
+ <PROCESS-ITEM ENTITY="JSFProcessItem"
+ ID="rules:#richfaces#include#examples#finalStep.xhtml:0" NAME="item" PATH="/richfaces/include/examples/finalStep.xhtml">
+ <PROCESS-ITEM-OUTPUT ENTITY="JSFProcessItemOutput"
+ ID="previous::#richfaces#include#examples#wstep2.xhtml"
+ NAME="output" PATH="/richfaces/include/examples/wstep2.xhtml"
+ TARGET="rules:#richfaces#include#examples#wstep2.xhtml" TITLE="previous"/>
+ </PROCESS-ITEM>
+ </PROCESS-ITEM>
+</PROCESS>
Modified: trunk/sandbox/samples/rex-demo/src/main/webapp/css/common.css
===================================================================
--- trunk/sandbox/samples/rex-demo/src/main/webapp/css/common.css 2007-11-20 23:08:20 UTC (rev 4121)
+++ trunk/sandbox/samples/rex-demo/src/main/webapp/css/common.css 2007-11-20 23:40:43 UTC (rev 4122)
@@ -42,7 +42,7 @@
li{
margin-top : 5px;
margin-bottom : 5px;
- margin-left : -12px;
+ margin-left : 12px;
}
ul{
margin-top : 10px;
Added: trunk/sandbox/samples/rex-demo/src/main/webapp/images/bfly.jpg
===================================================================
(Binary files differ)
Property changes on: trunk/sandbox/samples/rex-demo/src/main/webapp/images/bfly.jpg
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: trunk/sandbox/samples/rex-demo/src/main/webapp/images/tabpanel_custom/tabpanel_bg.jpg
===================================================================
(Binary files differ)
Added: trunk/sandbox/samples/rex-demo/src/main/webapp/richfaces/resizable/examples/pictures.xhtml
===================================================================
--- trunk/sandbox/samples/rex-demo/src/main/webapp/richfaces/resizable/examples/pictures.xhtml (rev 0)
+++ trunk/sandbox/samples/rex-demo/src/main/webapp/richfaces/resizable/examples/pictures.xhtml 2007-11-20 23:40:43 UTC (rev 4122)
@@ -0,0 +1,65 @@
+<ui:composition xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:a4j="http://richfaces.org/a4j"
+ xmlns:rex="http://labs.jboss.com/jbossrichfaces/ui/ui/rex-resizable"
+ xmlns:rich="http://richfaces.org/rich">
+
+<f:view contentType="text/html">
+
+ <button onclick="resizePic(500,427)">100% of Size</button>
+ <button onclick="resizePic(250,212)">50% of Size</button>
+ <script>
+ function resizePic(w,h) {
+ window.pic.resizeTo(w,h);
+ }
+ </script>
+
+ <rex:resizable wrap="true" name="window.pic" easing="easingInStrong"
+ pinned="false" handles="s se e" preserveRatio = "true" transparent="true"
+ minWidth="50" width="204" height="176" styleClass="res">
+ <h:graphicImage id="gm" width="204" height="176" value="/images/bfly.jpg" />
+ </rex:resizable>
+
+<rex:resizable easing="easingInStrong"
+ pinned="true" wrap="true" handles="e"
+ minWidth="400" width="500" height="260" styleClass="res">
+ <rich:dataTable width="483" id="carList" rows="10" columnClasses="col"
+ value="#{dataTableScrollerBean.allCars}" var="category">
+ <f:facet name="header">
+ <rich:columnGroup>
+ <h:column>
+ <h:outputText styleClass="headerText" value="Make" />
+ </h:column>
+ <h:column>
+ <h:outputText styleClass="headerText" value="Model" />
+ </h:column>
+ <h:column>
+ <h:outputText styleClass="headerText" value="Price" />
+ </h:column>
+ <h:column>
+ <h:outputText styleClass="headerText" value="Mileage" />
+ </h:column>
+ </rich:columnGroup>
+ </f:facet>
+
+ <h:column>
+ <h:outputText value="#{category.make}" />
+ </h:column>
+ <h:column>
+ <h:outputText value="#{category.model}" />
+ </h:column>
+ <h:column>
+ <h:outputText value="#{category.price}" />
+ </h:column>
+ <h:column>
+ <h:outputText value="#{category.mileage}" />
+ </h:column>
+
+ </rich:dataTable>
+ </rex:resizable>
+
+
+</f:view>
+</ui:composition>
\ No newline at end of file
Added: trunk/sandbox/samples/rex-demo/src/main/webapp/richfaces/resizable/examples/richpanel.xhtml
===================================================================
--- trunk/sandbox/samples/rex-demo/src/main/webapp/richfaces/resizable/examples/richpanel.xhtml (rev 0)
+++ trunk/sandbox/samples/rex-demo/src/main/webapp/richfaces/resizable/examples/richpanel.xhtml 2007-11-20 23:40:43 UTC (rev 4122)
@@ -0,0 +1,33 @@
+<ui:composition xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:a4j="http://richfaces.org/a4j"
+ xmlns:rex="http://labs.jboss.com/jbossrichfaces/ui/ui/rex-resizable"
+ xmlns:rich="http://richfaces.org/rich">
+
+<f:view contentType="text/html">
+
+
+
+ <rex:resizable draggable="true" name="mypanel" preserveRatio="false" easing="easingInStrong" animate="true"
+ minWidth="480" minHeight="130" width="429" height="200"
+ style="padding-bottom:4px;padding-right:4px;z-index:2000">
+ <rich:panel style="height:100%">
+ <f:facet name="header">
+ Dialog Title
+ </f:facet>
+ Drag the botton right hand corner to resize<br /><br />
+ Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Sed metus nibh,
+ sodales a, porta at, vulputate eget, dui. Pellentesque ut nisl. Maecenas
+ tortor turpis, interdum non, sodales non, iaculis ac, lacus. Vestibulum auctor,
+ tortor quis iaculis malesuada, libero lectus bibendum purus, sit amet tincidunt
+ quam turpis vel lacus.
+ </rich:panel>
+ </rex:resizable>
+
+
+
+
+</f:view>
+</ui:composition>
\ No newline at end of file
Modified: trunk/sandbox/samples/rex-demo/src/main/webapp/richfaces/resizable/examples/simple.xhtml
===================================================================
--- trunk/sandbox/samples/rex-demo/src/main/webapp/richfaces/resizable/examples/simple.xhtml 2007-11-20 23:08:20 UTC (rev 4121)
+++ trunk/sandbox/samples/rex-demo/src/main/webapp/richfaces/resizable/examples/simple.xhtml 2007-11-20 23:40:43 UTC (rev 4122)
@@ -8,28 +8,30 @@
<f:view contentType="text/html">
+ <style>
+ .res {
+ padding-bottom:12px
+ }
- <rex:resizable draggable="true" name="mypanel" preserveRatio="false" easing="easingInStrong" animate="true"
- minWidth="480" minHeight="130" width="429" height="200"
- style="padding-bottom:4px;padding-right:4px;z-index:2000">
- <rich:panel style="height:100%">
- <f:facet name="header">
- Dialog Title
- </f:facet>
+ .rdiv {
+ height:100%;
+ border:1px solid #CCC;
+ padding: 5px;
+ }
+ </style>
+
+ <rex:resizable name="mypanel" easing="easingInStrong" pinned="true" handles="e se s"
+ minWidth="480" minHeight="130" width="480" height="200" styleClass="res">
+ <div class="rdiv">
Drag the botton right hand corner to resize<br /><br />
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Sed metus nibh,
sodales a, porta at, vulputate eget, dui. Pellentesque ut nisl. Maecenas
tortor turpis, interdum non, sodales non, iaculis ac, lacus. Vestibulum auctor,
tortor quis iaculis malesuada, libero lectus bibendum purus, sit amet tincidunt
quam turpis vel lacus.
- </rich:panel>
-
+ </div>
</rex:resizable>
-
-
-
-
</f:view>
</ui:composition>
\ No newline at end of file
Modified: trunk/sandbox/samples/rex-demo/src/main/webapp/richfaces/resizable/usage.xhtml
===================================================================
--- trunk/sandbox/samples/rex-demo/src/main/webapp/richfaces/resizable/usage.xhtml 2007-11-20 23:08:20 UTC (rev 4121)
+++ trunk/sandbox/samples/rex-demo/src/main/webapp/richfaces/resizable/usage.xhtml 2007-11-20 23:40:43 UTC (rev 4122)
@@ -8,10 +8,11 @@
<ui:composition template="/templates/component-sample.xhtml">
<ui:define name="sample">
- <p>Description
+ <p>The "resizable" component represents the Ext JS wizard with the same name. It allows
+ to resize the JSF component or any pure DOM element. The following simplte example
+ shows how "resizable" might use to resize DIV element.
</p>
-
<div class="sample-container" >
<ui:include src="/richfaces/resizable/examples/simple.xhtml"/>
@@ -19,6 +20,33 @@
<ui:param name="sourcepath" value="/richfaces/resizable/examples/simple.xhtml"/>
</ui:include>
</div>
+
+ <p>The following example shows how to resize the image manually and resize it programmatically
+ using the javascript object API.
+ </p>
+
+
+
+ <div class="sample-container" >
+
+ <ui:include src="/richfaces/resizable/examples/pictures.xhtml"/>
+ <ui:include src="/templates/include/sourceview.xhtml">
+ <ui:param name="sourcepath" value="/richfaces/resizable/examples/pictures.xhtml"/>
+ </ui:include>
+ </div>
+
+
+
+ <p><ul>Known drawbacks:
+ <li>Requires the width and height defined explicitly.
+ I.e. no "auto fit" mode. No 100% mode.</li>
+ <li>Does not fit the size of the wrapped element precisely. Requires different
+ style for IE and FF browsers for correction</li>
+ <li>Incompatible with xhtml mode (it is EXT JS disease in general). Might cause
+ losing the flexibility in Ajax mode.</li>
+ </ul>
+ </p>
+
</ui:define>
Modified: trunk/sandbox/samples/rex-demo/src/main/webapp/templates/include/dynamic-css.xhtml
===================================================================
--- trunk/sandbox/samples/rex-demo/src/main/webapp/templates/include/dynamic-css.xhtml 2007-11-20 23:08:20 UTC (rev 4121)
+++ trunk/sandbox/samples/rex-demo/src/main/webapp/templates/include/dynamic-css.xhtml 2007-11-20 23:40:43 UTC (rev 4122)
@@ -6,7 +6,7 @@
<ui:composition>
<style type="text/css">
body{
- background-image : url(${facesContext.externalContext.requestContextPath}/images/page_bg.gif);
+ _background-image : url(${facesContext.externalContext.requestContextPath}/images/page_bg.gif);
}
li{
list-style : outside url(${facesContext.externalContext.requestContextPath}/images/bullet_arrow.gif);
Deleted: trunk/sandbox/samples/rex-demo/src/main/webapp/templates/main.xhtml
===================================================================
--- trunk/sandbox/samples/rex-demo/src/main/webapp/templates/main.xhtml 2007-11-20 23:08:20 UTC (rev 4121)
+++ trunk/sandbox/samples/rex-demo/src/main/webapp/templates/main.xhtml 2007-11-20 23:40:43 UTC (rev 4122)
@@ -1,65 +0,0 @@
-<!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:ui="http://java.sun.com/jsf/facelets"
- xmlns:h="http://java.sun.com/jsf/html"
- xmlns:f="http://java.sun.com/jsf/core"
- xmlns:a4j="http://richfaces.org/a4j"
- xmlns:rich="http://richfaces.org/rich">
-
-<head>
-<meta http-equiv="Content-Type" content="text/xhtml; charset=UTF-8"/>
-<title>
- <ui:insert name="title"/>
-</title>
-<link rel="STYLESHEET" type="text/css" href="${facesContext.externalContext.requestContextPath}/css/common.css"/>
-
-<ui:include src="/templates/include/dynamic-css.xhtml" />
-</head>
-
-<body>
-
-<ui:include src="/templates/include/header.xhtml" />
-<table class="left_menu" cellpadding="0" cellspacing="0" border="0">
-<tbody>
- <tr>
- <td>
- <ui:include src="/templates/include/references.xhtml" />
- <div class="menu_separator">
-
- </div>
- <ui:include src="/templates/include/components-navigation.xhtml" />
- </td>
- </tr>
-</tbody>
-</table>
-<h:outputText styleClass="component_name sheader" value="#{componentNavigator.currentComponent.name}"
- rendered="#{componentNavigator.hasCurrentComponent}" height="40" alt="" border="0"/>
-
-<ui:remove>
-<h:graphicImage value="#{componentNavigator.currentComponent.captionImage}"
- rendered="#{componentNavigator.hasCurrentComponent}" height="40" alt="" border="0" styleClass="component_name"/>
-</ui:remove>
-<table cellpadding="0" cellspacing="0" border="0" class="content_container" width="100%">
-<tbody>
- <tr>
- <td>
- <div class="content_container_left_brick"></div>
- </td>
- <td width="100%" class="content_container_pdddings">
-<!-- tabpanel begin -->
- <ui:insert name="body">Body</ui:insert>
-<!-- tabpanel end -->
- <rich:spacer style="height:10px;" />
- <rich:separator style="height:1px" />
- <div style="float:right" class="footer-text">${a4j.version}</div>
- <div style="float:none">
- <a href="http://jboss.com/index.html?module=bb&op=viewtopic&t=104575"
- style="color:#000; display:block" class="footer-text">RichFaces. Most Important Links</a>
- </div>
- </td>
- </tr>
-</tbody>
-</table>
-
-</body>
-</html>
Copied: trunk/sandbox/samples/rex-demo/src/main/webapp/templates/main_old.xhtml (from rev 3971, trunk/sandbox/samples/rex-demo/src/main/webapp/templates/main.xhtml)
===================================================================
--- trunk/sandbox/samples/rex-demo/src/main/webapp/templates/main_old.xhtml (rev 0)
+++ trunk/sandbox/samples/rex-demo/src/main/webapp/templates/main_old.xhtml 2007-11-20 23:40:43 UTC (rev 4122)
@@ -0,0 +1,65 @@
+<!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:ui="http://java.sun.com/jsf/facelets"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:a4j="http://richfaces.org/a4j"
+ xmlns:rich="http://richfaces.org/rich">
+
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml; charset=UTF-8"/>
+<title>
+ <ui:insert name="title"/>
+</title>
+<link rel="STYLESHEET" type="text/css" href="${facesContext.externalContext.requestContextPath}/css/common.css"/>
+
+<ui:include src="/templates/include/dynamic-css.xhtml" />
+</head>
+
+<body>
+
+<ui:include src="/templates/include/header.xhtml" />
+<table class="left_menu" cellpadding="0" cellspacing="0" border="0">
+<tbody>
+ <tr>
+ <td>
+ <ui:include src="/templates/include/references.xhtml" />
+ <div class="menu_separator">
+
+ </div>
+ <ui:include src="/templates/include/components-navigation.xhtml" />
+ </td>
+ </tr>
+</tbody>
+</table>
+<h:outputText styleClass="component_name sheader" value="#{componentNavigator.currentComponent.name}"
+ rendered="#{componentNavigator.hasCurrentComponent}" height="40" alt="" border="0"/>
+
+<ui:remove>
+<h:graphicImage value="#{componentNavigator.currentComponent.captionImage}"
+ rendered="#{componentNavigator.hasCurrentComponent}" height="40" alt="" border="0" styleClass="component_name"/>
+</ui:remove>
+<table cellpadding="0" cellspacing="0" border="0" class="content_container" width="100%">
+<tbody>
+ <tr>
+ <td>
+ <div class="content_container_left_brick"></div>
+ </td>
+ <td width="100%" class="content_container_pdddings">
+<!-- tabpanel begin -->
+ <ui:insert name="body">Body</ui:insert>
+<!-- tabpanel end -->
+ <rich:spacer style="height:10px;" />
+ <rich:separator style="height:1px" />
+ <div style="float:right" class="footer-text">${a4j.version}</div>
+ <div style="float:none">
+ <a href="http://jboss.com/index.html?module=bb&op=viewtopic&t=104575"
+ style="color:#000; display:block" class="footer-text">RichFaces. Most Important Links</a>
+ </div>
+ </td>
+ </tr>
+</tbody>
+</table>
+
+</body>
+</html>
Modified: trunk/sandbox/samples/rex-demo/src/main/webapp/welcome.xhtml
===================================================================
--- trunk/sandbox/samples/rex-demo/src/main/webapp/welcome.xhtml 2007-11-20 23:08:20 UTC (rev 4121)
+++ trunk/sandbox/samples/rex-demo/src/main/webapp/welcome.xhtml 2007-11-20 23:40:43 UTC (rev 4122)
@@ -2,6 +2,7 @@
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:rexr="http://labs.jboss.com/jbossrichfaces/ui/ui/rex-resizable"
xmlns:f="http://java.sun.com/jsf/core">
<ui:composition template="/templates/main.xhtml">
<ui:define name="title">RichFaces - Open Source Rich JSF Components</ui:define>
@@ -37,6 +38,21 @@
production unless the legal issues with <a href="http://extjs.com/license">Ext JS license</a>
is resolved.
</p>
+ <button onclick="resizePic(500,427)">100% of Size</button>
+ <button onclick="resizePic(250,212)">50% of Size</button>
+ <script>
+ function resizePic(w,h) {
+ window.pic.resizeTo(w,h);
+ }
+ </script>
+
+ <rexr:resizable wrap="true" name="window.pic" easing="easingInStrong"
+ pinned="false" handles="s se e" preserveRatio = "true" transparent="true"
+ minWidth="50" width="204" height="176" styleClass="res">
+ <h:graphicImage id="gm2" width="204" height="176" value="/images/bfly.jpg" />
+ </rexr:resizable>
+
+
</ui:define>
</ui:composition>
</html>
Modified: trunk/sandbox/ui/rex-resizable/src/main/config/component/resizable.xml
===================================================================
--- trunk/sandbox/ui/rex-resizable/src/main/config/component/resizable.xml 2007-11-20 23:08:20 UTC (rev 4121)
+++ trunk/sandbox/ui/rex-resizable/src/main/config/component/resizable.xml 2007-11-20 23:40:43 UTC (rev 4122)
@@ -86,7 +86,7 @@
<name>dynamic</name>
<classname>java.lang.String</classname>
<description>
- Animation duration if animate = true (defaults to .35)
+ True to resize the element while dragging instead of using a proxy (defaults to false)
</description>
<defaultvalue>""</defaultvalue>
</property>
@@ -246,5 +246,14 @@
</description>
<defaultvalue>""</defaultvalue>
</property>
+ <property>
+ <name>wrap</name>
+ <classname>java.lang.String</classname>
+ <description>
+ Apply to the child element directly. Important for some element, such
+ as image of textarea
+ </description>
+ <defaultvalue>""</defaultvalue>
+ </property>
</component>
</components>
Modified: trunk/sandbox/ui/rex-resizable/src/main/templates/resizable.jspx
===================================================================
--- trunk/sandbox/ui/rex-resizable/src/main/templates/resizable.jspx 2007-11-20 23:08:20 UTC (rev 4121)
+++ trunk/sandbox/ui/rex-resizable/src/main/templates/resizable.jspx 2007-11-20 23:40:43 UTC (rev 4122)
@@ -12,6 +12,7 @@
<f:clientid var="clientId"/>
<c:set var="name" value="#{component.attributes['name']}"/>
+ <c:set var="styleClass" value="#{component.attributes['styleClass']}"/>
<h:styles>extjs/ext-all.css,extjs/ext-css-patch.xcss</h:styles>
<h:scripts>extjs/ext-base.js,extjs/ext-all.js,script/rexInitWidget.js</h:scripts>
@@ -23,7 +24,7 @@
"heightIncrement", "maxHeight", "maxWidth", "minHeight",
"minWidth", "minX", "minY", "multiDirectional", "pinned",
"preserveRatio","resizeChild", "transparent", "width",
- "widthIncrement"};
+ "widthIncrement", "wrap"};
String[] qattr = { "adjustments", "easing", "handles"};
StringBuffer json = new StringBuffer();
@@ -35,8 +36,10 @@
String name = (String)component.getAttributes().get("name");
if (! "".equals(name)) {
- variables.setVariable("name", "window." + name + "=");
+ variables.setVariable("name", name + "=");
}
+ String wrap = (String)component.getAttributes().get("wrap");
+ if ("true".equals(wrap)) {variables.setVariable("wrapChild", ".dom.firstChild");}
]]>
@@ -44,14 +47,14 @@
-<div id="#{clientId}" x:passThruWithExclusions="id,styleClass,class">
+<div id="#{clientId}" class="#{styleClass}" x:passThruWithExclusions="id,styleClass">
<vcp:body>
<f:call name="renderChildren" />
</vcp:body>
<f:clientid var="clientId"/>
<script type="text/javascript">
window.Richfaces.rexInitWidget(function(){
-#{name} new Ext.Resizable("#{clientId}", { #{params} });
+#{name} new Ext.Resizable(Ext.get("#{clientId}")#{wrapChild}, { #{params} });
});
</script>
18 years, 5 months
JBoss Rich Faces SVN: r4120 - branches/3.1.x/framework/impl/src/main/java/org/richfaces/renderkit.
by richfaces-svn-commits@lists.jboss.org
Author: maksimkaszynski
Date: 2007-11-20 14:35:19 -0500 (Tue, 20 Nov 2007)
New Revision: 4120
Modified:
branches/3.1.x/framework/impl/src/main/java/org/richfaces/renderkit/MacroDefinitionJSContentHandler.java
Log:
Context menu macro substitution
Modified: branches/3.1.x/framework/impl/src/main/java/org/richfaces/renderkit/MacroDefinitionJSContentHandler.java
===================================================================
--- branches/3.1.x/framework/impl/src/main/java/org/richfaces/renderkit/MacroDefinitionJSContentHandler.java 2007-11-20 19:35:11 UTC (rev 4119)
+++ branches/3.1.x/framework/impl/src/main/java/org/richfaces/renderkit/MacroDefinitionJSContentHandler.java 2007-11-20 19:35:19 UTC (rev 4120)
@@ -3,6 +3,7 @@
*/
package org.richfaces.renderkit;
+import java.io.FilterWriter;
import java.io.IOException;
import java.io.StringReader;
import java.io.Writer;
@@ -22,6 +23,49 @@
private String prolog;
private String epilog;
+ /**
+ * Writer will not output duplicate commas
+ * @author Maksim Kaszynski
+ *
+ */
+ static class WellFormedWriter extends FilterWriter {
+
+ private char lastChar;
+
+ public WellFormedWriter(Writer out) {
+ super(out);
+ }
+
+ public void write(char[] cbuf, int off, int len) throws IOException {
+
+
+ //Skip comma
+ while (cbuf[off] == lastChar && lastChar == ',' && len > 0) {
+ off++;
+ len--;
+ }
+
+ while(len > 1 && cbuf[off] == cbuf[off+1] && cbuf[off] == ','){
+ len--;
+ off++;
+ }
+
+
+ super.write(cbuf, off, len);
+
+ lastChar = cbuf[off + len - 1];
+
+ }
+
+ public void write(int c) throws IOException {
+ if (c != lastChar || lastChar != ',') {
+ super.write(c);
+ lastChar = (char) c;
+ }
+ }
+
+ }
+
public MacroDefinitionJSContentHandler(Writer writer, String prolog,
String epilog) {
super(writer);
@@ -43,8 +87,7 @@
SAXException {
if (string.length() == 0) {
- outputWriter.write("\'\'");
- return;
+ this.outputWriter.write("\'\'");
}
List parsedExpressiion = parseExpressiion(string);
@@ -108,52 +151,62 @@
if (isProcessingCdata()) {
super.characters(ch, start, length);
} else {
- List parsedExpression = parseExpressiion(new String(ch, start, length));
- for (Iterator iterator = parsedExpression.iterator(); iterator
- .hasNext();) {
+ Writer oldWriter = outputWriter;
+ outputWriter = new WellFormedWriter(oldWriter);
+
+ try {
+ List parsedExpression = parseExpressiion(new String(ch, start,
+ length));
+ for (Iterator iterator = parsedExpression.iterator(); iterator
+ .hasNext();) {
- Object next = iterator.next();
-
- if (next instanceof Expression) {
- Expression expression = (Expression) next;
-
- if (this.isBeforeDocumentStart() || level < 0)
- return;
- try {
- if (level != 0 && !this.closeElement(false) && this.isProcessingCdata() == false) {
- this.outputWriter.write(',');
- }
+ Object next = iterator.next();
- if (this.isProcessingCdata() == false) {
- this.outputWriter.write("new ET(");
- }
-
- this.outputWriter.write("function (context) { return ");
- this.outputWriter.write(prolog);
- this.encode(expression.getExpression().toString());
- this.outputWriter.write(epilog);
- this.outputWriter.write("}");
+ if (next instanceof Expression) {
+ Expression expression = (Expression) next;
- if (this.isProcessingCdata() == false) {
- this.outputWriter.write(")");
- }
- } catch (IOException e) {
- throw new SAXException("Write error",e);
- }
+ if (this.isBeforeDocumentStart() || level < 0)
+ return;
+ try {
+ if (level != 0 && !this.closeElement(false)
+ && this.isProcessingCdata() == false) {
+ this.outputWriter.write(',');
+ }
- } else {
- char[] cs = next.toString().toCharArray();
- super.characters(cs, 0, cs.length);
- }
+ if (this.isProcessingCdata() == false) {
+ this.outputWriter.write("new ET(");
+ }
- if (iterator.hasNext()) {
- try {
- this.outputWriter.write(',');
- } catch (IOException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
+ this.outputWriter
+ .write("function (context) { return ");
+ this.outputWriter.write(prolog);
+ this.encode(expression.getExpression().toString());
+ this.outputWriter.write(epilog);
+ this.outputWriter.write("}");
+
+ if (this.isProcessingCdata() == false) {
+ this.outputWriter.write(")");
+ }
+ } catch (IOException e) {
+ throw new SAXException("Write error", e);
+ }
+
+ } else {
+ char[] cs = next.toString().toCharArray();
+ super.characters(cs, 0, cs.length);
}
- }
+
+ if (iterator.hasNext()) {
+ try {
+ this.outputWriter.write(',');
+ } catch (IOException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ }
+ }
+ } finally {
+ outputWriter = oldWriter;
}
}
}
18 years, 5 months
JBoss Rich Faces SVN: r4119 - branches/3.1.x/ui/menu-components/src/main/resources/org/richfaces/renderkit/html/scripts.
by richfaces-svn-commits@lists.jboss.org
Author: maksimkaszynski
Date: 2007-11-20 14:35:11 -0500 (Tue, 20 Nov 2007)
New Revision: 4119
Modified:
branches/3.1.x/ui/menu-components/src/main/resources/org/richfaces/renderkit/html/scripts/menu.js
Log:
Context menu macro substitution
Modified: branches/3.1.x/ui/menu-components/src/main/resources/org/richfaces/renderkit/html/scripts/menu.js
===================================================================
--- branches/3.1.x/ui/menu-components/src/main/resources/org/richfaces/renderkit/html/scripts/menu.js 2007-11-20 19:35:02 UTC (rev 4118)
+++ branches/3.1.x/ui/menu-components/src/main/resources/org/richfaces/renderkit/html/scripts/menu.js 2007-11-20 19:35:11 UTC (rev 4119)
@@ -1077,6 +1077,9 @@
if(!refLayer) return this;
var id = this.id;
this.highlightParent = false;
+ //TODO: clarify
+ return this;
+
if(!evt){
evt = 'onclick';
}
18 years, 5 months
JBoss Rich Faces SVN: r4118 - branches/3.1.x/sandbox/samples/contextMenuDemo/src/main/webapp/pages.
by richfaces-svn-commits@lists.jboss.org
Author: maksimkaszynski
Date: 2007-11-20 14:35:02 -0500 (Tue, 20 Nov 2007)
New Revision: 4118
Modified:
branches/3.1.x/sandbox/samples/contextMenuDemo/src/main/webapp/pages/index.jsp
Log:
Context menu macro substitution
Modified: branches/3.1.x/sandbox/samples/contextMenuDemo/src/main/webapp/pages/index.jsp
===================================================================
--- branches/3.1.x/sandbox/samples/contextMenuDemo/src/main/webapp/pages/index.jsp 2007-11-20 19:34:53 UTC (rev 4117)
+++ branches/3.1.x/sandbox/samples/contextMenuDemo/src/main/webapp/pages/index.jsp 2007-11-20 19:35:02 UTC (rev 4118)
@@ -21,28 +21,28 @@
</head>
<body>
<f:view>
- <h:form>
- <h:panelGroup id="outputText">
- <h:outputText value="Right Click Here" />
- <cm:contextMenu submitMode="server">
- <mc:menuItem id="menuItem11" action="#{bean.action}" value="Active11: ajax" submitMode="ajax" actionListener="#{bean.actionListener}">
+ <h:form id="f">
+ <h:panelGroup id="outputText" >
+ <h:outputLink value="#" onclick="$('f:m').component.show(event, {param: 'zz'});return false;">Right Click Here</h:outputLink>
+ <cm:contextMenu submitMode="server" id="m">
+ <mc:menuItem id="menuItem11" action="#{bean.action}" value="{param} ajax submit" submitMode="ajax" actionListener="#{bean.actionListener}">
<a4j:actionparam assignTo="#{bean.param}" name="param" value="{param}"></a4j:actionparam>
</mc:menuItem>
- <mc:menuItem id="menuItem12" action="#{bean.action}" value="Active12" immediate="true" actionListener="#{bean.actionListener}">
+ <mc:menuItem id="menuItem12" action="#{bean.action}" value="{param} Server submit " immediate="true" actionListener="#{bean.actionListener}">
<a4j:actionparam assignTo="#{bean.param}" name="param" value="{param}"></a4j:actionparam>
</mc:menuItem>
- <mc:menuItem id="menuItem14" action="#{bean.action}" value="Active14" actionListener="#{bean.actionListener}">
+ <mc:menuItem id="menuItem14" action="#{bean.action}" value="{param} default submit " actionListener="#{bean.actionListener}">
<a4j:actionparam assignTo="#{bean.param}" name="param" value="{param}"></a4j:actionparam>
</mc:menuItem>
<mc:menuSeparator id="menuSeparator11"/>
- <mc:menuItem id="menuItem16" action="#{bean.action}" value="Disable16" disabled="true" actionListener="#{bean.actionListener}">
+ <mc:menuItem id="menuItem16" action="#{bean.action}" value="Disable16 {param}" disabled="true" actionListener="#{bean.actionListener}">
<a4j:actionparam assignTo="#{bean.param}" name="param" value="{param}"></a4j:actionparam>
</mc:menuItem>
<mc:menuItem id="menuItem17" action="#{bean.action}" actionListener="#{bean.actionListener}">
<a4j:actionparam assignTo="#{bean.param}" name="param" value="{param}"></a4j:actionparam>
- <h:inputText value="xXx"/>
+ <h:inputText value="{param}"/>
</mc:menuItem>
</cm:contextMenu>
</h:panelGroup>
@@ -55,7 +55,9 @@
<f:facet name="footer">
<h:outputText value="First footer"></h:outputText>
</f:facet>
- <h:outputText value="#{row.first}"></h:outputText>
+ <h:outputLink value="#" onclick="$('f:m').component.show(event, {param: '#{row.first}'});return false;">
+ <h:outputText value="#{row.first}"></h:outputText>
+ </h:outputLink>
</dt:column>
<dt:column headerClass="header" footerClass="footer">
<f:facet name="header">
@@ -64,7 +66,9 @@
<f:facet name="footer">
<h:outputText value="Second footer"></h:outputText>
</f:facet>
- <h:outputText value="#{row.second}"></h:outputText>
+ <h:outputLink value="#" onclick="$('f:m').component.show(event, {param: '#{row.second}'});return false;">
+ <h:outputText value="#{row.second}"></h:outputText>
+ </h:outputLink>
</dt:column>
</dt:dataTable>
</h:form>
18 years, 5 months
JBoss Rich Faces SVN: r4117 - in branches/3.1.x/sandbox/ui/contextMenu/src/main: resources/org/richfaces/renderkit/html/scripts and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: maksimkaszynski
Date: 2007-11-20 14:34:53 -0500 (Tue, 20 Nov 2007)
New Revision: 4117
Modified:
branches/3.1.x/sandbox/ui/contextMenu/src/main/java/org/richfaces/renderkit/html/ContextMenuRendererBase.java
branches/3.1.x/sandbox/ui/contextMenu/src/main/resources/org/richfaces/renderkit/html/scripts/context-menu.js
Log:
Context menu macro substitution
Modified: branches/3.1.x/sandbox/ui/contextMenu/src/main/java/org/richfaces/renderkit/html/ContextMenuRendererBase.java
===================================================================
--- branches/3.1.x/sandbox/ui/contextMenu/src/main/java/org/richfaces/renderkit/html/ContextMenuRendererBase.java 2007-11-20 17:34:11 UTC (rev 4116)
+++ branches/3.1.x/sandbox/ui/contextMenu/src/main/java/org/richfaces/renderkit/html/ContextMenuRendererBase.java 2007-11-20 19:34:53 UTC (rev 4117)
@@ -90,9 +90,11 @@
throws IOException {
ResponseWriter writer = context.getResponseWriter();
writer.startElement("script", component);
- writer.write("var evaluator = ");
+ writer.write("new Richfaces.ContextMenu('");
+ writer.write(component.getClientId(context));
+ writer.write("',");
writeScriptBody(context, component, true);
- writer.write(";\n new Insertion.Top($('" + component.getClientId(context) + "'), evaluator.invoke('getContent', window).join(''));");
+ writer.write(");");
writer.endElement("script");
}
Modified: branches/3.1.x/sandbox/ui/contextMenu/src/main/resources/org/richfaces/renderkit/html/scripts/context-menu.js
===================================================================
--- branches/3.1.x/sandbox/ui/contextMenu/src/main/resources/org/richfaces/renderkit/html/scripts/context-menu.js 2007-11-20 17:34:11 UTC (rev 4116)
+++ branches/3.1.x/sandbox/ui/contextMenu/src/main/resources/org/richfaces/renderkit/html/scripts/context-menu.js 2007-11-20 19:34:53 UTC (rev 4117)
@@ -1,4 +1,42 @@
if (!window.Richfaces) var Richfaces = {};
-Richfaces.ContextMenu = {
- //show
+Richfaces.ContextMenu = Class.create();
+
+Richfaces.ContextMenu.prototype = {
+
+ initialize: function(id, evaluator) {
+ this.id = id;
+ this.evaluator = evaluator;
+ $(id).component = this;
+
+ },
+
+ show: function(event, context) {
+ this.construct(context);
+ new RichFaces.Menu.DelayedContextMenu(this.id + "_menu", event).show();
+ },
+
+ construct: function(context) {
+ if (this.isNewContext(context)) {
+ this.destroy();
+ }
+ var div = document.createElement("div");
+ div.id = this.id + ":_auto_created";
+ $(this.id).appendChild(div);
+ new Insertion.Top(div, this.evaluator.invoke('getContent', context||window).join(''));
+
+ },
+
+ destroy: function() {
+ var div = $(this.id + ":_auto_created");
+ if (div) {
+ div.parentNode.removeChild(div);
+ }
+ },
+
+ isNewContext: function(context) {
+ //TODO: Check whether contexts are the same and therefore
+ // do not destroy menu
+ //var oldContext = this.context || {};
+ return true;
+ }
};
\ No newline at end of file
18 years, 5 months