Author: piotr.buda
Date: 2008-08-08 06:19:53 -0400 (Fri, 08 Aug 2008)
New Revision: 9985
Added:
trunk/sandbox/ui/extendedDataTable/src/main/resources/org/richfaces/renderkit/html/scripts/ext-dt-simple-draggable.js
trunk/sandbox/ui/extendedDataTable/src/main/resources/org/richfaces/renderkit/html/scripts/ext-dt-simple-dropzone.js
trunk/sandbox/ui/extendedDataTable/src/test/java/org/richfaces/component/renderer/
trunk/sandbox/ui/extendedDataTable/src/test/java/org/richfaces/component/renderer/ExtendedDataTableRendererTest.java
Removed:
trunk/sandbox/ui/extendedDataTable/src/main/resources/org/richfaces/renderkit/html/scripts/ext-simple-draggable.js
trunk/sandbox/ui/extendedDataTable/src/main/resources/org/richfaces/renderkit/html/scripts/ext-simple-dropzone.js
trunk/sandbox/ui/extendedDataTable/src/test/java/org/richfaces/component/JSFComponentTest.java
Modified:
trunk/sandbox/ui/extendedDataTable/src/main/config/component/ExtendedDataTable.xml
trunk/sandbox/ui/extendedDataTable/src/main/java/
trunk/sandbox/ui/extendedDataTable/src/main/java/org/richfaces/component/UIExtendedDataTable.java
trunk/sandbox/ui/extendedDataTable/src/main/java/org/richfaces/renderkit/AbstractExtendedTableRenderer.java
trunk/sandbox/ui/extendedDataTable/src/main/java/org/richfaces/renderkit/html/TableDragDropRenderer.java
trunk/sandbox/ui/extendedDataTable/src/main/resources/org/richfaces/renderkit/html/css/extendedDataTable.xcss
trunk/sandbox/ui/extendedDataTable/src/main/resources/org/richfaces/renderkit/html/scripts/ext-dt-drag-indicator.js
trunk/sandbox/ui/extendedDataTable/src/main/templates/org/richfaces/htmlExtendedDataTable.jspx
Log:
Bugfix, changes to styles/javascript
Modified:
trunk/sandbox/ui/extendedDataTable/src/main/config/component/ExtendedDataTable.xml
===================================================================
---
trunk/sandbox/ui/extendedDataTable/src/main/config/component/ExtendedDataTable.xml 2008-08-08
07:11:27 UTC (rev 9984)
+++
trunk/sandbox/ui/extendedDataTable/src/main/config/component/ExtendedDataTable.xml 2008-08-08
10:19:53 UTC (rev 9985)
@@ -2,44 +2,44 @@
<!DOCTYPE components PUBLIC "-//AJAX4JSF//CDK Generator config/EN"
"http://labs.jboss.com/jbossrichfaces/component-config.dtd">
<components>
<component>
- <name>org.richfaces.ExtendedDataTable</name>
- <family>org.richfaces.ExtendedDataTable</family>
- <classname>org.richfaces.component.html.HtmlExtendedDataTable</classname>
- <superclass>org.richfaces.component.UIExtendedDataTable</superclass>
- <description>
- <![CDATA[
+ <name>org.richfaces.ExtendedDataTable</name>
+ <family>org.richfaces.ExtendedDataTable</family>
+
<classname>org.richfaces.component.html.HtmlExtendedDataTable</classname>
+ <superclass>org.richfaces.component.UIExtendedDataTable</superclass>
+ <description>
+ <![CDATA[
]]>
- </description>
- <renderer generate="true" override="true">
- <name>org.richfaces.ExtendedDataTableRenderer</name>
- <template>org/richfaces/htmlExtendedDataTable.jspx</template>
- </renderer>
- <tag>
- <name>extendedDataTable</name>
- <classname>org.richfaces.taglib.ExtendedDataTableTag</classname>
- <superclass>
- org.ajax4jsf.webapp.taglib.HtmlComponentTagBase
- </superclass>
- </tag>
- <!--
- <taghandler>
- <classname>org.ajax4jsf.tag.TestHandler</classname>
- </taghandler>
- -->
- &ui_component_attributes;
- &ui_data_attributes;
- &html_universal_attributes;
- &html_table_attributes;
- &html_events;
- &spec_table_attributes;
- <property>
- <name>onselectionchange</name>
- <classname>java.lang.String</classname>
- <description>
- HTML: script expression to invoke on changing of rows selection
- </description>
- </property>
- <property>
+ </description>
+ <renderer generate="true" override="true">
+ <name>org.richfaces.ExtendedDataTableRenderer</name>
+ <template>org/richfaces/htmlExtendedDataTable.jspx</template>
+ </renderer>
+ <tag>
+ <name>extendedDataTable</name>
+ <classname>org.richfaces.taglib.ExtendedDataTableTag</classname>
+ <superclass>
+ org.ajax4jsf.webapp.taglib.HtmlComponentTagBase
+ </superclass>
+ </tag>
+ <!--
+ <taghandler>
+ <classname>org.ajax4jsf.tag.TestHandler</classname>
+ </taghandler>
+ -->
+ &ui_component_attributes;
+ &ui_data_attributes;
+ &html_universal_attributes;
+ &html_table_attributes;
+ &html_events;
+ &spec_table_attributes;
+ <property>
+ <name>onselectionchange</name>
+ <classname>java.lang.String</classname>
+ <description>
+ HTML: script expression to invoke on changing of rows selection
+ </description>
+ </property>
+ <property>
<name>selectionMode</name>
<classname>java.lang.String</classname>
<description>
@@ -48,191 +48,191 @@
none: no rows can be selected.
</description>
<defaultvalue>
- "single"
+ "single"
</defaultvalue>
</property>
- <property>
- <name>height</name>
- <classname>java.lang.String</classname>
- <description>Defines a height of the component. Default value is
500px</description>
- <defaultvalue>"500px"</defaultvalue>
- </property>
- <property>
- <name>selectedClass</name>
- <classname>java.lang.String</classname>
- <description>
- CSS class for selected rows
- </description>
- </property>
- <property>
- <name>activeClass</name>
- <classname>java.lang.String</classname>
- <description>
- CSS class for active row
- </description>
- </property>
-
- <property>
- <name>ajaxKeys</name>
- <classname>java.util.Set</classname>
- <description>This attribute defines row keys that are updated after an AJAX
request</description>
- </property>
- <property>
- <name>border</name>
- <classname>java.lang.String</classname>
- <description>This attributes specifies the width of the frame around a
component</description>
- <defaultvalue>"0"</defaultvalue>
- </property>
- <property>
- <name>cellpadding</name>
- <classname>java.lang.String</classname>
- <description>This attribute specifies the amount of space between the border of
the cell and its contents</description>
- <defaultvalue>"0"</defaultvalue>
- </property>
- <property>
- <name>cellspacing</name>
- <classname>java.lang.String</classname>
- <description>This attribute specifies the amount of space between the border of
the cell and its contents. The attribute also specifies the amount of space to leave
between cells
- </description>
- <defaultvalue>"0"</defaultvalue>
- </property>
- <property>
- <name>captionClass</name>
- <classname>java.lang.String</classname>
- <description>Space-separated list of CSS style class(es) that are be applied to
caption for this component</description>
- <defaultvalue>""</defaultvalue>
- </property>
- <property>
- <name>captionStyle</name>
- <classname>java.lang.String</classname>
- <description>CSS style(s) is/are to be applied to caption when this component is
rendered</description>
- </property>
- <property>
- <name>headerClass</name>
- <classname>java.lang.String</classname>
- <description>Space-separated list of CSS style class(es) that are be applied to
header for this component
- </description>
- <defaultvalue>""</defaultvalue>
- </property>
- <property>
- <name>footerClass</name>
- <classname>java.lang.String</classname>
- <description>Space-separated list of CSS style class(es) that are be applied to
footer for this component
- </description>
- <defaultvalue>""</defaultvalue>
- </property>
-
- <property>
- <name>componentState</name>
- <classname>org.ajax4jsf.model.DataComponentState</classname>
- <description>It defines EL-binding for a component state for saving or
redefinition</description>
- </property>
- <property hidden="true" existintag="false"
exist="false" >
- <name>rowKey</name>
- <classname>java.lang.Object</classname>
- <description>
- RowKey is a representation of an identifier for a specific data row
- </description>
- </property>
- <property>
- <name>rowKeyVar</name>
- <classname>java.lang.String</classname>
- <description>The attribute provides access to a row key in a Request
scope</description>
- </property>
- <property>
- <name>stateVar</name>
- <classname>java.lang.String</classname>
- <description>
- The attribute provides access to a component state on the client side
- </description>
- </property>
- <property>
- <name>value</name>
- <classname>java.lang.Object</classname>
- <description>
- The current value for this component
- </description>
- </property>
- <!-- rows javascript events -->
- <property>
- <name>onRowClick</name>
- <classname>java.lang.String</classname>
- <description>
- HTML: a script expression; a pointer button is clicked on row
- </description>
- </property>
- <property>
- <name>onRowDblClick</name>
- <classname>java.lang.String</classname>
- <description>HTML: a script expression; a pointer button is double-clicked on
row
- </description>
- </property>
- <property>
- <name>onRowMouseUp</name>
- <classname>java.lang.String</classname>
- <description>HTML: script expression; a pointer button is released on row
- </description>
- </property>
- <property>
- <name>onRowMouseDown</name>
- <classname>java.lang.String</classname>
- <description>HTML: script expression; a pointer button is pressed down on row
- </description>
- </property>
- <property>
- <name>onRowMouseOver</name>
- <classname>java.lang.String</classname>
- <description>HTML: a script expression; a pointer is moved onto of row
- </description>
- </property>
- <property>
- <name>onRowMouseOut</name>
- <classname>java.lang.String</classname>
- <description>HTML: a script expression; a pointer is moved away of row
- </description>
- </property>
- <property>
- <name>onRowMouseMove</name>
- <classname>java.lang.String</classname>
- <description>HTML: a script expression; a pointer is moved within of row
- </description>
- </property>
- <property>
- <name>sortPriority</name>
- <classname>java.util.Collection</classname>
- <description>Defines a set of column ids in the order the columns could be
set</description>
- </property>
- <property hidden="true" existintag="false"
exist="false" >
- <name>sortFields</name>
- </property>
- <property hidden="true" existintag="false"
exist="false" >
- <name>filterFields</name>
- </property>
- <property>
- <name>sortMode</name>
- <classname>java.lang.String</classname>
- <description>
- Defines mode of sorting. Possible values are 'single' for sorting of one
column and 'multi' for some.
- </description>
- </property>
- <property hidden="true" existintag="false"
exist="false" >
- <name>summary</name>
- <classname>java.lang.Object</classname>
- </property>
-
- <property elonly="true">
- <name>tableState</name>
- <classname>java.lang.String</classname>
- <description>
- ValueBinding pointing at a property of a String to hold table state
- </description>
- </property>
-
- <property attachedstate="true" elonly="true">
- <name>selection</name>
- <classname>org.richfaces.model.selection.Selection</classname>
- <description>Value binding representing selected rows</description>
- </property>
-
- </component>
+ <property>
+ <name>height</name>
+ <classname>java.lang.String</classname>
+ <description>Defines a height of the component. Default value is
500px</description>
+ <defaultvalue>"500px"</defaultvalue>
+ </property>
+ <property>
+ <name>selectedClass</name>
+ <classname>java.lang.String</classname>
+ <description>
+ CSS class for selected rows
+ </description>
+ </property>
+ <property>
+ <name>activeClass</name>
+ <classname>java.lang.String</classname>
+ <description>
+ CSS class for active row
+ </description>
+ </property>
+
+ <property>
+ <name>ajaxKeys</name>
+ <classname>java.util.Set</classname>
+ <description>This attribute defines row keys that are updated after an
AJAX request</description>
+ </property>
+ <property>
+ <name>border</name>
+ <classname>java.lang.String</classname>
+ <description>This attributes specifies the width of the frame around a
component</description>
+ <defaultvalue>"0"</defaultvalue>
+ </property>
+ <property>
+ <name>cellpadding</name>
+ <classname>java.lang.String</classname>
+ <description>This attribute specifies the amount of space between the
border of the cell and its contents</description>
+ <defaultvalue>"0"</defaultvalue>
+ </property>
+ <property>
+ <name>cellspacing</name>
+ <classname>java.lang.String</classname>
+ <description>This attribute specifies the amount of space between the
border of the cell and its contents. The attribute also specifies the amount of space to
leave between cells
+ </description>
+ <defaultvalue>"0"</defaultvalue>
+ </property>
+ <property>
+ <name>captionClass</name>
+ <classname>java.lang.String</classname>
+ <description>Space-separated list of CSS style class(es) that are be
applied to caption for this component</description>
+ <defaultvalue>""</defaultvalue>
+ </property>
+ <property>
+ <name>captionStyle</name>
+ <classname>java.lang.String</classname>
+ <description>CSS style(s) is/are to be applied to caption when this
component is rendered</description>
+ </property>
+ <property>
+ <name>headerClass</name>
+ <classname>java.lang.String</classname>
+ <description>Space-separated list of CSS style class(es) that are be
applied to header for this component
+ </description>
+ <defaultvalue>""</defaultvalue>
+ </property>
+ <property>
+ <name>footerClass</name>
+ <classname>java.lang.String</classname>
+ <description>Space-separated list of CSS style class(es) that are be
applied to footer for this component
+ </description>
+ <defaultvalue>""</defaultvalue>
+ </property>
+
+ <property>
+ <name>componentState</name>
+ <classname>org.ajax4jsf.model.DataComponentState</classname>
+ <description>It defines EL-binding for a component state for saving or
redefinition</description>
+ </property>
+ <property hidden="true" existintag="false"
exist="false" >
+ <name>rowKey</name>
+ <classname>java.lang.Object</classname>
+ <description>
+ RowKey is a representation of an identifier for a specific data row
+ </description>
+ </property>
+ <property>
+ <name>rowKeyVar</name>
+ <classname>java.lang.String</classname>
+ <description>The attribute provides access to a row key in a Request
scope</description>
+ </property>
+ <property>
+ <name>stateVar</name>
+ <classname>java.lang.String</classname>
+ <description>
+ The attribute provides access to a component state on the client side
+ </description>
+ </property>
+ <property>
+ <name>value</name>
+ <classname>java.lang.Object</classname>
+ <description>
+ The current value for this component
+ </description>
+ </property>
+ <!-- rows javascript events -->
+ <property>
+ <name>onRowClick</name>
+ <classname>java.lang.String</classname>
+ <description>
+ HTML: a script expression; a pointer button is clicked on row
+ </description>
+ </property>
+ <property>
+ <name>onRowDblClick</name>
+ <classname>java.lang.String</classname>
+ <description>HTML: a script expression; a pointer button is
double-clicked on row
+ </description>
+ </property>
+ <property>
+ <name>onRowMouseUp</name>
+ <classname>java.lang.String</classname>
+ <description>HTML: script expression; a pointer button is released on
row
+ </description>
+ </property>
+ <property>
+ <name>onRowMouseDown</name>
+ <classname>java.lang.String</classname>
+ <description>HTML: script expression; a pointer button is pressed down
on row
+ </description>
+ </property>
+ <property>
+ <name>onRowMouseOver</name>
+ <classname>java.lang.String</classname>
+ <description>HTML: a script expression; a pointer is moved onto of row
+ </description>
+ </property>
+ <property>
+ <name>onRowMouseOut</name>
+ <classname>java.lang.String</classname>
+ <description>HTML: a script expression; a pointer is moved away of row
+ </description>
+ </property>
+ <property>
+ <name>onRowMouseMove</name>
+ <classname>java.lang.String</classname>
+ <description>HTML: a script expression; a pointer is moved within of
row
+ </description>
+ </property>
+ <property>
+ <name>sortPriority</name>
+ <classname>java.util.Collection</classname>
+ <description>Defines a set of column ids in the order the columns could
be set</description>
+ </property>
+ <property hidden="true" existintag="false"
exist="false" >
+ <name>sortFields</name>
+ </property>
+ <property hidden="true" existintag="false"
exist="false" >
+ <name>filterFields</name>
+ </property>
+ <property>
+ <name>sortMode</name>
+ <classname>java.lang.String</classname>
+ <description>
+ Defines mode of sorting. Possible values are 'single' for sorting of
one column and 'multi' for some.
+ </description>
+ </property>
+ <property hidden="true" existintag="false"
exist="false" >
+ <name>summary</name>
+ <classname>java.lang.Object</classname>
+ </property>
+
+ <property elonly="true">
+ <name>tableState</name>
+ <classname>java.lang.String</classname>
+ <description>
+ ValueBinding pointing at a property of a String to hold table state
+ </description>
+ </property>
+
+ <property attachedstate="true" elonly="true">
+ <name>selection</name>
+ <classname>org.richfaces.model.selection.Selection</classname>
+ <description>Value binding representing selected
rows</description>
+ </property>
+
+ </component>
</components>
Property changes on: trunk/sandbox/ui/extendedDataTable/src/main/java
___________________________________________________________________
Name: svn:ignore
+ META-INF
Modified:
trunk/sandbox/ui/extendedDataTable/src/main/java/org/richfaces/component/UIExtendedDataTable.java
===================================================================
---
trunk/sandbox/ui/extendedDataTable/src/main/java/org/richfaces/component/UIExtendedDataTable.java 2008-08-08
07:11:27 UTC (rev 9984)
+++
trunk/sandbox/ui/extendedDataTable/src/main/java/org/richfaces/component/UIExtendedDataTable.java 2008-08-08
10:19:53 UTC (rev 9985)
@@ -225,8 +225,6 @@
// try to add group column id as first
//TODO nick - is it ok to change user's priorities collection here?
- //PBU it is used in grouping mode - grouping column must be sorted
- //as first
if (priority.contains(groupColId)) {
priority.remove(groupColId);
}
Modified:
trunk/sandbox/ui/extendedDataTable/src/main/java/org/richfaces/renderkit/AbstractExtendedTableRenderer.java
===================================================================
---
trunk/sandbox/ui/extendedDataTable/src/main/java/org/richfaces/renderkit/AbstractExtendedTableRenderer.java 2008-08-08
07:11:27 UTC (rev 9984)
+++
trunk/sandbox/ui/extendedDataTable/src/main/java/org/richfaces/renderkit/AbstractExtendedTableRenderer.java 2008-08-08
10:19:53 UTC (rev 9985)
@@ -211,6 +211,7 @@
UIExtendedDataTable table, Iterator<UIColumn> headers,
String skinCellClass, String headerClass, String facetName,
String element) throws IOException {
+
if (filteringEnabled(table)) {
writer.startElement(HTML.TR_ELEMENT, table);
writer.writeAttribute(HTML.id_ATTRIBUTE, table
@@ -232,8 +233,7 @@
/**
* Checks if column has filtering enabled
*
- * @param dataColumn
- * column to inspect
+ * @param dataColumn column to inspect
* @return true if filtering is enabled, false otherwise
* @author pbuda
*/
@@ -246,8 +246,7 @@
/**
* Checks whether filtering is enabled in this table
*
- * @param table
- * table to inspect
+ * @param table table to inspect
* @return true if filtering is enabled, false otherwise
* @author pbuda
*/
Modified:
trunk/sandbox/ui/extendedDataTable/src/main/java/org/richfaces/renderkit/html/TableDragDropRenderer.java
===================================================================
---
trunk/sandbox/ui/extendedDataTable/src/main/java/org/richfaces/renderkit/html/TableDragDropRenderer.java 2008-08-08
07:11:27 UTC (rev 9984)
+++
trunk/sandbox/ui/extendedDataTable/src/main/java/org/richfaces/renderkit/html/TableDragDropRenderer.java 2008-08-08
10:19:53 UTC (rev 9985)
@@ -95,7 +95,7 @@
responseWriter.write("elt.markers['" + DEFAULT +
"'] = \"");
responseWriter.write(getPredefinedMarker(context, REJECT));
responseWriter.write("\";\n");
- responseWriter.write("createDragIndicator(elt, '',
'');\n");
+ responseWriter.write("createExtDragIndicator(elt, '',
'');\n");
}
}.encodeChildScripts(context, component);
Modified:
trunk/sandbox/ui/extendedDataTable/src/main/resources/org/richfaces/renderkit/html/css/extendedDataTable.xcss
===================================================================
---
trunk/sandbox/ui/extendedDataTable/src/main/resources/org/richfaces/renderkit/html/css/extendedDataTable.xcss 2008-08-08
07:11:27 UTC (rev 9984)
+++
trunk/sandbox/ui/extendedDataTable/src/main/resources/org/richfaces/renderkit/html/css/extendedDataTable.xcss 2008-08-08
10:19:53 UTC (rev 9985)
@@ -5,15 +5,6 @@
<f:verbatim>
-
- ul,ol,li{
- margin: 0;
- padding: 0;
- }
- ol,ul{
- list-style: none;
- }
-
.extdt-empty-cell{
}
/**
Modified:
trunk/sandbox/ui/extendedDataTable/src/main/resources/org/richfaces/renderkit/html/scripts/ext-dt-drag-indicator.js
===================================================================
---
trunk/sandbox/ui/extendedDataTable/src/main/resources/org/richfaces/renderkit/html/scripts/ext-dt-drag-indicator.js 2008-08-08
07:11:27 UTC (rev 9984)
+++
trunk/sandbox/ui/extendedDataTable/src/main/resources/org/richfaces/renderkit/html/scripts/ext-dt-drag-indicator.js 2008-08-08
10:19:53 UTC (rev 9985)
@@ -1,209 +1,196 @@
-DragIndicator = {
+ExtDragIndicator = {
init: function(event) {
- var ieVersion = RichFaces.getIEVersion();
- DragIndicator.isIE6 = (ieVersion && ieVersion < 7);
+ var ieVersion = RichFaces.getIEVersion();
+ ExtDragIndicator.isIE6 = (ieVersion && ieVersion < 7);
},
setContent: function(name, single, params) {
- Element.clearChildren(this);
+ Element.clearChildren(this);
- var p = DnD.getDnDDefaultParams(this);
-
- if (!p) {
- p = {};
- }
+ var p = DnD.getDnDDefaultParams(this);
+
+ if (!p) {
+ p = {};
+ }
- if (params) {
- Object.extend(p, params);
- }
-
- if (!p['marker']) {
- if (p[name]) {
- p['marker'] = p[name];
- } else {
- p['marker'] = this.markers[name];
- }
- }
+ if (params) {
+ Object.extend(p, params);
+ }
+
+ if (!p['marker']) {
+ if (p[name]) {
+ p['marker'] = p[name];
+ } else {
+ p['marker'] = this.markers[name];
+ }
+ }
- var parts;
+ var parts;
- if (single) {
- parts = this.indicatorTemplates['single'];
- } else {
- parts = this.indicatorTemplates['multi'];
- }
-
- new Insertion.Top(this, parts.invoke('getContent', p).join(''));
-
- if (DragIndicator.isIE6) {
- this.initIFrame();
- }
- },
+ if (single) {
+ parts = this.indicatorTemplates['single'];
+ } else {
+ parts = this.indicatorTemplates['multi'];
+ }
+
+ new Insertion.Top(this, parts.invoke('getContent', p).join(''));
+
+ if (ExtDragIndicator.isIE6) {
+ this.initIFrame();
+ }
+ },
- show: function() {
- if (!this.floatedToBody) {
- if (!this.realParent) {
- this.realParent = this.parentNode;
- this._nextSibling = this.nextSibling;
- }
- this.realParent.removeChild(this);
- document.body.appendChild(this);
- this.floatedToBody = true;
- }
- Element.show(this);
- this.style.position = 'absolute';
- },
+ show: function() {
+ if (!this.floatedToBody) {
+ if (!this.realParent) {
+ this.realParent = this.parentNode;
+ this._nextSibling = this.nextSibling;
+ }
+ this.realParent.removeChild(this);
+ document.body.appendChild(this);
+ this.floatedToBody = true;
+ }
+ Element.show(this);
+ this.style.position = 'absolute';
+ },
- hide: function() {
- Element.hide(this);
- this.style.position = '';
- this.offsets = undefined;
- this.leave();
- if (this.floatedToBody && this.realParent) {
- document.body.removeChild(this);
- if (this._nextSibling) {
- this.realParent.insertBefore(this, this._nextSibling);
- } else {
- this.realParent.appendChild(this);
- }
- this.floatedToBody = false;
- }
- },
+ hide: function() {
+ Element.hide(this);
+ this.style.position = '';
+ this.offsets = undefined;
+ this.leave();
+ if (this.floatedToBody && this.realParent) {
+ document.body.removeChild(this);
+ if (this._nextSibling) {
+ this.realParent.insertBefore(this, this._nextSibling);
+ } else {
+ this.realParent.appendChild(this);
+ }
+ this.floatedToBody = false;
+ }
+ },
- position: function(x, y) {
- if (!this.offsets) {
- Element.show(this);
- this.style.position = 'absolute';
- }
- Element.setStyle(this, {"left": x + "px", "top": y +
"px"});
- },
+ position: function(x, y) {
+ if (!this.offsets) {
+ Element.show(this);
+ this.style.position = 'absolute';
+ }
+ Element.setStyle(this, {"left": x + "px", "top": y
+ "px"});
+ },
- accept: function() {
- Element.removeClassName(this, 'drgind_default');
- Element.removeClassName(this, 'drgind_reject');
- Element.addClassName(this, 'drgind_accept');
+ accept: function() {
+ Element.removeClassName(this, 'drgind_default');
+ Element.removeClassName(this, 'drgind_reject');
+ Element.addClassName(this, 'drgind_accept');
- var acceptClass = this.getAcceptClass();
- if (acceptClass) {
- Element.addClassName(this, acceptClass);
- }
- },
+ var acceptClass = this.getAcceptClass();
+ if (acceptClass) {
+ Element.addClassName(this, acceptClass);
+ }
+ },
- reject: function() {
- Element.removeClassName(this, 'drgind_default');
- Element.removeClassName(this, 'drgind_accept');
- Element.addClassName(this, 'drgind_reject');
+ reject: function() {
+ Element.removeClassName(this, 'drgind_default');
+ Element.removeClassName(this, 'drgind_accept');
+ Element.addClassName(this, 'drgind_reject');
- var rejectClass = this.getRejectClass();
- if (rejectClass) {
- Element.addClassName(this, rejectClass);
- }
- },
+ var rejectClass = this.getRejectClass();
+ if (rejectClass) {
+ Element.addClassName(this, rejectClass);
+ }
+ },
- leave: function() {
- Element.removeClassName(this, 'drgind_accept');
- //Element.removeClassName(this, 'drgind_reject');
- //Element.addClassName(this, 'drgind_default');
- Element.removeClassName(this, 'drgind_default');
- Element.addClassName(this, 'drgind_reject');
+ leave: function() {
+ Element.removeClassName(this, 'drgind_accept');
+ //Element.removeClassName(this, 'drgind_reject');
+ //Element.addClassName(this, 'drgind_default');
+ Element.removeClassName(this, 'drgind_default');
+ Element.addClassName(this, 'drgind_reject');
- var acceptClass = this.getAcceptClass();
- var rejectClass = this.getRejectClass();
- if (acceptClass) {
- Element.removeClassName(this, acceptClass);
- }
- if (rejectClass) {
- Element.removeClassName(this, rejectClass);
- }
- },
+ var acceptClass = this.getAcceptClass();
+ var rejectClass = this.getRejectClass();
+ if (acceptClass) {
+ Element.removeClassName(this, acceptClass);
+ }
+ if (rejectClass) {
+ Element.removeClassName(this, rejectClass);
+ }
+ },
- getAcceptClass: function() {
- return this.ils_acceptClass;
- },
+ getAcceptClass: function() {
+ return this.ils_acceptClass;
+ },
- getRejectClass: function() {
- return this.ils_rejectClass;
- },
-
- initIFrame: function() {
- var iframe = document.createElement("iframe");
- Element.addClassName(iframe, 'rich-dragindicator-iframe');
- this.insertBefore(iframe, this.firstChild);
- var table = iframe.nextSibling;
- iframe.style.width = table.offsetWidth + "px";
- iframe.style.height = table.offsetHeight + "px";
- }
+ getRejectClass: function() {
+ return this.ils_rejectClass;
+ },
+
+ initIFrame: function() {
+ var iframe = document.createElement("iframe");
+ Element.addClassName(iframe, 'rich-dragindicator-iframe');
+ this.insertBefore(iframe, this.firstChild);
+ var table = iframe.nextSibling;
+ iframe.style.width = table.offsetWidth + "px";
+ iframe.style.height = table.offsetHeight + "px";
+ }
};
-function createDragIndicator(elt, acceptClass, rejectClass) {
- Object.extend(elt, DragIndicator);
+function createExtDragIndicator(elt, acceptClass, rejectClass) {
+ Object.extend(elt, ExtDragIndicator);
elt.init();
-
- elt.ils_acceptClass = acceptClass;
- elt.ils_rejectClass = rejectClass;
+
+ elt.ils_acceptClass = acceptClass;
+ elt.ils_rejectClass = rejectClass;
}
-// <table border="0" cellpadding="3" cellspacing="0"
class="drgind_internal" style="height : 100%">
-// <tr>
-// <td class="drgind_marker">
-// {marker}
-// </td>
-// <td class="drgind_text">
-// <div class="drgind_wordcut drgind_text_content">
-// {label}
-// </div>
-// </td>
-// </tr>
-// </table>
-// <div class="drgind_shadow" />
-DefaultDragIndicatorView =
+DefaultExtDragIndicatorView =
[
- new E('table',
- {
- 'style':'height : 100%; z-index: 2;',
- 'className':'drgind_internal',
- 'cellspacing':'0',
- 'cellpadding':'3',
- 'border':'0'
- },
- [
- new E('tbody',{},
- [
- new E('tr',{},
- [
- new E('td',
- {
- 'className':'drgind_marker'
- },
- [
- new ET(function (context) { return Richfaces.eval("marker",
context)})
- ]
- ),
- new E('td',
- {
- 'className':'drgind_text'
- },
- [
- new E('div',
- {
- 'className':'drgind_wordcut drgind_text_content'
- },
- [
- new ET(function (context) { return Richfaces.eval("label",
context)})
- ]
- )
- ]
- )
- ]
- )
- ]
- )
- ]
- ),
- new E('div',
- {
- 'className':'drgind_shadow'
- }
- )
+ new E('table',
+ {
+ 'style':'height : 100%; z-index: 2;',
+ 'className':'drgind_internal',
+ 'cellspacing':'0',
+ 'cellpadding':'3',
+ 'border':'0'
+ },
+ [
+ new E('tbody',{},
+ [
+ new E('tr',{},
+ [
+ new E('td',
+ {
+ 'className':'drgind_marker'
+ },
+ [
+ new ET(function (context) { return
Richfaces.eval("marker", context)})
+ ]
+ ),
+ new E('td',
+ {
+ 'className':'drgind_text'
+ },
+ [
+ new E('div',
+ {
+
'className':'drgind_wordcut drgind_text_content'
+ },
+ [
+ new ET(function (context) {
return Richfaces.eval("label", context)})
+ ]
+ )
+ ]
+ )
+ ]
+ )
+ ]
+ )
+ ]
+ ),
+ new E('div',
+ {
+ 'className':'drgind_shadow'
+ }
+ )
];
Copied:
trunk/sandbox/ui/extendedDataTable/src/main/resources/org/richfaces/renderkit/html/scripts/ext-dt-simple-draggable.js
(from rev 9873,
trunk/sandbox/ui/extendedDataTable/src/main/resources/org/richfaces/renderkit/html/scripts/ext-simple-draggable.js)
===================================================================
---
trunk/sandbox/ui/extendedDataTable/src/main/resources/org/richfaces/renderkit/html/scripts/ext-dt-simple-draggable.js
(rev 0)
+++
trunk/sandbox/ui/extendedDataTable/src/main/resources/org/richfaces/renderkit/html/scripts/ext-dt-simple-draggable.js 2008-08-08
10:19:53 UTC (rev 9985)
@@ -0,0 +1,121 @@
+DnD.ExtSimpleDraggable = Class.create();
+
+Object.extend(DnD.ExtSimpleDraggable.prototype, DnD.Draggable.prototype);
+Object.extend(DnD.ExtSimpleDraggable.prototype, {
+ initialize: function(id, options) {
+ this.id = $(id);
+
+ if (!this.id) {
+ alert("drag: Element with [" + id + "] ID was not found in the DOM
tree. Probably element has no client ID or client ID hasn't been written. DnD's
disabled. Check please!");
+ return ;
+ }
+
+ this.options = options;
+
+ this.dragIndicatorId = this.options.dragIndicator;
+
+ this.eventMouseDown = this.initDrag.bindAsEventListener(this);
+
+ Event.observe(this.id, "mousedown", this.eventMouseDown);
+
+ this.form = this.id;
+ while (this.form && !/^form$/i.test(this.form.tagName)) {
+ this.form = this.form.parentNode;
+ }
+
+ this.enableDraggableCursors(this.options.grab, this.options.grabbing);
+ },
+
+ getDnDDragParams: function() {
+ if (this.options.dndParams) {
+ return this.options.dndParams.parseJSON(EventHandlersWalk);
+ }
+
+ return null;
+ },
+
+ getIndicator: function() {
+ var dragIndicator = $(this.dragIndicatorId);
+ if (!dragIndicator) {
+ dragIndicator = this.getOrCreateDefaultIndicator();
+ }
+
+ return dragIndicator;
+ },
+
+ ondragstart : function(event, drag) {
+ this.showDropTargets();
+ drag.params = this.options.parameters;
+ drag.params[this.id] = this.id;
+
+ this.setIndicator(event);
+
+ this.getIndicator().leave();
+
+ //this.dragEnter(event);
+
+ if (this.form) {
+ drag.params[this.form.id] = this.form.id;
+ }
+ },
+
+ ondragend: function (event, drag) {
+ this.hideDropTargets();
+ },
+
+ getContentType: function() {
+ return this.options.dragType;
+ },
+
+ getDraggableOptions: function() {
+ return this.options;
+ },
+
+ initDrag: function(event) {
+ if (Event.isLeftClick(event)) {
+ var src = Event.element(event);
+ if(src.tagName && /^INPUT|SELECT|OPTION|BUTTON|TEXTAREA$/i.test(src.tagName))
+ return;
+
+ Event.stop(event);
+
+ this.startDrag(event);
+ //Event.observe(document, "mousemove", this.listenDragBound);
+ //Event.observe(document, "mouseup", this.stopListenDragBound);
+ }
+ },
+
+ showDropTargets: function(){
+ var idStr = this.id.id;
+ var ind = idStr.lastIndexOf('_');
+ var prefix = idStr.substring(0,ind).replace("hdrag", "hdrop");
+ var spans = document.getElementsByTagName("span");
+ for(i=0;i<spans.length;i++){
+ var s = spans[i];
+ if (s.id.indexOf(prefix) == 0){
+ //s.style.zIndex = '70';
+ s.style.visibility = "visible";
+ //change dropzone style
+ s.childNodes[0].style.visibility="hidden";//top element
+ s.childNodes[1].style.visibility="hidden";//bottom element
+ }
+ }//for
+ },
+
+ hideDropTargets: function(){
+ var idStr = this.id.id;
+ var ind = idStr.lastIndexOf('_');
+ var prefix = idStr.substring(0,ind).replace("hdrag", "hdrop");
+ var spans = document.getElementsByTagName("span");
+ for (i=0;i<spans.length;i++){
+ var s = spans[i];
+ if (s.id.indexOf(prefix) == 0){
+ //s.style.zIndex = '59';
+ s.style.visibility = "hidden";
+ //change dropzone style
+ s.childNodes[0].style.visibility="hidden";//top element
+ s.childNodes[1].style.visibility="hidden";//bottom element
+ }
+ }//for
+ }
+});
\ No newline at end of file
Property changes on:
trunk/sandbox/ui/extendedDataTable/src/main/resources/org/richfaces/renderkit/html/scripts/ext-dt-simple-draggable.js
___________________________________________________________________
Name: svn:mergeinfo
+
Copied:
trunk/sandbox/ui/extendedDataTable/src/main/resources/org/richfaces/renderkit/html/scripts/ext-dt-simple-dropzone.js
(from rev 9873,
trunk/sandbox/ui/extendedDataTable/src/main/resources/org/richfaces/renderkit/html/scripts/ext-simple-dropzone.js)
===================================================================
---
trunk/sandbox/ui/extendedDataTable/src/main/resources/org/richfaces/renderkit/html/scripts/ext-dt-simple-dropzone.js
(rev 0)
+++
trunk/sandbox/ui/extendedDataTable/src/main/resources/org/richfaces/renderkit/html/scripts/ext-dt-simple-dropzone.js 2008-08-08
10:19:53 UTC (rev 9985)
@@ -0,0 +1,99 @@
+DnD.ExtSimpleDropZone = Class.create();
+Object.extend(DnD.ExtSimpleDropZone.prototype, DnD.Dropzone.prototype);
+Object.extend(DnD.ExtSimpleDropZone.prototype, {
+ initialize: function(id, options) {
+ this.id = id;
+ var element = $(id);
+
+ if (!element) {
+ alert("drop: Element with [" + id + "] ID was not found in the DOM
tree. Probably element has no client ID or client ID hasn't been written. DnD's
disabled. Check please!");
+ return ;
+ }
+
+ this.element = element;
+ if (options.acceptedTypes) {
+ this.acceptedTypes = options.acceptedTypes;
+ } else {
+ this.acceptedTypes = [];
+ }
+
+ if (options.typeMapping) {
+ this.typeMapping = options.typeMapping;
+ } else {
+ this.typeMapping = {};
+ }
+
+ if (options.cursorTypeMapping) {
+ this.cursorTypeMapping = options.cursorTypeMapping;
+ } else {
+ this.cursorTypeMapping = {};
+ }
+
+ this.mouseoverBound = this.mouseover.bindAsEventListener(this);
+ this.mouseoutBound = this.mouseout.bindAsEventListener(this);
+ this.mouseupBound = this.mouseup.bindAsEventListener(this);
+
+ Event.observe(element, "mouseover", this.mouseoverBound);
+ Event.observe(element, "mouseout", this.mouseoutBound);
+ Event.observe(element, "mouseup", this.mouseupBound);
+
+
+
+ this.options = options || {};
+ this.enableDropzoneCursors(options.acceptCursor,options.rejectCursor);
+
+ },
+
+ getDropzoneOptions: function() {
+ return this.options;
+ },
+
+ getDnDDropParams: function() {
+ if (this.options.dndParams) {
+ return this.options.dndParams.parseJSON(EventHandlersWalk);
+ }
+
+ return null;
+ },
+
+ mouseover: function(event) {
+ if (window.drag){
+ this.dragEnter(event);
+ //change dropzone style
+ this.element.childNodes[0].style.visibility="visible";//top element
+ this.element.childNodes[1].style.visibility="visible";//bottom element
+ }
+ },
+
+ mouseup: function(event) {
+ this.dragUp(event);
+ },
+
+ mouseout: function(event) {
+ if (window.drag){
+ this.dragLeave(event);
+ //change dropzone style
+ this.element.childNodes[0].style.visibility="hidden";//top element
+ this.element.childNodes[1].style.visibility="hidden";//bottom element
+ }
+ },
+ getAcceptedTypes: function() {
+ return this.acceptedTypes;
+ },
+ getTypeMapping: function() {
+ return this.typeMapping;
+ },
+
+ getCursorTypeMapping: function() {
+ return this.cursorTypeMapping;
+ },
+
+ drop: function(event, drag){
+ alert('I drop');
+ },
+ onafterdrag: function(drag) {
+ if (this.options.onafterdrag) {
+ this.options.onafterdrag.call(this, drag);
+ }
+ }
+});
\ No newline at end of file
Property changes on:
trunk/sandbox/ui/extendedDataTable/src/main/resources/org/richfaces/renderkit/html/scripts/ext-dt-simple-dropzone.js
___________________________________________________________________
Name: svn:mergeinfo
+
Deleted:
trunk/sandbox/ui/extendedDataTable/src/main/resources/org/richfaces/renderkit/html/scripts/ext-simple-draggable.js
===================================================================
---
trunk/sandbox/ui/extendedDataTable/src/main/resources/org/richfaces/renderkit/html/scripts/ext-simple-draggable.js 2008-08-08
07:11:27 UTC (rev 9984)
+++
trunk/sandbox/ui/extendedDataTable/src/main/resources/org/richfaces/renderkit/html/scripts/ext-simple-draggable.js 2008-08-08
10:19:53 UTC (rev 9985)
@@ -1,121 +0,0 @@
-DnD.ExtSimpleDraggable = Class.create();
-
-Object.extend(DnD.ExtSimpleDraggable.prototype, DnD.Draggable.prototype);
-Object.extend(DnD.ExtSimpleDraggable.prototype, {
- initialize: function(id, options) {
- this.id = $(id);
-
- if (!this.id) {
- alert("drag: Element with [" + id + "] ID was not found in the DOM
tree. Probably element has no client ID or client ID hasn't been written. DnD's
disabled. Check please!");
- return ;
- }
-
- this.options = options;
-
- this.dragIndicatorId = this.options.dragIndicator;
-
- this.eventMouseDown = this.initDrag.bindAsEventListener(this);
-
- Event.observe(this.id, "mousedown", this.eventMouseDown);
-
- this.form = this.id;
- while (this.form && !/^form$/i.test(this.form.tagName)) {
- this.form = this.form.parentNode;
- }
-
- this.enableDraggableCursors(this.options.grab, this.options.grabbing);
- },
-
- getDnDDragParams: function() {
- if (this.options.dndParams) {
- return this.options.dndParams.parseJSON(EventHandlersWalk);
- }
-
- return null;
- },
-
- getIndicator: function() {
- var dragIndicator = $(this.dragIndicatorId);
- if (!dragIndicator) {
- dragIndicator = this.getOrCreateDefaultIndicator();
- }
-
- return dragIndicator;
- },
-
- ondragstart : function(event, drag) {
- this.showDropTargets();
- drag.params = this.options.parameters;
- drag.params[this.id] = this.id;
-
- this.setIndicator(event);
-
- this.getIndicator().leave();
-
- //this.dragEnter(event);
-
- if (this.form) {
- drag.params[this.form.id] = this.form.id;
- }
- },
-
- ondragend: function (event, drag) {
- this.hideDropTargets();
- },
-
- getContentType: function() {
- return this.options.dragType;
- },
-
- getDraggableOptions: function() {
- return this.options;
- },
-
- initDrag: function(event) {
- if (Event.isLeftClick(event)) {
- var src = Event.element(event);
- if(src.tagName && /^INPUT|SELECT|OPTION|BUTTON|TEXTAREA$/i.test(src.tagName))
- return;
-
- Event.stop(event);
-
- this.startDrag(event);
- //Event.observe(document, "mousemove", this.listenDragBound);
- //Event.observe(document, "mouseup", this.stopListenDragBound);
- }
- },
-
- showDropTargets: function(){
- var idStr = this.id.id;
- var ind = idStr.lastIndexOf('_');
- var prefix = idStr.substring(0,ind).replace("hdrag", "hdrop");
- var spans = document.getElementsByTagName("span");
- for(i=0;i<spans.length;i++){
- var s = spans[i];
- if (s.id.indexOf(prefix) == 0){
- //s.style.zIndex = '70';
- s.style.visibility = "visible";
- //change dropzone style
- s.childNodes[0].style.visibility="hidden";//top element
- s.childNodes[1].style.visibility="hidden";//bottom element
- }
- }//for
- },
-
- hideDropTargets: function(){
- var idStr = this.id.id;
- var ind = idStr.lastIndexOf('_');
- var prefix = idStr.substring(0,ind).replace("hdrag", "hdrop");
- var spans = document.getElementsByTagName("span");
- for (i=0;i<spans.length;i++){
- var s = spans[i];
- if (s.id.indexOf(prefix) == 0){
- //s.style.zIndex = '59';
- s.style.visibility = "hidden";
- //change dropzone style
- s.childNodes[0].style.visibility="hidden";//top element
- s.childNodes[1].style.visibility="hidden";//bottom element
- }
- }//for
- }
-});
\ No newline at end of file
Deleted:
trunk/sandbox/ui/extendedDataTable/src/main/resources/org/richfaces/renderkit/html/scripts/ext-simple-dropzone.js
===================================================================
---
trunk/sandbox/ui/extendedDataTable/src/main/resources/org/richfaces/renderkit/html/scripts/ext-simple-dropzone.js 2008-08-08
07:11:27 UTC (rev 9984)
+++
trunk/sandbox/ui/extendedDataTable/src/main/resources/org/richfaces/renderkit/html/scripts/ext-simple-dropzone.js 2008-08-08
10:19:53 UTC (rev 9985)
@@ -1,99 +0,0 @@
-DnD.ExtSimpleDropZone = Class.create();
-Object.extend(DnD.ExtSimpleDropZone.prototype, DnD.Dropzone.prototype);
-Object.extend(DnD.ExtSimpleDropZone.prototype, {
- initialize: function(id, options) {
- this.id = id;
- var element = $(id);
-
- if (!element) {
- alert("drop: Element with [" + id + "] ID was not found in the DOM
tree. Probably element has no client ID or client ID hasn't been written. DnD's
disabled. Check please!");
- return ;
- }
-
- this.element = element;
- if (options.acceptedTypes) {
- this.acceptedTypes = options.acceptedTypes;
- } else {
- this.acceptedTypes = [];
- }
-
- if (options.typeMapping) {
- this.typeMapping = options.typeMapping;
- } else {
- this.typeMapping = {};
- }
-
- if (options.cursorTypeMapping) {
- this.cursorTypeMapping = options.cursorTypeMapping;
- } else {
- this.cursorTypeMapping = {};
- }
-
- this.mouseoverBound = this.mouseover.bindAsEventListener(this);
- this.mouseoutBound = this.mouseout.bindAsEventListener(this);
- this.mouseupBound = this.mouseup.bindAsEventListener(this);
-
- Event.observe(element, "mouseover", this.mouseoverBound);
- Event.observe(element, "mouseout", this.mouseoutBound);
- Event.observe(element, "mouseup", this.mouseupBound);
-
-
-
- this.options = options || {};
- this.enableDropzoneCursors(options.acceptCursor,options.rejectCursor);
-
- },
-
- getDropzoneOptions: function() {
- return this.options;
- },
-
- getDnDDropParams: function() {
- if (this.options.dndParams) {
- return this.options.dndParams.parseJSON(EventHandlersWalk);
- }
-
- return null;
- },
-
- mouseover: function(event) {
- if (window.drag){
- this.dragEnter(event);
- //change dropzone style
- this.element.childNodes[0].style.visibility="visible";//top element
- this.element.childNodes[1].style.visibility="visible";//bottom element
- }
- },
-
- mouseup: function(event) {
- this.dragUp(event);
- },
-
- mouseout: function(event) {
- if (window.drag){
- this.dragLeave(event);
- //change dropzone style
- this.element.childNodes[0].style.visibility="hidden";//top element
- this.element.childNodes[1].style.visibility="hidden";//bottom element
- }
- },
- getAcceptedTypes: function() {
- return this.acceptedTypes;
- },
- getTypeMapping: function() {
- return this.typeMapping;
- },
-
- getCursorTypeMapping: function() {
- return this.cursorTypeMapping;
- },
-
- drop: function(event, drag){
- alert('I drop');
- },
- onafterdrag: function(drag) {
- if (this.options.onafterdrag) {
- this.options.onafterdrag.call(this, drag);
- }
- }
-});
\ No newline at end of file
Modified:
trunk/sandbox/ui/extendedDataTable/src/main/templates/org/richfaces/htmlExtendedDataTable.jspx
===================================================================
---
trunk/sandbox/ui/extendedDataTable/src/main/templates/org/richfaces/htmlExtendedDataTable.jspx 2008-08-08
07:11:27 UTC (rev 9984)
+++
trunk/sandbox/ui/extendedDataTable/src/main/templates/org/richfaces/htmlExtendedDataTable.jspx 2008-08-08
10:19:53 UTC (rev 9985)
@@ -41,8 +41,8 @@
/org/richfaces/renderkit/html/scripts/extended-data-table.js,
/org/richfaces/renderkit/html/scripts/ext-dt-drag-indicator.js,
- /org/richfaces/renderkit/html/scripts/ext-simple-draggable.js,
- /org/richfaces/renderkit/html/scripts/ext-simple-dropzone.js
+ /org/richfaces/renderkit/html/scripts/ext-dt-simple-draggable.js,
+ /org/richfaces/renderkit/html/scripts/ext-dt-simple-dropzone.js
</h:scripts>
<f:clientid var="clientId"/>
Deleted:
trunk/sandbox/ui/extendedDataTable/src/test/java/org/richfaces/component/JSFComponentTest.java
===================================================================
---
trunk/sandbox/ui/extendedDataTable/src/test/java/org/richfaces/component/JSFComponentTest.java 2008-08-08
07:11:27 UTC (rev 9984)
+++
trunk/sandbox/ui/extendedDataTable/src/test/java/org/richfaces/component/JSFComponentTest.java 2008-08-08
10:19:53 UTC (rev 9985)
@@ -1,53 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.richfaces.component;
-
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-import javax.faces.component.UIComponent;
-
-/**
- * Unit test for simple Component.
- */
-public class JSFComponentTest
- extends TestCase
-{
- /**
- * Create the test case
- *
- * @param testName name of the test case
- */
- public JSFComponentTest( String testName )
- {
- super( testName );
- }
-
-
- /**
- * Rigourous Test :-)
- */
- public void testComponent()
- {
- assertTrue( true );
- }
-}
Added:
trunk/sandbox/ui/extendedDataTable/src/test/java/org/richfaces/component/renderer/ExtendedDataTableRendererTest.java
===================================================================
---
trunk/sandbox/ui/extendedDataTable/src/test/java/org/richfaces/component/renderer/ExtendedDataTableRendererTest.java
(rev 0)
+++
trunk/sandbox/ui/extendedDataTable/src/test/java/org/richfaces/component/renderer/ExtendedDataTableRendererTest.java 2008-08-08
10:19:53 UTC (rev 9985)
@@ -0,0 +1,89 @@
+package org.richfaces.component.renderer;
+
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import javax.el.MethodExpression;
+import javax.faces.component.UIOutput;
+import javax.faces.component.html.HtmlOutputText;
+
+import org.ajax4jsf.tests.AbstractAjax4JsfTestCase;
+import org.richfaces.component.UIColumn;
+import org.richfaces.component.UIExtendedDataTable;
+
+import com.gargoylesoftware.htmlunit.html.HtmlElement;
+import com.gargoylesoftware.htmlunit.html.HtmlPage;
+
+
+/**
+ *
+ * @author pbuda
+ *
+ */
+public class ExtendedDataTableRendererTest extends AbstractAjax4JsfTestCase {
+
+ private UIExtendedDataTable table;
+
+ private Set<String> javascripts = new HashSet<String>();
+
+
+ public ExtendedDataTableRendererTest(String name) {
+ super(name);
+ }
+
+ @Override
+ public void setUp() throws Exception {
+ super.setUp();
+
+ //Create data table
+ table = (UIExtendedDataTable)
application.createComponent(UIExtendedDataTable.COMPONENT_TYPE);
+ table.setId("table");
+
+ UIColumn column = (UIColumn) createComponent(
+ UIColumn.COMPONENT_TYPE,
+ "org.richfaces.component.Column",
+ null, null, null
+ );
+
+ column.setFilterValue("field");
+
+ UIOutput output = (UIOutput) createComponent(
+ UIOutput.COMPONENT_TYPE,
+ HtmlOutputText.class.getName(),
+ null, null, null
+ );
+
+ column.getChildren().add(output);
+
+
+ table.getChildren().add(column);
+
+ facesContext.getViewRoot().getChildren().add(table);
+
+ //javascripts initialization
+
javascripts.add("org/richfaces/renderkit/html/scripts/extended-data-table.js");
+ }
+
+ @Override
+ public void tearDown() throws Exception {
+ table = null;
+ super.tearDown();
+ }
+
+ @SuppressWarnings("unchecked")
+ public void testLoadingStyles() throws Exception {
+ HtmlPage page = renderView();
+ assertNotNull(page);
+ List links =
page.getDocumentHtmlElement().getHtmlElementsByTagName("link");
+ assertNotNull(links);
+ HtmlElement link = (HtmlElement) links.get(0);
+
assertTrue(link.getAttributeValue("href").contains("css/extendedDataTable.xcss"));
+ }
+
+ public void testLoadingScripts() throws Exception {
+ HtmlPage page = renderView();
+ assertNotNull(page);
+ assertTrue(getCountValidScripts(page, javascripts, false).intValue() ==
javascripts.size());
+ }
+}