JBoss Rich Faces SVN: r18154 - root/docs/trunk/parent.
by richfaces-svn-commits@lists.jboss.org
Author: SeanRogers
Date: 2010-07-20 01:30:54 -0400 (Tue, 20 Jul 2010)
New Revision: 18154
Modified:
root/docs/trunk/parent/pom.xml
Log:
Fixed issue with xml samples by rolling back jDocBook version (RF-8930)
Modified: root/docs/trunk/parent/pom.xml
===================================================================
--- root/docs/trunk/parent/pom.xml 2010-07-19 15:28:03 UTC (rev 18153)
+++ root/docs/trunk/parent/pom.xml 2010-07-20 05:30:54 UTC (rev 18154)
@@ -38,7 +38,7 @@
<plugin>
<groupId>org.jboss.maven.plugins</groupId>
<artifactId>maven-jdocbook-plugin</artifactId>
- <version>2.2.3</version>
+ <version>2.2.1</version>
<extensions>true</extensions>
<dependencies>
<dependency>
14 years, 5 months
JBoss Rich Faces SVN: r18152 - in root/ui-sandbox/inputs/trunk/combobox/src/main: templates and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: pyaschenko
Date: 2010-07-19 11:16:14 -0400 (Mon, 19 Jul 2010)
New Revision: 18152
Modified:
root/ui-sandbox/inputs/trunk/combobox/src/main/resources/META-INF/resources/org.richfaces/AutoComplete.js
root/ui-sandbox/inputs/trunk/combobox/src/main/resources/META-INF/resources/org.richfaces/AutoCompleteBase.js
root/ui-sandbox/inputs/trunk/combobox/src/main/templates/comboBox.template.xml
Log:
https://jira.jboss.org/browse/RF-8875
Modified: root/ui-sandbox/inputs/trunk/combobox/src/main/resources/META-INF/resources/org.richfaces/AutoComplete.js
===================================================================
--- root/ui-sandbox/inputs/trunk/combobox/src/main/resources/META-INF/resources/org.richfaces/AutoComplete.js 2010-07-19 14:53:22 UTC (rev 18151)
+++ root/ui-sandbox/inputs/trunk/combobox/src/main/resources/META-INF/resources/org.richfaces/AutoComplete.js 2010-07-19 15:16:14 UTC (rev 18152)
@@ -56,12 +56,12 @@
rf.ui = rf.ui || {};
// Constructor definition
- rf.ui.ComboBox = function(componentId, fieldId, options) {
+ rf.ui.AutoComplete = function(componentId, fieldId, options) {
this.namespace = "."+rf.Event.createNamespace(this.name, this.componentId);
this.options = {};
// call constructor of parent class
$super.constructor.call(this, componentId+ID.SELECT, fieldId, options);
- this.attachToDom.call(this, componentId);
+ this.attachToDom(componentId);
this.componentId = componentId;
this.options = $.extend(this.options, defaultOptions, options);
this.inputValue = this.getInputValue();
@@ -71,20 +71,19 @@
updateItemsList.call(this, "");
};
- var $p ={};
-
// Extend component class and add protected methods from parent class to our container
- $p = rf.ui.SelectBase.extend(rf.ui.SelectBase, rf.ui.ComboBox, $p);
+ rf.ui.AutoCompleteBase.extend(rf.ui.AutoComplete);
// define super class link
- var $super = rf.ui.ComboBox.$super;
+ var $super = rf.ui.AutoComplete.$super;
var defaultOptions = {
selectedItemClass:'cb_select',
autoFill:true,
minChars:1,
selectFirst:true,
- ajaxMode:true
+ ajaxMode:true,
+ attachToBody:true
};
var ID = {
@@ -179,9 +178,9 @@
rf.ajax(this.componentId, event, {parameters: params, error: ajaxError, complete:ajaxSuccess});
};
- $.extend(rf.ui.ComboBox.prototype, (function () {
+ $.extend(rf.ui.AutoComplete.prototype, (function () {
return {
- name:"CompoBox",
+ name:"AutoComplete",
destroy: function () {
//TODO: add all unbind
rf.Event.unbind(rf.getDomElement(this.componentId+ID.ITEMS).parentNode, this.namespace);
Modified: root/ui-sandbox/inputs/trunk/combobox/src/main/resources/META-INF/resources/org.richfaces/AutoCompleteBase.js
===================================================================
--- root/ui-sandbox/inputs/trunk/combobox/src/main/resources/META-INF/resources/org.richfaces/AutoCompleteBase.js 2010-07-19 14:53:22 UTC (rev 18151)
+++ root/ui-sandbox/inputs/trunk/combobox/src/main/resources/META-INF/resources/org.richfaces/AutoCompleteBase.js 2010-07-19 15:16:14 UTC (rev 18152)
@@ -41,7 +41,7 @@
rf.ui = rf.ui || {};
// Constructor definition
- rf.ui.SelectBase = function(selectId, fieldId, options) {
+ rf.ui.AutoCompleteBase = function(selectId, fieldId, options) {
// call constructor of parent class
$super.constructor.call(this, selectId);
this.selectId = selectId;
@@ -52,13 +52,11 @@
bindEventHandlers.call(this);
};
- var $p ={};
-
// Extend component class and add protected methods from parent class to our container
- $p = rf.BaseComponent.extend(rf.BaseComponent, rf.ui.SelectBase, $p);
+ rf.BaseComponent.extend(rf.ui.AutoCompleteBase);
// define super class link
- var $super = rf.ui.SelectBase.$super;
+ var $super = rf.ui.AutoCompleteBase.$super;
var defaultOptions = {
changeDelay:8
@@ -202,9 +200,9 @@
}
}
- $.extend(rf.ui.SelectBase.prototype, (function () {
+ $.extend(rf.ui.AutoCompleteBase.prototype, (function () {
return {
- name:"SelectBase",
+ name:"AutoCompleteBase",
show: function (event) {
if (!this.isVisible) {
if (this.onBeforeShow(event)!=false) {
Modified: root/ui-sandbox/inputs/trunk/combobox/src/main/templates/comboBox.template.xml
===================================================================
--- root/ui-sandbox/inputs/trunk/combobox/src/main/templates/comboBox.template.xml 2010-07-19 14:53:22 UTC (rev 18151)
+++ root/ui-sandbox/inputs/trunk/combobox/src/main/templates/comboBox.template.xml 2010-07-19 15:16:14 UTC (rev 18152)
@@ -40,7 +40,7 @@
</div>
</div>
<script type="text/javascript">
- new RichFaces.ui.ComboBox("#{clientId}",
+ new RichFaces.ui.AutoComplete("#{clientId}",
"#{clientId}Input", {buttonId:"#{clientId}Button",
selectedItemClass:'cb_select'});
</script>
14 years, 5 months
JBoss Rich Faces SVN: r18151 - root/examples/iteration-demo/trunk.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2010-07-19 10:53:22 -0400 (Mon, 19 Jul 2010)
New Revision: 18151
Modified:
root/examples/iteration-demo/trunk/pom.xml
Log:
remove richfaces-commons ref
Modified: root/examples/iteration-demo/trunk/pom.xml
===================================================================
--- root/examples/iteration-demo/trunk/pom.xml 2010-07-19 14:47:20 UTC (rev 18150)
+++ root/examples/iteration-demo/trunk/pom.xml 2010-07-19 14:53:22 UTC (rev 18151)
@@ -101,10 +101,6 @@
<groupId>org.richfaces.core</groupId>
<artifactId>richfaces-core-impl</artifactId>
</dependency>
- <dependency>
- <groupId>org.richfaces.commons</groupId>
- <artifactId>richfaces-commons-api</artifactId>
- </dependency>
<dependency>
<groupId>net.sf.ehcache</groupId>
<artifactId>ehcache</artifactId>
14 years, 5 months
JBoss Rich Faces SVN: r18150 - in root/ui/iteration/trunk/tables/ui/src/main/java/org/richfaces: renderkit and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2010-07-19 10:47:20 -0400 (Mon, 19 Jul 2010)
New Revision: 18150
Modified:
root/ui/iteration/trunk/tables/ui/src/main/java/org/richfaces/component/UIDataGrid.java
root/ui/iteration/trunk/tables/ui/src/main/java/org/richfaces/renderkit/AbstractRowsRenderer.java
root/ui/iteration/trunk/tables/ui/src/main/java/org/richfaces/renderkit/DataGridRenderer.java
Log:
RF-8923, RF-8924
Modified: root/ui/iteration/trunk/tables/ui/src/main/java/org/richfaces/component/UIDataGrid.java
===================================================================
--- root/ui/iteration/trunk/tables/ui/src/main/java/org/richfaces/component/UIDataGrid.java 2010-07-19 14:09:07 UTC (rev 18149)
+++ root/ui/iteration/trunk/tables/ui/src/main/java/org/richfaces/component/UIDataGrid.java 2010-07-19 14:47:20 UTC (rev 18150)
@@ -71,7 +71,8 @@
}
public int getColumns() {
- return (Integer)getStateHelper().eval(PropertyKeys.columns, 1);
+ int columns = (Integer)getStateHelper().eval(PropertyKeys.columns, 1);
+ return (columns < 1 ? 1 : columns);
}
public void setColumns(int count) {
Modified: root/ui/iteration/trunk/tables/ui/src/main/java/org/richfaces/renderkit/AbstractRowsRenderer.java
===================================================================
--- root/ui/iteration/trunk/tables/ui/src/main/java/org/richfaces/renderkit/AbstractRowsRenderer.java 2010-07-19 14:09:07 UTC (rev 18149)
+++ root/ui/iteration/trunk/tables/ui/src/main/java/org/richfaces/renderkit/AbstractRowsRenderer.java 2010-07-19 14:47:20 UTC (rev 18150)
@@ -68,7 +68,13 @@
public void processRows(ResponseWriter writer, FacesContext facesContext, UIComponent component, Object[] options) throws IOException {
RowHolderBase rowHolder = createRowHolder(facesContext, component, options);
encodeRows(facesContext, rowHolder);
+ doCleanup(facesContext, rowHolder);
}
+
+
+ protected void doCleanup(FacesContext context, RowHolderBase rowHolder) throws IOException {
+ //Hook method
+ }
protected void doEncodeChildren(ResponseWriter writer, FacesContext facesContext, UIComponent component) throws IOException {
processRows(writer, facesContext, component, null);
Modified: root/ui/iteration/trunk/tables/ui/src/main/java/org/richfaces/renderkit/DataGridRenderer.java
===================================================================
--- root/ui/iteration/trunk/tables/ui/src/main/java/org/richfaces/renderkit/DataGridRenderer.java 2010-07-19 14:09:07 UTC (rev 18149)
+++ root/ui/iteration/trunk/tables/ui/src/main/java/org/richfaces/renderkit/DataGridRenderer.java 2010-07-19 14:47:20 UTC (rev 18150)
@@ -24,13 +24,16 @@
import java.io.IOException;
+import javax.faces.FacesException;
import javax.faces.application.ResourceDependencies;
import javax.faces.application.ResourceDependency;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import javax.faces.context.ResponseWriter;
+import org.ajax4jsf.model.DataVisitResult;
import org.ajax4jsf.renderkit.RendererUtils.HTML;
+import org.richfaces.component.Row;
import org.richfaces.component.UIDataGrid;
import org.richfaces.component.UIDataTableBase;
@@ -97,7 +100,7 @@
}
writer.startElement(HTML.TFOOT_ELEMENT, component);
-
+ writer.writeAttribute(HTML.ID_ATTRIBUTE, clientId , null);
writer.writeAttribute(HTML.CLASS_ATTRIBUTE, "rf-dg-tfoot", null);
writer.startElement(HTML.TR_ELEMENT, component);
writer.writeAttribute(HTML.CLASS_ATTRIBUTE, "rf-dg-f", null);
@@ -154,11 +157,13 @@
UIDataGrid dataGrid = (UIDataGrid) rowHolder.getRow();
int columns = dataGrid.getColumns();
- int processRow = rowHolder.getCurrentRow();
+ int processCell = rowHolder.getProcessCell();
- if (columns > 0 && (processRow % columns == 0)) {
- if (processRow != 0) {
+ if (columns > 0 && (processCell % columns == 0)) {
+ if (processCell != 0) {
writer.endElement(HTML.TR_ELEMENT);
+ rowHolder.resetProcessCell();
+ rowHolder.nextRow();
}
writer.startElement(HTML.TR_ELEMENT, dataGrid);
writer.writeAttribute(HTML.CLASS_ATTRIBUTE, "rf-dg-r", null);
@@ -166,14 +171,13 @@
writer.startElement(HTML.TD_ELEM, dataGrid);
writer.writeAttribute(HTML.CLASS_ATTRIBUTE, "rf-dg-c", null);
- getUtils().encodeId(facesContext, dataGrid);
renderChildren(facesContext, dataGrid);
writer.endElement(HTML.TD_ELEM);
}
public void encodeHeader(ResponseWriter writer, FacesContext facesContext, UIDataGrid dataGrid, boolean partial) throws IOException {
- UIComponent footerFacet = dataGrid.getHeaderFacet();
- encodeFacet(writer, facesContext, footerFacet, THEAD, dataGrid, new Object[] {partial});
+ UIComponent headerFacet = dataGrid.getHeaderFacet();
+ encodeFacet(writer, facesContext, headerFacet, THEAD, dataGrid, new Object[] {partial});
}
public void encodeFooter(ResponseWriter writer, FacesContext facesContext, UIDataGrid dataGrid, boolean partial) throws IOException {
@@ -260,4 +264,42 @@
throw new IllegalArgumentException("Unsupported metaComponentIdentifier: " + metaComponentId);
}
}
+
+ @Override
+ protected void doCleanup(FacesContext context, RowHolderBase rowHolder) throws IOException {
+ ResponseWriter writer = context.getResponseWriter();
+ UIDataGrid dataGrid = (UIDataGrid)rowHolder.getRow();
+
+ int cell = rowHolder.getProcessCell();
+ int columns = dataGrid.getColumns();
+ int rest = columns - cell;
+
+ if(rest != 0) {
+ for (int i = 0; i < rest; i++) {
+ writer.startElement(HTML.TD_ELEM, dataGrid);
+ writer.writeAttribute(HTML.CLASS_ATTRIBUTE, "rf-dg-c", null);
+ writer.endElement(HTML.TD_ELEM);
+ }
+ }
+
+ if(rest != 0){
+ writer.endElement(HTML.TR_ELEMENT);
+ }
+ }
+
+ public DataVisitResult process(FacesContext facesContext, Object rowKey, Object argument) {
+ RowHolderBase holder = (RowHolderBase) argument;
+ Row row = holder.getRow();
+ row.setRowKey(facesContext, rowKey);
+
+ try {
+ ResponseWriter writer = facesContext.getResponseWriter();
+ encodeRow(writer, facesContext, holder);
+ } catch (IOException e) {
+ throw new FacesException(e);
+ }
+
+ holder.nextCell();
+ return DataVisitResult.CONTINUE;
+ }
}
14 years, 5 months
JBoss Rich Faces SVN: r18149 - root/core/trunk/impl/src/main/resources/META-INF/resources.
by richfaces-svn-commits@lists.jboss.org
Author: pyaschenko
Date: 2010-07-19 10:09:07 -0400 (Mon, 19 Jul 2010)
New Revision: 18149
Modified:
root/core/trunk/impl/src/main/resources/META-INF/resources/richfaces-base-component.js
Log:
revert blunkFuntion
Modified: root/core/trunk/impl/src/main/resources/META-INF/resources/richfaces-base-component.js
===================================================================
--- root/core/trunk/impl/src/main/resources/META-INF/resources/richfaces-base-component.js 2010-07-19 13:52:13 UTC (rev 18148)
+++ root/core/trunk/impl/src/main/resources/META-INF/resources/richfaces-base-component.js 2010-07-19 14:09:07 UTC (rev 18149)
@@ -5,7 +5,7 @@
(function ($, richfaces, params) {
- richfaces.BLANK_FUNCTION = function (){}; //TODO: add it to global library
+ richfaces.blankFunction = function (){}; //TODO: add it to global library
/**
* @class Base class for all components.
@@ -56,7 +56,7 @@
var extend = function (parent, child, h) {
h = h || {};
- var F = richfaces.BLANK_FUNCTION;
+ var F = richfaces.blankFunction;
F.prototype = parent.prototype;
child.prototype = new F();
child.prototype.constructor = child;
@@ -127,7 +127,7 @@
*
* */
richfaces.BaseComponent.extendClass = function (methods) {
- var DerivedClass = methods.init || richfaces.BLANK_FUNCTION;
+ var DerivedClass = methods.init || richfaces.blankFunction;
var SupperClass = this;
SupperClass.extend(DerivedClass);
14 years, 5 months
JBoss Rich Faces SVN: r18148 - in root/ui: iteration/trunk/tables/ui/src/main/resources/META-INF/resources and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: pyaschenko
Date: 2010-07-19 09:52:13 -0400 (Mon, 19 Jul 2010)
New Revision: 18148
Modified:
root/ui/iteration/trunk/datascroller/ui/src/main/resources/META-INF/resources/script/datascroller.js
root/ui/iteration/trunk/tables/ui/src/main/resources/META-INF/resources/datatable.js
root/ui/iteration/trunk/tables/ui/src/main/resources/META-INF/resources/subtable.js
root/ui/output/trunk/panels/ui/src/main/resources/META-INF/resources/script/TogglePanelItem.js
root/ui/output/trunk/panels/ui/src/main/resources/META-INF/resources/script/popupPanel.js
Log:
attachToDOm call fixed according new rulez
Modified: root/ui/iteration/trunk/datascroller/ui/src/main/resources/META-INF/resources/script/datascroller.js
===================================================================
--- root/ui/iteration/trunk/datascroller/ui/src/main/resources/META-INF/resources/script/datascroller.js 2010-07-19 13:33:10 UTC (rev 18147)
+++ root/ui/iteration/trunk/datascroller/ui/src/main/resources/META-INF/resources/script/datascroller.js 2010-07-19 13:52:13 UTC (rev 18148)
@@ -54,7 +54,7 @@
$super.constructor.call(this,id);
- $p.attachToDom.call(this, id);
+ this.attachToDom(id);
this.options = options;
this.currentPage = options.currentPage;
Modified: root/ui/iteration/trunk/tables/ui/src/main/resources/META-INF/resources/datatable.js
===================================================================
--- root/ui/iteration/trunk/tables/ui/src/main/resources/META-INF/resources/datatable.js 2010-07-19 13:33:10 UTC (rev 18147)
+++ root/ui/iteration/trunk/tables/ui/src/main/resources/META-INF/resources/datatable.js 2010-07-19 13:52:13 UTC (rev 18148)
@@ -6,7 +6,7 @@
this.id = id;
this.options = options;
$super.constructor.call(this,id);
- $p.attachToDom.call(this, id);
+ this.attachToDom(id);
};
Modified: root/ui/iteration/trunk/tables/ui/src/main/resources/META-INF/resources/subtable.js
===================================================================
--- root/ui/iteration/trunk/tables/ui/src/main/resources/META-INF/resources/subtable.js 2010-07-19 13:33:10 UTC (rev 18147)
+++ root/ui/iteration/trunk/tables/ui/src/main/resources/META-INF/resources/subtable.js 2010-07-19 13:52:13 UTC (rev 18148)
@@ -11,7 +11,7 @@
this.formId = f;
$super.constructor.call(this, id);
- $p.attachToDom.call(this, this.id);
+ this.attachToDom(id);
};
$.extend(richfaces.ui.SubTable, {
Modified: root/ui/output/trunk/panels/ui/src/main/resources/META-INF/resources/script/TogglePanelItem.js
===================================================================
--- root/ui/output/trunk/panels/ui/src/main/resources/META-INF/resources/script/TogglePanelItem.js 2010-07-19 13:33:10 UTC (rev 18147)
+++ root/ui/output/trunk/panels/ui/src/main/resources/META-INF/resources/script/TogglePanelItem.js 2010-07-19 13:52:13 UTC (rev 18148)
@@ -28,7 +28,7 @@
rf.ui.TogglePanelItem = function(componentId, options) {
// call constructor of parent class
$super.constructor.call(this, componentId);
- $super.attachToDom.call(this, componentId);
+ this.attachToDom(componentId);
this.options = options;
this.name = this.options.name;
Modified: root/ui/output/trunk/panels/ui/src/main/resources/META-INF/resources/script/popupPanel.js
===================================================================
--- root/ui/output/trunk/panels/ui/src/main/resources/META-INF/resources/script/popupPanel.js 2010-07-19 13:33:10 UTC (rev 18147)
+++ root/ui/output/trunk/panels/ui/src/main/resources/META-INF/resources/script/popupPanel.js 2010-07-19 13:52:13 UTC (rev 18148)
@@ -38,7 +38,7 @@
$super.constructor.call(this,id);
this.markerId = id;
- $super.attachToDom.call(this, id);
+ this.attachToDom(id);
id = "#" + id;
this.options = options;
14 years, 5 months
JBoss Rich Faces SVN: r18147 - root/core/trunk/impl/src/main/resources/META-INF/resources.
by richfaces-svn-commits@lists.jboss.org
Author: Alex.Kolonitsky
Date: 2010-07-19 09:33:10 -0400 (Mon, 19 Jul 2010)
New Revision: 18147
Modified:
root/core/trunk/impl/src/main/resources/META-INF/resources/richfaces-base-component.js
Log:
rename blank function
remove unnessesary code
Modified: root/core/trunk/impl/src/main/resources/META-INF/resources/richfaces-base-component.js
===================================================================
--- root/core/trunk/impl/src/main/resources/META-INF/resources/richfaces-base-component.js 2010-07-19 13:32:31 UTC (rev 18146)
+++ root/core/trunk/impl/src/main/resources/META-INF/resources/richfaces-base-component.js 2010-07-19 13:33:10 UTC (rev 18147)
@@ -5,7 +5,7 @@
(function ($, richfaces, params) {
- richfaces.blankFunction = function (){}; //TODO: add it to global library
+ richfaces.BLANK_FUNCTION = function (){}; //TODO: add it to global library
/**
* @class Base class for all components.
@@ -56,7 +56,7 @@
var extend = function (parent, child, h) {
h = h || {};
- var F = richfaces.blankFunction;
+ var F = richfaces.BLANK_FUNCTION;
F.prototype = parent.prototype;
child.prototype = new F();
child.prototype.constructor = child;
@@ -127,9 +127,7 @@
*
* */
richfaces.BaseComponent.extendClass = function (methods) {
- var EMPTY_FUNC = function () {};
-
- var DerivedClass = methods.init || EMPTY_FUNC;
+ var DerivedClass = methods.init || richfaces.BLANK_FUNCTION;
var SupperClass = this;
SupperClass.extend(DerivedClass);
14 years, 5 months
JBoss Rich Faces SVN: r18146 - root/core/trunk/impl/src/main/resources/META-INF/skins.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2010-07-19 09:32:31 -0400 (Mon, 19 Jul 2010)
New Revision: 18146
Modified:
root/core/trunk/impl/src/main/resources/META-INF/skins/classic.skin.properties
root/core/trunk/impl/src/main/resources/META-INF/skins/deepMarine.skin.properties
root/core/trunk/impl/src/main/resources/META-INF/skins/emeraldTown.skin.properties
root/core/trunk/impl/src/main/resources/META-INF/skins/ruby.skin.properties
root/core/trunk/impl/src/main/resources/META-INF/skins/wine.skin.properties
Log:
Updated skins from Lex committed
Modified: root/core/trunk/impl/src/main/resources/META-INF/skins/classic.skin.properties
===================================================================
--- root/core/trunk/impl/src/main/resources/META-INF/skins/classic.skin.properties 2010-07-19 13:23:14 UTC (rev 18145)
+++ root/core/trunk/impl/src/main/resources/META-INF/skins/classic.skin.properties 2010-07-19 13:32:31 UTC (rev 18146)
@@ -47,7 +47,7 @@
tableBackgroundColor=#FFFFFF
tableHeaderBackgroundColor=#4A75B5
-tableSubHeaderBackgroundColor=#C6D6EA
+tableSubHeaderBackgroundColor=#93C4E5
tableFooterBackgroundColor=#cccccc
tableSubfooterBackgroundColor=#f1f1f1
tableBorderColor=#C0C0C0
Modified: root/core/trunk/impl/src/main/resources/META-INF/skins/deepMarine.skin.properties
===================================================================
--- root/core/trunk/impl/src/main/resources/META-INF/skins/deepMarine.skin.properties 2010-07-19 13:23:14 UTC (rev 18145)
+++ root/core/trunk/impl/src/main/resources/META-INF/skins/deepMarine.skin.properties 2010-07-19 13:32:31 UTC (rev 18146)
@@ -46,13 +46,13 @@
tableBackgroundColor=#FFFFFF
-tableHeaderBackgroundColor=#008894
+tableHeaderBackgroundColor=#82C9CF
tableSubHeaderBackgroundColor=#C9EDF0
tableFooterBackgroundColor=#cccccc
tableSubfooterBackgroundColor=#f1f1f1
tableBorderColor=#C0C0C0
tableBorderWidth=1px
-tableHeaderTextColor=#FFFFFF
+tableHeaderTextColor=#005E67
Modified: root/core/trunk/impl/src/main/resources/META-INF/skins/emeraldTown.skin.properties
===================================================================
--- root/core/trunk/impl/src/main/resources/META-INF/skins/emeraldTown.skin.properties 2010-07-19 13:23:14 UTC (rev 18145)
+++ root/core/trunk/impl/src/main/resources/META-INF/skins/emeraldTown.skin.properties 2010-07-19 13:32:31 UTC (rev 18146)
@@ -51,7 +51,7 @@
tableSubfooterBackgroundColor=#f1f1f1
tableBorderColor=#C0C0C0
tableBorderWidth=1px
-tableHeaderTextColor=#FFFFFF
+tableHeaderTextColor=#005000
Modified: root/core/trunk/impl/src/main/resources/META-INF/skins/ruby.skin.properties
===================================================================
--- root/core/trunk/impl/src/main/resources/META-INF/skins/ruby.skin.properties 2010-07-19 13:23:14 UTC (rev 18145)
+++ root/core/trunk/impl/src/main/resources/META-INF/skins/ruby.skin.properties 2010-07-19 13:32:31 UTC (rev 18146)
@@ -45,13 +45,13 @@
buttonFamilyFont=Arial, Verdana, sans-serif
tableBackgroundColor=#FFFFFF
-tableHeaderBackgroundColor=#D6E6FB
+tableHeaderBackgroundColor=#EB9A99
tableSubHeaderBackgroundColor=#F7DBDB
tableFooterBackgroundColor=#cccccc
tableSubfooterBackgroundColor=#f1f1f1
tableBorderColor=#C0C0C0
tableBorderWidth=1px
-tableHeaderTextColor=#FFFFFF
+tableHeaderTextColor=#980808
#Calendar colors
calendarWeekBackgroundColor=#f5f5f5
Modified: root/core/trunk/impl/src/main/resources/META-INF/skins/wine.skin.properties
===================================================================
--- root/core/trunk/impl/src/main/resources/META-INF/skins/wine.skin.properties 2010-07-19 13:23:14 UTC (rev 18145)
+++ root/core/trunk/impl/src/main/resources/META-INF/skins/wine.skin.properties 2010-07-19 13:32:31 UTC (rev 18146)
@@ -46,13 +46,13 @@
tableBackgroundColor=#FFFFFF
-tableHeaderBackgroundColor=#9AB37D
+tableHeaderBackgroundColor=#BCD0A5
tableSubHeaderBackgroundColor=#E4F1D5
tableFooterBackgroundColor=#cccccc
tableSubfooterBackgroundColor=#ECE3CD
tableBorderColor=#B6AD84
tableBorderWidth=1px
-tableHeaderTextColor=#FFFFFF
+tableHeaderTextColor=#495A34
#Calendar colors
14 years, 5 months
JBoss Rich Faces SVN: r18145 - in root: ui/iteration/trunk/datascroller/ui/src/main/resources/META-INF/resources/script and 2 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: Alex.Kolonitsky
Date: 2010-07-19 09:23:14 -0400 (Mon, 19 Jul 2010)
New Revision: 18145
Modified:
root/core/trunk/impl/src/main/resources/META-INF/resources/richfaces-base-component.js
root/ui/iteration/trunk/datascroller/ui/src/main/resources/META-INF/resources/script/datascroller.js
root/ui/iteration/trunk/tables/ui/src/main/resources/META-INF/resources/datatable.js
root/ui/iteration/trunk/tables/ui/src/main/resources/META-INF/resources/subtable.js
root/ui/output/trunk/panels/ui/src/main/resources/META-INF/resources/script/TogglePanel.js
root/ui/output/trunk/panels/ui/src/main/resources/META-INF/resources/script/TogglePanelItem.js
root/ui/output/trunk/panels/ui/src/main/resources/META-INF/resources/script/popupPanel.js
root/ui/output/trunk/panels/ui/src/main/resources/META-INF/resources/script/popupPanelBorders.js
root/ui/output/trunk/panels/ui/src/main/resources/META-INF/resources/script/popupPanelSizer.js
Log:
add extendClass function
fix refactoring for extend function
Modified: root/core/trunk/impl/src/main/resources/META-INF/resources/richfaces-base-component.js
===================================================================
--- root/core/trunk/impl/src/main/resources/META-INF/resources/richfaces-base-component.js 2010-07-19 12:28:10 UTC (rev 18144)
+++ root/core/trunk/impl/src/main/resources/META-INF/resources/richfaces-base-component.js 2010-07-19 13:23:14 UTC (rev 18145)
@@ -4,9 +4,9 @@
(function ($, richfaces, params) {
-
+
richfaces.blankFunction = function (){}; //TODO: add it to global library
-
+
/**
* @class Base class for all components.
* All RichFaces components should use this class as base or another RichFaces class which based on it.
@@ -14,27 +14,27 @@
<pre><code>
//Inheritance example:
(function ($, richfaces, params) {
-
+
// Constructor definition
richfaces.MyComponent = function(componentId, [options]) {
// call constructor of parent class
$super.constructor.call(this, componentId, [options]);
};
-
+
// define private method
var myPrivateMethod = function () {
}
-
+
// Extend component class and add protected methods from parent class to our container
richfaces.BaseComponent.extend(richfaces.BaseComponent, richfaces.MyComponent);
-
+
// define super class link
var $super = richfaces.MyComponent.$super;
-
+
// Add new properties and methods
$.extend(richfaces.MyComponent.prototype, (function (params) {
return {
- name:"MyComponent",
+ name:"MyComponent",
f:function (){alert("hello");
}
};
@@ -51,9 +51,9 @@
richfaces.BaseComponent = function(componentId) {
this.id = componentId;
};
-
+
var $p = {};
-
+
var extend = function (parent, child, h) {
h = h || {};
var F = richfaces.blankFunction;
@@ -64,9 +64,9 @@
if (child.$super == richfaces.BaseComponent.prototype) {
var r = jQuery.extend({}, $p, h||{});
}
-
+
var _parent = child;
-
+
// create wrapper with protected methods and variables
child.extend = function (_child, _h) {
_h = _h || {};
@@ -75,9 +75,9 @@
}
return r||h;
};
-
+
/**
- * Method extends child class prototype with parent prototype
+ * Method extends child class prototype with parent prototype
* and return the object with parent's protected methods
*
* @function
@@ -88,7 +88,62 @@
richfaces.BaseComponent.extend = function(child, h) {
return extend(richfaces.BaseComponent, child, h);
};
-
+
+
+ /**
+ * Easy way to create a subclass.
+ *
+ * Example:
+ *
+ * RichFaces.ui.MyClass = RichFaces.BaseComponent.extendClass({
+ * // Class name
+ * name: "MyClass",
+ *
+ * // Constructor
+ * init : function (...) {
+ * // ...
+ * },
+ *
+ * // public api
+ * publicFunction : function () {
+ * // ...
+ * },
+ *
+ * // private api
+ * // names of private methods should start with '__' (2 underscore symbols)
+ * __privateFunction : function () {
+ * // ...
+ * },
+ *
+ * __overrideMethod : function () {
+ * // if you need to use method from parent class use link to parent prototype
+ * // like in previous solution with extend method
+ * this.$super.__overrideMethod.call(this, ...params...);
+ *
+ * //...
+ * }
+ *
+ * });
+ *
+ * */
+ richfaces.BaseComponent.extendClass = function (methods) {
+ var EMPTY_FUNC = function () {};
+
+ var DerivedClass = methods.init || EMPTY_FUNC;
+ var SupperClass = this;
+
+ SupperClass.extend(DerivedClass);
+
+ DerivedClass.extendClass = SupperClass.extendClass;
+ DerivedClass.prototype.$super = SupperClass.prototype;
+
+ $.extend(DerivedClass.prototype, methods);
+
+ return DerivedClass;
+ },
+
+
+
$.extend(richfaces.BaseComponent.prototype, (function (params) {
return {
/**
@@ -98,7 +153,7 @@
* @type String
* */
name: "BaseComponent",
-
+
/**
* Method for converting object to string
*
@@ -115,7 +170,7 @@
result[result.length] = this.name;
return result.join(', ');
},
-
+
/**
* Method returns element's id for event handlers binding.
* Event API calls this method when binding by component object as selector was used.
@@ -124,11 +179,11 @@
* @name RichFaces.BaseComponent#getEventElement
*
* @return {String}
- * */
+ * */
getEventElement: function() {
- return this.id;
+ return this.id;
},
-
+
/**
* Attach component object to DOM element by component id, DOM element or jQuery object and returns the element
*
@@ -147,9 +202,9 @@
}
return element;
},
-
+
/**
- * Destroy method. Will be called before remove component from the page
+ * Destroy method. Will be called before remove component from the page
*
* @function
* @name RichFaces.BaseComponent#destroy
@@ -159,5 +214,5 @@
}
};
})(params));
-
+
})(jQuery, window.RichFaces || (window.RichFaces={}));
\ No newline at end of file
Modified: root/ui/iteration/trunk/datascroller/ui/src/main/resources/META-INF/resources/script/datascroller.js
===================================================================
--- root/ui/iteration/trunk/datascroller/ui/src/main/resources/META-INF/resources/script/datascroller.js 2010-07-19 12:28:10 UTC (rev 18144)
+++ root/ui/iteration/trunk/datascroller/ui/src/main/resources/META-INF/resources/script/datascroller.js 2010-07-19 13:23:14 UTC (rev 18145)
@@ -1,4 +1,4 @@
-(function ($, richfaces) {
+(function ($, richfaces) {
richfaces.ui = richfaces.ui || {};
@@ -92,8 +92,8 @@
}
};
- var $super = richfaces.BaseComponent.extend(richfaces.BaseComponent, richfaces.ui.DataScroller);
- var $p = richfaces.BaseComponent.extend(richfaces.BaseComponent,richfaces.ui.DataScroller, {});
+ var $super = richfaces.BaseComponent.extend(richfaces.ui.DataScroller);
+ var $p = richfaces.BaseComponent.extend(richfaces.ui.DataScroller, {});
var $super = richfaces.ui.DataScroller.$super;
$.extend(richfaces.ui.DataScroller.prototype, (function (options) {
Modified: root/ui/iteration/trunk/tables/ui/src/main/resources/META-INF/resources/datatable.js
===================================================================
--- root/ui/iteration/trunk/tables/ui/src/main/resources/META-INF/resources/datatable.js 2010-07-19 12:28:10 UTC (rev 18144)
+++ root/ui/iteration/trunk/tables/ui/src/main/resources/META-INF/resources/datatable.js 2010-07-19 13:23:14 UTC (rev 18145)
@@ -10,8 +10,8 @@
};
- var $super = richfaces.BaseComponent.extend(richfaces.BaseComponent, richfaces.ui.DataTable);
- var $p = richfaces.BaseComponent.extend(richfaces.BaseComponent,richfaces.ui.DataTable, {});
+ var $super = richfaces.BaseComponent.extend(richfaces.ui.DataTable);
+ var $p = richfaces.BaseComponent.extend(richfaces.ui.DataTable, {});
var $super = richfaces.ui.DataTable.$super;
$.extend(richfaces.ui.DataTable, {
Modified: root/ui/iteration/trunk/tables/ui/src/main/resources/META-INF/resources/subtable.js
===================================================================
--- root/ui/iteration/trunk/tables/ui/src/main/resources/META-INF/resources/subtable.js 2010-07-19 12:28:10 UTC (rev 18144)
+++ root/ui/iteration/trunk/tables/ui/src/main/resources/META-INF/resources/subtable.js 2010-07-19 13:23:14 UTC (rev 18145)
@@ -22,8 +22,8 @@
expand: 1
})
- var $super = richfaces.BaseComponent.extend(richfaces.BaseComponent, richfaces.ui.SubTable);
- var $p = richfaces.BaseComponent.extend(richfaces.BaseComponent,richfaces.ui.SubTable, {});
+ var $super = richfaces.BaseComponent.extend(richfaces.ui.SubTable);
+ var $p = richfaces.BaseComponent.extend(richfaces.ui.SubTable, {});
var $super = richfaces.ui.SubTable.$super;
$.extend(richfaces.ui.SubTable.prototype, (function () {
Modified: root/ui/output/trunk/panels/ui/src/main/resources/META-INF/resources/script/TogglePanel.js
===================================================================
--- root/ui/output/trunk/panels/ui/src/main/resources/META-INF/resources/script/TogglePanel.js 2010-07-19 12:28:10 UTC (rev 18144)
+++ root/ui/output/trunk/panels/ui/src/main/resources/META-INF/resources/script/TogglePanel.js 2010-07-19 13:23:14 UTC (rev 18145)
@@ -24,48 +24,14 @@
rf.ui = rf.ui || {};
- /***************************** Constructor definition *************************************************************/
- var DEFAULT_OPTIONS = {
- };
-
- /**
- * @class TogglePanel
- * @name TogglePanel
- *
- * @constructor
- * @param {String} componentId - component id
- * @param {Hash} options - params
- * */
- rf.ui.TogglePanel = function (componentId, options) {
- // call constructor of parent class
- $super.constructor.call(this, componentId);
- $p.attachToDom.call(this, componentId);
- this.options = $.extend({}, DEFAULT_OPTIONS, options);
-
- this.selectedItem = this.options.selectedItem;
- this.switchMode = this.options.switchMode;
- this.items = this.options.items;
- };
-
- var $p = {};
-
- // Extend component class and add protected methods from parent class to our container
- $p = rf.BaseComponent.extend(rf.BaseComponent, rf.ui.TogglePanel, $p);
-
- var $super = rf.ui.TogglePanel.$super;
-
- /***************************** Private Static Area ****************************************************************/
-
-
/* SIMPLE INNER CLASS for handle switch operation*/
- function SwitchItems (comp) {
+ function SwitchItems(comp) {
this.comp = comp;
}
SwitchItems.prototype = {
/**
- * @param {TogglePanel} comp
* @param {TogglePanelItem} oldPanel
* @param {TogglePanelItem} newPanel
*
@@ -93,13 +59,13 @@
execServer : function (oldPanel, newPanel) {
var continueProcess = oldPanel.leave();
if (!continueProcess) {
-
+
return false;
}
- this.setSelectedItem(newPanel.getName());
+ this.__setSelectedItem(newPanel.getName());
- rf.submitForm(this.getParentForm(), null, {});
+ rf.submitForm(this.__getParentForm(), null, {});
return false;
},
@@ -114,9 +80,9 @@
execAjax : function (oldPanel, newPanel) {
var options = $.extend({}, this.comp.options["ajax"], {}/*this.getParameters(newPanel)*/);
- this.setSelectedItem(newPanel.getName());
+ this.__setSelectedItem(newPanel.getName());
rf.ajax(this.comp.id, null, options);
- this.setSelectedItem(oldPanel.getName());
+ this.__setSelectedItem(oldPanel.getName());
return false;
},
@@ -136,10 +102,10 @@
return false;
}
- this.setSelectedItem(newPanel.getName());
+ this.__setSelectedItem(newPanel.getName());
newPanel.enter();
- fireItemChange(this.comp, oldPanel, newPanel);
+ this.__fireItemChange(oldPanel, newPanel);
return true;
},
@@ -147,255 +113,282 @@
/**
* @private
* */
- getParentForm : function () {
- return $(RichFaces.getDomElement(this.comp.id)).parent('form');
+ __getParentForm : function () {
+ return $(rf.getDomElement(this.comp.id)).parent('form');
},
/**
* @private
* */
- setSelectedItem : function (name) {
- rf.getDomElement(this.getValueInputId()).value = name;
+ __setSelectedItem : function (name) {
+ rf.getDomElement(this.__getValueInputId()).value = name;
this.comp.selectedItem = name;
},
/**
* @private
* */
- getValueInputId: function () {
+ __getValueInputId: function () {
return this.comp.id + "-value"
}
};
- /********************* Events *************************/
-
/**
- * Fire Concealable Event
+ * @class TogglePanel
+ * @name TogglePanel
+ *
+ * @constructor
+ * @param {String} componentId - component id
+ * @param {Hash} options - params
* */
- function fireBeforeItemChange ($this, oldItem, newItem) {
- return rf.Event.fireById($this.id, "beforeitemchange", {
- id: $this.id,
- oldItem : oldItem,
- newItem : newItem
- });
- }
+ rf.ui.TogglePanel = rf.BaseComponent.extendClass({
- function fireItemChange ($this, oldItem, newItem) {
- return new rf.Event.fireById($this.id, "itemchange", {
- id: $this.id,
- oldItem : oldItem,
- newItem : newItem
- });
- }
+ // class name
+ name:"TogglePanel",
- /********************* Methods *************************/
+ init : function (componentId, options) {
+ // call constructor of parent class
+ this.$super.constructor.call(this, componentId);
+ this.attachToDom(componentId);
- var ITEMS_META_NAMES = {
- "@first" : function (comp) { return 0; },
- "@prev" : function (comp) { return getItemIndex(comp.items, comp.selectedItem) - 1; },
- "@next" : function (comp) { return getItemIndex(comp.items, comp.selectedItem) + 1; },
- "@last" : function (comp) { return comp.items.length - 1; }
- };
+ this.options = options;
+ this.selectedItem = this.options.selectedItem;
+ this.switchMode = this.options.switchMode;
+ this.items = this.options.items;
+ },
- function getItemIndex (items, itemName) {
- for (var i = 0; i < items.length; i++) {
- if (items[i].getName() === itemName) {
- return i;
+ /***************************** Public Methods ********************************************************************/
+
+ /**
+ * @methodOf
+ * @name TogglePanel#getSelectItem
+ *
+ * @return {String} name of current selected panel item
+ */
+ getSelectItem: function () {
+ return this.selectedItem;
+ },
+
+ /**
+ * @methodOf
+ * @name TogglePanel#switchToItem
+ *
+ * @param {String} name - panel item name to switch
+ * we can use meta names @first, @prev, @next and @last
+ * @return {Boolean} - false if something wrong and true if all is ok
+ */
+ switchToItem: function (name) {
+ var newPanel = this.getNextItem(name);
+ if (newPanel == null) {
+ rf.log.warn("TogglePanel.switchToItems(" + name + "): item with name '" + name + "' not found");
+ return false;
}
- }
- rf.log.info("TogglePanel.getItemIndex: item with name '" + itemName + "' not found");
- return -1;
- }
+ var oldPanel = this.__getItemByName(this.getSelectItem());
- /**
- * @param {TogglePanelItem[]} items
- * @param {Number} index - array index
- *
- * @return {TogglePanelItem}
- * null - if item not found
- * */
- function getItem (items, index) {
- if (index >= 0 && index < items.length) {
- return items[index]
- }
+ var continueProcess = this.__fireBeforeItemChange(oldPanel, newPanel);
+ if (!continueProcess) {
+ rf.log.warn("TogglePanel.switchToItems(" + name + "): switch has been canceled by beforeItemChange event");
+ return false
+ }
- return null;
- }
+ return new SwitchItems(this).exec(oldPanel, newPanel);
+ },
- function getItemByName (items, name) {
- return getItem(items, getItemIndex(items, name));
- }
+ /**
+ * @methodOf
+ * @name TogglePanel#getNextItem
+ *
+ * @param {String} name of TogglePanelItem or meta name (@first | @prev | @next | @last)
+ * @return {TogglePanelItem} null if item not found
+ */
+ getNextItem : function (name) {
+ if (name) {
+ var newItemIndex = this.__ITEMS_META_NAMES[name];
+ if (newItemIndex) {
+ return this.__getItem(newItemIndex(this));
+ } else {
+ return this.__getItemByName(name);
+ }
+ } else {
+ return this.__getItemByName(this.nextItem());
+ }
+ },
- function getItemName (items, index) {
- var item = getItem(items, index);
- if (item == null) {
- return null;
- }
-
- return item.getName();
- }
+ /**
+ * please, remove this method when client side ajax events will be added
+ *
+ * */
+ onCompleteHandler : function (oldItemName, newItemName) {
+ var oldItem = this.__getItemByName(this.items, oldItemName);
+ var newItem = this.__getItemByName(this.items, newItemName);
+ // Don't do like this and remove it ASAP
+ new SwitchItems(this).execClient(oldItem, newItem);
+ },
- /***************************** Public Methods ********************************************************************/
- $.extend(rf.ui.TogglePanel.prototype, (function () {
- return {
- // class name
- name:"TogglePanel",
+ /**
+ * @methodOf
+ * @name TogglePanel#getItems
+ *
+ * @return {TogglePanelItem[]} all defined panel items
+ */
+ getItems : function () {
+ return this.items;
+ },
- /**
- * @methodOf
- * @name TogglePanel#getSelectItem
- *
- * @return {String} name of current selected panel item
- */
- getSelectItem: function () {
- return this.selectedItem;
- },
+ /**
+ * @methodOf
+ * @name TogglePanel#getItemsNames
+ *
+ * @return {String[]} names of all defined items
+ */
+ getItemsNames: function () {
+ var res = [];
+ for (var item in this.items) {
+ res.push(this.items[item].getName());
+ }
- /**
- * @methodOf
- * @name TogglePanel#switchToItem
- *
- * @param {String} name - panel item name to switch
- * we can use meta names @first, @prev, @next and @last
- * @return {Boolean} - false if something wrong and true if all is ok
- */
- switchToItem: function (name) {
- var newPanel = this.getNextItem(name);
- if (newPanel == null) {
- rf.log.warn("TogglePanel.switchToItems(" + name + "): item with name '" + name + "' not found");
- return false;
- }
+ return res;
+ },
- var oldPanel = getItemByName(this.items, this.getSelectItem());
+ /**
+ * @methodOf
+ * @name TogglePanel#nextItem
+ *
+ * @param {String} [itemName = selectedItem]
+ * @return {String} name of next panel item
+ */
+ nextItem: function (itemName) {
+ var itemIndex = this.__getItemIndex(itemName || this.selectedItem);
+ if (itemIndex == -1) {
+ return null;
+ }
- var continueProcess = fireBeforeItemChange(this, oldPanel, newPanel);
- if (!continueProcess) {
- rf.log.warn("TogglePanel.switchToItems(" + name + "): switch has been canceled by beforeItemChange event");
- return false
- }
+ return this.__getItemName(this.items, itemIndex + 1);
+ },
- return new SwitchItems(this).exec(oldPanel, newPanel);
- },
+ /**
+ * @methodOf
+ * @name TogglePanel#firstItem
+ *
+ * @return {String} name of first panel item
+ */
+ firstItem: function () {
+ return this.__getItemName(this.items, 0);
+ },
- /**
- * @methodOf
- * @name TogglePanel#getNextItem
- *
- * @param {String} name of TogglePanelItem or meta name (@first | @prev | @next | @last)
- * @return {TogglePanelItem} null if item not found
- */
- getNextItem : function (name) {
- if (name) {
- var newItemIndex = ITEMS_META_NAMES[name];
- if (newItemIndex) {
- return getItem(this.items, newItemIndex(this));
- } else {
- return getItemByName(this.items, name);
- }
- } else {
- return getItemByName(this.items, this.nextItem());
- }
- },
+ /**
+ * @methodOf
+ * @name TogglePanel#lastItem
+ *
+ * @return {String} name of last panel item
+ */
+ lastItem: function () {
+ return this.__getItemName(this.items, this.items.length - 1);
+ },
- /**
- * please, remove this method when client side ajax events will be added
- *
- * */
- onCompleteHandler : function (oldItemName, newItemName) {
- var oldItem = getItemByName(this.items, oldItemName);
- var newItem = getItemByName(this.items, newItemName);
+ /**
+ * @methodOf
+ * @name TogglePanel#prevItem
+ *
+ * @param {String} itemName
+ * @return {String} name of prev panel item
+ * null if it is first item
+ */
+ prevItem: function (itemName) {
+ var itemIndex = this.__getItemIndex(itemName || this.selectedItem);
+ if (itemIndex < 1) {
+ return null;
+ }
- // Don't do like this and remove it ASAP
- new SwitchItems(this).execClient(oldItem, newItem);
- },
+ return this.__getItemName(this.items, itemIndex - 1);
+ },
- /**
- * @methodOf
- * @name TogglePanel#getItems
- *
- * @return {TogglePanelItem[]} all defined panel items
- */
- getItems : function () {
- return this.items;
- },
+ /////////////////////////////////////////////////////////////////////////////////
+ //// Private
+ /////////////////////////////////////////////////////////////////////////////////
- /**
- * @methodOf
- * @name TogglePanel#getItemsNames
- *
- * @return {String[]} names of all defined items
- */
- getItemsNames: function () {
- var res = [];
- for (var item in this.items) {
- res.push(this.items[item].getName());
- }
+ /********************* Events *************************/
- return res;
- },
+ /**
+ * Fire Concealable Event
+ * */
+ __fireBeforeItemChange : function (oldItem, newItem) {
+ return rf.Event.fireById(this.id, "beforeitemchange", {
+ id: this.id,
+ oldItem : oldItem,
+ newItem : newItem
+ });
+ },
- /**
- * @methodOf
- * @name TogglePanel#nextItem
- *
- * @param {String} [itemName = selectedItem]
- * @return {String} name of next panel item
- */
- nextItem: function (itemName) {
- var itemIndex = getItemIndex(this.items, itemName || this.selectedItem);
- if (itemIndex == -1) {
- return null;
+ __fireItemChange : function (oldItem, newItem) {
+ return new rf.Event.fireById(this.id, "itemchange", {
+ id: this.id,
+ oldItem : oldItem,
+ newItem : newItem
+ });
+ },
+
+ /********************* Methods *************************/
+
+ __ITEMS_META_NAMES : {
+ "@first" : function (comp) { return 0; },
+ "@prev" : function (comp) { return comp.__getItemIndex(comp.selectedItem) - 1; },
+ "@next" : function (comp) { return comp.__getItemIndex(comp.selectedItem) + 1; },
+ "@last" : function (comp) { return comp.items.length - 1; }
+ },
+
+ /**
+ * @private
+ * */
+ __getItemIndex : function (itemName) {
+ for (var i = 0; i < this.items.length; i++) {
+ if (this.items[i].getName() === itemName) {
+ return i;
}
+ }
- return getItemName(this.items, itemIndex + 1);
- },
+ rf.log.info("TogglePanel.getItemIndex: item with name '" + itemName + "' not found");
+ return -1;
+ },
- /**
- * @methodOf
- * @name TogglePanel#firstItem
- *
- * @return {String} name of first panel item
- */
- firstItem: function () {
- return getItemName(this.items, 0);
- },
+ /**
+ * @private
+ * @param {Number} index - array index
+ *
+ * @return {TogglePanelItem}
+ * null - if item not found
+ * */
+ __getItem : function (index) {
+ if (index >= 0 && index < this.items.length) {
+ return this.items[index]
+ }
- /**
- * @methodOf
- * @name TogglePanel#lastItem
- *
- * @return {String} name of last panel item
- */
- lastItem: function () {
- return getItemName(this.items, this.items.length - 1);
- },
+ return null;
+ },
- /**
- * @methodOf
- * @name TogglePanel#prevItem
- *
- * @param {String} itemName
- * @return {String} name of prev panel item
- * null if it is first item
- */
- prevItem: function (itemName) {
- var itemIndex = getItemIndex(this.items, itemName || this.selectedItem);
- if (itemIndex < 1) {
- return null;
- }
-
- return getItemName(this.items, itemIndex - 1);
- },
+ __getItemByName : function (name) {
+ return this.__getItem(this.__getItemIndex(name));
+ },
- // class stuff
- destroy: function () {
- // rf.Event.unbindById(this.options.buttonId, "."+this.namespace);
- // rf.Event.unbindById(this.componentId, "."+this.namespace);
- // $super.destroy.call(this);
+ __getItemName : function (index) {
+ var item = this.__getItem(index);
+ if (item == null) {
+ return null;
}
- };
- })());
+
+ return item.getName();
+ },
+
+
+
+ // class stuff
+ destroy: function () {
+ // rf.Event.unbindById(this.options.buttonId, "."+this.namespace);
+ // rf.Event.unbindById(this.componentId, "."+this.namespace);
+ // $super.destroy.call(this);
+ }
+ });
})(jQuery, RichFaces);
Modified: root/ui/output/trunk/panels/ui/src/main/resources/META-INF/resources/script/TogglePanelItem.js
===================================================================
--- root/ui/output/trunk/panels/ui/src/main/resources/META-INF/resources/script/TogglePanelItem.js 2010-07-19 12:28:10 UTC (rev 18144)
+++ root/ui/output/trunk/panels/ui/src/main/resources/META-INF/resources/script/TogglePanelItem.js 2010-07-19 13:23:14 UTC (rev 18145)
@@ -25,23 +25,18 @@
/***************************** Stuff ******************************************************************************/
rf.ui = rf.ui || {};
- /***************************** Constructor definition *************************************************************/
- var DEFAULT_OPTIONS = {
- };
-
rf.ui.TogglePanelItem = function(componentId, options) {
// call constructor of parent class
$super.constructor.call(this, componentId);
- $p.attachToDom.call(this, componentId);
- this.options = $.extend({}, DEFAULT_OPTIONS, options);
+ $super.attachToDom.call(this, componentId);
+ this.options = options;
this.name = this.options.name;
this.togglePanelId = this.options.togglePanelId;
this.switchMode = this.options.switchMode;
};
- // Extend component class and add protected methods from parent class to our container
- var $p = rf.BaseComponent.extend(rf.BaseComponent, rf.ui.TogglePanelItem, {});
+ rf.BaseComponent.extend(rf.ui.TogglePanelItem);
// define super class link
var $super = rf.ui.TogglePanelItem.$super;
@@ -123,7 +118,7 @@
destroy: function () {
// rf.Event.unbindById(this.options.buttonId, "."+this.namespace);
// rf.Event.unbindById(this.componentId, "."+this.namespace);
- $super.destroy.call(this);
+// $super.destroy.call(this);
}
};
})());
Modified: root/ui/output/trunk/panels/ui/src/main/resources/META-INF/resources/script/popupPanel.js
===================================================================
--- root/ui/output/trunk/panels/ui/src/main/resources/META-INF/resources/script/popupPanel.js 2010-07-19 12:28:10 UTC (rev 18144)
+++ root/ui/output/trunk/panels/ui/src/main/resources/META-INF/resources/script/popupPanel.js 2010-07-19 13:23:14 UTC (rev 18145)
@@ -79,8 +79,8 @@
};
- var $super = richfaces.BaseComponent.extend(richfaces.BaseComponent, richfaces.ui.PopupPanel);
- var $p = richfaces.BaseComponent.extend(richfaces.BaseComponent,richfaces.ui.PopupPanel, {});
+ var $super = richfaces.BaseComponent.extend(richfaces.ui.PopupPanel);
+ var $p = richfaces.BaseComponent.extend(richfaces.ui.PopupPanel, {});
var $super = richfaces.ui.PopupPanel.$super;
$.extend(richfaces.ui.PopupPanel.prototype, (function (options) {
Modified: root/ui/output/trunk/panels/ui/src/main/resources/META-INF/resources/script/popupPanelBorders.js
===================================================================
--- root/ui/output/trunk/panels/ui/src/main/resources/META-INF/resources/script/popupPanelBorders.js 2010-07-19 12:28:10 UTC (rev 18144)
+++ root/ui/output/trunk/panels/ui/src/main/resources/META-INF/resources/script/popupPanelBorders.js 2010-07-19 13:23:14 UTC (rev 18145)
@@ -15,7 +15,7 @@
this.sizer = sizer;
};
- var $super = richfaces.BaseComponent.extend(richfaces.BaseComponent, richfaces.ui.PopupPanel.Border);
+ var $super = richfaces.BaseComponent.extend(richfaces.ui.PopupPanel.Border);
var $super = richfaces.ui.PopupPanel.Border.$super;
$.extend(richfaces.ui.PopupPanel.Border.prototype, (function (options) {
Modified: root/ui/output/trunk/panels/ui/src/main/resources/META-INF/resources/script/popupPanelSizer.js
===================================================================
--- root/ui/output/trunk/panels/ui/src/main/resources/META-INF/resources/script/popupPanelSizer.js 2010-07-19 12:28:10 UTC (rev 18144)
+++ root/ui/output/trunk/panels/ui/src/main/resources/META-INF/resources/script/popupPanelSizer.js 2010-07-19 13:23:14 UTC (rev 18145)
@@ -8,7 +8,7 @@
};
- var $super = richfaces.BaseComponent.extend(richfaces.BaseComponent, richfaces.ui.PopupPanel.Sizer);
+ var $super = richfaces.BaseComponent.extend(richfaces.ui.PopupPanel.Sizer);
var $super = richfaces.ui.PopupPanel.Sizer.$super;
$.extend(richfaces.ui.PopupPanel.Sizer.prototype, (function (options) {
return {
14 years, 5 months