JBoss Rich Faces SVN: r16886 - branches/enterprise/3.3.X/ui/scrollableDataTable/src/main/java/org/richfaces/renderkit/html.
by richfaces-svn-commits@lists.jboss.org
Author: konstantin.mishin
Date: 2010-05-04 11:54:02 -0400 (Tue, 04 May 2010)
New Revision: 16886
Modified:
branches/enterprise/3.3.X/ui/scrollableDataTable/src/main/java/org/richfaces/renderkit/html/SelectionRendererContributor.java
Log:
RF-8631
Modified: branches/enterprise/3.3.X/ui/scrollableDataTable/src/main/java/org/richfaces/renderkit/html/SelectionRendererContributor.java
===================================================================
--- branches/enterprise/3.3.X/ui/scrollableDataTable/src/main/java/org/richfaces/renderkit/html/SelectionRendererContributor.java 2010-05-04 15:10:11 UTC (rev 16885)
+++ branches/enterprise/3.3.X/ui/scrollableDataTable/src/main/java/org/richfaces/renderkit/html/SelectionRendererContributor.java 2010-05-04 15:54:02 UTC (rev 16886)
@@ -118,11 +118,6 @@
} catch (IOException e) {
throw new FacesException(e);
}
- int shiftRowIndex = clientSelection.getShiftRowIndex();
- if (shiftRowIndex != -1) {
- int rows = grid.getRows();
- grid.setShiftRowIndex(grid.getFirst() + (rows + shiftRowIndex - clientRowIndex) % rows);
- }
int oldFirst = grid.getFirst();
int oldRows = grid.getRows();
int newFirst = -1;
@@ -158,6 +153,11 @@
selectionBinding.setValue(context.getELContext(),
simpleSelection);
}
+ int shiftRowIndex = clientSelection.getShiftRowIndex();
+ if (shiftRowIndex != -1) {
+ int rows = grid.getRows();
+ grid.setShiftRowIndex(grid.getFirst() + (rows + shiftRowIndex - clientRowIndex) % rows);
+ }
ScrollableDataTableRendererState.restoreState(context);
}
}
14 years, 8 months
JBoss Rich Faces SVN: r16885 - root/framework/trunk/impl/src/main/resources/META-INF/resources.
by richfaces-svn-commits@lists.jboss.org
Author: pyaschenko
Date: 2010-05-04 11:10:11 -0400 (Tue, 04 May 2010)
New Revision: 16885
Modified:
root/framework/trunk/impl/src/main/resources/META-INF/resources/richfaces-queue.js
Log:
setQueueOptions was updated
Modified: root/framework/trunk/impl/src/main/resources/META-INF/resources/richfaces-queue.js
===================================================================
--- root/framework/trunk/impl/src/main/resources/META-INF/resources/richfaces-queue.js 2010-05-04 14:39:11 UTC (rev 16884)
+++ root/framework/trunk/impl/src/main/resources/META-INF/resources/richfaces-queue.js 2010-05-04 15:10:11 UTC (rev 16885)
@@ -245,6 +245,8 @@
return {
+ DEFAULT_QUEUE_ID: DEFAULT_QUEUE_ID,
+
/**
* Get current queue size
* @function
@@ -340,21 +342,23 @@
* @function
* @name RichFaces.queue.setQueueOptions
*
- * @param {string} [id] - Queue id for storing options
+ * @param {string||object} [id] - Queue id for storing options or hash with options for multiple options set
* @param {object} options - Queue options object
* */
setQueueOptions: function (id, options) {
- var queueId = DEFAULT_QUEUE_ID;
- if (typeof id == "string") {
- queueId = id;
- } else {
- options = id;
+ var tid = typeof id;
+ if (tid == "string") {
+ // add named queue options
+ if (defaultQueueOptions[id]) {
+ throw "Queue already registered";
+ } else {
+ defaultQueueOptions[id] = options;
+ }
+ } else if (tid == "object"){
+ // first parameter is hash with queue names and options
+ $.extend(defaultQueueOptions, id);
}
- if (defaultQueueOptions[queueId]) {
- throw "Queue already registered";
- } else {
- defaultQueueOptions[queueId] = options;
- }
+ return richfaces.queue;
}
}
}());
14 years, 8 months
JBoss Rich Faces SVN: r16884 - root/ui-sandbox/trunk/components/tables/ui/src/main/resources/META-INF/resources.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2010-05-04 10:39:11 -0400 (Tue, 04 May 2010)
New Revision: 16884
Modified:
root/ui-sandbox/trunk/components/tables/ui/src/main/resources/META-INF/resources/datatable.js
root/ui-sandbox/trunk/components/tables/ui/src/main/resources/META-INF/resources/subtable.js
root/ui-sandbox/trunk/components/tables/ui/src/main/resources/META-INF/resources/toggler.js
Log:
fix - apply richfacesBaseComponent
Modified: root/ui-sandbox/trunk/components/tables/ui/src/main/resources/META-INF/resources/datatable.js
===================================================================
--- root/ui-sandbox/trunk/components/tables/ui/src/main/resources/META-INF/resources/datatable.js 2010-05-04 14:28:59 UTC (rev 16883)
+++ root/ui-sandbox/trunk/components/tables/ui/src/main/resources/META-INF/resources/datatable.js 2010-05-04 14:39:11 UTC (rev 16884)
@@ -1,138 +1,24 @@
-(function (jQuery, richfaces) {
+(function ($, richfaces) {
richfaces.ui = richfaces.ui || {};
richfaces.ui.DataTable = function(id, options) {
this.id = id;
- this.options = options;
- this.sortMode = options.sortMode;
- this.initializeColumns(options.columns);
- };
-
- jQuery.extend(richfaces.ui.DataTable, {
- ASCENDING :'ASCENDING',
- DESCENDING : 'DESCENDING',
- UNSORTED : 'UNSORTED',
- SINGLE: 'single',
- MULTI: 'multi'
- });
-
- jQuery.extend(richfaces.ui.DataTable.prototype, ( function () {
-
- var columns = {};
+ this.options = options;
- var convertId = function (id){
- return id.replace(/:/g, "\\:");
- };
-
- var getElement = function (id) {
- return jQuery("#" + convertId(id));
- };
-
- return {
-
- initializeColumns : function(options) {
- for(var property in options) {
- var column = new richfaces.ui.Column(property, options[property]);
- if(column.sortable) {
- var element = getElement(column.id);
- var _this = this;
-
- element.bind(column.sortEvent, column, function(e) {
- _this.processSortEvent(e);
- });
- }
- columns[property] = column;
- }
- },
-
- processSortEvent: function (e) {
- var column = e.data;
- column.toggleSortControl(e);
-
- if(this.sortMode == richfaces.ui.DataTable.SINGLE) {
- for(var x in columns) {
- if(columns[x].id != column.id) {
- columns[x].resetSortControl();
- }
- }
- }
- }
- }
-
- })());
-
-})(jQuery, window.RichFaces);
-
-
-(function (jQuery, richfaces) {
-
- richfaces.ui = richfaces.ui || {};
-
- richfaces.ui.Column = function(id, options) {
- this.id = id;
- this.sortable = options.sorting.sortable;
- //TODO: anton move to another place???
- if(this.sortable) {
- this.sortOrder = options.sorting.sortOrder;
- this.sortEvent = options.sorting.sortEvent;
- }
- this.initializeControls(id);
+ $super.constructor.call(this,id);
+ $p.attachToDom.call(this, id);
};
- jQuery.extend(richfaces.ui.Column.prototype, ( function () {
-
- var convertId = function (id){
- return id.replace(/:/g, "\\:");
- };
-
- var getElement = function (id) {
- return jQuery("#" + convertId(id));
- };
-
- var saveOrder = function(newOrder) {
- var input = getElement(this.id + ":sorting");
- input.attr("value",newOrder);
- };
-
+ var $super = richfaces.BaseComponent.extend(richfaces.BaseComponent, richfaces.ui.DataTable);
+ var $p = richfaces.BaseComponent.extend(richfaces.BaseComponent,richfaces.ui.DataTable, {});
+ var $super = richfaces.ui.DataTable.$super;
+
+ $.extend(richfaces.ui.DataTable.prototype, ( function () {
return {
- initializeControls: function(id) {
- this.asc = getElement(id+':ASCENDING');
- this.desc = getElement(id+':DESCENDING');
- this.unsort = getElement(id+':UNSORTED');
- },
-
- toggleSortControl: function(e) {
-
- if(this.sortOrder == richfaces.ui.DataTable.ASCENDING) {
- this.asc.hide();
- this.unsort.hide();
- this.desc.show();
- this.sortOrder = richfaces.ui.DataTable.DESCENDING;
-
- } else if(this.sortOrder == richfaces.ui.DataTable.DESCENDING) {
- this.asc.show();
- this.unsort.hide();
- this.desc.hide();
- this.sortOrder = richfaces.ui.DataTable.ASCENDING;
-
- } else if(this.sortOrder == richfaces.ui.DataTable.UNSORTED) {
- this.asc.hide();
- this.unsort.hide();
- this.desc.show();
- this.sortOrder = richfaces.ui.DataTable.DESCENDING;
- }
-
- saveOrder.call(this, this.sortOrder);
- },
-
- resetSortControl: function(){
- this.asc.hide();
- this.desc.hide();
- this.unsort.show();
- saveOrder.call(this, richfaces.ui.DataTable.UNSORTED);
- }
+
}
})());
})(jQuery, window.RichFaces);
+
Modified: root/ui-sandbox/trunk/components/tables/ui/src/main/resources/META-INF/resources/subtable.js
===================================================================
--- root/ui-sandbox/trunk/components/tables/ui/src/main/resources/META-INF/resources/subtable.js 2010-05-04 14:28:59 UTC (rev 16883)
+++ root/ui-sandbox/trunk/components/tables/ui/src/main/resources/META-INF/resources/subtable.js 2010-05-04 14:39:11 UTC (rev 16884)
@@ -1,4 +1,4 @@
-(function (jQuery, richfaces) {
+(function ($, richfaces) {
richfaces.ui = richfaces.ui || {};
@@ -9,22 +9,24 @@
this.eventOptions = options.eventOptions;
this.formId = f;
- this.element = document.getElementById(this.id);
- this.element.component = this;
- this.element = jQuery(this.element);
+ $super.constructor.call(this, id);
+ $p.attachToDom.call(this, id);
};
- jQuery.extend(richfaces.ui.SubTable, {
+ $.extend(richfaces.ui.SubTable, {
MODE_AJAX: "ajax",
MODE_SRV: "server",
MODE_CLNT: "client"
})
-
- jQuery.extend(richfaces.ui.SubTable.prototype, (function () {
+ var $super = richfaces.BaseComponent.extend(richfaces.BaseComponent, richfaces.ui.SubTable);
+ var $p = richfaces.BaseComponent.extend(richfaces.BaseComponent,richfaces.ui.SubTable, {});
+ var $super = richfaces.ui.SubTable.$super;
+
+ $.extend(richfaces.ui.SubTable.prototype, (function () {
getElementById = function(id) {
- return jQuery(document.getElementById(id));
+ return $(document.getElementById(id));
}
getState = function() {
Modified: root/ui-sandbox/trunk/components/tables/ui/src/main/resources/META-INF/resources/toggler.js
===================================================================
--- root/ui-sandbox/trunk/components/tables/ui/src/main/resources/META-INF/resources/toggler.js 2010-05-04 14:28:59 UTC (rev 16883)
+++ root/ui-sandbox/trunk/components/tables/ui/src/main/resources/META-INF/resources/toggler.js 2010-05-04 14:39:11 UTC (rev 16884)
@@ -1,4 +1,4 @@
-(function (jQuery, richfaces) {
+(function ($, richfaces) {
richfaces.ui = richfaces.ui || {};
@@ -12,20 +12,22 @@
richfaces.Event.bindById(this.id, this.eventName, this.toggle, this);
};
- jQuery.extend(richfaces.ui.DataTableToggler.prototype, (function () {
+ $.extend(richfaces.ui.DataTableToggler.prototype, (function () {
getElementById= function(id) {
- jQuery(document.getElementById(id))
+ $(document.getElementById(id))
}
return {
toggle: function(event) {
var element = getElementById(this.forId);
- var subtable = element.attr('component');
- this.toggleControl(subtable.isExpand());
- subtable.toggle(event);
- },
+ var subtable = element.attr('richfaces');
+ if(subtable && subtable.component) {
+ this.toggleControl(subtable.component.isExpand());
+ subtable.component.toggle(event);
+ }
+ },
toggleControl: function(expanded) {
var expandControl = getElementById(this.expandControl);
14 years, 8 months
JBoss Rich Faces SVN: r16883 - root/ui-sandbox/trunk/components/componentcontrol/src/main/resources/META-INF.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2010-05-04 10:28:59 -0400 (Tue, 04 May 2010)
New Revision: 16883
Modified:
root/ui-sandbox/trunk/components/componentcontrol/src/main/resources/META-INF/cc.taglib.xml
Log:
RF-8634
Modified: root/ui-sandbox/trunk/components/componentcontrol/src/main/resources/META-INF/cc.taglib.xml
===================================================================
--- root/ui-sandbox/trunk/components/componentcontrol/src/main/resources/META-INF/cc.taglib.xml 2010-05-04 14:28:45 UTC (rev 16882)
+++ root/ui-sandbox/trunk/components/componentcontrol/src/main/resources/META-INF/cc.taglib.xml 2010-05-04 14:28:59 UTC (rev 16883)
@@ -13,7 +13,7 @@
</behavior>
</tag>
<tag>
- <tag-name>hashParameter</tag-name>
+ <tag-name>hashParam</tag-name>
<component>
<component-type>org.richfaces.HashParameter</component-type>
<handler-class>javax.faces.view.facelets.ComponentHandler</handler-class>
14 years, 8 months
JBoss Rich Faces SVN: r16882 - in root/framework/trunk/impl/src: test/java/org/richfaces/context and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2010-05-04 10:28:45 -0400 (Tue, 04 May 2010)
New Revision: 16882
Modified:
root/framework/trunk/impl/src/main/java/org/richfaces/context/ComponentIdResolver.java
root/framework/trunk/impl/src/test/java/org/richfaces/context/ComponentIdResolverTest.java
Log:
https://jira.jboss.org/jira/browse/RF-7856 - NPE fixed
Modified: root/framework/trunk/impl/src/main/java/org/richfaces/context/ComponentIdResolver.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/richfaces/context/ComponentIdResolver.java 2010-05-04 12:50:17 UTC (rev 16881)
+++ root/framework/trunk/impl/src/main/java/org/richfaces/context/ComponentIdResolver.java 2010-05-04 14:28:45 UTC (rev 16882)
@@ -93,20 +93,17 @@
private static UIComponent findRoot(UIComponent component) {
UIComponent c = component;
- while (c != null && !isRoot(c)) {
+ while (!isRoot(c)) {
c = c.getParent();
}
return c;
}
- private static UIComponent findContainerOrRoot(UIComponent component) {
+ private static UIComponent findContainer(UIComponent component) {
UIComponent c = component;
- while (c != null && c.getParent() != null) {
- if (c instanceof NamingContainer) {
- break;
- }
+ while (c != null && !(c instanceof NamingContainer)) {
c = c.getParent();
}
@@ -135,7 +132,7 @@
private String computeClientId(FacesContext context,
UIComponent topMatchComponent, String id) {
- UIComponent container = findContainerOrRoot(topMatchComponent.getParent());
+ UIComponent container = findContainer(topMatchComponent.getParent());
String containerClientId = null;
@@ -441,14 +438,14 @@
resolveId(rootNode, c, c);
if (hasUnresolvedIds()) {
- boolean resolutionResult = false;
-
- while (!isRoot(c) && !resolutionResult) {
- c = findContainerOrRoot(c);
-
- resolutionResult = findComponentsInContainer(c, rootNode, true);
-
- c = c.getParent();
+ UIComponent container = findContainer(c);
+ while (container != null && !isRoot(container)) {
+ boolean resolutionResult = findComponentsInContainer(container, rootNode, true);
+ if (resolutionResult) {
+ break;
+ }
+
+ container = findContainer(container.getParent());
}
}
Modified: root/framework/trunk/impl/src/test/java/org/richfaces/context/ComponentIdResolverTest.java
===================================================================
--- root/framework/trunk/impl/src/test/java/org/richfaces/context/ComponentIdResolverTest.java 2010-05-04 12:50:17 UTC (rev 16881)
+++ root/framework/trunk/impl/src/test/java/org/richfaces/context/ComponentIdResolverTest.java 2010-05-04 14:28:45 UTC (rev 16882)
@@ -182,6 +182,19 @@
}
@Test
+ public void testFindNonExistentWithContext() throws Exception {
+ ComponentIdResolver resolver = createComponentIdResolver();
+ resolver.addId("nonExistentId");
+ resolver.addId("xForm:nonExistentId");
+ resolver.addId(":ySubview:nonExistentId");
+
+ resolver.resolve(evaluateComponentExpression("#{testBean.table}"));
+
+ Set<String> resolvedIds = resolver.getResolvedIds();
+ assertEquals(asSet("nonExistentId", "xForm:nonExistentId", "ySubview:nonExistentId"), resolvedIds);
+ }
+
+ @Test
public void testFindViaMetadataResolverInContext() throws Exception {
ComponentIdResolver resolver = createComponentIdResolver();
resolver.addId("@region");
14 years, 8 months
JBoss Rich Faces SVN: r16881 - in root: cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt and 9 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: Alex.Kolonitsky
Date: 2010-05-04 08:50:17 -0400 (Tue, 04 May 2010)
New Revision: 16881
Modified:
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/CdkClassLoader.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/CdkException.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/CdkProcessingException.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/Generator.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/LibraryBuilder.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/RichFacesConventions.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/SourceFileManager.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/AptModule.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/AptSourceUtils.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/CdkProcessor.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/processors/BehaviorProcessor.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/processors/ConverterProcessor.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/processors/DescriptionProcessorImpl.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/processors/ProcessorBase.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/processors/RendererProcessor.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/ComponentLibrary.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/ModelCollection.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/ModelElementBase.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/ValidatorModel.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/JavaClassConfiguration.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/RendererClassVisitor.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/RendererTemplateParser.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/TemplateModule.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/el/ELParserUtils.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/el/node/AstPropertySuffixTreeNode.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/el/node/BinaryArithmeticOperationTreeNode.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/util/JavaUtils.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/util/Pair.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/XmlModule.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/BehaviorBean.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/ComponentBean.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/ConverterBean.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/ElementAdapterBase.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/ElementBeanBase.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/RendererBean.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/ValidatorBean.java
root/ui/trunk/components/core/src/test/java/org/richfaces/component/AbstractQueueComponentTest.java
Log:
fix checkstyle
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/CdkClassLoader.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/CdkClassLoader.java 2010-05-04 05:15:25 UTC (rev 16880)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/CdkClassLoader.java 2010-05-04 12:50:17 UTC (rev 16881)
@@ -23,21 +23,20 @@
package org.richfaces.cdk;
+import com.google.common.collect.ImmutableSet;
+import com.google.common.collect.Sets;
+
import java.io.File;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLClassLoader;
import java.util.Set;
-import com.google.common.collect.ImmutableSet;
-import com.google.common.collect.Sets;
-
/**
* <p class="changed_added_4_0">
* </p>
- *
+ *
* @author asmirnov(a)exadel.com
- *
*/
public class CdkClassLoader extends URLClassLoader {
@@ -50,8 +49,8 @@
addFiles(files);
}
- public CdkClassLoader(Iterable<File> files,ClassLoader parent) throws MalformedURLException {
- super(EMPTY_URLS,parent);
+ public CdkClassLoader(Iterable<File> files, ClassLoader parent) throws MalformedURLException {
+ super(EMPTY_URLS, parent);
addFiles(files);
}
@@ -61,6 +60,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @return the files
*/
public Iterable<File> getFiles() {
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/CdkException.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/CdkException.java 2010-05-04 05:15:25 UTC (rev 16880)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/CdkException.java 2010-05-04 12:50:17 UTC (rev 16881)
@@ -35,7 +35,7 @@
/**
* <p class="changed_added_4_0"></p>
*/
- public CdkException() {}
+ public CdkException() { }
/**
* <p class="changed_added_4_0"></p>
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/CdkProcessingException.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/CdkProcessingException.java 2010-05-04 05:15:25 UTC (rev 16880)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/CdkProcessingException.java 2010-05-04 12:50:17 UTC (rev 16881)
@@ -44,7 +44,7 @@
/**
* <p class="changed_added_4_0"></p>
*/
- public CdkProcessingException() {}
+ public CdkProcessingException() { }
/**
* <p class="changed_added_4_0"></p>
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/Generator.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/Generator.java 2010-05-04 05:15:25 UTC (rev 16880)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/Generator.java 2010-05-04 12:50:17 UTC (rev 16881)
@@ -69,7 +69,7 @@
private Map<Outputs, FileManager> outputFolders = Maps.newEnumMap(Outputs.class);
- private Map<Sources,FileManager> sources = Maps.newEnumMap(Sources.class);
+ private Map<Sources, FileManager> sources = Maps.newEnumMap(Sources.class);
private LibraryBuilder libraryBuilder;
@@ -100,7 +100,7 @@
this.outputFolders.put(type, new OutputFileManager(outputFolder));
}
- public void addSources(Sources type, Iterable<File> files, Iterable<File> folders){
+ public void addSources(Sources type, Iterable<File> files, Iterable<File> folders) {
this.sources.put(type, new SourceFileManager(files, folders));
}
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/LibraryBuilder.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/LibraryBuilder.java 2010-05-04 05:15:25 UTC (rev 16880)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/LibraryBuilder.java 2010-05-04 12:50:17 UTC (rev 16881)
@@ -21,12 +21,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.cdk;
-
-
/**
* <p class="changed_added_4_0">
* That class builds JSF library model from different sources. It acts as
@@ -34,9 +30,8 @@
* </p>
*
* @author asmirnov(a)exadel.com
- *
*/
-public interface LibraryBuilder {
+public interface LibraryBuilder {
/**
* <p class="changed_added_4_0">
@@ -45,13 +40,13 @@
*
* @throws CdkException
*/
- public void build() throws CdkException ;
+ public void build() throws CdkException;
/**
* Generate all types of files from library model.
- *
+ *
* @throws CdkException
*/
- public void generate() throws CdkException ;
+ public void generate() throws CdkException;
}
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/RichFacesConventions.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/RichFacesConventions.java 2010-05-04 05:15:25 UTC (rev 16880)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/RichFacesConventions.java 2010-05-04 12:50:17 UTC (rev 16881)
@@ -103,7 +103,7 @@
}
@Override
- public String inferUIComponentFamily( FacesId componentType) {
+ public String inferUIComponentFamily (FacesId componentType) {
if (null == componentType) {
throw new IllegalArgumentException();
}
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/SourceFileManager.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/SourceFileManager.java 2010-05-04 05:15:25 UTC (rev 16880)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/SourceFileManager.java 2010-05-04 12:50:17 UTC (rev 16881)
@@ -33,7 +33,6 @@
* </p>
*
* @author asmirnov(a)exadel.com
- *
*/
public class SourceFileManager implements FileManager {
@@ -50,6 +49,7 @@
*
* @see org.richfaces.cdk.FileManager#createFile(java.lang.String)
*/
+
@Override
public Writer createOutput(String path, long lastModified) throws IOException {
throw new UnsupportedOperationException("Cannot create file in source folder");
@@ -60,6 +60,7 @@
*
* @see org.richfaces.cdk.FileManager#getFile(java.lang.String)
*/
+
@Override
public File getFile(String path) throws FileNotFoundException {
String platformPath;
@@ -80,9 +81,9 @@
}
}
}
- if(null != sources){
+ if (null != sources) {
for (File file : sources) {
- if(file.getAbsolutePath().endsWith(platformPath)){
+ if (file.getAbsolutePath().endsWith(platformPath)) {
return file;
}
}
@@ -95,6 +96,7 @@
*
* @see org.richfaces.cdk.FileManager#getFiles()
*/
+
@Override
public Iterable<File> getFiles() {
return sources;
@@ -102,6 +104,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @return the folders
*/
@Override
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/AptModule.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/AptModule.java 2010-05-04 05:15:25 UTC (rev 16880)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/AptModule.java 2010-05-04 12:50:17 UTC (rev 16881)
@@ -42,23 +42,24 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @author asmirnov(a)exadel.com
- *
*/
public class AptModule extends AbstractModule {
/* (non-Javadoc)
* @see com.google.inject.AbstractModule#configure()
*/
+
@Override
protected void configure() {
- Multibinder<CdkAnnotationProcessor> setBinder = Multibinder.newSetBinder(binder(),CdkAnnotationProcessor.class);
+ Multibinder<CdkAnnotationProcessor> setBinder = Multibinder.newSetBinder(binder(), CdkAnnotationProcessor.class);
setBinder.addBinding().to(ComponentProcessor.class);
setBinder.addBinding().to(BehaviorProcessor.class);
setBinder.addBinding().to(RendererProcessor.class);
setBinder.addBinding().to(ConverterProcessor.class);
setBinder.addBinding().to(ValidatorProcessor.class);
-
+
bind(Processor.class).to(CdkProcessor.class);
bind(AttributesProcessor.class).to(AttributesProcessorImpl.class);
bind(DescriptionProcessor.class).to(DescriptionProcessorImpl.class);
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/AptSourceUtils.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/AptSourceUtils.java 2010-05-04 05:15:25 UTC (rev 16880)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/AptSourceUtils.java 2010-05-04 12:50:17 UTC (rev 16881)
@@ -61,7 +61,7 @@
// Get all methods and fields annotated by annotation.
for (Element childElement : members) {
- boolean annotated = (null != childElement.getAnnotation(annotation));
+ boolean annotated = null != childElement.getAnnotation(annotation);
if (!annotated) {
continue;
}
@@ -249,7 +249,7 @@
@Override
public TypeElement asTypeElement(TypeMirror mirror) {
- if(TypeKind.DECLARED.equals(mirror.getKind())){
+ if (TypeKind.DECLARED.equals(mirror.getKind())) {
return (TypeElement) processingEnv.getTypeUtils().asElement(mirror);
} else {
return null;
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/CdkProcessor.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/CdkProcessor.java 2010-05-04 05:15:25 UTC (rev 16880)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/CdkProcessor.java 2010-05-04 12:50:17 UTC (rev 16881)
@@ -88,7 +88,7 @@
if (!roundEnv.processingOver()) {
// Process annotations.
for (CdkAnnotationProcessor process : processors) {
- processAnnotation(process,roundEnv);
+ processAnnotation(process, roundEnv);
}
// parse non-java sources
for (ModelBuilder builder : builders) {
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/processors/BehaviorProcessor.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/processors/BehaviorProcessor.java 2010-05-04 05:15:25 UTC (rev 16880)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/processors/BehaviorProcessor.java 2010-05-04 12:50:17 UTC (rev 16881)
@@ -52,7 +52,7 @@
setTagInfo(behavior.tag(), behaviorModel);
AttributesProcessor attributesProcessor = getAttributeProcessor();
attributesProcessor.processXmlFragment(behaviorModel, behavior.attributes());
- attributesProcessor.processType(behaviorModel,element);
+ attributesProcessor.processType(behaviorModel, element);
setDescription(behaviorModel, behavior.description(), getDocComment(element));
library.getBehaviors().add(behaviorModel);
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/processors/ConverterProcessor.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/processors/ConverterProcessor.java 2010-05-04 05:15:25 UTC (rev 16880)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/processors/ConverterProcessor.java 2010-05-04 12:50:17 UTC (rev 16881)
@@ -63,7 +63,7 @@
AttributesProcessor attributesProcessor = getAttributeProcessor();
attributesProcessor.processXmlFragment(converterModel, converter.attributes());
- attributesProcessor.processType(converterModel,element);
+ attributesProcessor.processType(converterModel, element);
setClassNames(element, converterModel, converter.generate());
setTagInfo(converter.tag(), converterModel);
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/processors/DescriptionProcessorImpl.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/processors/DescriptionProcessorImpl.java 2010-05-04 05:15:25 UTC (rev 16880)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/processors/DescriptionProcessorImpl.java 2010-05-04 12:50:17 UTC (rev 16881)
@@ -29,8 +29,8 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @author asmirnov(a)exadel.com
- *
*/
public class DescriptionProcessorImpl implements DescriptionProcessor {
@@ -52,9 +52,10 @@
@Override
public void processDescription(DescriptionGroup model, Description description) {
- processDescription(model, description,null);
+ processDescription(model, description, null);
}
+
protected void setIcon(DescriptionGroup component, Description icon) {
if (null != icon && (!Strings.isEmpty(icon.smallIcon()) || !Strings.isEmpty(icon.largeIcon()))) {
DescriptionGroup.Icon iconValue = new DescriptionGroup.Icon();
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/processors/ProcessorBase.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/processors/ProcessorBase.java 2010-05-04 05:15:25 UTC (rev 16880)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/processors/ProcessorBase.java 2010-05-04 12:50:17 UTC (rev 16881)
@@ -121,6 +121,6 @@
}
protected void setDescription(DescriptionGroup model, Description description, String docComment) {
- descriptionProcessor.processDescription(model, description,docComment);
+ descriptionProcessor.processDescription(model, description, docComment);
}
}
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/processors/RendererProcessor.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/processors/RendererProcessor.java 2010-05-04 05:15:25 UTC (rev 16880)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/processors/RendererProcessor.java 2010-05-04 12:50:17 UTC (rev 16881)
@@ -176,7 +176,7 @@
return value.toString();
}
- return null;//getNamingConventions().inferRendererTypeByRendererClass(asClassDesctiption(rendererElement));
+ return null; //getNamingConventions().inferRendererTypeByRendererClass(asClassDesctiption(rendererElement));
}
private void setRendererType(TypeElement rendererElement, RendererModel rendererModel, JsfRenderer annotation) {
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/ComponentLibrary.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/ComponentLibrary.java 2010-05-04 05:15:25 UTC (rev 16880)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/ComponentLibrary.java 2010-05-04 12:50:17 UTC (rev 16881)
@@ -138,7 +138,7 @@
RenderKitModel renderKit = renderKits.get(renderKitType);
- if(null == renderKit){
+ if (null == renderKit) {
renderKit = new RenderKitModel();
renderKits.put(renderKitType, renderKit);
}
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/ModelCollection.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/ModelCollection.java 2010-05-04 05:15:25 UTC (rev 16880)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/ModelCollection.java 2010-05-04 12:50:17 UTC (rev 16881)
@@ -35,11 +35,10 @@
/**
* <p class="changed_added_4_0">
* Base class for all model collections. This collection use {@link Mergeable#same(Object)} method instead of equals
- * to lookup objects in the {@link #contains(Object)} and {@link #remove(Object)} methods. In addition, it merges same objects instead of replace in the {@link #add(ModelElement)} method.
+ * to lookup objects in the {@link #contains(Object)} and {@link #remove(Object)} methods. In addition, it merges same objects instead of replace in the {@link #add(ModelElement)} method.
* </p>
- *
+ *
* @author asmirnov(a)exadel.com
- *
*/
public class ModelCollection<E extends ModelElement<? super E>> implements Collection<E>, Visitable {
@@ -49,7 +48,6 @@
return new ModelCollection<T>();
}
-
public E find(final Predicate<? super E> predicate) {
try {
return Iterables.find(elements, predicate);
@@ -60,7 +58,7 @@
@Override
public boolean add(E e) {
- if(null == e){
+ if (null == e) {
throw new NullPointerException();
}
for (E element : elements) {
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/ModelElementBase.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/ModelElementBase.java 2010-05-04 05:15:25 UTC (rev 16880)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/ModelElementBase.java 2010-05-04 12:50:17 UTC (rev 16881)
@@ -1,10 +1,9 @@
package org.richfaces.cdk.model;
-import java.util.Collection;
-
import com.google.common.collect.Lists;
-import com.google.common.collect.Sets;
+import java.util.Collection;
+
/**
* <p class="changed_added_4_0">Base class for the most JSF components taht have description
* attributes and support extensions in faces-config.</p>
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/ValidatorModel.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/ValidatorModel.java 2010-05-04 05:15:25 UTC (rev 16880)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/ValidatorModel.java 2010-05-04 12:50:17 UTC (rev 16881)
@@ -44,7 +44,7 @@
@Override
public void merge(ValidatorModel other) {
- ComponentLibrary.merge(getAttributes(),other.getAttributes());
+ ComponentLibrary.merge(getAttributes(), other.getAttributes());
ComponentLibrary.merge(this, other);
}
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/JavaClassConfiguration.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/JavaClassConfiguration.java 2010-05-04 05:15:25 UTC (rev 16880)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/JavaClassConfiguration.java 2010-05-04 12:50:17 UTC (rev 16881)
@@ -41,7 +41,7 @@
public class JavaClassConfiguration extends Configuration implements FreeMarkerRenderer {
private static final String TEMPLATES = "/META-INF/templates/java";
- public JavaClassConfiguration(){
+ public JavaClassConfiguration() {
// TODO set proper template loader.
setClassForTemplateLoading(this.getClass(), TEMPLATES);
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/RendererClassVisitor.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/RendererClassVisitor.java 2010-05-04 05:15:25 UTC (rev 16880)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/RendererClassVisitor.java 2010-05-04 12:50:17 UTC (rev 16881)
@@ -27,13 +27,6 @@
import com.google.common.collect.Collections2;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Lists;
-import org.richfaces.cdk.templatecompiler.builder.model.Argument;
-import org.richfaces.cdk.templatecompiler.builder.model.JavaClass;
-import org.richfaces.cdk.templatecompiler.builder.model.JavaField;
-import org.richfaces.cdk.templatecompiler.builder.model.JavaMethod;
-import org.richfaces.cdk.templatecompiler.builder.model.JavaModifier;
-import org.richfaces.cdk.templatecompiler.builder.model.MethodBody;
-import org.richfaces.cdk.templatecompiler.builder.model.MethodBodyStatementsContainer;
import org.richfaces.cdk.CdkException;
import org.richfaces.cdk.Logger;
import org.richfaces.cdk.attributes.Attribute;
@@ -42,13 +35,19 @@
import org.richfaces.cdk.attributes.SchemaSet;
import org.richfaces.cdk.model.EventName;
import org.richfaces.cdk.model.PropertyBase;
+import org.richfaces.cdk.templatecompiler.builder.model.Argument;
+import org.richfaces.cdk.templatecompiler.builder.model.JavaClass;
+import org.richfaces.cdk.templatecompiler.builder.model.JavaField;
+import org.richfaces.cdk.templatecompiler.builder.model.JavaMethod;
+import org.richfaces.cdk.templatecompiler.builder.model.JavaModifier;
+import org.richfaces.cdk.templatecompiler.builder.model.MethodBody;
+import org.richfaces.cdk.templatecompiler.builder.model.MethodBodyStatementsContainer;
import org.richfaces.cdk.templatecompiler.el.ELParserUtils;
import org.richfaces.cdk.templatecompiler.el.ELVisitor;
import org.richfaces.cdk.templatecompiler.el.HelperMethod;
import org.richfaces.cdk.templatecompiler.el.ParsingException;
import org.richfaces.cdk.templatecompiler.el.Type;
import org.richfaces.cdk.templatecompiler.el.types.TypesFactory;
-import static org.richfaces.cdk.templatecompiler.QNameComparator.QNAME_COMPARATOR;
import org.richfaces.cdk.templatecompiler.model.AnyElement;
import org.richfaces.cdk.templatecompiler.model.CdkBodyElement;
import org.richfaces.cdk.templatecompiler.model.CdkCallElement;
@@ -62,8 +61,6 @@
import org.richfaces.cdk.templatecompiler.model.CompositeInterface;
import org.richfaces.cdk.templatecompiler.model.Template;
import org.richfaces.cdk.templatecompiler.model.TemplateVisitor;
-import static org.richfaces.cdk.util.JavaUtils.getEscapedString;
-import static org.richfaces.cdk.util.JavaUtils.getEscapedStringsArray;
import org.richfaces.cdk.util.Strings;
import org.richfaces.cdk.xmlconfig.JAXB;
@@ -84,16 +81,20 @@
import java.util.Set;
import java.util.TreeMap;
+import static org.richfaces.cdk.templatecompiler.QNameComparator.QNAME_COMPARATOR;
+import static org.richfaces.cdk.util.JavaUtils.getEscapedString;
+import static org.richfaces.cdk.util.JavaUtils.getEscapedStringsArray;
+
/**
* <p class="changed_added_4_0">
* </p>
- *
+ *
* @author asmirnov(a)exadel.com
*/
public class RendererClassVisitor implements TemplateVisitor {
/**
- *
+ *
*/
// TODO externalize
static final String RENDER_KIT_UTILS_CLASS_NAME = "org.richfaces.renderkit.RenderKitUtils";
@@ -123,14 +124,14 @@
static final String CLIENT_ID_VARIABLE = "clientId";
/**
- *
+ *
*/
private static final String PASS_THROUGH_ATTRIBUTES_FIELD_NAME = "PASS_THROUGH_ATTRIBUTES";
private static final Set<String> DEFAULT_NAMESPACES = ImmutableSet.of(Template.XHTML_EL_NAMESPACE,
Template.XHTML_NAMESPACE);
- private static final EnumMap<HelperMethod, HelperMethodBodyStatement> HELPER_METHOD_BODIES =
+ private static final EnumMap<HelperMethod, HelperMethodBodyStatement> HELPER_METHOD_BODIES =
new EnumMap<HelperMethod, HelperMethodBodyStatement>(HelperMethod.class);
static {
@@ -139,7 +140,7 @@
HELPER_METHOD_BODIES.put(HelperMethod.TO_BOOLEAN_CONVERSION, new ConversionToBooleanMethodBodyStatement());
HELPER_METHOD_BODIES.put(HelperMethod.TO_STRING_CONVERSION, new ConversionToStringMethodBodyStatement());
}
-
+
private final Logger log;
private MethodBodyStatementsContainer currentStatement;
@@ -160,7 +161,7 @@
private Collection<PropertyBase> attributes;
public RendererClassVisitor(CompositeInterface compositeInterface, Collection<PropertyBase> attributes,
- ClassLoader classLoader, JAXB jaxbBinding, Logger log) {
+ ClassLoader classLoader, JAXB jaxbBinding, Logger log) {
this.compositeInterface = compositeInterface;
this.attributes = attributes;
this.classLoader = classLoader;
@@ -190,18 +191,18 @@
private void addHelperMethod(HelperMethod helperMethod) {
if (addedHelperMethods.add(helperMethod)) {
HelperMethodBodyStatement methodBodyStatement = HELPER_METHOD_BODIES.get(helperMethod);
-
+
String[] argumentNames = methodBodyStatement.getArgumentNames();
Class<?>[] argumentTypes = helperMethod.getArgumentTypes();
assert argumentNames.length == argumentTypes.length;
-
+
Argument[] arguments = new Argument[argumentTypes.length];
for (int i = 0; i < arguments.length; i++) {
arguments[i] = new Argument(argumentNames[i], argumentTypes[i]);
}
- JavaMethod helperJavaMethod = new JavaMethod(helperMethod.getName(),
+ JavaMethod helperJavaMethod = new JavaMethod(helperMethod.getName(),
helperMethod.getReturnType(), arguments);
helperJavaMethod.addModifier(JavaModifier.PRIVATE);
@@ -292,7 +293,7 @@
}
// OPTIMIZATION - use ModelCollection with lookup method
- for (PropertyBase property : attributes) {
+ for (PropertyBase property : attributes) {
if (attributeName.equals(property.getName())) {
Set<EventName> eventNames = property.getEventNames();
if (eventNames != null && !eventNames.isEmpty()) {
@@ -333,8 +334,8 @@
generatedClass.addImport(Collections.class);
// TODO - get rid of FQNs for classes via imports
- passThroughField.setGenericArguments(new JavaClass[] { new JavaClass(String.class),
- new JavaClass("org.richfaces.renderkit.ComponentAttribute") });
+ passThroughField.setGenericArguments(new JavaClass[]{new JavaClass(String.class),
+ new JavaClass("org.richfaces.renderkit.ComponentAttribute")});
StringBuilder fieldValue = new StringBuilder("Collections.unmodifiableMap(ComponentAttribute.createMap(");
boolean isFirstArgument = true;
@@ -424,7 +425,7 @@
/**
* <p class="changed_added_4_0">
* </p>
- *
+ *
* @return the rendererClass
*/
public JavaClass getGeneratedClass() {
@@ -437,6 +438,7 @@
* @see org.richfaces.cdk.templatecompiler.model.TemplateVisitor
* #startElement(org.richfaces.cdk.templatecompiler.model.CdkBodyElement)
*/
+
@Override
public void startElement(CdkBodyElement cdkBodyElement) throws CdkException {
flushToEncodeMethod("encodeBegin");
@@ -448,6 +450,7 @@
* @see org.richfaces.cdk.templatecompiler.model.TemplateVisitor
* #endElement(org.richfaces.cdk.templatecompiler.model.CdkBodyElement)
*/
+
@Override
public void endElement(CdkBodyElement cdkBodyElement) throws CdkException {
flushToEncodeMethod("encodeChildren");
@@ -459,6 +462,7 @@
* @see org.richfaces.cdk.templatecompiler.model.TemplateVisitor
* #startElement(org.richfaces.cdk.templatecompiler.model.AnyElement)
*/
+
@Override
public void startElement(AnyElement anyElement) throws CdkException {
QName elementName = anyElement.getName();
@@ -536,6 +540,7 @@
* @see org.richfaces.cdk.templatecompiler.model.TemplateVisitor
* #endElement(org.richfaces.cdk.templatecompiler.model.AnyElement)
*/
+
@Override
public void endElement(AnyElement anyElement) throws CdkException {
QName elementName = anyElement.getName();
@@ -547,6 +552,7 @@
*
* @see org.richfaces.cdk.templatecompiler.model.TemplateVisitor#visitElement(java.lang.String)
*/
+
@Override
public void visitElement(String text) throws CdkException {
if (text != null) {
@@ -563,6 +569,7 @@
* @see org.richfaces.cdk.templatecompiler.model.TemplateVisitor
* #visitElement(org.richfaces.cdk.templatecompiler.model.CdkCallElement)
*/
+
@Override
public void visitElement(CdkCallElement cdkCallElement) throws CdkException {
String expression = cdkCallElement.getExpression();
@@ -579,6 +586,7 @@
* @see org.richfaces.cdk.templatecompiler.model.TemplateVisitor
* #startElement(org.richfaces.cdk.templatecompiler.model.CdkIfElement)
*/
+
@Override
public void startElement(CdkIfElement cdkIfElement) {
String compiledTestExpression = compileEl(cdkIfElement.getTest(), Boolean.TYPE);
@@ -593,6 +601,7 @@
* @see org.richfaces.cdk.templatecompiler.model.TemplateVisitor
* #endElement(org.richfaces.cdk.templatecompiler.model.CdkIfElement)
*/
+
@Override
public void endElement(CdkIfElement cdkIfElement) {
popStatement();
@@ -605,6 +614,7 @@
* @see org.richfaces.cdk.templatecompiler.model.TemplateVisitor
* #startElement(org.richfaces.cdk.templatecompiler.model.CdkChooseElement)
*/
+
@Override
public void startElement(CdkChooseElement cdkChooseElement) {
pushStatement(new IfElseStatement());
@@ -616,6 +626,7 @@
* @see org.richfaces.cdk.templatecompiler.model.TemplateVisitor
* #endElement(org.richfaces.cdk.templatecompiler.model.CdkChooseElement)
*/
+
@Override
public void endElement(CdkChooseElement cdkChooseElement) {
popStatement();
@@ -627,6 +638,7 @@
* @see org.richfaces.cdk.templatecompiler.model.TemplateVisitor
* #startElement(org.richfaces.cdk.templatecompiler.model.CdkWhenElement)
*/
+
@Override
public void startElement(CdkWhenElement cdkWhenElement) {
String compiledTestExpression = compileEl(cdkWhenElement.getTest(), Boolean.TYPE);
@@ -640,6 +652,7 @@
* @see org.richfaces.cdk.templatecompiler.model.TemplateVisitor
* #endElement(org.richfaces.cdk.templatecompiler.model.CdkWhenElement)
*/
+
@Override
public void endElement(CdkWhenElement cdkWhenElement) {
popStatement();
@@ -651,6 +664,7 @@
* @see org.richfaces.cdk.templatecompiler.model.TemplateVisitor
* #startElement(org.richfaces.cdk.templatecompiler.model.CdkOtherwiseElement)
*/
+
@Override
public void startElement(CdkOtherwiseElement cdkOtherwiseElement) {
pushStatement(new IfStatement(""));
@@ -662,6 +676,7 @@
* @see org.richfaces.cdk.templatecompiler.model.TemplateVisitor
* #endElement(org.richfaces.cdk.templatecompiler.model.CdkOtherwiseElement)
*/
+
@Override
public void endElement(CdkOtherwiseElement cdkOtherwiseElement) {
popStatement();
@@ -673,6 +688,7 @@
* @see org.richfaces.cdk.templatecompiler.model.TemplateVisitor
* #visitElement(org.richfaces.cdk.templatecompiler.model.CdkObjectElement)
*/
+
@Override
public void visitElement(CdkObjectElement cdkObjectElement) {
String name = cdkObjectElement.getName();
@@ -721,6 +737,7 @@
* @see org.richfaces.cdk.templatecompiler.model.TemplateVisitor
* #startElement(org.richfaces.cdk.templatecompiler.model.CdkForEachElement)
*/
+
@Override
public void startElement(CdkForEachElement cdkForEachElement) {
String items = cdkForEachElement.getItems();
@@ -742,6 +759,7 @@
* @see org.richfaces.cdk.templatecompiler.model.TemplateVisitor
* #endElement(org.richfaces.cdk.templatecompiler.model.CdkForEachElement)
*/
+
@Override
public void endElement(CdkForEachElement cdkForEachElement) {
popStatement();
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/RendererTemplateParser.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/RendererTemplateParser.java 2010-05-04 05:15:25 UTC (rev 16880)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/RendererTemplateParser.java 2010-05-04 12:50:17 UTC (rev 16881)
@@ -155,9 +155,9 @@
*/
@Override
public void build() throws CdkException {
- Iterable<File> sources = this.sources.getFiles();
- if (null != sources) {
- for (File file : sources) {
+ Iterable<File> sourceFiles = this.sources.getFiles();
+ if (null != sourceFiles) {
+ for (File file : sourceFiles) {
build(file, null);
}
}
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/TemplateModule.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/TemplateModule.java 2010-05-04 05:15:25 UTC (rev 16880)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/TemplateModule.java 2010-05-04 12:50:17 UTC (rev 16881)
@@ -44,7 +44,7 @@
protected void configure() {
Multibinder<ModelBuilder> modelBinder = Multibinder.newSetBinder(binder(), ModelBuilder.class);
modelBinder.addBinding().to(RendererTemplateParser.class);
- Multibinder.newSetBinder(binder(),CdkWriter.class).addBinding().to(RendererClassGenerator.class);
+ Multibinder.newSetBinder(binder(), CdkWriter.class).addBinding().to(RendererClassGenerator.class);
bind(new TypeLiteral<TemplateVisitorFactory<RendererClassVisitor>>(){}).to(VisitorFactoryImpl.class);
bind(FreeMarkerRenderer.class).to(JavaClassConfiguration.class);
}
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/el/ELParserUtils.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/el/ELParserUtils.java 2010-05-04 05:15:25 UTC (rev 16880)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/el/ELParserUtils.java 2010-05-04 12:50:17 UTC (rev 16881)
@@ -463,7 +463,7 @@
public static String coerceToType(String valueString, ELVisitor visitor, Type expectedType) {
if (!expectedType.isAssignableFrom(visitor.getExpressionType())) {
- for (HelperMethod conversionMethod: HelperMethod.getConversionMethods()) {
+ for (HelperMethod conversionMethod : HelperMethod.getConversionMethods()) {
Type returnType = TypesFactory.getType(conversionMethod.getReturnType());
if (expectedType.isAssignableFrom(returnType)) {
visitor.getUsedHelperMethods().add(conversionMethod);
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/el/node/AstPropertySuffixTreeNode.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/el/node/AstPropertySuffixTreeNode.java 2010-05-04 05:15:25 UTC (rev 16880)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/el/node/AstPropertySuffixTreeNode.java 2010-05-04 12:50:17 UTC (rev 16881)
@@ -43,13 +43,13 @@
super(node);
}
- private final String capitalize(String propertyName) {
+ private String capitalize(String propertyName) {
char[] chars = propertyName.toCharArray();
chars[0] = Character.toUpperCase(chars[0]);
return new String(chars);
}
- private final Method getReadMethod(Class<?> clazz, String propertyName) {
+ private Method getReadMethod(Class<?> clazz, String propertyName) {
if (clazz == null) {
return null;
}
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/el/node/BinaryArithmeticOperationTreeNode.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/el/node/BinaryArithmeticOperationTreeNode.java 2010-05-04 05:15:25 UTC (rev 16880)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/el/node/BinaryArithmeticOperationTreeNode.java 2010-05-04 12:50:17 UTC (rev 16881)
@@ -44,15 +44,16 @@
/* (non-Javadoc)
* @see org.richfaces.cdk.templatecompiler.el.node.AbstractBinaryOperationTreeNode#getOperationType(java.lang.reflect.Type, java.lang.reflect.Type)
*/
+
@Override
protected Type getOperationType(Type firstArgumentType,
Type secondArgumentType) {
Type doubleType = TypesFactory.getType(Double.class);
-
- if (doubleType.isAssignableFrom(firstArgumentType) ||
- doubleType.isAssignableFrom(secondArgumentType)) {
+ if (doubleType.isAssignableFrom(firstArgumentType)
+ || doubleType.isAssignableFrom(secondArgumentType)) {
+
return TypesFactory.getType(Double.TYPE);
}
@@ -62,10 +63,11 @@
/* (non-Javadoc)
* @see org.richfaces.cdk.templatecompiler.el.node.AbstractBinaryOperationTreeNode#getCoercedChildOutput(int, java.util.Map, org.richfaces.cdk.templatecompiler.el.ELVisitor)
*/
+
@Override
protected String getCoercedChildOutput(int childIndex, ELVisitor visitor)
throws ParsingException {
-
+
//TODO implement coercion to number
return getChildOutput(childIndex, visitor);
}
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/util/JavaUtils.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/util/JavaUtils.java 2010-05-04 05:15:25 UTC (rev 16880)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/util/JavaUtils.java 2010-05-04 12:50:17 UTC (rev 16881)
@@ -35,12 +35,11 @@
/**
* @author Nick Belaevski
- *
*/
public final class JavaUtils {
public static final ImmutableMap<Class<?>, Class<?>> BOXING_CLASSES =
- ImmutableMap.<Class<?>, Class<?>> builder().put(Boolean.TYPE, Boolean.class).put(Character.TYPE,
+ ImmutableMap.<Class<?>, Class<?>>builder().put(Boolean.TYPE, Boolean.class).put(Character.TYPE,
Character.class).put(Byte.TYPE, Byte.class).put(Short.TYPE, Short.class).put(Integer.TYPE, Integer.class)
.put(Long.TYPE, Long.class).put(Float.TYPE, Float.class).put(Double.TYPE, Double.class).build();
@@ -52,7 +51,7 @@
* <p class="changed_added_4_0">
* Transform character to Java code expression
* </p>
- *
+ *
* @param c
* @return
*/
@@ -84,7 +83,7 @@
* <p class="changed_added_4_0">
* Escapes string into Java language expression
* </p>
- *
+ *
* @param s
* @return
*/
@@ -127,7 +126,7 @@
* <p class="changed_added_4_0">
* Escapes sequence of strings into comma-separated sequence of Java language expressions
* </p>
- *
+ *
* @param strings
* @return
*/
@@ -202,9 +201,9 @@
for (PropertyDescriptor sourceProperty : sourceProperties) {
if (!JAXBBinding.IGNORE_PROPERTIES.contains(name) && name.equals(sourceProperty.getName())) {
try {
- writeProperty(source, destination, targetProperty, sourceProperty);
+ writeProperty(source, destination, targetProperty, sourceProperty);
} catch (Exception e) {
- throw new CdkException("Error on copying property "+name+" from object "+source.getClass()+" to "+destination.getClass(), e);
+ throw new CdkException("Error on copying property " + name + " from object " + source.getClass() + " to " + destination.getClass(), e);
}
}
}
@@ -215,7 +214,7 @@
}
public static void writeProperty(Object source, Object destination, PropertyDescriptor targetProperty,
- PropertyDescriptor sourceProperty) throws IllegalAccessException, InvocationTargetException {
+ PropertyDescriptor sourceProperty) throws IllegalAccessException, InvocationTargetException {
Method readMethod = sourceProperty.getReadMethod();
if (readMethod == null) {
return;
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/util/Pair.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/util/Pair.java 2010-05-04 05:15:25 UTC (rev 16880)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/util/Pair.java 2010-05-04 12:50:17 UTC (rev 16881)
@@ -25,10 +25,10 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @author asmirnov(a)exadel.com
- *
*/
-public class Pair<A,B> {
+public class Pair<A, B> {
private final A first;
@@ -36,6 +36,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @param first
* @param second
*/
@@ -44,12 +45,13 @@
this.second = second;
}
- public static <X,Y> Pair<X,Y> of( X first, Y second){
- return new Pair<X, Y>(first,second);
+ public static <X, Y> Pair<X, Y> of(X first, Y second) {
+ return new Pair<X, Y>(first, second);
}
/**
* <p class="changed_added_4_0"></p>
+ *
* @return the first
*/
public A getFirst() {
@@ -58,6 +60,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @return the second
*/
public B getSecond() {
@@ -67,6 +70,7 @@
/* (non-Javadoc)
* @see java.lang.Object#hashCode()
*/
+
@Override
public int hashCode() {
final int prime = 31;
@@ -79,6 +83,7 @@
/* (non-Javadoc)
* @see java.lang.Object#equals(java.lang.Object)
*/
+
@Override
public boolean equals(Object obj) {
if (this == obj) {
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/XmlModule.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/XmlModule.java 2010-05-04 05:15:25 UTC (rev 16880)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/XmlModule.java 2010-05-04 12:50:17 UTC (rev 16881)
@@ -47,7 +47,7 @@
bind(NamespacePrefixMapper.class).to(FacesConfigNamespacePreffixMapper.class);
Multibinder.newSetBinder(binder(), ModelBuilder.class)
.addBinding().to(FacesConfigParser.class);
- Multibinder.newSetBinder(binder(),CdkWriter.class)
+ Multibinder.newSetBinder(binder(), CdkWriter.class)
.addBinding().to(FacesConfigGenerator.class);
}
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/BehaviorBean.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/BehaviorBean.java 2010-05-04 05:15:25 UTC (rev 16880)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/BehaviorBean.java 2010-05-04 12:50:17 UTC (rev 16881)
@@ -22,24 +22,23 @@
package org.richfaces.cdk.xmlconfig.model;
-import java.util.Collection;
-
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlType;
-import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
-
import org.richfaces.cdk.model.AttributeModel;
import org.richfaces.cdk.model.ClassName;
import org.richfaces.cdk.model.ComponentLibrary;
import org.richfaces.cdk.model.FacesId;
import org.richfaces.cdk.model.PropertyModel;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
+import java.util.Collection;
+
/**
* @author akolonitsky
* @since Jan 21, 2010
*/
@XmlType(name = "faces-config-behaviorType", namespace = ComponentLibrary.FACES_CONFIG_NAMESPACE,
- propOrder={"id", "targetClass", "facesAttributes", "properties", "extension"})
+ propOrder = {"id", "targetClass", "facesAttributes", "properties", "extension"})
@XmlJavaTypeAdapter(BehaviorAdapter.class)
public class BehaviorBean extends ElementBeanBase<BehaviorBean.BehaviorExtension> {
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/ComponentBean.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/ComponentBean.java 2010-05-04 05:15:25 UTC (rev 16880)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/ComponentBean.java 2010-05-04 12:50:17 UTC (rev 16881)
@@ -23,13 +23,7 @@
package org.richfaces.cdk.xmlconfig.model;
-import java.util.Collection;
-import java.util.List;
-
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlType;
-import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
-
+import com.google.common.collect.Lists;
import org.richfaces.cdk.model.AttributeModel;
import org.richfaces.cdk.model.ClassName;
import org.richfaces.cdk.model.ComponentLibrary;
@@ -39,7 +33,11 @@
import org.richfaces.cdk.model.PropertyModel;
import org.richfaces.cdk.model.TagModel;
-import com.google.common.collect.Lists;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
+import java.util.Collection;
+import java.util.List;
/**
* <p class="changed_added_4_0"></p>
@@ -47,10 +45,10 @@
* @author asmirnov(a)exadel.com
*/
@XmlType(name = "faces-config-componentType", namespace = ComponentLibrary.FACES_CONFIG_NAMESPACE,
- propOrder={"type", "targetClass", "facets", "facesAttributes", "properties", "extension"})
+ propOrder = {"type", "targetClass", "facets", "facesAttributes", "properties", "extension"})
@XmlJavaTypeAdapter(ComponentAdapter.class)
public class ComponentBean extends ElementBeanBase<ComponentBean.ComponentExtension> {
-
+
private List<FacetModel> facets = Lists.newArrayList();
private ClassName targetClass;
private FacesId type;
@@ -60,7 +58,7 @@
*
* @return the type
*/
- @XmlElement(name = "component-type", namespace = ComponentLibrary.FACES_CONFIG_NAMESPACE,required=true)
+ @XmlElement(name = "component-type", namespace = ComponentLibrary.FACES_CONFIG_NAMESPACE, required = true)
public FacesId getType() {
return type;
}
@@ -145,10 +143,11 @@
}
public static class ComponentExtension extends ExtensionBeanBase {
- private String rendererType ;
+ private String rendererType;
private List<EventModel> events = Lists.newArrayList();
private List<TagModel> tags = Lists.newArrayList();
private String family;
+
/**
* <p class="changed_added_4_0"></p>
*
@@ -209,6 +208,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @return the tags
*/
@XmlElement(name = "tag", namespace = ComponentLibrary.CDK_EXTENSIONS_NAMESPACE)
@@ -218,6 +218,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @param tags the tags to set
*/
public void setTags(List<TagModel> tags) {
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/ConverterBean.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/ConverterBean.java 2010-05-04 05:15:25 UTC (rev 16880)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/ConverterBean.java 2010-05-04 12:50:17 UTC (rev 16881)
@@ -21,25 +21,23 @@
package org.richfaces.cdk.xmlconfig.model;
+import org.richfaces.cdk.model.AttributeModel;
import org.richfaces.cdk.model.ClassName;
import org.richfaces.cdk.model.ComponentLibrary;
import org.richfaces.cdk.model.FacesId;
import org.richfaces.cdk.model.PropertyModel;
-import org.richfaces.cdk.model.AttributeModel;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
-
import java.util.Collection;
-import java.util.List;
/**
* @author akolonitsky
* @since Jan 6, 2010
*/
@XmlType(name = "faces-config-converterType", namespace = ComponentLibrary.FACES_CONFIG_NAMESPACE,
- propOrder={"id", "converterForClass", "targetClass", "facesAttributes", "properties", "extension"})
+ propOrder = {"id", "converterForClass", "targetClass", "facesAttributes", "properties", "extension"})
@XmlJavaTypeAdapter(ConverterAdapter.class)
public class ConverterBean extends ElementBeanBase<ConverterBean.ConverterExtension> {
@@ -58,7 +56,6 @@
this.id = id;
}
-
@Override
@XmlElement(name = "property", namespace = ComponentLibrary.FACES_CONFIG_NAMESPACE, type = PropertyBean.class)
@XmlJavaTypeAdapter(PropertyAdapter.class)
@@ -90,12 +87,12 @@
public void setTargetClass(ClassName converterClass) {
this.targetClass = converterClass;
}
-
+
@Override
public void setExtension(ConverterExtension extension) {
super.setExtension(extension);
}
-
+
@XmlElement(name = "converter-extension", namespace = ComponentLibrary.FACES_CONFIG_NAMESPACE, nillable = true)
@Override
public ConverterExtension getExtension() {
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/ElementAdapterBase.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/ElementAdapterBase.java 2010-05-04 05:15:25 UTC (rev 16880)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/ElementAdapterBase.java 2010-05-04 12:50:17 UTC (rev 16881)
@@ -23,10 +23,7 @@
package org.richfaces.cdk.xmlconfig.model;
import org.richfaces.cdk.model.BeanModelBase;
-import org.richfaces.cdk.model.AttributeModel;
-import java.util.ArrayList;
-
/**
* @author akolonitsky
* @since Mar 19, 2010
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/ElementBeanBase.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/ElementBeanBase.java 2010-05-04 05:15:25 UTC (rev 16880)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/ElementBeanBase.java 2010-05-04 12:50:17 UTC (rev 16881)
@@ -41,14 +41,14 @@
@SuppressWarnings("unchecked")
public abstract class ElementBeanBase<E extends ConfigExtension> extends ExtensibleBean<E> {
- private static final Predicate<PropertyBase> propertyPredicate = new Predicate<PropertyBase>() {
+ private static final Predicate<PropertyBase> PROPERTY_PREDICATE = new Predicate<PropertyBase>() {
@Override
public boolean apply(PropertyBase input) {
return input instanceof PropertyModel;
}
};
- private static final Predicate<PropertyBase> attributePredicate = new Predicate<PropertyBase>() {
+ private static final Predicate<PropertyBase> ATTRIBUTE_PREDICATE = new Predicate<PropertyBase>() {
@Override
public boolean apply(PropertyBase input) {
return input instanceof AttributeModel;
@@ -57,9 +57,9 @@
private Collection<? extends PropertyBase> attributes = Lists.newArrayList();
- private Collection<PropertyModel> properties = (Collection<PropertyModel>) Collections2.filter(attributes, propertyPredicate);
+ private Collection<PropertyModel> properties = (Collection<PropertyModel>) Collections2.filter(attributes, PROPERTY_PREDICATE);
- private Collection<AttributeModel> facesAttributes = (Collection<AttributeModel>) Collections2.filter(attributes, attributePredicate);
+ private Collection<AttributeModel> facesAttributes = (Collection<AttributeModel>) Collections2.filter(attributes, ATTRIBUTE_PREDICATE);
public Collection<PropertyModel> getProperties() {
return properties;
@@ -77,7 +77,7 @@
public void setAttributes(Collection<PropertyBase> attributes) {
this.attributes = attributes;
- properties = (Collection<PropertyModel>) Collections2.filter(this.attributes, propertyPredicate);
- facesAttributes = (Collection<AttributeModel>) Collections2.filter(this.attributes, attributePredicate);
+ properties = (Collection<PropertyModel>) Collections2.filter(this.attributes, PROPERTY_PREDICATE);
+ facesAttributes = (Collection<AttributeModel>) Collections2.filter(this.attributes, ATTRIBUTE_PREDICATE);
}
}
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/RendererBean.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/RendererBean.java 2010-05-04 05:15:25 UTC (rev 16880)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/RendererBean.java 2010-05-04 12:50:17 UTC (rev 16881)
@@ -23,19 +23,17 @@
package org.richfaces.cdk.xmlconfig.model;
-import java.util.List;
-
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlType;
-import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
-
+import com.google.common.collect.Lists;
import org.richfaces.cdk.model.AttributeModel;
import org.richfaces.cdk.model.ClassName;
import org.richfaces.cdk.model.ComponentLibrary;
import org.richfaces.cdk.model.ConfigExtension;
import org.richfaces.cdk.model.TagModel;
-import com.google.common.collect.Lists;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
+import java.util.List;
/**
* <p class="changed_added_4_0">
@@ -44,7 +42,7 @@
* @author asmirnov(a)exadel.com
*/
@XmlType(name = "faces-config-rendererType", namespace = ComponentLibrary.FACES_CONFIG_NAMESPACE,
- propOrder={"family","type","rendererClass",/*"facet",*/"attributes","extension"})
+ propOrder = {"family", "type", "rendererClass",/*"facet",*/"attributes", "extension"})
public class RendererBean extends
ExtensibleBean<RendererBean.RendererExtension> {
@@ -168,9 +166,9 @@
/**
* <p class="changed_added_4_0">
* </p>
- *
+ * <p/>
* TODO
- *
+ *
* @return the tag
*/
// @XmlElement(name = "tag", namespace = ComponentLibrary.CDK_EXTENSIONS_NAMESPACE)
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/ValidatorBean.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/ValidatorBean.java 2010-05-04 05:15:25 UTC (rev 16880)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/ValidatorBean.java 2010-05-04 12:50:17 UTC (rev 16881)
@@ -21,18 +21,16 @@
package org.richfaces.cdk.xmlconfig.model;
+import org.richfaces.cdk.model.AttributeModel;
import org.richfaces.cdk.model.ClassName;
import org.richfaces.cdk.model.ComponentLibrary;
import org.richfaces.cdk.model.FacesId;
import org.richfaces.cdk.model.PropertyModel;
-import org.richfaces.cdk.model.AttributeModel;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
-
import java.util.Collection;
-import java.util.List;
/**
* @author akolonitsky
Modified: root/ui/trunk/components/core/src/test/java/org/richfaces/component/AbstractQueueComponentTest.java
===================================================================
--- root/ui/trunk/components/core/src/test/java/org/richfaces/component/AbstractQueueComponentTest.java 2010-05-04 05:15:25 UTC (rev 16880)
+++ root/ui/trunk/components/core/src/test/java/org/richfaces/component/AbstractQueueComponentTest.java 2010-05-04 12:50:17 UTC (rev 16881)
@@ -492,3 +492,5 @@
}
}
}
+
+
14 years, 8 months
JBoss Rich Faces SVN: r16880 - in branches/enterprise/3.3.X/docs/userguide: en/src/main/docbook/included and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: SeanRogers
Date: 2010-05-04 01:15:25 -0400 (Tue, 04 May 2010)
New Revision: 16880
Added:
branches/enterprise/3.3.X/docs/userguide/3.3.1.SP2.zip
Modified:
branches/enterprise/3.3.X/docs/userguide/en/src/main/docbook/included/calendar.xml
branches/enterprise/3.3.X/docs/userguide/en/src/main/docbook/included/editor.xml
branches/enterprise/3.3.X/docs/userguide/en/src/main/docbook/modules/RFCarchitectover.xml
Log:
docs bundle added temporarily
Added: branches/enterprise/3.3.X/docs/userguide/3.3.1.SP2.zip
===================================================================
(Binary files differ)
Property changes on: branches/enterprise/3.3.X/docs/userguide/3.3.1.SP2.zip
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: branches/enterprise/3.3.X/docs/userguide/en/src/main/docbook/included/calendar.xml
===================================================================
--- branches/enterprise/3.3.X/docs/userguide/en/src/main/docbook/included/calendar.xml 2010-05-04 00:42:31 UTC (rev 16879)
+++ branches/enterprise/3.3.X/docs/userguide/en/src/main/docbook/included/calendar.xml 2010-05-04 05:15:25 UTC (rev 16880)
@@ -206,7 +206,10 @@
</emphasis> attributes were designed only for the
"<code>client</code>" mode to
load some data initially.</para>
- </note>
+ </note>
+ <para>
+ Refer to <xref linkend="LimitationsAndRules" /> for limitations on serializing data.
+ </para>
<para><emphasis>
<property>"ondateselect"</property>
</emphasis> attribute is used to define an event that is triggered
Modified: branches/enterprise/3.3.X/docs/userguide/en/src/main/docbook/included/editor.xml
===================================================================
--- branches/enterprise/3.3.X/docs/userguide/en/src/main/docbook/included/editor.xml 2010-05-04 00:42:31 UTC (rev 16879)
+++ branches/enterprise/3.3.X/docs/userguide/en/src/main/docbook/included/editor.xml 2010-05-04 05:15:25 UTC (rev 16880)
@@ -343,7 +343,14 @@
<programlisting role="XML"><![CDATA[...
[Lorem ipsum=>http://mysite.com] *dolor sit* amet, ea _commodo_ consequat.
...]]></programlisting>
- <para>Accordingly, if the Seam text is passed to the component it will be parsed to HTML code.</para>
+ <para>Accordingly, if the Seam text is passed to the component it will be parsed to HTML code.</para>
+
+ <note>
+ <title><emphasis role="bold"> <property><rich:editor></property></emphasis> in <productname>Internet Explorer</productname></title>
+ <para>
+ When used in conjunction with a <emphasis role="bold"> <property><base></property></emphasis> HTML element containing an <varname>href</varname> attribute, the <emphasis role="bold"> <property><rich:editor></property></emphasis> will not be rendered correctly. Avoid using the <emphasis role="bold"> <property><base></property></emphasis> element and <varname>href</varname> attribute on pages containing a <emphasis role="bold"> <property><rich:editor></property></emphasis> component.
+ </para>
+ </note>
</section>
<section>
Modified: branches/enterprise/3.3.X/docs/userguide/en/src/main/docbook/modules/RFCarchitectover.xml
===================================================================
--- branches/enterprise/3.3.X/docs/userguide/en/src/main/docbook/modules/RFCarchitectover.xml 2010-05-04 00:42:31 UTC (rev 16879)
+++ branches/enterprise/3.3.X/docs/userguide/en/src/main/docbook/modules/RFCarchitectover.xml 2010-05-04 05:15:25 UTC (rev 16880)
@@ -194,7 +194,7 @@
Certain components in the <property>RichFaces</property> framework allow data to be serialized and transferred from the server to the client. If the data model being used contains circular references, the references are partially serialized. Serialization of the data is done from the top-most object down, so all circular references back to parent objects are ignored when transferred to the client.
</para>
<para>
- Only the data required by the client should be serialized. Serializing excess data can lead to performance and memory issues if too much data is processed, or security issues if private data is exposed to end-users. Large amounts of data can be handled creating Data Transfer Objects (<acronym>DTO</acronym>) from entities and passing them as suggestion values. Alternatively a mapping framework or assembler can manage the required data.
+ Only the data required by the client should be serialized. Serializing excess data can lead to performance and memory issues if too much data is processed. Additionally, security issues may arise if private data is exposed to end-users. Large amounts of data can be handled creating Data Transfer Objects (<acronym>DTO</acronym>) from entities and passing them as suggestion values. Alternatively a mapping framework or assembler can manage the required data.
</para>
</listitem>
</itemizedlist>
@@ -906,7 +906,7 @@
complex types including arrays and collections. The beans should be serializable to
be refered with <emphasis>
<property>"data"</property>
- </emphasis> . </para>
+ </emphasis> . Refer to <xref linkend="LimitationsAndRules" /> for limitations on serializing data.</para>
<para> There is a number of useful functions which can be used in JavaScript: </para>
<itemizedlist>
<listitem>
14 years, 8 months
JBoss Rich Faces SVN: r16879 - in root/cdk/trunk/plugins/generator/src: main/java/org/richfaces/cdk/model and 3 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: alexsmirnov
Date: 2010-05-03 20:42:31 -0400 (Mon, 03 May 2010)
New Revision: 16879
Modified:
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/processors/ComponentProcessor.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/ModelElementBase.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/util/JavaUtils.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/BehaviorBean.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/ComponentAdapter.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/ComponentBean.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/ConverterBean.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/ElementAdapterBase.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/ElementBeanBase.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/ValidatorBean.java
root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/xmlconfig/ComponentAdapterTest.java
Log:
Integration test generates components from annotations.
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/processors/ComponentProcessor.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/processors/ComponentProcessor.java 2010-05-03 22:32:23 UTC (rev 16878)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/processors/ComponentProcessor.java 2010-05-04 00:42:31 UTC (rev 16879)
@@ -81,6 +81,7 @@
// Should that component be generated ?
setClassNames(componentElement, component, annotation.generate());
setComponentProperties(componentElement, component, annotation);
+ library.getComponents().add(component);
// Process the second level annotations.
for (final SubComponent subcomponent : annotation.components()) {
@@ -88,10 +89,10 @@
ComponentModel subcomponentModel = new ComponentModel();
subcomponentModel.setBaseClass(component.getTargetClass());
subcomponentModel.setTargetClass(ClassName.parseName(subcomponent.generate()));
+ subcomponentModel.setGenerate(!Strings.isEmpty(subcomponent.generate()));
setComponentProperties(null, subcomponentModel, subAnnotation);
- }
-
- library.getComponents().add(component);
+ library.getComponents().add(subcomponentModel);
+ }
}
/**
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/ModelElementBase.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/ModelElementBase.java 2010-05-03 22:32:23 UTC (rev 16878)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/ModelElementBase.java 2010-05-04 00:42:31 UTC (rev 16879)
@@ -2,6 +2,7 @@
import java.util.Collection;
+import com.google.common.collect.Lists;
import com.google.common.collect.Sets;
/**
@@ -20,7 +21,7 @@
private final ModelCollection<TagModel> tags = ModelCollection.<TagModel>create();
- private final Collection<ClassName> interfaces = Sets.newHashSet();
+ private final Collection<ClassName> interfaces = Lists.newArrayList();
/**
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/util/JavaUtils.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/util/JavaUtils.java 2010-05-03 22:32:23 UTC (rev 16878)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/util/JavaUtils.java 2010-05-04 00:42:31 UTC (rev 16879)
@@ -201,13 +201,16 @@
for (PropertyDescriptor sourceProperty : sourceProperties) {
if (!JAXBBinding.IGNORE_PROPERTIES.contains(name) && name.equals(sourceProperty.getName())) {
-
+ try {
writeProperty(source, destination, targetProperty, sourceProperty);
+ } catch (Exception e) {
+ throw new CdkException("Error on copying property "+name+" from object "+source.getClass()+" to "+destination.getClass(), e);
+ }
}
}
}
} catch (Exception e) {
- throw new CdkException("Properties copiing error", e);
+ throw new CdkException("Properties copying error", e);
}
}
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/BehaviorBean.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/BehaviorBean.java 2010-05-03 22:32:23 UTC (rev 16878)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/BehaviorBean.java 2010-05-04 00:42:31 UTC (rev 16879)
@@ -22,23 +22,24 @@
package org.richfaces.cdk.xmlconfig.model;
+import java.util.Collection;
+
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
+
+import org.richfaces.cdk.model.AttributeModel;
import org.richfaces.cdk.model.ClassName;
import org.richfaces.cdk.model.ComponentLibrary;
import org.richfaces.cdk.model.FacesId;
import org.richfaces.cdk.model.PropertyModel;
-import org.richfaces.cdk.model.AttributeModel;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlType;
-import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
-import java.util.List;
-
/**
* @author akolonitsky
* @since Jan 21, 2010
*/
@XmlType(name = "faces-config-behaviorType", namespace = ComponentLibrary.FACES_CONFIG_NAMESPACE,
- propOrder={"id", "targetClass", "attributes", "properties", "extension"})
+ propOrder={"id", "targetClass", "facesAttributes", "properties", "extension"})
@XmlJavaTypeAdapter(BehaviorAdapter.class)
public class BehaviorBean extends ElementBeanBase<BehaviorBean.BehaviorExtension> {
@@ -58,15 +59,15 @@
@Override
@XmlElement(name = "property", namespace = ComponentLibrary.FACES_CONFIG_NAMESPACE, type = PropertyBean.class)
@XmlJavaTypeAdapter(PropertyAdapter.class)
- public List<PropertyModel> getProperties() {
+ public Collection<PropertyModel> getProperties() {
return super.getProperties();
}
@Override
@XmlElement(name = "attribute", namespace = ComponentLibrary.FACES_CONFIG_NAMESPACE, type = AttributeBean.class)
@XmlJavaTypeAdapter(AttributeAdapter.class)
- public List<AttributeModel> getAttributes() {
- return super.getAttributes();
+ public Collection<AttributeModel> getFacesAttributes() {
+ return super.getFacesAttributes();
}
@XmlElement(name = "behavior-class", namespace = ComponentLibrary.FACES_CONFIG_NAMESPACE)
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/ComponentAdapter.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/ComponentAdapter.java 2010-05-03 22:32:23 UTC (rev 16878)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/ComponentAdapter.java 2010-05-04 00:42:31 UTC (rev 16879)
@@ -48,18 +48,4 @@
return ComponentModel.class;
}
- @Override
- protected void postMarshal(ComponentModel model, ComponentBean bean) {
- super.postMarshal(model, bean);
-// TODO
-// if(null != model.getRenderer()){
-// bean.getExtension().setRendererType(model.getRenderer().getType().getType());
-// }
- }
-
- @Override
- protected void postUnmarshal(ComponentBean bean, ComponentModel model) {
- super.postUnmarshal(bean, model);
- // TODO set renderer from type.
- }
}
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/ComponentBean.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/ComponentBean.java 2010-05-03 22:32:23 UTC (rev 16878)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/ComponentBean.java 2010-05-04 00:42:31 UTC (rev 16879)
@@ -23,20 +23,23 @@
package org.richfaces.cdk.xmlconfig.model;
-import com.google.common.collect.Lists;
+import java.util.Collection;
+import java.util.List;
+
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
+
+import org.richfaces.cdk.model.AttributeModel;
import org.richfaces.cdk.model.ClassName;
import org.richfaces.cdk.model.ComponentLibrary;
import org.richfaces.cdk.model.EventModel;
import org.richfaces.cdk.model.FacesId;
import org.richfaces.cdk.model.FacetModel;
import org.richfaces.cdk.model.PropertyModel;
-import org.richfaces.cdk.model.AttributeModel;
import org.richfaces.cdk.model.TagModel;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlType;
-import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
-import java.util.List;
+import com.google.common.collect.Lists;
/**
* <p class="changed_added_4_0"></p>
@@ -44,7 +47,7 @@
* @author asmirnov(a)exadel.com
*/
@XmlType(name = "faces-config-componentType", namespace = ComponentLibrary.FACES_CONFIG_NAMESPACE,
- propOrder={"type", "targetClass", "facets", "attributes", "properties", "extension"})
+ propOrder={"type", "targetClass", "facets", "facesAttributes", "properties", "extension"})
@XmlJavaTypeAdapter(ComponentAdapter.class)
public class ComponentBean extends ElementBeanBase<ComponentBean.ComponentExtension> {
@@ -74,15 +77,15 @@
@Override
@XmlElement(name = "property", namespace = ComponentLibrary.FACES_CONFIG_NAMESPACE, type = PropertyBean.class)
@XmlJavaTypeAdapter(PropertyAdapter.class)
- public List<PropertyModel> getProperties() {
+ public Collection<PropertyModel> getProperties() {
return super.getProperties();
}
@Override
@XmlElement(name = "attribute", namespace = ComponentLibrary.FACES_CONFIG_NAMESPACE, type = AttributeBean.class)
@XmlJavaTypeAdapter(AttributeAdapter.class)
- public List<AttributeModel> getAttributes() {
- return super.getAttributes();
+ public Collection<AttributeModel> getFacesAttributes() {
+ return super.getFacesAttributes();
}
/**
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/ConverterBean.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/ConverterBean.java 2010-05-03 22:32:23 UTC (rev 16878)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/ConverterBean.java 2010-05-04 00:42:31 UTC (rev 16879)
@@ -30,6 +30,8 @@
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
+
+import java.util.Collection;
import java.util.List;
/**
@@ -37,7 +39,7 @@
* @since Jan 6, 2010
*/
@XmlType(name = "faces-config-converterType", namespace = ComponentLibrary.FACES_CONFIG_NAMESPACE,
- propOrder={"id", "converterForClass", "targetClass", "attributes", "properties", "extension"})
+ propOrder={"id", "converterForClass", "targetClass", "facesAttributes", "properties", "extension"})
@XmlJavaTypeAdapter(ConverterAdapter.class)
public class ConverterBean extends ElementBeanBase<ConverterBean.ConverterExtension> {
@@ -60,15 +62,15 @@
@Override
@XmlElement(name = "property", namespace = ComponentLibrary.FACES_CONFIG_NAMESPACE, type = PropertyBean.class)
@XmlJavaTypeAdapter(PropertyAdapter.class)
- public List<PropertyModel> getProperties() {
+ public Collection<PropertyModel> getProperties() {
return super.getProperties();
}
@Override
@XmlElement(name = "attribute", namespace = ComponentLibrary.FACES_CONFIG_NAMESPACE, type = AttributeBean.class)
@XmlJavaTypeAdapter(AttributeAdapter.class)
- public List<AttributeModel> getAttributes() {
- return super.getAttributes();
+ public Collection<AttributeModel> getFacesAttributes() {
+ return super.getFacesAttributes();
}
@XmlElement(name = "converter-for-class", namespace = ComponentLibrary.FACES_CONFIG_NAMESPACE)
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/ElementAdapterBase.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/ElementAdapterBase.java 2010-05-03 22:32:23 UTC (rev 16878)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/ElementAdapterBase.java 2010-05-04 00:42:31 UTC (rev 16879)
@@ -33,15 +33,5 @@
*/
public abstract class ElementAdapterBase<Bean extends ElementBeanBase, Model extends BeanModelBase> extends AdapterBase<Bean, Model> {
- @Override
- protected void postUnmarshal(Bean bean, Model model) {
- model.addAttributes(bean.getAllProperties());
- }
-
- @Override
- protected void postMarshal(Model model, Bean bean) {
- bean.setAttributes(new ArrayList<AttributeModel>());
- bean.setAllProperties(new ArrayList<org.richfaces.cdk.model.PropertyBase>(model.getAttributes()));
- }
}
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/ElementBeanBase.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/ElementBeanBase.java 2010-05-03 22:32:23 UTC (rev 16878)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/ElementBeanBase.java 2010-05-04 00:42:31 UTC (rev 16879)
@@ -22,67 +22,62 @@
package org.richfaces.cdk.xmlconfig.model;
-import com.google.common.collect.Lists;
+import java.util.Collection;
+
import org.richfaces.cdk.model.AttributeModel;
import org.richfaces.cdk.model.ConfigExtension;
-import org.richfaces.cdk.model.PropertyModel;
import org.richfaces.cdk.model.PropertyBase;
+import org.richfaces.cdk.model.PropertyModel;
-import java.util.ArrayList;
-import java.util.List;
+import com.google.common.base.Predicate;
+import com.google.common.collect.Collections2;
+import com.google.common.collect.Lists;
/**
* TODO - is the tho different collections are necessary ?
* @author akolonitsky
* @since Mar 19, 2010
*/
+@SuppressWarnings("unchecked")
public abstract class ElementBeanBase<E extends ConfigExtension> extends ExtensibleBean<E> {
- private List<PropertyModel> properties = Lists.newArrayList();
+ private static final Predicate<PropertyBase> propertyPredicate = new Predicate<PropertyBase>() {
+ @Override
+ public boolean apply(PropertyBase input) {
+ return input instanceof PropertyModel;
+ }
+ };
- private List<AttributeModel> attributes = Lists.newArrayList();
+ private static final Predicate<PropertyBase> attributePredicate = new Predicate<PropertyBase>() {
+ @Override
+ public boolean apply(PropertyBase input) {
+ return input instanceof AttributeModel;
+ }
+ };
- public List<PropertyModel> getProperties() {
+ private Collection<? extends PropertyBase> attributes = Lists.newArrayList();
+
+ private Collection<PropertyModel> properties = (Collection<PropertyModel>) Collections2.filter(attributes, propertyPredicate);
+
+ private Collection<AttributeModel> facesAttributes = (Collection<AttributeModel>) Collections2.filter(attributes, attributePredicate);
+
+ public Collection<PropertyModel> getProperties() {
return properties;
}
- public void setProperties(List<PropertyModel> properties) {
- this.properties = properties;
- }
- public List<AttributeModel> getAttributes() {
- return this.attributes;
+ public Collection<AttributeModel> getFacesAttributes() {
+ return this.facesAttributes;
}
- public void addAttributes(List<AttributeModel> attributes) {
- if (attributes == null) {
- return;
- }
- for (AttributeModel attribute : attributes) {
-// this.attributes.
- }
+ public Collection<PropertyBase> getAttributes() {
+ return (Collection<PropertyBase>) attributes;
}
- public void setAttributes(List<AttributeModel> attributes) {
+ public void setAttributes(Collection<PropertyBase> attributes) {
this.attributes = attributes;
+ properties = (Collection<PropertyModel>) Collections2.filter(this.attributes, propertyPredicate);
+ facesAttributes = (Collection<AttributeModel>) Collections2.filter(this.attributes, attributePredicate);
}
-
- public List<PropertyBase> getAllProperties() {
- List<PropertyBase> allProperties = new ArrayList<PropertyBase>(attributes.size() + properties.size());
- allProperties.addAll(attributes);
- allProperties.addAll(properties);
- return allProperties;
- }
-
- public void setAllProperties(List<PropertyBase> allProperties) {
- for (PropertyBase propertyBase : allProperties) {
- if (propertyBase instanceof PropertyModel) {
- properties.add((PropertyModel) propertyBase);
- }
- if (propertyBase instanceof AttributeModel) {
- attributes.add((AttributeModel) propertyBase);
- }
- }
- }
}
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/ValidatorBean.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/ValidatorBean.java 2010-05-03 22:32:23 UTC (rev 16878)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/ValidatorBean.java 2010-05-04 00:42:31 UTC (rev 16879)
@@ -30,6 +30,8 @@
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
+
+import java.util.Collection;
import java.util.List;
/**
@@ -37,7 +39,7 @@
* @since Jan 13, 2010
*/
@XmlType(name = "faces-config-validatorType", namespace = ComponentLibrary.FACES_CONFIG_NAMESPACE,
- propOrder={"id", "targetClass", "attributes", "properties", "extension"})
+ propOrder={"id", "targetClass", "facesAttributes", "properties", "extension"})
@XmlJavaTypeAdapter(ValidatorAdapter.class)
public class ValidatorBean extends ElementBeanBase<ValidatorBean.ValidatorExtension> {
@@ -59,15 +61,15 @@
@Override
@XmlElement(name = "property", namespace = ComponentLibrary.FACES_CONFIG_NAMESPACE, type = PropertyBean.class)
@XmlJavaTypeAdapter(PropertyAdapter.class)
- public List<PropertyModel> getProperties() {
+ public Collection<PropertyModel> getProperties() {
return super.getProperties();
}
@Override
@XmlElement(name = "attribute", namespace = ComponentLibrary.FACES_CONFIG_NAMESPACE, type = AttributeBean.class)
@XmlJavaTypeAdapter(AttributeAdapter.class)
- public List<AttributeModel> getAttributes() {
- return super.getAttributes();
+ public Collection<AttributeModel> getFacesAttributes() {
+ return super.getFacesAttributes();
}
@XmlElement(name = "validator-class", namespace = ComponentLibrary.FACES_CONFIG_NAMESPACE)
Modified: root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/xmlconfig/ComponentAdapterTest.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/xmlconfig/ComponentAdapterTest.java 2010-05-03 22:32:23 UTC (rev 16878)
+++ root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/xmlconfig/ComponentAdapterTest.java 2010-05-04 00:42:31 UTC (rev 16879)
@@ -34,7 +34,7 @@
ComponentBean componentBean = componentAdapter.marshal(component);
assertEquals(FOO_BAR, componentBean.getType().toString());
- Collection<PropertyBase> attributes = componentBean.getAllProperties();
+ Collection<PropertyBase> attributes = componentBean.getAttributes();
assertEquals(1, attributes.size());
assertEquals(BAZ, Iterables.getOnlyElement(attributes).getName());
14 years, 8 months
JBoss Rich Faces SVN: r16878 - root/cdk/trunk/bom.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2010-05-03 18:32:23 -0400 (Mon, 03 May 2010)
New Revision: 16878
Modified:
root/cdk/trunk/bom/pom.xml
Log:
Changed repository IDs in CDK BoM file
Modified: root/cdk/trunk/bom/pom.xml
===================================================================
--- root/cdk/trunk/bom/pom.xml 2010-05-03 21:50:30 UTC (rev 16877)
+++ root/cdk/trunk/bom/pom.xml 2010-05-03 22:32:23 UTC (rev 16878)
@@ -28,12 +28,12 @@
http://labs.jboss.com/portal/jbossrichfaces/downloads
</downloadUrl>
<repository>
- <id>repository.jboss.org</id>
+ <id>jboss-releases-repository</id>
<uniqueVersion>false</uniqueVersion>
<url>${releaseRepository}</url>
</repository>
<snapshotRepository>
- <id>snapshots.jboss.org</id>
+ <id>jboss-snapshots-repository</id>
<uniqueVersion>true</uniqueVersion>
<url>${snapshotRepository}</url>
</snapshotRepository>
14 years, 8 months
JBoss Rich Faces SVN: r16877 - in root/cdk/trunk: archetypes and 3 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: alexsmirnov
Date: 2010-05-03 17:50:30 -0400 (Mon, 03 May 2010)
New Revision: 16877
Added:
root/cdk/trunk/parent/
Removed:
root/cdk/trunk/root/
Modified:
root/cdk/trunk/archetypes/pom.xml
root/cdk/trunk/bom/pom.xml
root/cdk/trunk/parent/pom.xml
root/cdk/trunk/plugins/pom.xml
root/cdk/trunk/pom.xml
Log:
rename root to parent, fix deployment configuration
Modified: root/cdk/trunk/archetypes/pom.xml
===================================================================
--- root/cdk/trunk/archetypes/pom.xml 2010-05-03 18:32:44 UTC (rev 16876)
+++ root/cdk/trunk/archetypes/pom.xml 2010-05-03 21:50:30 UTC (rev 16877)
@@ -5,9 +5,10 @@
http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
- <groupId>org.richfaces</groupId>
- <artifactId>cdk</artifactId>
- <version>4.0.0-SNAPSHOT</version>
+ <groupId>org.richfaces.cdk</groupId>
+ <artifactId>parent</artifactId>
+ <version>4.0.0-SNAPSHOT</version>
+ <relativePath>../parent</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
@@ -21,4 +22,4 @@
<module>ui-multimodule</module>
</modules>
-</project>
\ No newline at end of file
+</project>
Modified: root/cdk/trunk/bom/pom.xml
===================================================================
--- root/cdk/trunk/bom/pom.xml 2010-05-03 18:32:44 UTC (rev 16876)
+++ root/cdk/trunk/bom/pom.xml 2010-05-03 21:50:30 UTC (rev 16877)
@@ -23,6 +23,25 @@
<developerConnection>scm:svn:https://svn.jboss.org/repos/richfaces/root/cdk/trunk/bom</developerConnection>
<url>http://fisheye.jboss.org/browse/Richfaces/cdk/trunk/bom</url>
</scm>
+ <distributionManagement>
+ <downloadUrl>
+ http://labs.jboss.com/portal/jbossrichfaces/downloads
+ </downloadUrl>
+ <repository>
+ <id>repository.jboss.org</id>
+ <uniqueVersion>false</uniqueVersion>
+ <url>${releaseRepository}</url>
+ </repository>
+ <snapshotRepository>
+ <id>snapshots.jboss.org</id>
+ <uniqueVersion>true</uniqueVersion>
+ <url>${snapshotRepository}</url>
+ </snapshotRepository>
+ <!--site>
+ <url>file:target/site2</url>
+ </site-->
+ </distributionManagement>
+
<build>
<!-- Define CDK plugin that is used by JSF component projects -->
<pluginManagement>
Copied: root/cdk/trunk/parent (from rev 16873, root/cdk/trunk/root)
Modified: root/cdk/trunk/parent/pom.xml
===================================================================
--- root/cdk/trunk/root/pom.xml 2010-05-03 16:45:09 UTC (rev 16873)
+++ root/cdk/trunk/parent/pom.xml 2010-05-03 21:50:30 UTC (rev 16877)
@@ -13,8 +13,8 @@
<modelVersion>4.0.0</modelVersion>
- <groupId>org.richfaces</groupId>
- <artifactId>cdk</artifactId>
+ <groupId>org.richfaces.cdk</groupId>
+ <artifactId>parent</artifactId>
<version>4.0.0-SNAPSHOT</version>
<packaging>pom</packaging>
<name>JSF Components Development Kit (CDK)</name>
@@ -28,28 +28,6 @@
<developerConnection>scm:svn:https://svn.jboss.org/repos/richfaces/root/cdk/trunk/root</developerConnection>
<url>http://fisheye.jboss.org/browse/Richfaces/cdk/trunk/root</url>
</scm>
- <!--
- TODO move distribution management and repositories to the root pom
- -->
- <distributionManagement>
- <downloadUrl>
- http://labs.jboss.com/portal/jbossrichfaces/downloads
- </downloadUrl>
- <repository>
- <id>repository.jboss.org</id>
- <uniqueVersion>false</uniqueVersion>
- <url>${releaseRepository}</url>
- </repository>
- <snapshotRepository>
- <id>snapshots.jboss.org</id>
- <uniqueVersion>true</uniqueVersion>
- <url>${snapshotRepository}</url>
- </snapshotRepository>
- <!--site>
- <url>file:target/site2</url>
- </site-->
- </distributionManagement>
-
<repositories>
<repository>
<releases>
@@ -208,4 +186,4 @@
</plugin>
</plugins>
</reporting>
-</project>
\ No newline at end of file
+</project>
Modified: root/cdk/trunk/plugins/pom.xml
===================================================================
--- root/cdk/trunk/plugins/pom.xml 2010-05-03 18:32:44 UTC (rev 16876)
+++ root/cdk/trunk/plugins/pom.xml 2010-05-03 21:50:30 UTC (rev 16877)
@@ -2,10 +2,10 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
- <groupId>org.richfaces</groupId>
- <artifactId>cdk</artifactId>
+ <groupId>org.richfaces.cdk</groupId>
+ <artifactId>parent</artifactId>
<version>4.0.0-SNAPSHOT</version>
- <relativePath>../root</relativePath>
+ <relativePath>../parent</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
@@ -36,4 +36,4 @@
<module>maven-cdk-plugin</module>
</modules>
-</project>
\ No newline at end of file
+</project>
Modified: root/cdk/trunk/pom.xml
===================================================================
--- root/cdk/trunk/pom.xml 2010-05-03 18:32:44 UTC (rev 16876)
+++ root/cdk/trunk/pom.xml 2010-05-03 21:50:30 UTC (rev 16877)
@@ -16,7 +16,7 @@
<modules>
<module>bom</module>
- <module>root</module>
+ <module>parent</module>
<module>plugins</module>
<module>archetypes</module>
</modules>
14 years, 8 months