JBoss Rich Faces SVN: r16784 - in root: framework/trunk/impl/src/main/java/org/richfaces/context and 2 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: amarkhel
Date: 2010-04-20 12:48:51 -0400 (Tue, 20 Apr 2010)
New Revision: 16784
Added:
root/framework/trunk/commons/src/main/java/META-INF/
root/framework/trunk/impl/src/main/resources/META-INF/resources/basic.ecss
root/framework/trunk/impl/src/main/resources/META-INF/resources/basic_both.ecss
root/framework/trunk/impl/src/main/resources/META-INF/resources/basic_classes.ecss
root/framework/trunk/impl/src/main/resources/META-INF/resources/extended.ecss
root/framework/trunk/impl/src/main/resources/META-INF/resources/extended_both.ecss
root/framework/trunk/impl/src/main/resources/META-INF/resources/extended_classes.ecss
Removed:
root/ui/trunk/components/core/src/main/resources/META-INF/resources/richfaces.css/basic.ecss
root/ui/trunk/components/core/src/main/resources/META-INF/resources/richfaces.css/basic_both.ecss
root/ui/trunk/components/core/src/main/resources/META-INF/resources/richfaces.css/basic_classes.ecss
root/ui/trunk/components/core/src/main/resources/META-INF/resources/richfaces.css/extended.ecss
root/ui/trunk/components/core/src/main/resources/META-INF/resources/richfaces.css/extended_both.ecss
root/ui/trunk/components/core/src/main/resources/META-INF/resources/richfaces.css/extended_classes.ecss
Modified:
root/framework/trunk/impl/src/main/java/org/richfaces/context/PreRenderViewListener.java
Log:
Fix path of skinning resources
Modified: root/framework/trunk/impl/src/main/java/org/richfaces/context/PreRenderViewListener.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/richfaces/context/PreRenderViewListener.java 2010-04-20 16:42:23 UTC (rev 16783)
+++ root/framework/trunk/impl/src/main/java/org/richfaces/context/PreRenderViewListener.java 2010-04-20 16:48:51 UTC (rev 16784)
@@ -146,10 +146,10 @@
}
if (resourceSuffix != null) {
- addResource("richfaces.css/basic".concat(resourceSuffix));
+ addResource("basic".concat(resourceSuffix));
if (extendedSkinningAllowed) {
- addResource("richfaces.css/extended".concat(resourceSuffix));
+ addResource("extended".concat(resourceSuffix));
}
}
}
Added: root/framework/trunk/impl/src/main/resources/META-INF/resources/basic.ecss
===================================================================
--- root/framework/trunk/impl/src/main/resources/META-INF/resources/basic.ecss (rev 0)
+++ root/framework/trunk/impl/src/main/resources/META-INF/resources/basic.ecss 2010-04-20 16:48:51 UTC (rev 16784)
@@ -0,0 +1,25 @@
+input, select, textarea, button, keygen, isindex, legend, a {
+ font-size : '#{richSkin.generalSizeFont}';
+ font-family : '#{richSkin.generalFamilyFont}';
+ color : '#{richSkin.controlTextColor}';
+}
+fieldset {
+ border-width: 1px;
+ border-style: solid;
+ padding: 10px;
+ border-color : '#{richSkin.panelBorderColor}';
+}
+hr {
+ border-width: 1px;
+ border-style: solid;
+ border-color : '#{richSkin.panelBorderColor}';
+}
+a {
+ color : '#{richSkin.generalLinkColor}';
+}
+a:hover {
+ color : '#{richSkin.hoverLinkColor}';
+}
+a:visited {
+ color : '#{richSkin.visitedLinkColor}';
+}
\ No newline at end of file
Added: root/framework/trunk/impl/src/main/resources/META-INF/resources/basic_both.ecss
===================================================================
--- root/framework/trunk/impl/src/main/resources/META-INF/resources/basic_both.ecss (rev 0)
+++ root/framework/trunk/impl/src/main/resources/META-INF/resources/basic_both.ecss 2010-04-20 16:48:51 UTC (rev 16784)
@@ -0,0 +1,2 @@
+@import url(#{resource['basic.ecss']});
+@import url(#{resource['basic_classes.ecss']});
\ No newline at end of file
Added: root/framework/trunk/impl/src/main/resources/META-INF/resources/basic_classes.ecss
===================================================================
--- root/framework/trunk/impl/src/main/resources/META-INF/resources/basic_classes.ecss (rev 0)
+++ root/framework/trunk/impl/src/main/resources/META-INF/resources/basic_classes.ecss 2010-04-20 16:48:51 UTC (rev 16784)
@@ -0,0 +1,349 @@
+.rich-container input, .rich-input, .rich-container select, .rich-select,
+.rich-container textarea, .rich-textarea, .rich-container button, .rich-button,
+.rich-container keygen, .rich-keygen,.rich-container isindex, .rich-isindex,
+.rich-container legend, .rich-legend,.rich-container a, .rich-link,
+.rich-container fieldset, .rich-fieldset,.rich-field, .rich-field-edit, .rich-field-error,
+.rich-button, .rich-button-disabled, .rich-button-over, .rich-button-press {
+ font-size : '#{richSkin.generalSizeFont}';
+ font-family : '#{richSkin.generalFamilyFont}';
+ color : '#{richSkin.controlTextColor}';
+}
+
+.rich-container fieldset, .rich-fieldset {
+ border-width: 1px;
+ border-style: solid;
+ padding: 10px;
+}
+
+.rich-container hr, .rich-hr {
+ border-width: 1px;
+ border-style: solid;
+}
+
+.rich-container legend, .rich-legend {
+ font-weight : bold;
+}
+
+.rich-container form, .rich-form {
+ padding : 0px;
+ margin : 0px;
+}
+
+.rich-container fieldset, .rich-fieldset{
+ border-color : '#{richSkin.panelBorderColor}';
+}
+
+.rich-container hr, .rich-hr{
+ border-color : '#{richSkin.panelBorderColor}';
+}
+
+.rich-container a, .rich-link{
+ color: '#{richSkin.generalLinkColor}';
+}
+
+.rich-container a:hover, .rich-link:hover{
+ color : '#{richSkin.hoverLinkColor}';
+}
+
+.rich-container a:visited, .rich-link:visited{
+ color : '#{richSkin.visitedLinkColor}';
+}
+
+.rich-field, .rich-field-edit, .rich-field-error{
+ border-width: 1px;
+ border-style: inset;
+ border-color: '#{richSkin.panelBorderColor}';
+}
+
+.rich-field{
+ background-color : '#{richSkin.controlBackgroundColor}';
+ background-image : 'url(#{resource['org.richfaces.renderkit.html.images.ButtonBackgroundImage']})';
+ background-repeat : no-repeat;
+ background-position : 1px 1px;
+}
+
+.rich-field-edit{
+ background-color : '#{richSkin.editBackgroundColor}';
+}
+
+.rich-field-error{
+ background-color : '#{richSkin.warningBackgroundColor}';
+ background-image : 'url(#{resource['org.richfaces.renderkit.html.images.InputErrorIcon']})';
+ background-repeat : no-repeat;
+ background-position : center left;
+ padding-left : 7px;
+}
+
+.rich-button, .rich-button-disabled, .rich-button-over, .rich-button-press{
+ border-width : 1px;
+ border-style : solid;
+ border-color : '#{richSkin.panelBorderColor}';
+ background-color : '#{richSkin.trimColor}';
+ padding : 2px 10px 2px 10px;
+ text-align : center;
+ cursor : pointer;
+ background-repeat : repeat-x;
+ background-position : top left;
+}
+
+.rich-button{
+ background-image : 'url(#{resource['org.richfaces.renderkit.html.images.StandardButtonBgImage']})';
+}
+
+.rich-button-disabled{
+ background-image : 'url(#{resource['org.richfaces.renderkit.html.images.StandardButtonBgImage']})';
+}
+
+.rich-button-over{
+ background-image : 'url(#{resource['org.richfaces.renderkit.html.images.StandardButtonBgImage']})';
+}
+
+.rich-button-press{
+ background-image : 'url(#{resource['org.richfaces.renderkit.html.images.StandardButtonPressedBgImage']})';
+ background-position : bottom left;
+}
+
+ /*border color styles*/
+
+.rich-box-border-color-control-select{
+ border-color : '#{richSkin.selectControlColor}';
+}
+
+.rich-box-border-color-subborder{
+ border-color : '#{richSkin.subBorderColor}';
+}
+
+.rich-box-border-color-header{
+ border-color : '#{richSkin.headerBackgroundColor}';
+}
+
+.rich-box-border-color-general{
+ border-color : '#{richSkin.generalBackgroundColor}';
+}
+
+.rich-box-border-color-additional{
+ border-color : '#{richSkin.additionalBackgroundColor}';
+}
+
+.rich-box-border-color-panel{
+ border-color : '#{richSkin.panelBorderColor}';
+}
+
+.rich-box-border-color-tip{
+ border-color : '#{richSkin.tipBorderColor}';
+}
+
+.rich-box-border-color-table{
+ border-color : '#{richSkin.tableBorderColor}';
+}
+
+.rich-box-border-control-select, .rich-box-border-subborder, .rich-box-border-header,
+ .rich-box-border-general, .rich-box-border-additional, .rich-box-border-panel, .rich-box-border-tip, .rich-box-border-table{
+ border-style : solid;
+ border-width : 1px;
+}
+
+.rich-box-border-control-select{
+ border-color : '#{richSkin.selectControlColor}';
+}
+
+.rich-box-border-subborder{
+ border-color : '#{richSkin.subBorderColor}';
+}
+
+.rich-box-border-header{
+ border-color : '#{richSkin.headerBackgroundColor}';
+}
+
+.rich-box-border-general{
+ border-color : '#{richSkin.generalBackgroundColor}';
+}
+
+.rich-box-border-additional{
+ border-color : '#{richSkin.additionalBackgroundColor}';
+}
+
+.rich-box-border-panel{
+ border-color : '#{richSkin.panelBorderColor}';
+}
+
+.rich-box-border-tip{
+ border-color : '#{richSkin.tipBorderColor}';
+}
+
+.rich-box-border-table{
+ border-color : '#{richSkin.tableBorderColor}';
+}
+
+ /*background color styles*/
+
+.rich-box-bgcolor-header{
+ background-color : '#{richSkin.headerBackgroundColor}';
+}
+
+.rich-box-bgcolor-general{
+ background-color : '#{richSkin.generalBackgroundColor}';
+}
+
+.rich-box-bgcolor-additional{
+ background-color : '#{richSkin.additionalBackgroundColor}';
+}
+
+.rich-box-bgcolor-panel{
+ background-color : '#{richSkin.panelBorderColor}';
+}
+
+.rich-box-bgcolor-tab{
+ background-color : '#{richSkin.tabBackgroundColor}';
+}
+
+.rich-box-bgcolor-trim{
+ background-color : '#{richSkin.trimColor}';
+}
+
+.rich-box-bgcolor-tip{
+ background-color : '#{richSkin.tipBackgroundColor}';
+}
+
+.rich-box-bgcolor-table{
+ background-color : '#{richSkin.tableBackgroundColor}';
+}
+
+.rich-box-bgcolor-table-footer{
+ background-color : '#{richSkin.tableFooterBackgroundColor}';
+}
+
+.rich-box-bgcolor-table-subfooter{
+ background-color : '#{richSkin.tableSubfooterBackgroundColor}';
+}
+
+.rich-box-bgcolor-editor{
+ background-color : '#{richSkin.editorBackgroundColor}';
+}
+
+.rich-box-bgcolor-edit{
+ background-color : '#{richSkin.editBackgroundColor}';
+}
+
+ /*text color styles*/
+
+.rich-text-color-header{
+ color : '#{richSkin.headerTextColor}';
+}
+
+.rich-text-color-general{
+ color : '#{richSkin.generalTextColor}';
+}
+
+.rich-text-color-tab-disabled{
+ color : '#{richSkin.tabDisabledTextColor}';
+}
+
+.rich-text-color-select{
+ color : '#{richSkin.selectControlColor}';
+}
+
+.rich-text-color-link-general{
+ color : '#{richSkin.generalLinkColor}';
+}
+
+.rich-text-color-link-hover{
+ color : '#{richSkin.hoverLinkColor}';
+}
+
+.rich-text-color-link-visited{
+ color : '#{richSkin.visitedLinkColor}';
+}
+
+ /*font size styles*/
+
+.rich-font-size-general{
+ font-size : '#{richSkin.generalSizeFont}';
+}
+
+.rich-font-size-header{
+ font-size : '#{richSkin.headerSizeFont}';
+}
+
+ /*font family styles*/
+
+.rich-font-family-general{
+ font-family : '#{richSkin.generalFamilyFont}';
+}
+
+.rich-font-family-header{
+ font-family : '#{richSkin.headerFamilyFont}';
+}
+
+ /* text styles */
+
+.rich-text-general{
+ font-size : '#{richSkin.generalSizeFont}';
+ font-family : '#{richSkin.generalFamilyFont}';
+ color : '#{richSkin.generalTextColor}';
+}
+
+.rich-text-header{
+ font-size : '#{richSkin.generalSizeFont}';
+ font-family : '#{richSkin.headerFamilyFont}';
+ color : '#{richSkin.headerTextColor}';
+}
+
+.rich-text-tab-disabled{
+ font-size : '#{richSkin.generalSizeFont}';
+ font-family : '#{richSkin.generalFamilyFont}';
+ color : '#{richSkin.tabDisabledTextColor}';
+}
+
+.rich-text-control-select{
+ font-size : '#{richSkin.generalSizeFont}';
+ font-family : '#{richSkin.headerFamilyFont};
+ color : '#{richSkin.selectControlColor}';
+}
+
+ /*gradient styles*/
+
+.rich-gradient-header-inverse{
+ background-image : 'url(#{resource['org.richfaces.renderkit.html.gradientimages.HeaderInverseGradientImage']})';
+ background-repeat : repeat-x;
+}
+
+.rich-gradient-header{
+ background-image : 'url(#{resource['org.richfaces.renderkit.html.gradientimages.HeaderGradientImage']})';
+ background-repeat : repeat-x;
+}
+
+.rich-gradient-tab{
+ background-image : 'url(#{resource['org.richfaces.renderkit.html.gradientimages.TabGradientImage']})';
+ background-repeat : repeat-x;
+}
+
+.rich-gradient-tab-inverse{
+ background-image : 'url(#{resource['org.richfaces.renderkit.html.gradientimages.TabInverseGradientImage']})';
+ background-repeat : repeat-x;
+}
+
+.rich-gradient-input{
+ background-image : 'url(#{resource['org.richfaces.renderkit.html.gradientimages.InputGradientImage']})';
+ background-repeat : repeat-x;
+}
+
+.rich-gradient-menu-inverse{
+ background-image : 'url(#{resource['org.richfaces.renderkit.html.gradientimages.MenuInverseGradientImage']})';
+ background-repeat : repeat-x;
+}
+
+.rich-gradient-menu{
+ background-image : 'url(#{resource['org.richfaces.renderkit.html.gradientimages.MenuGradientImage']})';
+ background-repeat : repeat-x;
+}
+
+.rich-gradient-button-inverse{
+ background-image : 'url(#{resource['org.richfaces.renderkit.html.gradientimages.ButtonInverseGradientImage']})';
+ background-repeat : repeat-x;
+}
+
+.rich-gradient-button{
+ background-image : 'url(#{resource['org.richfaces.renderkit.html.gradientimages.ButtonGradientImage']})';
+ background-repeat : repeat-x;
+}
\ No newline at end of file
Added: root/framework/trunk/impl/src/main/resources/META-INF/resources/extended.ecss
===================================================================
--- root/framework/trunk/impl/src/main/resources/META-INF/resources/extended.ecss (rev 0)
+++ root/framework/trunk/impl/src/main/resources/META-INF/resources/extended.ecss 2010-04-20 16:48:51 UTC (rev 16784)
@@ -0,0 +1,86 @@
+input, select, textarea, button, keygen, isindex{
+ border-width:1px;
+ border-color:'#{richSkin.panelBorderColor}';
+ color:'#{richSkin.controlTextColor}';
+}
+
+
+ *|button {
+ border-width: 1px;
+ background-repeat : repeat-x;
+ background-position : top left;
+ }
+
+ button[type="button"], button[type="reset"], button[type="submit"], input[type="reset"], input[type="submit"], input[type="button"] {
+ border-width: 1px;
+ background-repeat : repeat-x;
+ background-position : top left;
+ }
+
+
+ *|button{
+ border-color:'#{richSkin.panelBorderColor}';
+ font-size:'#{richSkin.generalSizeFont}';
+ font-family:'#{richSkin.generalFamilyFont}';
+ color:'#{richSkin.headerTextColor}';
+ background-color:'#{richSkin.headerBackgroundColor}';
+ background-image:'url(#{resource['org.richfaces.renderkit.html.images.ButtonBackgroundImage']})';
+}
+button[type="button"], button[type="reset"], button[type="submit"], input[type="reset"], input[type="submit"], input[type="button"]{
+ border-color:'#{richSkin.panelBorderColor}';
+ font-size:'#{richSkin.generalSizeFont}';
+ font-family:'#{richSkin.generalFamilyFont}';
+ color:'#{richSkin.headerTextColor}';
+ background-color:'#{richSkin.headerBackgroundColor}';
+ background-image:'url(#{resource['org.richfaces.renderkit.html.images.ButtonBackgroundImage']})';
+}
+*|button[disabled]{
+ color:'#{richSkin.tabDisabledTextColor}';
+ border-color:'#{richSkin.tableFooterBackgroundColor}';
+ background-color:'#{richSkin.tableFooterBackgroundColor}';
+ background-image:'url(#{resource['org.richfaces.renderkit.html.images.ButtonDisabledBackgroundImage']})';
+}
+button[type="button"][disabled], button[type="reset"][disabled], button[type="submit"][disabled], input[type="reset"][disabled], input[type="submit"][disabled], input[type="button"][disabled]{
+ color:'#{richSkin.tabDisabledTextColor}';
+ border-color:'#{richSkin.tableFooterBackgroundColor}';
+ background-color:'#{richSkin.tableFooterBackgroundColor}';
+ background-image:'url(#{resource['org.richfaces.renderkit.html.images.ButtonDisabledBackgroundImage']})';
+}
+
+
+ *|textarea {
+ border-width: 1px;
+ border-style : inset;
+ background-repeat : no-repeat;
+ background-position : 1px 1px;
+ }
+
+ textarea[type="textarea"], input[type="text"], input[type="password"], select {
+ border-width: 1px;
+ border-style : inset;
+ background-repeat : no-repeat;
+ background-position : 1px 1px;
+ }
+
+ *|textarea{
+ border-color:'#{richSkin.panelBorderColor}';
+ font-size:'#{richSkin.generalSizeFont}';
+ font-family:'#{richSkin.generalFamilyFont}';
+ color:'#{richSkin.controlTextColor}';
+ background-color:'#{richSkin.controlBackgroundColor}';
+ background-image:'url(#{resource['org.richfaces.renderkit.html.images.InputBackgroundImage']})';
+}
+textarea[type="textarea"], input[type="text"], input[type="password"], select{
+ border-color:'#{richSkin.panelBorderColor}';
+ font-size:'#{richSkin.generalSizeFont}';
+ font-family:'#{richSkin.generalFamilyFont}';
+ color:'#{richSkin.controlTextColor}';
+ background-color:'#{richSkin.controlBackgroundColor}';
+ background-image:'url(#{resource['org.richfaces.renderkit.html.images.InputBackgroundImage']})';
+}
+*|textarea[disabled], *|select[disabled]{
+ color:'#{richSkin.panelBorderColor}';
+}
+textarea[type="textarea"][disabled], input[type="text"][disabled], input[type="password"][disabled], select[disabled]{
+ color:'#{richSkin.panelBorderColor}';
+}
\ No newline at end of file
Added: root/framework/trunk/impl/src/main/resources/META-INF/resources/extended_both.ecss
===================================================================
--- root/framework/trunk/impl/src/main/resources/META-INF/resources/extended_both.ecss (rev 0)
+++ root/framework/trunk/impl/src/main/resources/META-INF/resources/extended_both.ecss 2010-04-20 16:48:51 UTC (rev 16784)
@@ -0,0 +1,2 @@
+@import url(#{resource['extended.ecss']});
+@import url(#{resource['extended_classes.ecss']});
\ No newline at end of file
Added: root/framework/trunk/impl/src/main/resources/META-INF/resources/extended_classes.ecss
===================================================================
--- root/framework/trunk/impl/src/main/resources/META-INF/resources/extended_classes.ecss (rev 0)
+++ root/framework/trunk/impl/src/main/resources/META-INF/resources/extended_classes.ecss 2010-04-20 16:48:51 UTC (rev 16784)
@@ -0,0 +1,96 @@
+.rich-container input, .rich-input, .rich-container select, .rich-select, .rich-container textarea, .rich-textarea, .rich-container button, .rich-button, .rich-container keygen, .rich-keygen, .rich-container isindex, .rich-isindex{
+ border-width:1px;
+ border-color:'#{richSkin.panelBorderColor}';
+ color:'#{richSkin.controlTextColor}';
+}
+
+
+ .rich-container *|button, .rich-button {
+ border-width: 1px;
+ background-repeat : repeat-x;
+ background-position : top left;
+ }
+
+ .rich-button,
+ .rich-container button[type="button"], .rich-button-button,
+ .rich-container button[type="reset"], .rich-button-reset,
+ .rich-container button[type="submit"], .rich-button-submit,
+ .rich-container input[type="reset"], .rich-input-reset,
+ .rich-container input[type="submit"], .rich-input-submit,
+ .rich-container input[type="button"], .rich-input-button {
+ border-width: 1px;
+ background-repeat : repeat-x;
+ background-position : top left;
+ }
+
+
+ .rich-container *|button, .rich-button{
+ border-color:'#{richSkin.panelBorderColor}';
+ font-size:'#{richSkin.generalSizeFont}';
+ font-family:'#{richSkin.generalFamilyFont}';
+ color:'#{richSkin.headerTextColor}';
+ background-color:'#{richSkin.headerBackgroundColor}';
+ background-image:'url(#{resource['org.richfaces.renderkit.html.images.ButtonBackgroundImage']})';
+}
+ .rich-button, .rich-container button[type="button"], .rich-button-button, .rich-container button[type="reset"], .rich-button-reset, .rich-container button[type="submit"], .rich-button-submit, .rich-container input[type="reset"], .rich-input-reset, .rich-container input[type="submit"], .rich-input-submit, .rich-container input[type="button"], .rich-input-button {
+ border-color:'#{richSkin.panelBorderColor}';
+ font-size:'#{richSkin.generalSizeFont}';
+ font-family:'#{richSkin.generalFamilyFont}';
+ color:'#{richSkin.headerTextColor}';
+ background-color:'#{richSkin.headerBackgroundColor}';
+ background-image:'url(#{resource['org.richfaces.renderkit.html.images.ButtonBackgroundImage']})';
+}
+.rich-container *|button[disabled]{
+ color:'#{richSkin.tabDisabledTextColor}';
+ background-color:'#{richSkin.tableFooterBackgroundColor}';
+ border-color:'#{richSkin.tableFooterBackgroundColor}';
+ background-image:'url(#{resource['org.richfaces.renderkit.html.images.ButtonDisabledBackgroundImage']})';
+}
+.rich-button-disabled, .rich-container button[type="button"][disabled], .rich-button-button-disabled, .rich-container button[type="reset"][disabled], .rich-button-reset-disabled, .rich-container button[type="submit"][disabled], .rich-button-submit-disabled, .rich-container input[type="reset"][disabled], .rich-input-reset-disabled, .rich-container input[type="submit"][disabled], .rich-input-submit-disabled, .rich-container input[type="button"][disabled], .rich-input-button-disabled{
+ color:'#{richSkin.tabDisabledTextColor}';
+ background-color:'#{richSkin.tableFooterBackgroundColor}';
+ border-color:'#{richSkin.tableFooterBackgroundColor}';
+ background-image:'url(#{resource['org.richfaces.renderkit.html.images.ButtonDisabledBackgroundImage']})';
+}
+
+
+ .rich-container *|textarea {
+ border-width: 1px;
+ border-style : inset;
+ background-repeat : no-repeat;
+ background-position : 1px 1px;
+ }
+
+ .rich-textarea,
+ .rich-container textarea[type="textarea"], .rich-textarea-textarea,
+ .rich-container input[type="text"], .rich-input-text,
+ .rich-container input[type="password"], .rich-input-password,
+ .rich-container select, .rich-select {
+ border-width: 1px;
+ border-style : inset;
+ background-repeat : no-repeat;
+ background-position : 1px 1px;
+ }
+
+ .rich-container *|textarea{
+ border-color:'#{richSkin.panelBorderColor}';
+ font-size:'#{richSkin.generalSizeFont}';
+ font-family:'#{richSkin.generalFamilyFont}';
+ color:'#{richSkin.controlTextColor}';
+ background-color:'#{richSkin.controlBackgroundColor}';
+ background-image:'url(#{resource['org.richfaces.renderkit.html.images.InputBackgroundImage']})';
+}
+.rich-textarea, .rich-container textarea[type="textarea"], .rich-textarea-textarea, .rich-container input[type="text"], .rich-input-text, .rich-container input[type="password"], .rich-input-password, .rich-container select, .rich-select{
+ border-color:'#{richSkin.panelBorderColor}';
+ font-size:'#{richSkin.generalSizeFont}';
+ font-family:'#{richSkin.generalFamilyFont}';
+ color:'#{richSkin.controlTextColor}';
+ background-color:'#{richSkin.controlBackgroundColor}';
+ background-image:'url(#{resource['org.richfaces.renderkit.html.images.InputBackgroundImage']})';
+}
+.rich-container *|textarea[disabled], .rich-container *|select[disabled]{
+ color:'#{richSkin.panelBorderColor}';
+}
+.rich-textarea-disabled, .rich-container textarea[type="textarea"][disabled], .rich-textarea-textarea-disabled, .rich-container input[type="text"][disabled], .rich-input-text-disabled, .rich-container input[type="password"][disabled], .rich-input-password-disabled, .rich-container select[disabled], .rich-select-disabled{
+ color:'#{richSkin.panelBorderColor}';
+}
\ No newline at end of file
Deleted: root/ui/trunk/components/core/src/main/resources/META-INF/resources/richfaces.css/basic.ecss
===================================================================
--- root/ui/trunk/components/core/src/main/resources/META-INF/resources/richfaces.css/basic.ecss 2010-04-20 16:42:23 UTC (rev 16783)
+++ root/ui/trunk/components/core/src/main/resources/META-INF/resources/richfaces.css/basic.ecss 2010-04-20 16:48:51 UTC (rev 16784)
@@ -1,25 +0,0 @@
-input, select, textarea, button, keygen, isindex, legend, a {
- font-size : '#{richSkin.generalSizeFont}';
- font-family : '#{richSkin.generalFamilyFont}';
- color : '#{richSkin.controlTextColor}';
-}
-fieldset {
- border-width: 1px;
- border-style: solid;
- padding: 10px;
- border-color : '#{richSkin.panelBorderColor}';
-}
-hr {
- border-width: 1px;
- border-style: solid;
- border-color : '#{richSkin.panelBorderColor}';
-}
-a {
- color : '#{richSkin.generalLinkColor}';
-}
-a:hover {
- color : '#{richSkin.hoverLinkColor}';
-}
-a:visited {
- color : '#{richSkin.visitedLinkColor}';
-}
\ No newline at end of file
Deleted: root/ui/trunk/components/core/src/main/resources/META-INF/resources/richfaces.css/basic_both.ecss
===================================================================
--- root/ui/trunk/components/core/src/main/resources/META-INF/resources/richfaces.css/basic_both.ecss 2010-04-20 16:42:23 UTC (rev 16783)
+++ root/ui/trunk/components/core/src/main/resources/META-INF/resources/richfaces.css/basic_both.ecss 2010-04-20 16:48:51 UTC (rev 16784)
@@ -1,2 +0,0 @@
-@import url(#{resource['richfaces.css/basic.ecss']});
-@import url(#{resource['richfaces.css/basic_classes.ecss']});
\ No newline at end of file
Deleted: root/ui/trunk/components/core/src/main/resources/META-INF/resources/richfaces.css/basic_classes.ecss
===================================================================
--- root/ui/trunk/components/core/src/main/resources/META-INF/resources/richfaces.css/basic_classes.ecss 2010-04-20 16:42:23 UTC (rev 16783)
+++ root/ui/trunk/components/core/src/main/resources/META-INF/resources/richfaces.css/basic_classes.ecss 2010-04-20 16:48:51 UTC (rev 16784)
@@ -1,349 +0,0 @@
-.rich-container input, .rich-input, .rich-container select, .rich-select,
-.rich-container textarea, .rich-textarea, .rich-container button, .rich-button,
-.rich-container keygen, .rich-keygen,.rich-container isindex, .rich-isindex,
-.rich-container legend, .rich-legend,.rich-container a, .rich-link,
-.rich-container fieldset, .rich-fieldset,.rich-field, .rich-field-edit, .rich-field-error,
-.rich-button, .rich-button-disabled, .rich-button-over, .rich-button-press {
- font-size : '#{richSkin.generalSizeFont}';
- font-family : '#{richSkin.generalFamilyFont}';
- color : '#{richSkin.controlTextColor}';
-}
-
-.rich-container fieldset, .rich-fieldset {
- border-width: 1px;
- border-style: solid;
- padding: 10px;
-}
-
-.rich-container hr, .rich-hr {
- border-width: 1px;
- border-style: solid;
-}
-
-.rich-container legend, .rich-legend {
- font-weight : bold;
-}
-
-.rich-container form, .rich-form {
- padding : 0px;
- margin : 0px;
-}
-
-.rich-container fieldset, .rich-fieldset{
- border-color : '#{richSkin.panelBorderColor}';
-}
-
-.rich-container hr, .rich-hr{
- border-color : '#{richSkin.panelBorderColor}';
-}
-
-.rich-container a, .rich-link{
- color: '#{richSkin.generalLinkColor}';
-}
-
-.rich-container a:hover, .rich-link:hover{
- color : '#{richSkin.hoverLinkColor}';
-}
-
-.rich-container a:visited, .rich-link:visited{
- color : '#{richSkin.visitedLinkColor}';
-}
-
-.rich-field, .rich-field-edit, .rich-field-error{
- border-width: 1px;
- border-style: inset;
- border-color: '#{richSkin.panelBorderColor}';
-}
-
-.rich-field{
- background-color : '#{richSkin.controlBackgroundColor}';
- background-image : 'url(#{resource['org.richfaces.renderkit.html.images.ButtonBackgroundImage']})';
- background-repeat : no-repeat;
- background-position : 1px 1px;
-}
-
-.rich-field-edit{
- background-color : '#{richSkin.editBackgroundColor}';
-}
-
-.rich-field-error{
- background-color : '#{richSkin.warningBackgroundColor}';
- background-image : 'url(#{resource['org.richfaces.renderkit.html.images.InputErrorIcon']})';
- background-repeat : no-repeat;
- background-position : center left;
- padding-left : 7px;
-}
-
-.rich-button, .rich-button-disabled, .rich-button-over, .rich-button-press{
- border-width : 1px;
- border-style : solid;
- border-color : '#{richSkin.panelBorderColor}';
- background-color : '#{richSkin.trimColor}';
- padding : 2px 10px 2px 10px;
- text-align : center;
- cursor : pointer;
- background-repeat : repeat-x;
- background-position : top left;
-}
-
-.rich-button{
- background-image : 'url(#{resource['org.richfaces.renderkit.html.images.StandardButtonBgImage']})';
-}
-
-.rich-button-disabled{
- background-image : 'url(#{resource['org.richfaces.renderkit.html.images.StandardButtonBgImage']})';
-}
-
-.rich-button-over{
- background-image : 'url(#{resource['org.richfaces.renderkit.html.images.StandardButtonBgImage']})';
-}
-
-.rich-button-press{
- background-image : 'url(#{resource['org.richfaces.renderkit.html.images.StandardButtonPressedBgImage']})';
- background-position : bottom left;
-}
-
- /*border color styles*/
-
-.rich-box-border-color-control-select{
- border-color : '#{richSkin.selectControlColor}';
-}
-
-.rich-box-border-color-subborder{
- border-color : '#{richSkin.subBorderColor}';
-}
-
-.rich-box-border-color-header{
- border-color : '#{richSkin.headerBackgroundColor}';
-}
-
-.rich-box-border-color-general{
- border-color : '#{richSkin.generalBackgroundColor}';
-}
-
-.rich-box-border-color-additional{
- border-color : '#{richSkin.additionalBackgroundColor}';
-}
-
-.rich-box-border-color-panel{
- border-color : '#{richSkin.panelBorderColor}';
-}
-
-.rich-box-border-color-tip{
- border-color : '#{richSkin.tipBorderColor}';
-}
-
-.rich-box-border-color-table{
- border-color : '#{richSkin.tableBorderColor}';
-}
-
-.rich-box-border-control-select, .rich-box-border-subborder, .rich-box-border-header,
- .rich-box-border-general, .rich-box-border-additional, .rich-box-border-panel, .rich-box-border-tip, .rich-box-border-table{
- border-style : solid;
- border-width : 1px;
-}
-
-.rich-box-border-control-select{
- border-color : '#{richSkin.selectControlColor}';
-}
-
-.rich-box-border-subborder{
- border-color : '#{richSkin.subBorderColor}';
-}
-
-.rich-box-border-header{
- border-color : '#{richSkin.headerBackgroundColor}';
-}
-
-.rich-box-border-general{
- border-color : '#{richSkin.generalBackgroundColor}';
-}
-
-.rich-box-border-additional{
- border-color : '#{richSkin.additionalBackgroundColor}';
-}
-
-.rich-box-border-panel{
- border-color : '#{richSkin.panelBorderColor}';
-}
-
-.rich-box-border-tip{
- border-color : '#{richSkin.tipBorderColor}';
-}
-
-.rich-box-border-table{
- border-color : '#{richSkin.tableBorderColor}';
-}
-
- /*background color styles*/
-
-.rich-box-bgcolor-header{
- background-color : '#{richSkin.headerBackgroundColor}';
-}
-
-.rich-box-bgcolor-general{
- background-color : '#{richSkin.generalBackgroundColor}';
-}
-
-.rich-box-bgcolor-additional{
- background-color : '#{richSkin.additionalBackgroundColor}';
-}
-
-.rich-box-bgcolor-panel{
- background-color : '#{richSkin.panelBorderColor}';
-}
-
-.rich-box-bgcolor-tab{
- background-color : '#{richSkin.tabBackgroundColor}';
-}
-
-.rich-box-bgcolor-trim{
- background-color : '#{richSkin.trimColor}';
-}
-
-.rich-box-bgcolor-tip{
- background-color : '#{richSkin.tipBackgroundColor}';
-}
-
-.rich-box-bgcolor-table{
- background-color : '#{richSkin.tableBackgroundColor}';
-}
-
-.rich-box-bgcolor-table-footer{
- background-color : '#{richSkin.tableFooterBackgroundColor}';
-}
-
-.rich-box-bgcolor-table-subfooter{
- background-color : '#{richSkin.tableSubfooterBackgroundColor}';
-}
-
-.rich-box-bgcolor-editor{
- background-color : '#{richSkin.editorBackgroundColor}';
-}
-
-.rich-box-bgcolor-edit{
- background-color : '#{richSkin.editBackgroundColor}';
-}
-
- /*text color styles*/
-
-.rich-text-color-header{
- color : '#{richSkin.headerTextColor}';
-}
-
-.rich-text-color-general{
- color : '#{richSkin.generalTextColor}';
-}
-
-.rich-text-color-tab-disabled{
- color : '#{richSkin.tabDisabledTextColor}';
-}
-
-.rich-text-color-select{
- color : '#{richSkin.selectControlColor}';
-}
-
-.rich-text-color-link-general{
- color : '#{richSkin.generalLinkColor}';
-}
-
-.rich-text-color-link-hover{
- color : '#{richSkin.hoverLinkColor}';
-}
-
-.rich-text-color-link-visited{
- color : '#{richSkin.visitedLinkColor}';
-}
-
- /*font size styles*/
-
-.rich-font-size-general{
- font-size : '#{richSkin.generalSizeFont}';
-}
-
-.rich-font-size-header{
- font-size : '#{richSkin.headerSizeFont}';
-}
-
- /*font family styles*/
-
-.rich-font-family-general{
- font-family : '#{richSkin.generalFamilyFont}';
-}
-
-.rich-font-family-header{
- font-family : '#{richSkin.headerFamilyFont}';
-}
-
- /* text styles */
-
-.rich-text-general{
- font-size : '#{richSkin.generalSizeFont}';
- font-family : '#{richSkin.generalFamilyFont}';
- color : '#{richSkin.generalTextColor}';
-}
-
-.rich-text-header{
- font-size : '#{richSkin.generalSizeFont}';
- font-family : '#{richSkin.headerFamilyFont}';
- color : '#{richSkin.headerTextColor}';
-}
-
-.rich-text-tab-disabled{
- font-size : '#{richSkin.generalSizeFont}';
- font-family : '#{richSkin.generalFamilyFont}';
- color : '#{richSkin.tabDisabledTextColor}';
-}
-
-.rich-text-control-select{
- font-size : '#{richSkin.generalSizeFont}';
- font-family : '#{richSkin.headerFamilyFont};
- color : '#{richSkin.selectControlColor}';
-}
-
- /*gradient styles*/
-
-.rich-gradient-header-inverse{
- background-image : 'url(#{resource['org.richfaces.renderkit.html.gradientimages.HeaderInverseGradientImage']})';
- background-repeat : repeat-x;
-}
-
-.rich-gradient-header{
- background-image : 'url(#{resource['org.richfaces.renderkit.html.gradientimages.HeaderGradientImage']})';
- background-repeat : repeat-x;
-}
-
-.rich-gradient-tab{
- background-image : 'url(#{resource['org.richfaces.renderkit.html.gradientimages.TabGradientImage']})';
- background-repeat : repeat-x;
-}
-
-.rich-gradient-tab-inverse{
- background-image : 'url(#{resource['org.richfaces.renderkit.html.gradientimages.TabInverseGradientImage']})';
- background-repeat : repeat-x;
-}
-
-.rich-gradient-input{
- background-image : 'url(#{resource['org.richfaces.renderkit.html.gradientimages.InputGradientImage']})';
- background-repeat : repeat-x;
-}
-
-.rich-gradient-menu-inverse{
- background-image : 'url(#{resource['org.richfaces.renderkit.html.gradientimages.MenuInverseGradientImage']})';
- background-repeat : repeat-x;
-}
-
-.rich-gradient-menu{
- background-image : 'url(#{resource['org.richfaces.renderkit.html.gradientimages.MenuGradientImage']})';
- background-repeat : repeat-x;
-}
-
-.rich-gradient-button-inverse{
- background-image : 'url(#{resource['org.richfaces.renderkit.html.gradientimages.ButtonInverseGradientImage']})';
- background-repeat : repeat-x;
-}
-
-.rich-gradient-button{
- background-image : 'url(#{resource['org.richfaces.renderkit.html.gradientimages.ButtonGradientImage']})';
- background-repeat : repeat-x;
-}
\ No newline at end of file
Deleted: root/ui/trunk/components/core/src/main/resources/META-INF/resources/richfaces.css/extended.ecss
===================================================================
--- root/ui/trunk/components/core/src/main/resources/META-INF/resources/richfaces.css/extended.ecss 2010-04-20 16:42:23 UTC (rev 16783)
+++ root/ui/trunk/components/core/src/main/resources/META-INF/resources/richfaces.css/extended.ecss 2010-04-20 16:48:51 UTC (rev 16784)
@@ -1,86 +0,0 @@
-input, select, textarea, button, keygen, isindex{
- border-width:1px;
- border-color:'#{richSkin.panelBorderColor}';
- color:'#{richSkin.controlTextColor}';
-}
-
-
- *|button {
- border-width: 1px;
- background-repeat : repeat-x;
- background-position : top left;
- }
-
- button[type="button"], button[type="reset"], button[type="submit"], input[type="reset"], input[type="submit"], input[type="button"] {
- border-width: 1px;
- background-repeat : repeat-x;
- background-position : top left;
- }
-
-
- *|button{
- border-color:'#{richSkin.panelBorderColor}';
- font-size:'#{richSkin.generalSizeFont}';
- font-family:'#{richSkin.generalFamilyFont}';
- color:'#{richSkin.headerTextColor}';
- background-color:'#{richSkin.headerBackgroundColor}';
- background-image:'url(#{resource['org.richfaces.renderkit.html.images.ButtonBackgroundImage']})';
-}
-button[type="button"], button[type="reset"], button[type="submit"], input[type="reset"], input[type="submit"], input[type="button"]{
- border-color:'#{richSkin.panelBorderColor}';
- font-size:'#{richSkin.generalSizeFont}';
- font-family:'#{richSkin.generalFamilyFont}';
- color:'#{richSkin.headerTextColor}';
- background-color:'#{richSkin.headerBackgroundColor}';
- background-image:'url(#{resource['org.richfaces.renderkit.html.images.ButtonBackgroundImage']})';
-}
-*|button[disabled]{
- color:'#{richSkin.tabDisabledTextColor}';
- border-color:'#{richSkin.tableFooterBackgroundColor}';
- background-color:'#{richSkin.tableFooterBackgroundColor}';
- background-image:'url(#{resource['org.richfaces.renderkit.html.images.ButtonDisabledBackgroundImage']})';
-}
-button[type="button"][disabled], button[type="reset"][disabled], button[type="submit"][disabled], input[type="reset"][disabled], input[type="submit"][disabled], input[type="button"][disabled]{
- color:'#{richSkin.tabDisabledTextColor}';
- border-color:'#{richSkin.tableFooterBackgroundColor}';
- background-color:'#{richSkin.tableFooterBackgroundColor}';
- background-image:'url(#{resource['org.richfaces.renderkit.html.images.ButtonDisabledBackgroundImage']})';
-}
-
-
- *|textarea {
- border-width: 1px;
- border-style : inset;
- background-repeat : no-repeat;
- background-position : 1px 1px;
- }
-
- textarea[type="textarea"], input[type="text"], input[type="password"], select {
- border-width: 1px;
- border-style : inset;
- background-repeat : no-repeat;
- background-position : 1px 1px;
- }
-
- *|textarea{
- border-color:'#{richSkin.panelBorderColor}';
- font-size:'#{richSkin.generalSizeFont}';
- font-family:'#{richSkin.generalFamilyFont}';
- color:'#{richSkin.controlTextColor}';
- background-color:'#{richSkin.controlBackgroundColor}';
- background-image:'url(#{resource['org.richfaces.renderkit.html.images.InputBackgroundImage']})';
-}
-textarea[type="textarea"], input[type="text"], input[type="password"], select{
- border-color:'#{richSkin.panelBorderColor}';
- font-size:'#{richSkin.generalSizeFont}';
- font-family:'#{richSkin.generalFamilyFont}';
- color:'#{richSkin.controlTextColor}';
- background-color:'#{richSkin.controlBackgroundColor}';
- background-image:'url(#{resource['org.richfaces.renderkit.html.images.InputBackgroundImage']})';
-}
-*|textarea[disabled], *|select[disabled]{
- color:'#{richSkin.panelBorderColor}';
-}
-textarea[type="textarea"][disabled], input[type="text"][disabled], input[type="password"][disabled], select[disabled]{
- color:'#{richSkin.panelBorderColor}';
-}
\ No newline at end of file
Deleted: root/ui/trunk/components/core/src/main/resources/META-INF/resources/richfaces.css/extended_both.ecss
===================================================================
--- root/ui/trunk/components/core/src/main/resources/META-INF/resources/richfaces.css/extended_both.ecss 2010-04-20 16:42:23 UTC (rev 16783)
+++ root/ui/trunk/components/core/src/main/resources/META-INF/resources/richfaces.css/extended_both.ecss 2010-04-20 16:48:51 UTC (rev 16784)
@@ -1,2 +0,0 @@
-@import url(#{resource['richfaces.css/extended.ecss']});
-@import url(#{resource['richfaces.css/extended_classes.ecss']});
\ No newline at end of file
Deleted: root/ui/trunk/components/core/src/main/resources/META-INF/resources/richfaces.css/extended_classes.ecss
===================================================================
--- root/ui/trunk/components/core/src/main/resources/META-INF/resources/richfaces.css/extended_classes.ecss 2010-04-20 16:42:23 UTC (rev 16783)
+++ root/ui/trunk/components/core/src/main/resources/META-INF/resources/richfaces.css/extended_classes.ecss 2010-04-20 16:48:51 UTC (rev 16784)
@@ -1,96 +0,0 @@
-.rich-container input, .rich-input, .rich-container select, .rich-select, .rich-container textarea, .rich-textarea, .rich-container button, .rich-button, .rich-container keygen, .rich-keygen, .rich-container isindex, .rich-isindex{
- border-width:1px;
- border-color:'#{richSkin.panelBorderColor}';
- color:'#{richSkin.controlTextColor}';
-}
-
-
- .rich-container *|button, .rich-button {
- border-width: 1px;
- background-repeat : repeat-x;
- background-position : top left;
- }
-
- .rich-button,
- .rich-container button[type="button"], .rich-button-button,
- .rich-container button[type="reset"], .rich-button-reset,
- .rich-container button[type="submit"], .rich-button-submit,
- .rich-container input[type="reset"], .rich-input-reset,
- .rich-container input[type="submit"], .rich-input-submit,
- .rich-container input[type="button"], .rich-input-button {
- border-width: 1px;
- background-repeat : repeat-x;
- background-position : top left;
- }
-
-
- .rich-container *|button, .rich-button{
- border-color:'#{richSkin.panelBorderColor}';
- font-size:'#{richSkin.generalSizeFont}';
- font-family:'#{richSkin.generalFamilyFont}';
- color:'#{richSkin.headerTextColor}';
- background-color:'#{richSkin.headerBackgroundColor}';
- background-image:'url(#{resource['org.richfaces.renderkit.html.images.ButtonBackgroundImage']})';
-}
- .rich-button, .rich-container button[type="button"], .rich-button-button, .rich-container button[type="reset"], .rich-button-reset, .rich-container button[type="submit"], .rich-button-submit, .rich-container input[type="reset"], .rich-input-reset, .rich-container input[type="submit"], .rich-input-submit, .rich-container input[type="button"], .rich-input-button {
- border-color:'#{richSkin.panelBorderColor}';
- font-size:'#{richSkin.generalSizeFont}';
- font-family:'#{richSkin.generalFamilyFont}';
- color:'#{richSkin.headerTextColor}';
- background-color:'#{richSkin.headerBackgroundColor}';
- background-image:'url(#{resource['org.richfaces.renderkit.html.images.ButtonBackgroundImage']})';
-}
-.rich-container *|button[disabled]{
- color:'#{richSkin.tabDisabledTextColor}';
- background-color:'#{richSkin.tableFooterBackgroundColor}';
- border-color:'#{richSkin.tableFooterBackgroundColor}';
- background-image:'url(#{resource['org.richfaces.renderkit.html.images.ButtonDisabledBackgroundImage']})';
-}
-.rich-button-disabled, .rich-container button[type="button"][disabled], .rich-button-button-disabled, .rich-container button[type="reset"][disabled], .rich-button-reset-disabled, .rich-container button[type="submit"][disabled], .rich-button-submit-disabled, .rich-container input[type="reset"][disabled], .rich-input-reset-disabled, .rich-container input[type="submit"][disabled], .rich-input-submit-disabled, .rich-container input[type="button"][disabled], .rich-input-button-disabled{
- color:'#{richSkin.tabDisabledTextColor}';
- background-color:'#{richSkin.tableFooterBackgroundColor}';
- border-color:'#{richSkin.tableFooterBackgroundColor}';
- background-image:'url(#{resource['org.richfaces.renderkit.html.images.ButtonDisabledBackgroundImage']})';
-}
-
-
- .rich-container *|textarea {
- border-width: 1px;
- border-style : inset;
- background-repeat : no-repeat;
- background-position : 1px 1px;
- }
-
- .rich-textarea,
- .rich-container textarea[type="textarea"], .rich-textarea-textarea,
- .rich-container input[type="text"], .rich-input-text,
- .rich-container input[type="password"], .rich-input-password,
- .rich-container select, .rich-select {
- border-width: 1px;
- border-style : inset;
- background-repeat : no-repeat;
- background-position : 1px 1px;
- }
-
- .rich-container *|textarea{
- border-color:'#{richSkin.panelBorderColor}';
- font-size:'#{richSkin.generalSizeFont}';
- font-family:'#{richSkin.generalFamilyFont}';
- color:'#{richSkin.controlTextColor}';
- background-color:'#{richSkin.controlBackgroundColor}';
- background-image:'url(#{resource['org.richfaces.renderkit.html.images.InputBackgroundImage']})';
-}
-.rich-textarea, .rich-container textarea[type="textarea"], .rich-textarea-textarea, .rich-container input[type="text"], .rich-input-text, .rich-container input[type="password"], .rich-input-password, .rich-container select, .rich-select{
- border-color:'#{richSkin.panelBorderColor}';
- font-size:'#{richSkin.generalSizeFont}';
- font-family:'#{richSkin.generalFamilyFont}';
- color:'#{richSkin.controlTextColor}';
- background-color:'#{richSkin.controlBackgroundColor}';
- background-image:'url(#{resource['org.richfaces.renderkit.html.images.InputBackgroundImage']})';
-}
-.rich-container *|textarea[disabled], .rich-container *|select[disabled]{
- color:'#{richSkin.panelBorderColor}';
-}
-.rich-textarea-disabled, .rich-container textarea[type="textarea"][disabled], .rich-textarea-textarea-disabled, .rich-container input[type="text"][disabled], .rich-input-text-disabled, .rich-container input[type="password"][disabled], .rich-input-password-disabled, .rich-container select[disabled], .rich-select-disabled{
- color:'#{richSkin.panelBorderColor}';
-}
\ No newline at end of file
14 years, 8 months
JBoss Rich Faces SVN: r16783 - in root: framework/trunk/impl/src/main/java/org/richfaces/resource and 2 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: Alex.Kolonitsky
Date: 2010-04-20 12:42:23 -0400 (Tue, 20 Apr 2010)
New Revision: 16783
Added:
root/ui/trunk/components/core/src/main/java/org/richfaces/view/facelets/html/AjaxPushHandler1.java
Removed:
root/ui/trunk/components/core/src/main/java/org/richfaces/view/facelets/html/AjaxPushHandler_.java
Modified:
root/examples/trunk/richfaces-demo/src/main/java/org/richfaces/demo/common/SkinBean.java
root/framework/trunk/impl/src/main/java/org/richfaces/resource/Xcss2EcssConverter.java
root/ui/trunk/components/core/src/main/java/org/richfaces/component/AbstractMediaOutput.java
Log:
fix checkstyle
Modified: root/examples/trunk/richfaces-demo/src/main/java/org/richfaces/demo/common/SkinBean.java
===================================================================
--- root/examples/trunk/richfaces-demo/src/main/java/org/richfaces/demo/common/SkinBean.java 2010-04-20 16:29:38 UTC (rev 16782)
+++ root/examples/trunk/richfaces-demo/src/main/java/org/richfaces/demo/common/SkinBean.java 2010-04-20 16:42:23 UTC (rev 16783)
@@ -1,31 +1,24 @@
/**
- *
+ *
*/
package org.richfaces.demo.common;
import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.List;
-import javax.faces.context.FacesContext;
-import javax.faces.event.ValueChangeEvent;
-import javax.faces.model.SelectItem;
-
/**
* @author sim
- *
*/
public class SkinBean implements Serializable {
- /**
- *
- */
- private static final long serialVersionUID = -2399884208294434812L;
- private String skin;
- public String getSkin() {
- return skin;
- }
+ /**
+ *
+ */
+ private static final long serialVersionUID = -2399884208294434812L;
+ private String skin;
+ public String getSkin() {
+ return skin;
+ }
public void setSkin(String skin) {
Modified: root/framework/trunk/impl/src/main/java/org/richfaces/resource/Xcss2EcssConverter.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/richfaces/resource/Xcss2EcssConverter.java 2010-04-20 16:29:38 UTC (rev 16782)
+++ root/framework/trunk/impl/src/main/java/org/richfaces/resource/Xcss2EcssConverter.java 2010-04-20 16:42:23 UTC (rev 16783)
@@ -3,6 +3,7 @@
import java.io.File;
import java.io.InputStream;
import java.io.UnsupportedEncodingException;
+import java.io.IOException;
import java.net.URLDecoder;
import javax.xml.parsers.SAXParserFactory;
@@ -12,6 +13,7 @@
import org.xml.sax.Attributes;
import javax.xml.parsers.SAXParser;
+import javax.xml.parsers.ParserConfigurationException;
public final class Xcss2EcssConverter {
@@ -19,7 +21,7 @@
private Xcss2EcssConverter() {
}
- public static void main(String[] args) {
+ public static void main(String[] args) throws SAXException, ParserConfigurationException, IOException {
// Create Handler
Handler handler = new Handler();
@@ -58,7 +60,7 @@
*/
public void startElement(String namespaceURI, String localName, String qName, Attributes atts)
throws SAXException {
-
+
if (TEMPLATE.equals(localName)) {
ecssContent = new StringBuilder();
}
@@ -153,7 +155,7 @@
*/
public void characters(char[] ch, int start, int length)
throws SAXException {
-
+
if (verbatim) {
String strValue = new String(ch, start, length);
ecssContent.append(strValue);
@@ -172,7 +174,7 @@
*/
public void endElement(String namespaceURI, String localName, String qName)
throws SAXException {
-
+
if (TEMPLATE.equals(localName)) {
System.out.println(ecssContent.toString().trim());
}
@@ -193,6 +195,7 @@
hasAttribbute = false;
}
if (ATTRIBBUTE.equals(localName)) {
+ // Do nothing.
}
}
@@ -207,28 +210,31 @@
* Constructor
*
* @param handler - DefaultHandler for the SAX parser
+ * @throws javax.xml.parsers.ParserConfigurationException
+ *
+ * @throws org.xml.sax.SAXException
*/
- public CreateParser(DefaultHandler handler) {
+ public CreateParser(DefaultHandler handler) throws SAXException, ParserConfigurationException {
this.handler = handler;
create();
}
/**
* Create the SAX parser
+ *
+ * @throws javax.xml.parsers.ParserConfigurationException
+ *
+ * @throws org.xml.sax.SAXException
*/
- private void create() {
- try {
- // Obtain a new instance of a SAXParserFactory.
- SAXParserFactory factory = SAXParserFactory.newInstance();
- // Specifies that the parser produced by this code will provide support for XML namespaces.
- factory.setNamespaceAware(true);
- // Specifies that the parser produced by this code will validate documents as they are parsed.
- //factory.setValidating(true);
- // Creates a new instance of a SAXParser using the currently configured factory parameters.
- saxParser = factory.newSAXParser();
- } catch (Throwable t) {
- t.printStackTrace();
- }
+ private void create() throws SAXException, ParserConfigurationException {
+ // Obtain a new instance of a SAXParserFactory.
+ SAXParserFactory factory = SAXParserFactory.newInstance();
+ // Specifies that the parser produced by this code will provide support for XML namespaces.
+ factory.setNamespaceAware(true);
+ // Specifies that the parser produced by this code will validate documents as they are parsed.
+ //factory.setValidating(true);
+ // Creates a new instance of a SAXParser using the currently configured factory parameters.
+ saxParser = factory.newSAXParser();
}
/**
@@ -236,12 +242,8 @@
*
* @param file - File
*/
- public void parse(File file) {
- try {
- saxParser.parse(file, handler);
- } catch (Throwable t) {
- t.printStackTrace();
- }
+ public void parse(File file) throws IOException, SAXException {
+ saxParser.parse(file, handler);
}
/**
@@ -249,12 +251,8 @@
*
* @param uri - String
*/
- public void parse(String uri) {
- try {
- saxParser.parse(uri, handler);
- } catch (Throwable t) {
- t.printStackTrace();
- }
+ public void parse(String uri) throws IOException, SAXException {
+ saxParser.parse(uri, handler);
}
/**
@@ -262,12 +260,8 @@
*
* @param stream - InputStream
*/
- public void parse(InputStream stream) {
- try {
- saxParser.parse(stream, handler);
- } catch (Throwable t) {
- t.printStackTrace();
- }
+ public void parse(InputStream stream) throws IOException, SAXException {
+ saxParser.parse(stream, handler);
}
}
Modified: root/ui/trunk/components/core/src/main/java/org/richfaces/component/AbstractMediaOutput.java
===================================================================
--- root/ui/trunk/components/core/src/main/java/org/richfaces/component/AbstractMediaOutput.java 2010-04-20 16:29:38 UTC (rev 16782)
+++ root/ui/trunk/components/core/src/main/java/org/richfaces/component/AbstractMediaOutput.java 2010-04-20 16:42:23 UTC (rev 16783)
@@ -205,7 +205,7 @@
public abstract String getVspace();
- @Attribute(events = @EventName("blur"))
+ @Attribute(events = @EventName("blur"))
public abstract String getOnblur();
@Attribute(events = @EventName("click"))
Copied: root/ui/trunk/components/core/src/main/java/org/richfaces/view/facelets/html/AjaxPushHandler1.java (from rev 16778, root/ui/trunk/components/core/src/main/java/org/richfaces/view/facelets/html/AjaxPushHandler_.java)
===================================================================
--- root/ui/trunk/components/core/src/main/java/org/richfaces/view/facelets/html/AjaxPushHandler1.java (rev 0)
+++ root/ui/trunk/components/core/src/main/java/org/richfaces/view/facelets/html/AjaxPushHandler1.java 2010-04-20 16:42:23 UTC (rev 16783)
@@ -0,0 +1,83 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+
+package org.richfaces.view.facelets.html;
+
+import java.util.EventListener;
+
+import javax.faces.view.facelets.ComponentConfig;
+import javax.faces.view.facelets.ComponentHandler;
+import javax.faces.view.facelets.FaceletContext;
+import javax.faces.view.facelets.MetaRule;
+import javax.faces.view.facelets.MetaRuleset;
+import javax.faces.view.facelets.Metadata;
+import javax.faces.view.facelets.MetadataTarget;
+import javax.faces.view.facelets.TagAttribute;
+
+import org.richfaces.component.AbstractPush;
+
+public class AjaxPushHandler1 extends ComponentHandler {
+ private static final MetaRule AJAX_PUSH_META_RULE = new AjaxPushMetaRule();
+
+ public AjaxPushHandler1(ComponentConfig config) {
+ super(config);
+ }
+
+ @Override
+ protected MetaRuleset createMetaRuleset(Class type) {
+ MetaRuleset metaRules = super.createMetaRuleset(type);
+
+ metaRules.addRule(AJAX_PUSH_META_RULE);
+
+ return metaRules;
+ }
+
+ static class AjaxPushActionMapper extends Metadata {
+ private static final Class<?>[] AJAX_PUSH_ACTION_SIG = new Class[] {EventListener.class};
+ private final TagAttribute send;
+
+ public AjaxPushActionMapper(TagAttribute attribute) {
+ send = attribute;
+ }
+
+ public void applyMetadata(FaceletContext ctx, Object instance) {
+ ((AbstractPush) instance).setEventProducer(this.send.getMethodExpression(ctx, null, AJAX_PUSH_ACTION_SIG));
+ }
+ }
+
+ static class AjaxPushMetaRule extends MetaRule {
+
+ public AjaxPushMetaRule() {
+ super();
+ }
+
+ public Metadata applyRule(String name, TagAttribute attribute, MetadataTarget meta) {
+ if (meta.isTargetInstanceOf(AbstractPush.class)) {
+ if ("eventProducer".equals(name)) {
+ return new AjaxPushActionMapper(attribute);
+ }
+ }
+
+ return null;
+ }
+ }
+}
Property changes on: root/ui/trunk/components/core/src/main/java/org/richfaces/view/facelets/html/AjaxPushHandler1.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Date Revision Author
Deleted: root/ui/trunk/components/core/src/main/java/org/richfaces/view/facelets/html/AjaxPushHandler_.java
===================================================================
--- root/ui/trunk/components/core/src/main/java/org/richfaces/view/facelets/html/AjaxPushHandler_.java 2010-04-20 16:29:38 UTC (rev 16782)
+++ root/ui/trunk/components/core/src/main/java/org/richfaces/view/facelets/html/AjaxPushHandler_.java 2010-04-20 16:42:23 UTC (rev 16783)
@@ -1,83 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-
-package org.richfaces.view.facelets.html;
-
-import java.util.EventListener;
-
-import javax.faces.view.facelets.ComponentConfig;
-import javax.faces.view.facelets.ComponentHandler;
-import javax.faces.view.facelets.FaceletContext;
-import javax.faces.view.facelets.MetaRule;
-import javax.faces.view.facelets.MetaRuleset;
-import javax.faces.view.facelets.Metadata;
-import javax.faces.view.facelets.MetadataTarget;
-import javax.faces.view.facelets.TagAttribute;
-
-import org.richfaces.component.AbstractPush;
-
-public class AjaxPushHandler_ extends ComponentHandler {
- private static final MetaRule AJAX_PUSH_META_RULE = new AjaxPushMetaRule();
-
- public AjaxPushHandler_(ComponentConfig config) {
- super(config);
- }
-
- @Override
- protected MetaRuleset createMetaRuleset(Class type) {
- MetaRuleset metaRules = super.createMetaRuleset(type);
-
- metaRules.addRule(AJAX_PUSH_META_RULE);
-
- return metaRules;
- }
-
- static class AjaxPushActionMapper extends Metadata {
- private static final Class<?>[] AJAX_PUSH_ACTION_SIG = new Class[] {EventListener.class};
- private final TagAttribute send;
-
- public AjaxPushActionMapper(TagAttribute attribute) {
- send = attribute;
- }
-
- public void applyMetadata(FaceletContext ctx, Object instance) {
- ((AbstractPush) instance).setEventProducer(this.send.getMethodExpression(ctx, null, AJAX_PUSH_ACTION_SIG));
- }
- }
-
- static class AjaxPushMetaRule extends MetaRule {
-
- public AjaxPushMetaRule() {
- super();
- }
-
- public Metadata applyRule(String name, TagAttribute attribute, MetadataTarget meta) {
- if (meta.isTargetInstanceOf(AbstractPush.class)) {
- if ("eventProducer".equals(name)) {
- return new AjaxPushActionMapper(attribute);
- }
- }
-
- return null;
- }
- }
-}
14 years, 8 months
JBoss Rich Faces SVN: r16782 - in root/framework/trunk/impl/src/main/java/org/richfaces: renderkit/html/images and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: Alex.Kolonitsky
Date: 2010-04-20 12:29:38 -0400 (Tue, 20 Apr 2010)
New Revision: 16782
Modified:
root/framework/trunk/impl/src/main/java/org/richfaces/context/PreRenderViewListener.java
root/framework/trunk/impl/src/main/java/org/richfaces/renderkit/html/images/ComboBoxButtonPressGradient.java
root/framework/trunk/impl/src/main/java/org/richfaces/renderkit/html/images/InputErrorIcon.java
root/framework/trunk/impl/src/main/java/org/richfaces/renderkit/html/images/OneColorBasedResource.java
root/framework/trunk/impl/src/main/java/org/richfaces/renderkit/html/images/SpinnerButtonGradient.java
root/framework/trunk/impl/src/main/java/org/richfaces/renderkit/html/images/SpinnerFieldGradient.java
Log:
fix checkstyle
Modified: root/framework/trunk/impl/src/main/java/org/richfaces/context/PreRenderViewListener.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/richfaces/context/PreRenderViewListener.java 2010-04-20 16:24:24 UTC (rev 16781)
+++ root/framework/trunk/impl/src/main/java/org/richfaces/context/PreRenderViewListener.java 2010-04-20 16:29:38 UTC (rev 16782)
@@ -45,11 +45,11 @@
private static final String ENABLE = "enable";
- private static final String _CLASSES_ECSS = "_classes.ecss";
+ private static final String CLASSES_ECSS = "_classes.ecss";
private static final String ECSS = ".ecss";
- private static final String _BOTH_ECSS = "_both.ecss";
+ private static final String BOTH_ECSS = "_both.ecss";
private static final String HEAD = "head";
@@ -133,13 +133,13 @@
if (useStdControlsSkinning) {
if (useStdControlsSkinningClasses) {
- resourceSuffix = _BOTH_ECSS;
+ resourceSuffix = BOTH_ECSS;
} else {
resourceSuffix = ECSS;
}
} else {
if (useStdControlsSkinningClasses) {
- resourceSuffix = _CLASSES_ECSS;
+ resourceSuffix = CLASSES_ECSS;
} else {
// no resources
}
Modified: root/framework/trunk/impl/src/main/java/org/richfaces/renderkit/html/images/ComboBoxButtonPressGradient.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/richfaces/renderkit/html/images/ComboBoxButtonPressGradient.java 2010-04-20 16:24:24 UTC (rev 16781)
+++ root/framework/trunk/impl/src/main/java/org/richfaces/renderkit/html/images/ComboBoxButtonPressGradient.java 2010-04-20 16:29:38 UTC (rev 16782)
@@ -27,10 +27,10 @@
* @author Anton Belevich
* @since 3.2.0
*/
-public class ComboBoxButtonPressGradient extends BaseGradient{
-
- public ComboBoxButtonPressGradient() {
- super(7,15 , 9, Skin.HEADER_BACKGROUND_COLOR, "headerGradientColor");
- }
+public class ComboBoxButtonPressGradient extends BaseGradient {
+ public ComboBoxButtonPressGradient() {
+ super(7, 15, 9, Skin.HEADER_BACKGROUND_COLOR, "headerGradientColor");
+ }
+
}
Modified: root/framework/trunk/impl/src/main/java/org/richfaces/renderkit/html/images/InputErrorIcon.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/richfaces/renderkit/html/images/InputErrorIcon.java 2010-04-20 16:24:24 UTC (rev 16781)
+++ root/framework/trunk/impl/src/main/java/org/richfaces/renderkit/html/images/InputErrorIcon.java 2010-04-20 16:29:38 UTC (rev 16782)
@@ -20,13 +20,10 @@
*/
package org.richfaces.renderkit.html.images;
-import java.awt.Dimension;
-import java.awt.Graphics2D;
-import java.awt.RenderingHints;
-
-import org.ajax4jsf.resource.Java2Dresource;
import org.ajax4jsf.resource.ResourceContext;
+import java.awt.*;
+
public class InputErrorIcon extends OneColorBasedResource {
public InputErrorIcon() {
@@ -34,7 +31,7 @@
}
/**
- * @see Java2Dresource#paint(ResourceContext, Graphics2D)
+ * @see org.ajax4jsf.resource.Java2Dresource#paint(ResourceContext, Graphics2D)
*/
protected void paint(ResourceContext context, Graphics2D g2d) {
g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
Modified: root/framework/trunk/impl/src/main/java/org/richfaces/renderkit/html/images/OneColorBasedResource.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/richfaces/renderkit/html/images/OneColorBasedResource.java 2010-04-20 16:24:24 UTC (rev 16781)
+++ root/framework/trunk/impl/src/main/java/org/richfaces/renderkit/html/images/OneColorBasedResource.java 2010-04-20 16:29:38 UTC (rev 16782)
@@ -21,14 +21,11 @@
package org.richfaces.renderkit.html.images;
-import java.awt.Color;
-import java.awt.Dimension;
-
-import javax.faces.context.FacesContext;
-
import org.ajax4jsf.resource.Java2Dresource;
import org.ajax4jsf.resource.ResourceContext;
+import java.awt.*;
+
public abstract class OneColorBasedResource extends Java2Dresource {
private Dimension dimension;
Modified: root/framework/trunk/impl/src/main/java/org/richfaces/renderkit/html/images/SpinnerButtonGradient.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/richfaces/renderkit/html/images/SpinnerButtonGradient.java 2010-04-20 16:24:24 UTC (rev 16781)
+++ root/framework/trunk/impl/src/main/java/org/richfaces/renderkit/html/images/SpinnerButtonGradient.java 2010-04-20 16:29:38 UTC (rev 16782)
@@ -24,7 +24,7 @@
import org.richfaces.renderkit.html.BaseGradient;
public class SpinnerButtonGradient extends BaseGradient {
- public SpinnerButtonGradient() {
- super(30, 50, 20, "headerGradientColor", "headerBackgroundColor");
- }
+ public SpinnerButtonGradient() {
+ super(30, 50, 20, "headerGradientColor", "headerBackgroundColor");
+ }
}
Modified: root/framework/trunk/impl/src/main/java/org/richfaces/renderkit/html/images/SpinnerFieldGradient.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/richfaces/renderkit/html/images/SpinnerFieldGradient.java 2010-04-20 16:24:24 UTC (rev 16781)
+++ root/framework/trunk/impl/src/main/java/org/richfaces/renderkit/html/images/SpinnerFieldGradient.java 2010-04-20 16:29:38 UTC (rev 16782)
@@ -25,9 +25,7 @@
public class SpinnerFieldGradient extends BaseGradient {
- public SpinnerFieldGradient() {
- super(30, 50, 12, "additionalBackgroundColor", "controlBackgroundColor");
- }
-
-
+ public SpinnerFieldGradient() {
+ super(30, 50, 12, "additionalBackgroundColor", "controlBackgroundColor");
+ }
}
14 years, 8 months
JBoss Rich Faces SVN: r16781 - in root/framework/trunk/impl/src/main/java/org: richfaces/context and 3 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: Alex.Kolonitsky
Date: 2010-04-20 12:24:24 -0400 (Tue, 20 Apr 2010)
New Revision: 16781
Modified:
root/framework/trunk/impl/src/main/java/org/ajax4jsf/resource/Java2Dresource.java
root/framework/trunk/impl/src/main/java/org/richfaces/context/PreRenderViewListener.java
root/framework/trunk/impl/src/main/java/org/richfaces/renderkit/html/BaseGradient.java
root/framework/trunk/impl/src/main/java/org/richfaces/resource/CSSCompiler.java
root/framework/trunk/impl/src/main/java/org/richfaces/resource/CompiledCSSResource.java
root/framework/trunk/impl/src/main/java/org/richfaces/resource/ResourceHandlerImpl.java
root/framework/trunk/impl/src/main/java/org/richfaces/util/Util.java
Log:
fix checkstyle
Modified: root/framework/trunk/impl/src/main/java/org/ajax4jsf/resource/Java2Dresource.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/ajax4jsf/resource/Java2Dresource.java 2010-04-20 16:12:31 UTC (rev 16780)
+++ root/framework/trunk/impl/src/main/java/org/ajax4jsf/resource/Java2Dresource.java 2010-04-20 16:24:24 UTC (rev 16781)
@@ -29,7 +29,6 @@
import org.richfaces.skin.Skin;
import org.richfaces.skin.SkinFactory;
-import javax.faces.application.ResourceHandler;
import javax.faces.component.StateHolder;
import javax.faces.context.FacesContext;
import javax.imageio.ImageIO;
@@ -149,7 +148,6 @@
* generated to render IMG's width and height Subclasses should override
* this method to provide correct sizes of rendered images
*
- * @param facesContext
* @return dimensions of the image to be displayed on page
*/
public abstract Dimension getDimension();
Modified: root/framework/trunk/impl/src/main/java/org/richfaces/context/PreRenderViewListener.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/richfaces/context/PreRenderViewListener.java 2010-04-20 16:12:31 UTC (rev 16780)
+++ root/framework/trunk/impl/src/main/java/org/richfaces/context/PreRenderViewListener.java 2010-04-20 16:24:24 UTC (rev 16781)
@@ -21,6 +21,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+import org.ajax4jsf.context.ContextInitParameters;
+
import javax.faces.component.UIOutput;
import javax.faces.context.FacesContext;
import javax.faces.event.AbortProcessingException;
@@ -28,10 +30,6 @@
import javax.faces.event.SystemEvent;
import javax.faces.event.SystemEventListener;
-import org.ajax4jsf.context.ContextInitParameters;
-import org.richfaces.log.RichfacesLogger;
-import org.slf4j.Logger;
-
/**
* This class used for determining what standard skinning resources should be encoded.
* Implements SystemEventListener and reacts on PreRenderViewEvent
Modified: root/framework/trunk/impl/src/main/java/org/richfaces/renderkit/html/BaseGradient.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/richfaces/renderkit/html/BaseGradient.java 2010-04-20 16:12:31 UTC (rev 16780)
+++ root/framework/trunk/impl/src/main/java/org/richfaces/renderkit/html/BaseGradient.java 2010-04-20 16:24:24 UTC (rev 16781)
@@ -22,17 +22,18 @@
package org.richfaces.renderkit.html;
import org.ajax4jsf.resource.Java2Dresource;
-import org.ajax4jsf.util.HtmlColor;
-import org.ajax4jsf.util.HtmlDimensions;
import org.ajax4jsf.util.NumericDataInputStream;
import org.ajax4jsf.util.NumericDataOutputStream;
import org.richfaces.renderkit.html.images.GradientType;
import org.richfaces.renderkit.html.images.GradientType.BiColor;
import org.richfaces.skin.Skin;
-import org.richfaces.skin.SkinFactory;
import javax.faces.context.FacesContext;
-import java.awt.*;
+import java.awt.Dimension;
+import java.awt.GradientPaint;
+import java.awt.Graphics2D;
+import java.awt.RenderingHints;
+import java.awt.Shape;
import java.awt.geom.AffineTransform;
import java.awt.geom.Rectangle2D;
Modified: root/framework/trunk/impl/src/main/java/org/richfaces/resource/CSSCompiler.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/richfaces/resource/CSSCompiler.java 2010-04-20 16:12:31 UTC (rev 16780)
+++ root/framework/trunk/impl/src/main/java/org/richfaces/resource/CSSCompiler.java 2010-04-20 16:24:24 UTC (rev 16781)
@@ -1,5 +1,21 @@
package org.richfaces.resource;
+import com.steadystate.css.parser.CSSOMParser;
+import org.richfaces.log.RichfacesLogger;
+import org.slf4j.Logger;
+import org.w3c.css.sac.InputSource;
+import org.w3c.dom.css.CSSImportRule;
+import org.w3c.dom.css.CSSRule;
+import org.w3c.dom.css.CSSRuleList;
+import org.w3c.dom.css.CSSStyleDeclaration;
+import org.w3c.dom.css.CSSStyleRule;
+import org.w3c.dom.css.CSSStyleSheet;
+
+import javax.el.ELContext;
+import javax.el.ELException;
+import javax.el.ValueExpression;
+import javax.faces.application.Resource;
+import javax.faces.context.FacesContext;
import java.io.BufferedInputStream;
import java.io.ByteArrayInputStream;
import java.io.IOException;
@@ -10,98 +26,81 @@
import java.util.List;
import java.util.regex.Pattern;
-import javax.el.ELContext;
-import javax.el.ELException;
-import javax.el.ValueExpression;
-import javax.faces.application.Resource;
-import javax.faces.context.FacesContext;
+public final class CSSCompiler {
-import org.ajax4jsf.util.ELUtils;
-import org.richfaces.log.RichfacesLogger;
-import org.slf4j.Logger;
-import org.w3c.css.sac.InputSource;
-import org.w3c.dom.css.CSSImportRule;
-import org.w3c.dom.css.CSSRule;
-import org.w3c.dom.css.CSSRuleList;
-import org.w3c.dom.css.CSSStyleDeclaration;
-import org.w3c.dom.css.CSSStyleRule;
-import org.w3c.dom.css.CSSStyleSheet;
+ private static final Logger LOGGER = RichfacesLogger.RESOURCE.getLogger();
+ private static final String INVALID_RESOURCE_FORMAT_COLON_ERROR =
+ "Invalid resource format. Property ''{0}'' contains more than one colon (:).";
+ private static final String INVALID_RESOURCE_FORMAT_NO_LIBRARY_NAME_ERROR =
+ "Invalid resource format. Property ''{0}'' cannot be parsed to extract resource name and library name.";
+ private static final String INVALID_RESOURCE_FORMAT_ERROR =
+ "Invalid resource format. Property ''{0}'' cannot be parsed.";
-import com.steadystate.css.parser.CSSOMParser;
+ private CSSCompiler() {
+ }
-public class CSSCompiler {
-
- private static final Logger LOGGER = RichfacesLogger.RESOURCE.getLogger();
- private static final String INVALID_RESOURCE_FORMAT_COLON_ERROR =
- "Invalid resource format. Property ''{0}'' contains more than one colon (:).";
- private static final String INVALID_RESOURCE_FORMAT_NO_LIBRARY_NAME_ERROR =
- "Invalid resource format. Property ''{0}'' cannot be parsed to extract resource name and library name.";
- private static final String INVALID_RESOURCE_FORMAT_ERROR =
- "Invalid resource format. Property ''{0}'' cannot be parsed.";
- public static InputStream parse(Resource resource) throws IOException {
- FacesContext ctx = FacesContext.getCurrentInstance();
+ public static InputStream parse(Resource resource) throws IOException {
+ FacesContext ctx = FacesContext.getCurrentInstance();
InputStream stream = new BufferedInputStream(
- new ELEvaluatingInputStream(ctx,
- resource,
- resource.getInputStream()));
- StringBuilder main = new StringBuilder();
- try {
- InputSource source = new InputSource(new InputStreamReader(stream));
- CSSOMParser parser = new CSSOMParser();
- // parse and create a stylesheet composition
- CSSStyleSheet stylesheet = parser.parseStyleSheet(source, null,null);
+ new ELEvaluatingInputStream(ctx,
+ resource,
+ resource.getInputStream()));
+ StringBuilder main = new StringBuilder();
+ try {
+ InputSource source = new InputSource(new InputStreamReader(stream));
+ CSSOMParser parser = new CSSOMParser();
+ // parse and create a stylesheet composition
+ CSSStyleSheet stylesheet = parser.parseStyleSheet(source, null, null);
- // now iterate through the dom and inspect.
+ // now iterate through the dom and inspect.
- CSSRuleList ruleList = stylesheet.getCssRules();
- for (int i = 0; i < ruleList.getLength(); i++) {
- CSSRule rule = ruleList.item(i);
- if(rule instanceof CSSImportRule){
+ CSSRuleList ruleList = stylesheet.getCssRules();
+ for (int i = 0; i < ruleList.getLength(); i++) {
+ CSSRule rule = ruleList.item(i);
+ if (rule instanceof CSSImportRule) {
main.append(rule.getCssText());
main.append("\r\n");
- }else if (rule instanceof CSSStyleRule) {
- CSSStyleRule styleRule = (CSSStyleRule) rule;
- boolean needAppendSelector = false;
- StringBuilder selector = new StringBuilder();
- selector.append(styleRule.getSelectorText());
- CSSStyleDeclaration styleDeclaration = styleRule.getStyle();
- selector.append("{" + "\r\n");
- for (int j = 0; j < styleDeclaration.getLength(); j++) {
- String property = styleDeclaration.item(j);
- String value = styleDeclaration.getPropertyCSSValue(property).getCssText();
- if(value.startsWith("\"")){
- //Remove quotas
- value = value.substring(1, value.length()-1);
- }
- if(value != null && value.trim().length() > 0 && !value.equals("\"\"")){
- //One of properties of selector is not empty
- needAppendSelector = true;
- selector.append("\t" + property + ":");
- selector.append(value + ";" + "\r\n");
- }
- }
- selector.append("}" + "\r\n");
- if(needAppendSelector){
- main.append(selector);
- }
- }// end of StyleRule instance test
- } // end of ruleList loop
+ } else if (rule instanceof CSSStyleRule) {
+ CSSStyleRule styleRule = (CSSStyleRule) rule;
+ boolean needAppendSelector = false;
+ StringBuilder selector = new StringBuilder();
+ selector.append(styleRule.getSelectorText());
+ CSSStyleDeclaration styleDeclaration = styleRule.getStyle();
+ selector.append("{" + "\r\n");
+ for (int j = 0; j < styleDeclaration.getLength(); j++) {
+ String property = styleDeclaration.item(j);
+ String value = styleDeclaration.getPropertyCSSValue(property).getCssText();
+ if (value.startsWith("\"")) {
+ //Remove quotas
+ value = value.substring(1, value.length() - 1);
+ }
+ if (value != null && value.trim().length() > 0 && !value.equals("\"\"")) {
+ //One of properties of selector is not empty
+ needAppendSelector = true;
+ selector.append("\t" + property + ":");
+ selector.append(value + ";" + "\r\n");
+ }
+ }
+ selector.append("}" + "\r\n");
+ if (needAppendSelector) {
+ main.append(selector);
+ }
+ }// end of StyleRule instance test
+ } // end of ruleList loop
- if (stream != null){
- stream.close();
- }
- new ByteArrayInputStream(main.toString().getBytes());
- return new ByteArrayInputStream(main.toString().getBytes("US-ASCII"));
- }
+ if (stream != null) {
+ stream.close();
+ }
+ new ByteArrayInputStream(main.toString().getBytes());
+ return new ByteArrayInputStream(main.toString().getBytes("US-ASCII"));
+ } catch (IOException ioe) {
+ LOGGER.warn("IO Error: " + ioe + "while evaluating dynamic CSS");
+ } catch (Exception e) {
+ LOGGER.warn("Error: " + e + "while evaluating dynamic CSS");
+ }
+ return null;
+ }
- catch (IOException ioe) {
- LOGGER.warn("IO Error: " + ioe + "while evaluating dynamic CSS");
- } catch (Exception e) {
- LOGGER.warn("Error: " + e + "while evaluating dynamic CSS");
- }
- return null;
- }
-
private static final class ELEvaluatingInputStream extends InputStream {
// Premature optimization is the root of all evil. Blah blah.
@@ -112,6 +111,7 @@
private FacesContext ctx;
private Resource info;
+ private int nextRead = -1;
// ---------------------------------------------------- Constructors
@@ -178,12 +178,9 @@
return i;
}
-
- private int nextRead = -1;
-
-
private void readExpressionIntoBufferAndEvaluateIntoBuffer()
- throws IOException {
+ throws IOException {
+
int i;
char c;
do {
@@ -205,24 +202,26 @@
* expressionResult;
*/
private void evaluateExpressionIntoBuffer() {
- char chars[] = new char[buf.size()];
- for (int i = 0, len = buf.size(); i < len; i++) {
+ char [] chars = new char[buf.size()];
+ int len = buf.size();
+ for (int i = 0; i < len; i++) {
chars[i] = (char) (int) buf.get(i);
}
String expressionBody = new String(chars);
- int colon;
+
// If this expression contains a ":"
- if (-1 != (colon = expressionBody.indexOf(":"))) {
+ int colon = expressionBody.indexOf(":");
+ if (-1 != colon) {
// Make sure it contains only one ":"
if (!isPropertyValid(expressionBody)) {
String message = MessageFormat.format(INVALID_RESOURCE_FORMAT_COLON_ERROR,
- expressionBody);
+ expressionBody);
throw new ELException(message);
}
String[] parts = split(expressionBody, ":");
if (null == parts[0] || null == parts[1]) {
String message = MessageFormat.format(INVALID_RESOURCE_FORMAT_NO_LIBRARY_NAME_ERROR,
- expressionBody);
+ expressionBody);
throw new ELException(message);
}
@@ -235,32 +234,32 @@
mark = parts[1].indexOf("]") - 1;
parts[1] = parts[1].substring(0, mark);
expressionBody = "resource[" + quoteMark + parts[0] +
- ":" + parts[1] + quoteMark + "]";
+ ":" + parts[1] + quoteMark + "]";
}
- }
- catch (Exception e) {
+ } catch (Exception e) {
String message = MessageFormat.format(INVALID_RESOURCE_FORMAT_ERROR,
- expressionBody);
+ expressionBody);
throw new ELException(message);
}
}
ELContext elContext = ctx.getELContext();
ValueExpression ve =
- ctx.getApplication().getExpressionFactory().
- createValueExpression(elContext, "#{" + expressionBody +
- "}", String.class);
+ ctx.getApplication().getExpressionFactory().
+ createValueExpression(elContext, "#{" + expressionBody +
+ "}", String.class);
Object value = ve.getValue(elContext);
String expressionResult = ((value != null) ? value.toString() : "");
buf.clear();
- for (int i = 0, len = expressionResult.length(); i < len; i++) {
+ int expressionResultLen = expressionResult.length();
+ for (int i = 0; i < expressionResultLen; i++) {
buf.add((int) expressionResult.charAt(i));
}
}
private String[] split(String expressionBody, String toSplit) {
- return Pattern.compile(expressionBody).split(toSplit, 0);
+ return Pattern.compile(expressionBody).split(toSplit, 0);
}
@@ -271,7 +270,7 @@
}
-
+
private boolean isPropertyValid(String property) {
int idx = property.indexOf(':');
return (property.indexOf(':', idx + 1) == -1);
Modified: root/framework/trunk/impl/src/main/java/org/richfaces/resource/CompiledCSSResource.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/richfaces/resource/CompiledCSSResource.java 2010-04-20 16:12:31 UTC (rev 16780)
+++ root/framework/trunk/impl/src/main/java/org/richfaces/resource/CompiledCSSResource.java 2010-04-20 16:24:24 UTC (rev 16781)
@@ -32,72 +32,71 @@
import org.richfaces.log.RichfacesLogger;
import org.richfaces.skin.SkinFactory;
import org.slf4j.Logger;
+
/**
* @author amarkhel
- * Class, that represented dynamic CSS resource.
- *
+ * Class, that represented dynamic CSS resource.
*/
public class CompiledCSSResource extends AbstractBaseResource {
- private static final String SKIN = "?skin=";
+ private static final String SKIN = "?skin=";
private static final String TEXT_CSS = "text/css";
private static final Logger LOGGER = RichfacesLogger.RESOURCE.getLogger();
-
- public CompiledCSSResource(Resource resource){
- this.resourceDelegate = resource;
- }
-
- private Resource resourceDelegate;
-
- @Override
- public InputStream getInputStream() {
- InputStream stream = null;
- try{
- stream = CSSCompiler.parse(resourceDelegate);
- }
- catch(IOException ioe){
- LOGGER.warn("IO Error: " + ioe + "while loading dynamic CSS");
- }
- return stream;
- }
- @Override
+ private Resource resourceDelegate;
+
+ public CompiledCSSResource(Resource resource) {
+ this.resourceDelegate = resource;
+ }
+
+ @Override
+ public InputStream getInputStream() {
+ InputStream stream = null;
+ try {
+ stream = CSSCompiler.parse(resourceDelegate);
+ } catch (IOException ioe) {
+ LOGGER.warn("IO Error: " + ioe + "while loading dynamic CSS");
+ }
+ return stream;
+ }
+
+ @Override
public String getContentType() {
return TEXT_CSS;
}
- public Resource getResourceDelegate() {
- return resourceDelegate;
- }
+ public Resource getResourceDelegate() {
+ return resourceDelegate;
+ }
- public void setResourceDelegate(Resource resourceDelegate) {
- this.resourceDelegate = resourceDelegate;
- }
-
- @Override
- public String getResourceName() {
+ public void setResourceDelegate(Resource resourceDelegate) {
+ this.resourceDelegate = resourceDelegate;
+ }
+
+ @Override
+ public String getResourceName() {
return resourceDelegate.getResourceName();
}
-
- @Override
+
+ @Override
public String getRequestPath() {
- StringBuilder b = new StringBuilder();
- String path = resourceDelegate.getRequestPath();
- b.append(path);
- b.append(SKIN);
- b.append(getSkinHashCode());
- return b.toString();
- }
+ StringBuilder b = new StringBuilder();
+ String path = resourceDelegate.getRequestPath();
+ b.append(path);
+ b.append(SKIN);
+ b.append(getSkinHashCode());
+ return b.toString();
+ }
private int getSkinHashCode() {
- return ((SkinFactory)ServiceTracker.getService(FacesContext.getCurrentInstance(), SkinFactory.class)).getSkin(FacesContext.getCurrentInstance()).hashCode();
+ return ((SkinFactory) ServiceTracker.getService(FacesContext.getCurrentInstance(), SkinFactory.class)).getSkin(FacesContext.getCurrentInstance()).hashCode();
}
-
- @Override
+
+ @Override
public boolean userAgentNeedsUpdate(FacesContext context) {
- if(context.isProjectStage(ProjectStage.Development)){
- return true;
- }
- return super.userAgentNeedsUpdate(context);
- }
+ if (context.isProjectStage(ProjectStage.Development)) {
+ return true;
+ }
+ return super.userAgentNeedsUpdate(context);
+ }
}
Modified: root/framework/trunk/impl/src/main/java/org/richfaces/resource/ResourceHandlerImpl.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/richfaces/resource/ResourceHandlerImpl.java 2010-04-20 16:12:31 UTC (rev 16780)
+++ root/framework/trunk/impl/src/main/java/org/richfaces/resource/ResourceHandlerImpl.java 2010-04-20 16:24:24 UTC (rev 16781)
@@ -24,7 +24,6 @@
import org.ajax4jsf.cache.Cache;
import org.ajax4jsf.cache.CacheManager;
import org.ajax4jsf.resource.Java2Dresource;
-import org.jboss.cache.util.BeanUtils;
import org.richfaces.context.AttributesContext;
import org.richfaces.context.SingletonsContext;
import org.richfaces.log.RichfacesLogger;
@@ -47,7 +46,6 @@
import java.net.URL;
import java.text.MessageFormat;
import java.util.Date;
-import java.util.HashMap;
import java.util.Locale;
import java.util.Map;
import java.util.Map.Entry;
@@ -115,7 +113,7 @@
Object oldCodec = applicationMap.put(RESOURCE_CODEC_ATTRIBUTE_NAME, codec);
if ((oldCodec != null) && (codec != null) && !oldCodec.equals(codec)
- && facesContext.isProjectStage(ProjectStage.Development)) {
+ && facesContext.isProjectStage(ProjectStage.Development)) {
LOGGER.warn("Resource codec should be typically set once per application lifetime");
}
}
@@ -259,15 +257,15 @@
if (LOGGER.isDebugEnabled()) {
LOGGER.debug(
- MessageFormat.format(
- "Client requested {0} version of resource, server has {1} version",
- String.valueOf(requestedVersion), String.valueOf(existingVersion)));
+ MessageFormat.format(
+ "Client requested {0} version of resource, server has {1} version",
+ String.valueOf(requestedVersion), String.valueOf(existingVersion)));
}
if ((existingVersion != null) && (requestedVersion != null)
- && !existingVersion.equals(requestedVersion)) {
+ && !existingVersion.equals(requestedVersion)) {
logResourceProblem(context, null, "Resource {0} of version {1} was not found", resourceName,
- requestedVersion);
+ requestedVersion);
sendResourceNotFound(context);
return;
@@ -314,8 +312,8 @@
if (LOGGER.isDebugEnabled()) {
LOGGER.debug(new MessageFormat(
- "Storing {0} resource in cache until {1,date,dd MMM yyyy HH:mm:ss zzz}", Locale.US).
- format(new Object[]{resourceKey, cacheExpirationDate}));
+ "Storing {0} resource in cache until {1,date,dd MMM yyyy HH:mm:ss zzz}", Locale.US).
+ format(new Object[]{resourceKey, cacheExpirationDate}));
}
cache.put(resourceKey, cachedResource, cacheExpirationDate);
@@ -427,7 +425,7 @@
* Should be called only if {@link #isResourceExists(String)} returns <code>true</code>
*
* @param resourceName
- * @param params
+ * @param params
* @return
*/
protected Resource createHandlerDependentResource(String resourceName, Map<String, String> params) {
@@ -441,14 +439,14 @@
if (Resource.class.isAssignableFrom(resourceClass)) {
resource = (Resource) resourceClass.newInstance();
resource.setResourceName(resourceName);
- if(resource instanceof Java2Dresource){
- Java2Dresource dynamicResource = (Java2Dresource)resource;
+ if (resource instanceof Java2Dresource) {
+ Java2Dresource dynamicResource = (Java2Dresource) resource;
dynamicResource.populateParameters(params);
resource = dynamicResource;
}
if (LOGGER.isDebugEnabled()) {
LOGGER.debug(MessageFormat.format("Successfully created instance of {0} resource",
- resourceName));
+ resourceName));
}
} else {
throw new ClassCastException(resourceClass.getName());
@@ -467,12 +465,12 @@
Map<String, String> params = Util.parseResourceParameters(resourceName);
resourceName = extractParametersFromResourceName(resourceName);
if ((resourceName != null) && ((libraryName == null) || (libraryName.length() == 0))
- && isResourceExists(resourceName)) {
+ && isResourceExists(resourceName)) {
result = createHandlerDependentResource(resourceName, params);
} else {
- result = defaultHandler.createResource(resourceName, libraryName, contentType);
- if(resourceName.indexOf(".ecss") != -1){
- result = new CompiledCSSResource(result);
+ result = defaultHandler.createResource(resourceName, libraryName, contentType);
+ if (resourceName.indexOf(".ecss") != -1) {
+ result = new CompiledCSSResource(result);
}
}
@@ -480,7 +478,7 @@
}
private String extractParametersFromResourceName(String resourceName) {
- if(!(resourceName.lastIndexOf("?") != -1)){
+ if (!(resourceName.lastIndexOf("?") != -1)) {
return resourceName;
}
return resourceName.substring(0, resourceName.lastIndexOf("?"));
@@ -499,7 +497,7 @@
@Override
public String getRendererTypeForResourceName(String resourceName) {
- if(resourceName.indexOf(".ecss") != -1){
+ if (resourceName.indexOf(".ecss") != -1) {
return "javax.faces.resource.Stylesheet";
}
return defaultHandler.getRendererTypeForResourceName(resourceName);
Modified: root/framework/trunk/impl/src/main/java/org/richfaces/util/Util.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/richfaces/util/Util.java 2010-04-20 16:12:31 UTC (rev 16780)
+++ root/framework/trunk/impl/src/main/java/org/richfaces/util/Util.java 2010-04-20 16:24:24 UTC (rev 16781)
@@ -42,7 +42,6 @@
package org.richfaces.util;
import org.ajax4jsf.Messages;
-import org.ajax4jsf.util.HtmlColor;
import org.ajax4jsf.util.base64.Codec;
import org.richfaces.log.RichfacesLogger;
import org.slf4j.Logger;
@@ -353,21 +352,21 @@
return viewHandler.getResourceURL(context, resourcePath);
}
- public static Map<String, String> parseResourceParameters(String resourceName){
+ public static Map<String, String> parseResourceParameters(String resourceName) {
Map<String, String> params = new HashMap<String, String>();
- if(!(resourceName.lastIndexOf(QUESTION_SIGN) != -1)){
+ if (!(resourceName.lastIndexOf(QUESTION_SIGN) != -1)) {
return params;
}
resourceName = resourceName.substring(resourceName.lastIndexOf(QUESTION_SIGN) + 1);
try {
if (resourceName.trim().length() > 0) {
String query = resourceName;
- String paramPairs[] = query.split(AND_SEPARATOR);
- for(int i = 0; i < paramPairs.length ; i++){
- String pair[] = paramPairs[i].split(EQUALS_SIGN);
+ String[] paramPairs = query.split(AND_SEPARATOR);
+ for (int i = 0; i < paramPairs.length; i++) {
+ String[] pair = paramPairs[i].split(EQUALS_SIGN);
String key = URLDecoder.decode(pair[0], "UTF-8").trim();
String value = URLDecoder.decode(pair[1], "UTF-8").trim();
- if(key != null && value != null && key.trim().length() > 0 && value.trim().length() > 0){
+ if (key != null && value != null && key.trim().length() > 0 && value.trim().length() > 0) {
params.put(key, value);
}
}
@@ -377,7 +376,7 @@
}
return params;
}
-
+
public static String decodeResourceURL(FacesContext context) {
ExternalContext externalContext = context.getExternalContext();
String resourceName = null;
14 years, 8 months
JBoss Rich Faces SVN: r16780 - in root/framework/trunk/impl/src/main/java/org/richfaces: renderkit/html/images and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: Alex.Kolonitsky
Date: 2010-04-20 12:12:31 -0400 (Tue, 20 Apr 2010)
New Revision: 16780
Modified:
root/framework/trunk/impl/src/main/java/org/richfaces/renderkit/html/CustomizeableGradient.java
root/framework/trunk/impl/src/main/java/org/richfaces/renderkit/html/images/CancelControlIcon.java
root/framework/trunk/impl/src/main/java/org/richfaces/resource/Xcss2EcssConverter.java
Log:
fix checkstyle
Modified: root/framework/trunk/impl/src/main/java/org/richfaces/renderkit/html/CustomizeableGradient.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/richfaces/renderkit/html/CustomizeableGradient.java 2010-04-20 15:57:57 UTC (rev 16779)
+++ root/framework/trunk/impl/src/main/java/org/richfaces/renderkit/html/CustomizeableGradient.java 2010-04-20 16:12:31 UTC (rev 16780)
@@ -21,6 +21,14 @@
package org.richfaces.renderkit.html;
+import org.ajax4jsf.resource.Java2Dresource;
+import org.ajax4jsf.util.NumericDataInputStream;
+import org.richfaces.renderkit.html.images.GradientAlignment;
+import org.richfaces.renderkit.html.images.GradientType;
+import org.richfaces.renderkit.html.images.GradientType.BiColor;
+import org.richfaces.skin.Skin;
+
+import javax.faces.context.FacesContext;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.GradientPaint;
@@ -30,16 +38,6 @@
import java.awt.geom.Rectangle2D;
import java.util.Map;
-import javax.faces.context.FacesContext;
-
-import org.ajax4jsf.resource.Java2Dresource;
-import org.ajax4jsf.util.NumericDataInputStream;
-import org.richfaces.renderkit.html.images.GradientAlignment;
-import org.richfaces.renderkit.html.images.GradientType;
-import org.richfaces.renderkit.html.images.GradientType.BiColor;
-import org.richfaces.skin.Skin;
-import org.richfaces.skin.SkinFactory;
-
/**
* @author Nick Belaevski - nbelaevski(a)exadel.com
* created 02.02.2007
Modified: root/framework/trunk/impl/src/main/java/org/richfaces/renderkit/html/images/CancelControlIcon.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/richfaces/renderkit/html/images/CancelControlIcon.java 2010-04-20 15:57:57 UTC (rev 16779)
+++ root/framework/trunk/impl/src/main/java/org/richfaces/renderkit/html/images/CancelControlIcon.java 2010-04-20 16:12:31 UTC (rev 16780)
@@ -20,45 +20,42 @@
*/
package org.richfaces.renderkit.html.images;
+import org.ajax4jsf.resource.Java2Dresource;
+import org.ajax4jsf.util.HtmlColor;
+import org.ajax4jsf.util.NumericDataInputStream;
+
+import javax.faces.context.FacesContext;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.GradientPaint;
import java.awt.Graphics2D;
import java.awt.RenderingHints;
-import java.util.Date;
-import javax.faces.context.FacesContext;
-
-import org.ajax4jsf.resource.Java2Dresource;
-import org.ajax4jsf.resource.ResourceContext;
-import org.ajax4jsf.resource.Java2Dresource.ImageType;
-import org.ajax4jsf.util.HtmlColor;
-import org.ajax4jsf.util.NumericDataInputStream;
-import org.ajax4jsf.util.Zipper2;
-
-/**
+/**
* implementation of the default CANCEL icon renderer
+ *
* @author Anton Belevich
* @since 3.2.0
- *
*/
public class CancelControlIcon extends Java2Dresource {
- protected static final String ALTERNATE_COLOR = "#ED6161";
- protected Integer iconColor;
+ protected static final String ALTERNATE_COLOR = "#ED6161";
+
+ private static final Dimension DIMENSIONS = new Dimension(11, 11);
+
+ protected Integer iconColor;
protected Integer iconBorderColor;
- private static final Dimension dimensions = new Dimension(11, 11);
- public CancelControlIcon() {
- super(ImageType.GIF);
- }
-
- @Override
- public Dimension getDimension() {
- return dimensions;
- }
-
- @Override
+ public CancelControlIcon() {
+ super(ImageType.GIF);
+ }
+
+ @Override
+ public Dimension getDimension() {
+ return DIMENSIONS;
+ }
+
+ @Override
protected void readState(FacesContext context, NumericDataInputStream stream) {
super.readState(context, stream);
@@ -72,52 +69,52 @@
stream.writeIntColor(this.iconColor);
stream.writeIntColor(this.iconBorderColor);
}
-
- @Override
- protected void paint(Graphics2D g2d, Dimension dimension) {
-
- g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_OFF);
+
+ @Override
+ protected void paint(Graphics2D g2d, Dimension dimension) {
+
+ g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_OFF);
// g2d.setRenderingHint(RenderingHints.KEY_FRACTIONALMETRICS, RenderingHints.VALUE_FRACTIONALMETRICS_ON);
// g2d.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
- g2d.setRenderingHint(RenderingHints.KEY_STROKE_CONTROL, RenderingHints.VALUE_STROKE_DEFAULT);
- g2d.setRenderingHint(RenderingHints.KEY_COLOR_RENDERING, RenderingHints.VALUE_COLOR_RENDER_DEFAULT);
- g2d.setRenderingHint(RenderingHints.KEY_DITHERING, RenderingHints.VALUE_DITHER_ENABLE);
- g2d.setRenderingHint(RenderingHints.KEY_ALPHA_INTERPOLATION, RenderingHints.VALUE_ALPHA_INTERPOLATION_QUALITY);
- g2d.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BILINEAR);
- g2d.setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_DEFAULT);
- Color iconColour = new Color(iconColor);
- Color iconBorder = new Color(iconBorderColor);
- g2d.setColor(iconColour);
+ g2d.setRenderingHint(RenderingHints.KEY_STROKE_CONTROL, RenderingHints.VALUE_STROKE_DEFAULT);
+ g2d.setRenderingHint(RenderingHints.KEY_COLOR_RENDERING, RenderingHints.VALUE_COLOR_RENDER_DEFAULT);
+ g2d.setRenderingHint(RenderingHints.KEY_DITHERING, RenderingHints.VALUE_DITHER_ENABLE);
+ g2d.setRenderingHint(RenderingHints.KEY_ALPHA_INTERPOLATION, RenderingHints.VALUE_ALPHA_INTERPOLATION_QUALITY);
+ g2d.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BILINEAR);
+ g2d.setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_DEFAULT);
+ Color iconColour = new Color(iconColor);
+ Color iconBorder = new Color(iconBorderColor);
+ g2d.setColor(iconColour);
- Color altenateColor = HtmlColor.decode(ALTERNATE_COLOR);
- GradientPaint gradient = new GradientPaint(2,3,altenateColor,3,9,iconColour);
- g2d.setPaint(gradient);
-
- // draw cross
- g2d.drawLine(2, 3, 7, 8);
- g2d.drawLine(3, 3, 7, 7);
- g2d.drawLine(3, 2, 8, 7);
-
- g2d.drawLine(2, 7, 7, 2);
- g2d.drawLine(3, 7, 7, 3);
- g2d.drawLine(3, 8, 8, 3);
-
- //draw border
- g2d.setColor(iconBorder);
- g2d.drawLine(1, 3, 3, 5);
- g2d.drawLine(3, 5, 1, 7);
- g2d.drawLine(1, 7, 3, 9);
- g2d.drawLine(3, 9, 5, 7);
- g2d.drawLine(5, 7, 7, 9);
- g2d.drawLine(7, 9, 9, 7);
- g2d.drawLine(9, 7, 7, 5);
- g2d.drawLine(7, 5, 9, 3);
- g2d.drawLine(9, 3, 7, 1);
- g2d.drawLine(7, 1, 5, 3);
- g2d.drawLine(5, 3, 3, 1);
- g2d.drawLine(3, 1, 1, 3);
-
-
- }
+ Color altenateColor = HtmlColor.decode(ALTERNATE_COLOR);
+ GradientPaint gradient = new GradientPaint(2, 3, altenateColor, 3, 9, iconColour);
+ g2d.setPaint(gradient);
+
+ // draw cross
+ g2d.drawLine(2, 3, 7, 8);
+ g2d.drawLine(3, 3, 7, 7);
+ g2d.drawLine(3, 2, 8, 7);
+
+ g2d.drawLine(2, 7, 7, 2);
+ g2d.drawLine(3, 7, 7, 3);
+ g2d.drawLine(3, 8, 8, 3);
+
+ //draw border
+ g2d.setColor(iconBorder);
+ g2d.drawLine(1, 3, 3, 5);
+ g2d.drawLine(3, 5, 1, 7);
+ g2d.drawLine(1, 7, 3, 9);
+ g2d.drawLine(3, 9, 5, 7);
+ g2d.drawLine(5, 7, 7, 9);
+ g2d.drawLine(7, 9, 9, 7);
+ g2d.drawLine(9, 7, 7, 5);
+ g2d.drawLine(7, 5, 9, 3);
+ g2d.drawLine(9, 3, 7, 1);
+ g2d.drawLine(7, 1, 5, 3);
+ g2d.drawLine(5, 3, 3, 1);
+ g2d.drawLine(3, 1, 1, 3);
+
+
+ }
}
Modified: root/framework/trunk/impl/src/main/java/org/richfaces/resource/Xcss2EcssConverter.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/richfaces/resource/Xcss2EcssConverter.java 2010-04-20 15:57:57 UTC (rev 16779)
+++ root/framework/trunk/impl/src/main/java/org/richfaces/resource/Xcss2EcssConverter.java 2010-04-20 16:12:31 UTC (rev 16780)
@@ -10,11 +10,15 @@
import org.xml.sax.SAXException;
import org.xml.sax.helpers.DefaultHandler;
import org.xml.sax.Attributes;
+
import javax.xml.parsers.SAXParser;
-public class Xcss2EcssConverter {
+public final class Xcss2EcssConverter {
+ private Xcss2EcssConverter() {
+ }
+
public static void main(String[] args) {
// Create Handler
@@ -26,165 +30,174 @@
// Parse the XML file, handler generates the output
String string = "E:/projs/richafces4/framework/trunk/impl/src/test/java/org/ajax4jsf/cache/extended.xcss";
parser.parse(string);
- }
+ }
}
+
class Handler extends DefaultHandler {
- private final String TEMPLATE = "template";
- private final String SELECTOR = "selector";
- private final String STYLE = "style";
- private final String RESOURCE = "resource";
- private final String ATTRIBBUTE = "attribute";
- private final String VERBATIM = "verbatim";
- private final String IMPORT = "importResource";
+ private static final String TEMPLATE = "template";
+ private static final String SELECTOR = "selector";
+ private static final String STYLE = "style";
+ private static final String RESOURCE = "resource";
+ private static final String ATTRIBBUTE = "attribute";
+ private static final String VERBATIM = "verbatim";
+ private static final String IMPORT = "importResource";
private StringBuilder ecssContent;
private boolean hasAttribbute = false;
- private boolean verbatim = false;;
+ private boolean verbatim = false;
+ ;
/**
* Receive notification of the start of an element.
+ *
* @param namespaceURI - The Namespace URI, or the empty string if the element has no Namespace URI or if Namespace processing is not being performed.
- * @param localName - The local name (without prefix), or the empty string if Namespace processing is not being performed.
- * @param qName - The qualified name (with prefix), or the empty string if qualified names are not available.
- * @param atts - The attributes attached to the element. If there are no attributes, it shall be an empty Attributes object.
+ * @param localName - The local name (without prefix), or the empty string if Namespace processing is not being performed.
+ * @param qName - The qualified name (with prefix), or the empty string if qualified names are not available.
+ * @param atts - The attributes attached to the element. If there are no attributes, it shall be an empty Attributes object.
* @throws SAXException - Any SAX exception, possibly wrapping another exception.
*/
public void startElement(String namespaceURI, String localName, String qName, Attributes atts)
throws SAXException {
- if (TEMPLATE.equals(localName)){
- ecssContent = new StringBuilder();
- }
- if (IMPORT.equals(localName)){
- String src = atts.getValue("src");
- ecssContent.append("@import url(#{resource['");
- ecssContent.append(src);
- ecssContent.append("']}\r\n");
- }
- if (VERBATIM.equals(localName)){
- verbatim = true;
- }
- if (SELECTOR.equals(localName)){
- String value = atts.getValue("name");
- if(null != value){
- ecssContent.append(value);
- ecssContent.append("{\r\n");
+
+ if (TEMPLATE.equals(localName)) {
+ ecssContent = new StringBuilder();
}
- }
- if (STYLE.equals(localName)){
- // Reset Order's values
- String name = atts.getValue("name");
- String skin = atts.getValue("skin");
- String value = atts.getValue("value");
- if(null != name){
- if(skin != null){
- ecssContent.append("\t");
- ecssContent.append(name);
- ecssContent.append(":");
- ecssContent.append("'#{richSkin.");
- ecssContent.append(skin);
- ecssContent.append("}'");
- }else if(value != null){
- ecssContent.append("\t");
- ecssContent.append(name);
- ecssContent.append(":");
- ecssContent.append(value);
- }else{
- ecssContent.append("\t");
- ecssContent.append(name);
- ecssContent.append(":");
- }
- }
- }
- if (RESOURCE.equals(localName)){
- String value = atts.getValue("f:key");
- if(null != value){
- ecssContent.append("'url(#{resource['");
- ecssContent.append(value);
-
- }
+ if (IMPORT.equals(localName)) {
+ String src = atts.getValue("src");
+ ecssContent.append("@import url(#{resource['");
+ ecssContent.append(src);
+ ecssContent.append("']}\r\n");
}
- if (ATTRIBBUTE.equals(localName)){
- if(!hasAttribbute){
- ecssContent.append("?");
- hasAttribbute = true;
- }
- String name = atts.getValue("name");
- String skin = atts.getValue("skin");
- String value = atts.getValue("value");
- if(null != name){
- if(skin != null){
- ecssContent.append(name);
- ecssContent.append("=");
- ecssContent.append("Skin.");
- ecssContent.append(skin);
- ecssContent.append("&");
- }else if(value != null){
- ecssContent.append(name);
- ecssContent.append("=");
- try {
- ecssContent.append(URLDecoder.decode(value, "UTF-8"));
- } catch (UnsupportedEncodingException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
+ if (VERBATIM.equals(localName)) {
+ verbatim = true;
+ }
+ if (SELECTOR.equals(localName)) {
+ String value = atts.getValue("name");
+ if (null != value) {
+ ecssContent.append(value);
+ ecssContent.append("{\r\n");
+ }
+ }
+ if (STYLE.equals(localName)) {
+ // Reset Order's values
+ String name = atts.getValue("name");
+ String skin = atts.getValue("skin");
+ String value = atts.getValue("value");
+ if (null != name) {
+ if (skin != null) {
+ ecssContent.append("\t");
+ ecssContent.append(name);
+ ecssContent.append(":");
+ ecssContent.append("'#{richSkin.");
+ ecssContent.append(skin);
+ ecssContent.append("}'");
+ } else if (value != null) {
+ ecssContent.append("\t");
+ ecssContent.append(name);
+ ecssContent.append(":");
+ ecssContent.append(value);
+ } else {
+ ecssContent.append("\t");
+ ecssContent.append(name);
+ ecssContent.append(":");
}
- ecssContent.append("&");
- }else{
- //ERROR
- }
- }
+ }
}
- }
+ if (RESOURCE.equals(localName)) {
+ String value = atts.getValue("f:key");
+ if (null != value) {
+ ecssContent.append("'url(#{resource['");
+ ecssContent.append(value);
+ }
+ }
+ if (ATTRIBBUTE.equals(localName)) {
+ if (!hasAttribbute) {
+ ecssContent.append("?");
+ hasAttribbute = true;
+ }
+ String name = atts.getValue("name");
+ String skin = atts.getValue("skin");
+ String value = atts.getValue("value");
+ if (null != name) {
+ if (skin != null) {
+ ecssContent.append(name);
+ ecssContent.append("=");
+ ecssContent.append("Skin.");
+ ecssContent.append(skin);
+ ecssContent.append("&");
+ } else if (value != null) {
+ ecssContent.append(name);
+ ecssContent.append("=");
+ try {
+ ecssContent.append(URLDecoder.decode(value, "UTF-8"));
+ } catch (UnsupportedEncodingException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ ecssContent.append("&");
+ } else {
+ //ERROR
+ }
+ }
+ }
+ }
+
/**
* Receive notification of character data inside an element.
- * @param ch - The characters.
- * @param start - The start position in the character array.
+ *
+ * @param ch - The characters.
+ * @param start - The start position in the character array.
* @param length - The number of characters to use from the character array.
* @throws SAXException - Any SAX exception, possibly wrapping another exception.
*/
public void characters(char[] ch, int start, int length)
throws SAXException {
- if ( verbatim ){
+
+ if (verbatim) {
String strValue = new String(ch, start, length);
ecssContent.append(strValue);
-
- }
+ }
+
}
/**
* Receive notification of the end of an element.
+ *
* @param namespaceURI - The Namespace URI, or the empty string if the element has no Namespace URI or if Namespace processing is not being performed.
- * @param localName - The local name (without prefix), or the empty string if Namespace processing is not being performed.
- * @param qName - The qualified name (with prefix), or the empty string if qualified names are not available.
+ * @param localName - The local name (without prefix), or the empty string if Namespace processing is not being performed.
+ * @param qName - The qualified name (with prefix), or the empty string if qualified names are not available.
* @throws SAXException - Any SAX exception, possibly wrapping another exception.
*/
public void endElement(String namespaceURI, String localName, String qName)
throws SAXException {
- if (TEMPLATE.equals(localName)){
+
+ if (TEMPLATE.equals(localName)) {
System.out.println(ecssContent.toString().trim());
}
- if (VERBATIM.equals(localName)){
+ if (VERBATIM.equals(localName)) {
verbatim = false;
}
- if (SELECTOR.equals(localName)){
- ecssContent.append("}\r\n");
+ if (SELECTOR.equals(localName)) {
+ ecssContent.append("}\r\n");
}
- if (STYLE.equals(localName)){
+ if (STYLE.equals(localName)) {
ecssContent.append(";\r\n");
}
- if (RESOURCE.equals(localName)){
- if(hasAttribbute){
- ecssContent.setLength(ecssContent.length() -1);
+ if (RESOURCE.equals(localName)) {
+ if (hasAttribbute) {
+ ecssContent.setLength(ecssContent.length() - 1);
}
ecssContent.append("']})'");
hasAttribbute = false;
- }
- if (ATTRIBBUTE.equals(localName)){
- }
+ }
+ if (ATTRIBBUTE.equals(localName)) {
+ }
}
- }
+}
+
class CreateParser {
private DefaultHandler handler;
@@ -192,65 +205,69 @@
/**
* Constructor
+ *
* @param handler - DefaultHandler for the SAX parser
*/
public CreateParser(DefaultHandler handler) {
- this.handler = handler;
- create();
+ this.handler = handler;
+ create();
}
/**
* Create the SAX parser
*/
private void create() {
- try {
- // Obtain a new instance of a SAXParserFactory.
- SAXParserFactory factory = SAXParserFactory.newInstance();
- // Specifies that the parser produced by this code will provide support for XML namespaces.
- factory.setNamespaceAware(true);
- // Specifies that the parser produced by this code will validate documents as they are parsed.
- //factory.setValidating(true);
- // Creates a new instance of a SAXParser using the currently configured factory parameters.
- saxParser = factory.newSAXParser();
- } catch (Throwable t) {
- t.printStackTrace();
- }
+ try {
+ // Obtain a new instance of a SAXParserFactory.
+ SAXParserFactory factory = SAXParserFactory.newInstance();
+ // Specifies that the parser produced by this code will provide support for XML namespaces.
+ factory.setNamespaceAware(true);
+ // Specifies that the parser produced by this code will validate documents as they are parsed.
+ //factory.setValidating(true);
+ // Creates a new instance of a SAXParser using the currently configured factory parameters.
+ saxParser = factory.newSAXParser();
+ } catch (Throwable t) {
+ t.printStackTrace();
+ }
}
/**
* Parse a File
+ *
* @param file - File
*/
- public void parse(File file){
- try{
- saxParser.parse(file,handler);
- } catch (Throwable t) {
- t.printStackTrace();
- }
+ public void parse(File file) {
+ try {
+ saxParser.parse(file, handler);
+ } catch (Throwable t) {
+ t.printStackTrace();
+ }
}
/**
* Parse a URI
+ *
* @param uri - String
*/
- public void parse(String uri){
- try{
- saxParser.parse(uri,handler);
- } catch (Throwable t) {
- t.printStackTrace();
- }
+ public void parse(String uri) {
+ try {
+ saxParser.parse(uri, handler);
+ } catch (Throwable t) {
+ t.printStackTrace();
+ }
}
/**
* Parse a Stream
+ *
* @param stream - InputStream
*/
- public void parse(InputStream stream){
- try{
- saxParser.parse(stream,handler);
- } catch (Throwable t) {
- t.printStackTrace();
- }
+ public void parse(InputStream stream) {
+ try {
+ saxParser.parse(stream, handler);
+ } catch (Throwable t) {
+ t.printStackTrace();
+ }
}
- }
+}
14 years, 8 months
JBoss Rich Faces SVN: r16779 - root/cdk/trunk/plugins/generator/src/main/resources/META-INF/templates.
by richfaces-svn-commits@lists.jboss.org
Author: Alex.Kolonitsky
Date: 2010-04-20 11:57:57 -0400 (Tue, 20 Apr 2010)
New Revision: 16779
Added:
root/cdk/trunk/plugins/generator/src/main/resources/META-INF/templates/_attribute_accessors.ftl
Log:
RF-7826 Migrate A1 components to new CDK
Added: root/cdk/trunk/plugins/generator/src/main/resources/META-INF/templates/_attribute_accessors.ftl
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/resources/META-INF/templates/_attribute_accessors.ftl (rev 0)
+++ root/cdk/trunk/plugins/generator/src/main/resources/META-INF/templates/_attribute_accessors.ftl 2010-04-20 15:57:57 UTC (rev 16779)
@@ -0,0 +1,14 @@
+
+ public ${attribute.simpleTypeName} ${attribute.getterName}() {
+ <#if attribute.typeForCasting?contains("Boolean")>
+ return Boolean.valueOf(getStateHelper().eval(Properties.${attribute.name}<#if attribute.defaultValue?exists>, ${attribute.defaultValue}</#if>).toString());
+ <#elseif attribute.bindingAttribute >
+ return (${attribute.typeForCasting}) getStateHelper().get(Properties.${attribute.name});
+ <#else>
+ return (${attribute.typeForCasting}) getStateHelper().eval(Properties.${attribute.name}<#if attribute.defaultValue?exists>, ${attribute.defaultValue}</#if>);
+ </#if>
+ }
+
+ public void ${attribute.setterName}(${attribute.simpleTypeName} ${attribute.name}) {
+ getStateHelper().put(Properties.${attribute.name}, ${attribute.name});
+ }
14 years, 8 months
JBoss Rich Faces SVN: r16778 - in root: cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/processors and 9 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: Alex.Kolonitsky
Date: 2010-04-20 11:51:44 -0400 (Tue, 20 Apr 2010)
New Revision: 16778
Modified:
root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/Tag.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/processors/AttributesProcessorImpl.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/generate/java/taghandler/TagHandlerModule.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/generate/taglib/TaglibGeneratorVisitor.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/generate/taglib/TaglibWriter.java
root/cdk/trunk/plugins/generator/src/main/resources/META-INF/templates/_attributes.ftl
root/cdk/trunk/plugins/generator/src/main/resources/META-INF/templates/component.ftl
root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/generate/java/ComponentClassGeneratorTest.java
root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/generate/java/ConverterClassGeneratorTest.java
root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/xmlconfig/TaglibGeneratorVisitorTest.java
root/cdk/trunk/plugins/generator/src/test/resources/org/richfaces/cdk/generate/java/GeneratedComponent.java
root/cdk/trunk/plugins/generator/src/test/resources/org/richfaces/cdk/generate/java/GeneratedConverter.java
root/ui/trunk/components/core/src/main/java/org/ajax4jsf/component/behavior/AjaxBehavior.java
root/ui/trunk/components/core/src/main/java/org/richfaces/component/AbstractCommandLink.java
root/ui/trunk/components/core/src/main/java/org/richfaces/component/AbstractMediaOutput.java
root/ui/trunk/components/core/src/main/java/org/richfaces/component/AbstractPush.java
root/ui/trunk/components/core/src/main/resources/META-INF/a4j.taglib.xml
root/ui/trunk/components/core/src/main/resources/META-INF/behaviors-handler-delegate.faces-config.xml
Log:
RF-7826 Migrate A1 components to new CDK
Modified: root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/Tag.java
===================================================================
--- root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/Tag.java 2010-04-20 15:48:45 UTC (rev 16777)
+++ root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/Tag.java 2010-04-20 15:51:44 UTC (rev 16778)
@@ -53,5 +53,5 @@
public String baseClass() default "";
public boolean generate() default false;
-
+
}
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/processors/AttributesProcessorImpl.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/processors/AttributesProcessorImpl.java 2010-04-20 15:48:45 UTC (rev 16777)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/processors/AttributesProcessorImpl.java 2010-04-20 15:51:44 UTC (rev 16778)
@@ -200,16 +200,21 @@
@Override
public void processType(final BeanModelBase component, TypeElement element) throws CdkException {
-
- // Process XML files with standard attributes definitions.
+ log.debug("AttributesProcessorImpl.processType");
+ log.debug(" -> component = " + component);
+ log.debug(" -> typeElement = " + element.getQualifiedName());
+
+ log.debug(" -- Process XML files with standard attributes definitions.");
+ log.debug(" -> sourceUtils.visitSupertypes...");
SourceUtils sourceUtils = getSourceUtils();
sourceUtils.visitSupertypes(element, new SuperTypeVisitor() {
@Override
public void visit(TypeMirror type) {
try {
- component.getAttributes().addAll(parseProperties(
- CdkEntityResolver.URN_ATTRIBUTES + type.toString() + ".xml"));
+ log.debug(" -> visit - " + type.toString());
+ component.getAttributes().addAll(
+ parseProperties(CdkEntityResolver.URN_ATTRIBUTES + type.toString() + ".xml"));
} catch (CdkException e) {
// TODO - log errors ?
}
@@ -218,7 +223,8 @@
});
- Set<BeanProperty> properties = Sets.newHashSet();
+ log.debug(" -- Process Java files.");
+ Set<BeanProperty> properties = Sets.newHashSet();
properties.addAll(sourceUtils.getBeanPropertiesAnnotatedWith(Attribute.class, element));
properties.addAll(sourceUtils.getAbstractBeanProperties(element));
// TODO - encapsulate attribute builder into utility class.
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/generate/java/taghandler/TagHandlerModule.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/generate/java/taghandler/TagHandlerModule.java 2010-04-20 15:48:45 UTC (rev 16777)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/generate/java/taghandler/TagHandlerModule.java 2010-04-20 15:51:44 UTC (rev 16778)
@@ -23,6 +23,8 @@
package org.richfaces.cdk.generate.java.taghandler;
import com.google.inject.AbstractModule;
+import com.google.inject.multibindings.Multibinder;
+import org.richfaces.cdk.CdkWriter;
/**
* @author akolonitsky
@@ -32,9 +34,7 @@
@Override
protected void configure() {
-/*
Multibinder.newSetBinder(binder(), CdkWriter.class)
.addBinding().to(TagHandlerWriter.class);
-*/
}
}
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/generate/taglib/TaglibGeneratorVisitor.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/generate/taglib/TaglibGeneratorVisitor.java 2010-04-20 15:48:45 UTC (rev 16777)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/generate/taglib/TaglibGeneratorVisitor.java 2010-04-20 15:51:44 UTC (rev 16778)
@@ -58,6 +58,12 @@
private ComponentLibrary componentLibrary;
+ private String id;
+
+ public TaglibGeneratorVisitor(String id) {
+ this.id = id;
+ }
+
public Document getDocument() {
return document;
}
@@ -72,7 +78,7 @@
faceletTaglib = document.addElement("facelet-taglib", "http://java.sun.com/xml/ns/javaee");
faceletTaglib.addAttribute("version", "2.0");
- faceletTaglib.addAttribute("id", "a4j"); // TODO do it as param param
+ faceletTaglib.addAttribute("id", id); // TODO do it as param param
faceletTaglib.addElement("namespace").addText("http://richfaces.org/a4j"); // TODO do it as param param
}
@@ -149,7 +155,9 @@
private void appendAttributs(Element tag, BeanModelBase model) {
for (PropertyBase entry : model.getAttributes()) {
- createAttributeElement(tag, entry.getName(), entry);
+ if (!entry.isHidden() && !entry.isReadOnly()) {
+ createAttributeElement(tag, entry.getName(), entry);
+ }
}
}
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/generate/taglib/TaglibWriter.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/generate/taglib/TaglibWriter.java 2010-04-20 15:48:45 UTC (rev 16777)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/generate/taglib/TaglibWriter.java 2010-04-20 15:51:44 UTC (rev 16778)
@@ -48,13 +48,12 @@
@Output(Outputs.RESOURCES)
private FileManager output;
- /*
- * (non-Javadoc)
- * @see org.richfaces.cdk.CdkWriter#render(org.richfaces.cdk.model.ComponentLibrary)
- */
+ // TODO set it as parametr
+ private String id = "a4j";
+
@Override
public void render() throws CdkException {
- TaglibGeneratorVisitor visitor = new TaglibGeneratorVisitor();
+ TaglibGeneratorVisitor visitor = new TaglibGeneratorVisitor(id);
library.accept(visitor);
try {
@@ -71,7 +70,7 @@
protected Writer getOutput() throws CdkException {
try {
- return output.createOutput("META-INF/taglib.xml", library.lastModified());
+ return output.createOutput("META-INF/" + id + ".taglib.xml", library.lastModified());
} catch (IOException e) {
throw new CdkException(e);
}
Modified: root/cdk/trunk/plugins/generator/src/main/resources/META-INF/templates/_attributes.ftl
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/resources/META-INF/templates/_attributes.ftl 2010-04-20 15:48:45 UTC (rev 16777)
+++ root/cdk/trunk/plugins/generator/src/main/resources/META-INF/templates/_attributes.ftl 2010-04-20 15:51:44 UTC (rev 16778)
@@ -3,14 +3,7 @@
}
<#list generatedAttributes as attribute>
-
- public ${attribute.simpleTypeName} ${attribute.getterName}() {
- return (${attribute.typeForCasting}) getStateHelper().eval(Properties.${attribute.name});
- }
-
- public void ${attribute.setterName}(${attribute.simpleTypeName} ${attribute.name}) {
- getStateHelper().put(Properties.${attribute.name}, ${attribute.name});
- }
+ <#include "_attribute_accessors.ftl">
</#list>
private StateHelper stateHelper = null;
Modified: root/cdk/trunk/plugins/generator/src/main/resources/META-INF/templates/component.ftl
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/resources/META-INF/templates/component.ftl 2010-04-20 15:48:45 UTC (rev 16777)
+++ root/cdk/trunk/plugins/generator/src/main/resources/META-INF/templates/component.ftl 2010-04-20 15:51:44 UTC (rev 16778)
@@ -63,13 +63,6 @@
}
<#list generatedAttributes as attribute>
-
- public ${attribute.simpleTypeName} ${attribute.getterName}() {
- return (${attribute.typeForCasting}) getStateHelper().eval(Properties.${attribute.name}<#if attribute.defaultValue?exists>, ${attribute.defaultValue}</#if>);
- }
-
- public void ${attribute.setterName}(${attribute.simpleTypeName} ${attribute.name}) {
- getStateHelper().put(Properties.${attribute.name}, ${attribute.name});
- }
+ <#include "_attribute_accessors.ftl">
</#list>
}
\ No newline at end of file
Modified: root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/generate/java/ComponentClassGeneratorTest.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/generate/java/ComponentClassGeneratorTest.java 2010-04-20 15:48:45 UTC (rev 16777)
+++ root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/generate/java/ComponentClassGeneratorTest.java 2010-04-20 15:51:44 UTC (rev 16778)
@@ -32,6 +32,7 @@
import org.junit.Test;
import org.junit.runner.RunWith;
import org.richfaces.cdk.CdkTestRunner;
+import org.richfaces.cdk.Logger;
import org.richfaces.cdk.model.ClassName;
import org.richfaces.cdk.model.ComponentModel;
import org.richfaces.cdk.model.EventName;
@@ -59,6 +60,9 @@
@Inject
private ComponentClassGenerator generator;
+ @Inject
+ private Logger log;
+
@Test
public void testGetOutputFileComponent() throws Exception {
final StringWriter outputWriter = new StringWriter();
@@ -70,10 +74,12 @@
library.getComponents().add(component);
generator.generate(component);
-// System.out.println(outputWriter);
+ log.debug(outputWriter.toString());
+
verify(output);
-// TODI - any change in the template breaks test, make comperison more intellectual ?
-// compare(outputWriter, "GeneratedComponent.java");
+
+// TODO - any change in the template breaks test, make comperison more intellectual ?
+ compare(outputWriter, "GeneratedComponent.java");
}
public ComponentClassGenerator getGenerator() {
Modified: root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/generate/java/ConverterClassGeneratorTest.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/generate/java/ConverterClassGeneratorTest.java 2010-04-20 15:48:45 UTC (rev 16777)
+++ root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/generate/java/ConverterClassGeneratorTest.java 2010-04-20 15:51:44 UTC (rev 16778)
@@ -31,6 +31,7 @@
import org.junit.Test;
import org.junit.runner.RunWith;
import org.richfaces.cdk.CdkTestRunner;
+import org.richfaces.cdk.Logger;
import org.richfaces.cdk.generate.freemarker.PropertyModel;
import org.richfaces.cdk.model.ClassName;
import org.richfaces.cdk.model.ComponentLibrary;
@@ -51,6 +52,9 @@
@Inject
private ConverterClassGenerator generator;
+ @Inject
+ private Logger log;
+
@Test
public void testGetOutputFileValidator() throws Exception {
final StringWriter outputWriter = new StringWriter();
@@ -77,7 +81,7 @@
library.getConverters().add(converter);
generator.generate(converter);
-// System.out.println(outputWriter);
+ log.debug(outputWriter.toString());
verify(output);
compare(outputWriter, "GeneratedConverter.java");
Modified: root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/xmlconfig/TaglibGeneratorVisitorTest.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/xmlconfig/TaglibGeneratorVisitorTest.java 2010-04-20 15:48:45 UTC (rev 16777)
+++ root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/xmlconfig/TaglibGeneratorVisitorTest.java 2010-04-20 15:51:44 UTC (rev 16778)
@@ -56,7 +56,7 @@
ComponentLibrary library = new ComponentLibrary();
library.getValidators().add(validator);
- TaglibGeneratorVisitor visitor = new TaglibGeneratorVisitor();
+ TaglibGeneratorVisitor visitor = new TaglibGeneratorVisitor("a4j");
library.accept(visitor);
// visitor.generate();
Modified: root/cdk/trunk/plugins/generator/src/test/resources/org/richfaces/cdk/generate/java/GeneratedComponent.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/test/resources/org/richfaces/cdk/generate/java/GeneratedComponent.java 2010-04-20 15:48:45 UTC (rev 16777)
+++ root/cdk/trunk/plugins/generator/src/test/resources/org/richfaces/cdk/generate/java/GeneratedComponent.java 2010-04-20 15:51:44 UTC (rev 16778)
@@ -44,9 +44,9 @@
*
**/
@Generated({"RichFaces CDK", "4.0.0-SNAPSHOT"})
-public class GeneratedComponent extends UIOutput
- implements ClientBehaviorHolder
- {
+public class GeneratedComponent extends UIOutput
+ implements ClientBehaviorHolder
+ {
public static final String COMPONENT_TYPE="foo.bar";
@@ -55,6 +55,7 @@
private static final Collection<String> EVENT_NAMES = Collections.unmodifiableCollection(Arrays.asList(
"id",
"action"
+
));
public Collection<String> getEventNames() {
@@ -74,62 +75,63 @@
listStrings,
listInteger,
list
+
}
public Object getTestValue() {
- return (Object) getStateHelper().eval(Properties.testValue);
+ return (Object) getStateHelper().eval(Properties.testValue);
}
public void setTestValue(Object testValue) {
- getStateHelper().put(Properties.testValue, testValue);
+ getStateHelper().put(Properties.testValue, testValue);
}
public Boolean isTestFlag() {
- return (Boolean) getStateHelper().eval(Properties.testFlag);
+ return Boolean.valueOf(getStateHelper().eval(Properties.testFlag).toString());
}
public void setTestFlag(Boolean testFlag) {
- getStateHelper().put(Properties.testFlag, testFlag);
+ getStateHelper().put(Properties.testFlag, testFlag);
}
public MethodBinding getTestBinding() {
- return (MethodBinding) getStateHelper().eval(Properties.testBinding);
+ return (MethodBinding) getStateHelper().get(Properties.testBinding);
}
public void setTestBinding(MethodBinding testBinding) {
- getStateHelper().put(Properties.testBinding, testBinding);
+ getStateHelper().put(Properties.testBinding, testBinding);
}
public MethodExpression getTestExpr() {
- return (MethodExpression) getStateHelper().eval(Properties.testExpr);
+ return (MethodExpression) getStateHelper().get(Properties.testExpr);
}
public void setTestExpr(MethodExpression testExpr) {
- getStateHelper().put(Properties.testExpr, testExpr);
+ getStateHelper().put(Properties.testExpr, testExpr);
}
public ArrayList getListStrings() {
- return (ArrayList) getStateHelper().eval(Properties.listStrings);
+ return (ArrayList) getStateHelper().eval(Properties.listStrings);
}
public void setListStrings(ArrayList listStrings) {
- getStateHelper().put(Properties.listStrings, listStrings);
+ getStateHelper().put(Properties.listStrings, listStrings);
}
public ArrayList getListInteger() {
- return (ArrayList) getStateHelper().eval(Properties.listInteger);
+ return (ArrayList) getStateHelper().eval(Properties.listInteger);
}
public void setListInteger(ArrayList listInteger) {
- getStateHelper().put(Properties.listInteger, listInteger);
+ getStateHelper().put(Properties.listInteger, listInteger);
}
public ArrayList getList() {
- return (ArrayList) getStateHelper().eval(Properties.list);
+ return (ArrayList) getStateHelper().eval(Properties.list);
}
public void setList(ArrayList list) {
- getStateHelper().put(Properties.list, list);
+ getStateHelper().put(Properties.list, list);
}
}
\ No newline at end of file
Modified: root/cdk/trunk/plugins/generator/src/test/resources/org/richfaces/cdk/generate/java/GeneratedConverter.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/test/resources/org/richfaces/cdk/generate/java/GeneratedConverter.java 2010-04-20 15:48:45 UTC (rev 16777)
+++ root/cdk/trunk/plugins/generator/src/test/resources/org/richfaces/cdk/generate/java/GeneratedConverter.java 2010-04-20 15:51:44 UTC (rev 16778)
@@ -56,43 +56,43 @@
public PropertyModel getMyClass() {
- return (PropertyModel) getStateHelper().eval(Properties.myClass);
+ return (PropertyModel) getStateHelper().eval(Properties.myClass);
}
public void setMyClass(PropertyModel myClass) {
- getStateHelper().put(Properties.myClass, myClass);
+ getStateHelper().put(Properties.myClass, myClass);
}
public Object getTestObject() {
- return (Object) getStateHelper().eval(Properties.testObject);
+ return (Object) getStateHelper().eval(Properties.testObject);
}
public void setTestObject(Object testObject) {
- getStateHelper().put(Properties.testObject, testObject);
+ getStateHelper().put(Properties.testObject, testObject);
}
public Boolean isTestBoolean() {
- return (Boolean) getStateHelper().eval(Properties.testBoolean);
+ return Boolean.valueOf(getStateHelper().eval(Properties.testBoolean).toString());
}
public void setTestBoolean(Boolean testBoolean) {
- getStateHelper().put(Properties.testBoolean, testBoolean);
+ getStateHelper().put(Properties.testBoolean, testBoolean);
}
public Integer getTestInteger() {
- return (Integer) getStateHelper().eval(Properties.testInteger);
+ return (Integer) getStateHelper().eval(Properties.testInteger);
}
public void setTestInteger(Integer testInteger) {
- getStateHelper().put(Properties.testInteger, testInteger);
+ getStateHelper().put(Properties.testInteger, testInteger);
}
public boolean isVisible() {
- return (Boolean) getStateHelper().eval(Properties.visible);
+ return Boolean.valueOf(getStateHelper().eval(Properties.visible).toString());
}
public void setVisible(boolean visible) {
- getStateHelper().put(Properties.visible, visible);
+ getStateHelper().put(Properties.visible, visible);
}
private StateHelper stateHelper = null;
@@ -143,4 +143,4 @@
initialState = false;
}
-}
+}
\ No newline at end of file
Modified: root/ui/trunk/components/core/src/main/java/org/ajax4jsf/component/behavior/AjaxBehavior.java
===================================================================
--- root/ui/trunk/components/core/src/main/java/org/ajax4jsf/component/behavior/AjaxBehavior.java 2010-04-20 15:48:45 UTC (rev 16777)
+++ root/ui/trunk/components/core/src/main/java/org/ajax4jsf/component/behavior/AjaxBehavior.java 2010-04-20 15:51:44 UTC (rev 16778)
@@ -21,7 +21,7 @@
*/
@JsfBehavior(
id = "org.ajax4jsf.behavior.Ajax",
- tag = @Tag(name = "ajax", handler = "org.richfaces.taglib.html.facelets.AjaxHandler", type = TagType.Facelets)
+ tag = @Tag(name = "ajax", handler = "org.richfaces.view.facelets.html.AjaxHandler", type = TagType.Facelets)
)
@FacesBehavior(value = "org.ajax4jsf.behavior.Ajax")
public class AjaxBehavior extends javax.faces.component.behavior.AjaxBehavior implements AjaxClientBehavior {
Modified: root/ui/trunk/components/core/src/main/java/org/richfaces/component/AbstractCommandLink.java
===================================================================
--- root/ui/trunk/components/core/src/main/java/org/richfaces/component/AbstractCommandLink.java 2010-04-20 15:48:45 UTC (rev 16777)
+++ root/ui/trunk/components/core/src/main/java/org/richfaces/component/AbstractCommandLink.java 2010-04-20 15:51:44 UTC (rev 16778)
@@ -20,22 +20,20 @@
*/
-
package org.richfaces.component;
-import org.richfaces.cdk.annotations.JsfComponent;
import org.richfaces.cdk.annotations.Attribute;
import org.richfaces.cdk.annotations.EventName;
+import org.richfaces.cdk.annotations.JsfComponent;
-import javax.faces.component.UIComponentBase;
+import javax.faces.component.UICommand;
/**
* @author Nick Belaevski
- *
*/
@JsfComponent
-public abstract class AbstractCommandLink extends UIComponentBase {
-
+public abstract class AbstractCommandLink extends UICommand {
+
public static final String COMPONENT_TYPE = "org.richfaces.CommandLink";
public static final String COMPONENT_FAMILY = "org.richfaces.CommandLink";
Modified: root/ui/trunk/components/core/src/main/java/org/richfaces/component/AbstractMediaOutput.java
===================================================================
--- root/ui/trunk/components/core/src/main/java/org/richfaces/component/AbstractMediaOutput.java 2010-04-20 15:48:45 UTC (rev 16777)
+++ root/ui/trunk/components/core/src/main/java/org/richfaces/component/AbstractMediaOutput.java 2010-04-20 15:51:44 UTC (rev 16778)
@@ -47,7 +47,7 @@
*
*/
@JsfComponent(
- tag = @Tag(generate = true, handler = "org.richfaces.taglib.html.facelets.MediaOutputHandler")
+ tag = @Tag(generate = false, handler = "org.richfaces.view.facelets.html.MediaOutputHandler")
)
public abstract class AbstractMediaOutput extends UIOutput implements ResourceComponent2 {
@@ -160,13 +160,6 @@
public abstract void setCoords(String coords);
- /**
- * TODO original implemenattion
- *
- * public MethodExpression getCreateContentExpression() {
- * return (MethodExpression) getStateHelper().get(PropertyKeys.createContentExpression);
- * }
- * */
public abstract MethodExpression getCreateContentExpression();
public abstract String getDeclare();
@@ -212,7 +205,7 @@
public abstract String getVspace();
-// todo @Attribute(events = @EventName("blur"))
+ @Attribute(events = @EventName("blur"))
public abstract String getOnblur();
@Attribute(events = @EventName("click"))
@@ -221,7 +214,7 @@
@Attribute(events = @EventName("dblclick"))
public abstract String getOndblclick();
-// todo @Attribute(events = @EventName("focus"))
+ @Attribute(events = @EventName("focus"))
public abstract String getOnfocus();
@Attribute(events = @EventName("keydown"))
Modified: root/ui/trunk/components/core/src/main/java/org/richfaces/component/AbstractPush.java
===================================================================
--- root/ui/trunk/components/core/src/main/java/org/richfaces/component/AbstractPush.java 2010-04-20 15:48:45 UTC (rev 16777)
+++ root/ui/trunk/components/core/src/main/java/org/richfaces/component/AbstractPush.java 2010-04-20 15:51:44 UTC (rev 16778)
@@ -45,7 +45,7 @@
*
*/
@JsfComponent(
- tag = @Tag(generate = true, handler = "org.richfaces.taglib.html.facelets.AjaxPushHandler")
+ tag = @Tag(generate = true, handler = "org.richfaces.view.facelets.html.AjaxPushHandler")
)
public abstract class AbstractPush extends UICommand {
Modified: root/ui/trunk/components/core/src/main/resources/META-INF/a4j.taglib.xml
===================================================================
--- root/ui/trunk/components/core/src/main/resources/META-INF/a4j.taglib.xml 2010-04-20 15:48:45 UTC (rev 16777)
+++ root/ui/trunk/components/core/src/main/resources/META-INF/a4j.taglib.xml 2010-04-20 15:51:44 UTC (rev 16778)
@@ -66,7 +66,7 @@
<component>
<component-type>org.richfaces.Push</component-type>
<renderer-type>org.richfaces.PushRenderer</renderer-type>
- <handler-class>org.richfaces.taglib.html.facelets.AjaxPushHandler</handler-class>
+ <handler-class>org.richfaces.view.facelets.html.AjaxPushHandler</handler-class>
</component>
</tag>
<tag>
@@ -86,7 +86,7 @@
<tag-name>ajax</tag-name>
<behavior>
<behavior-id>org.ajax4jsf.behavior.Ajax</behavior-id>
- <handler-class>org.richfaces.taglib.html.facelets.AjaxHandler</handler-class>
+ <handler-class>org.richfaces.view.facelets.html.AjaxHandler</handler-class>
</behavior>
</tag>
</facelet-taglib>
Modified: root/ui/trunk/components/core/src/main/resources/META-INF/behaviors-handler-delegate.faces-config.xml
===================================================================
--- root/ui/trunk/components/core/src/main/resources/META-INF/behaviors-handler-delegate.faces-config.xml 2010-04-20 15:48:45 UTC (rev 16777)
+++ root/ui/trunk/components/core/src/main/resources/META-INF/behaviors-handler-delegate.faces-config.xml 2010-04-20 15:51:44 UTC (rev 16778)
@@ -12,7 +12,7 @@
</ordering>
<factory>
- <tag-handler-delegate-factory>org.richfaces.taglib.html.facelets.BehaviorsTagHandlerDelegateFactoryImpl</tag-handler-delegate-factory>
+ <tag-handler-delegate-factory>org.richfaces.view.facelets.html.BehaviorsTagHandlerDelegateFactoryImpl</tag-handler-delegate-factory>
</factory>
</faces-config>
\ No newline at end of file
14 years, 8 months
JBoss Rich Faces SVN: r16777 - in root: ui/trunk/components/core/src/main/java/org/richfaces and 4 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: Alex.Kolonitsky
Date: 2010-04-20 11:48:45 -0400 (Tue, 20 Apr 2010)
New Revision: 16777
Added:
root/ui/trunk/components/core/src/main/java/org/richfaces/view/
root/ui/trunk/components/core/src/main/java/org/richfaces/view/facelets/
root/ui/trunk/components/core/src/main/java/org/richfaces/view/facelets/html/
root/ui/trunk/components/core/src/main/java/org/richfaces/view/facelets/html/AjaxHandler.java
root/ui/trunk/components/core/src/main/java/org/richfaces/view/facelets/html/AjaxPushHandler_.java
root/ui/trunk/components/core/src/main/java/org/richfaces/view/facelets/html/BehaviorStack.java
root/ui/trunk/components/core/src/main/java/org/richfaces/view/facelets/html/BehaviorsAddingComponentHandlerWrapper.java
root/ui/trunk/components/core/src/main/java/org/richfaces/view/facelets/html/BehaviorsTagHandlerDelegateFactoryImpl.java
root/ui/trunk/components/core/src/main/java/org/richfaces/view/facelets/html/MediaOutputHandler.java
Removed:
root/ui/trunk/components/core/src/main/java/org/richfaces/taglib/html/facelets/AjaxHandler.java
root/ui/trunk/components/core/src/main/java/org/richfaces/taglib/html/facelets/AjaxPushHandler.java
root/ui/trunk/components/core/src/main/java/org/richfaces/taglib/html/facelets/BehaviorStack.java
root/ui/trunk/components/core/src/main/java/org/richfaces/taglib/html/facelets/BehaviorsAddingComponentHandlerWrapper.java
root/ui/trunk/components/core/src/main/java/org/richfaces/taglib/html/facelets/BehaviorsTagHandlerDelegateFactoryImpl.java
root/ui/trunk/components/core/src/main/java/org/richfaces/taglib/html/facelets/MediaOutputHandler.java
Modified:
root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/TagType.java
Log:
RF-7826 Migrate A1 components to new CDK
Modified: root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/TagType.java
===================================================================
--- root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/TagType.java 2010-04-20 15:42:52 UTC (rev 16776)
+++ root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/TagType.java 2010-04-20 15:48:45 UTC (rev 16777)
@@ -27,5 +27,5 @@
* @since Feb 11, 2010
*/
public enum TagType {
- None, Jsp, Facelets, All
+ Jsp, Facelets, All
}
Deleted: root/ui/trunk/components/core/src/main/java/org/richfaces/taglib/html/facelets/AjaxHandler.java
===================================================================
--- root/ui/trunk/components/core/src/main/java/org/richfaces/taglib/html/facelets/AjaxHandler.java 2010-04-20 15:42:52 UTC (rev 16776)
+++ root/ui/trunk/components/core/src/main/java/org/richfaces/taglib/html/facelets/AjaxHandler.java 2010-04-20 15:48:45 UTC (rev 16777)
@@ -1,272 +0,0 @@
-package org.richfaces.taglib.html.facelets;
-
-import java.beans.BeanDescriptor;
-import java.beans.BeanInfo;
-import java.io.IOException;
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-import java.util.Map;
-
-import javax.el.ELContext;
-import javax.el.MethodExpression;
-import javax.faces.application.Application;
-import javax.faces.component.UIComponent;
-import javax.faces.component.behavior.ClientBehaviorHolder;
-import javax.faces.context.FacesContext;
-import javax.faces.event.AbortProcessingException;
-import javax.faces.event.AjaxBehaviorEvent;
-import javax.faces.event.AjaxBehaviorListener;
-import javax.faces.view.AttachedObjectHandler;
-import javax.faces.view.AttachedObjectTarget;
-import javax.faces.view.BehaviorHolderAttachedObjectHandler;
-import javax.faces.view.BehaviorHolderAttachedObjectTarget;
-import javax.faces.view.facelets.BehaviorConfig;
-import javax.faces.view.facelets.ComponentHandler;
-import javax.faces.view.facelets.CompositeFaceletHandler;
-import javax.faces.view.facelets.FaceletContext;
-import javax.faces.view.facelets.TagAttribute;
-import javax.faces.view.facelets.TagException;
-import javax.faces.view.facelets.TagHandler;
-
-import org.ajax4jsf.component.behavior.AjaxBehavior;
-
-public class AjaxHandler extends TagHandler implements BehaviorHolderAttachedObjectHandler {
-
- // TODO - is that implementation dependency?
- private static final String JAVAX_FACES_RETARGETABLE_HANDLERS = "javax.faces.RetargetableHandlers";
- private final TagAttribute disabled;
- private final TagAttribute event;
- private final TagAttribute execute;
- private final TagAttribute immediate;
- private final TagAttribute limitRender;
- private final TagAttribute listener;
- private final TagAttribute onbeforedomupdate;
- private final TagAttribute onbegin;
- private final TagAttribute oncomplete;
- private final TagAttribute onerror;
- private final TagAttribute onevent;
- private final TagAttribute queueId;
- private final TagAttribute render;
- private final TagAttribute similarityGroupingId;
- private final TagAttribute statusId;
- private final boolean wrapping;
-
- public AjaxHandler(BehaviorConfig config) {
- super(config);
- this.event = this.getAttribute("event");
- this.execute = this.getAttribute("execute");
- this.render = this.getAttribute("render");
- this.disabled = this.getAttribute("disabled");
- this.immediate = this.getAttribute("immediate");
- this.listener = this.getAttribute("listener");
- this.limitRender = this.getAttribute("limitRender");
- this.queueId = this.getAttribute("queueId");
- this.statusId = this.getAttribute("status");
- this.similarityGroupingId = this.getAttribute("similarityGroupingId");
- this.onevent = this.getAttribute("onevent");
- this.onerror = this.getAttribute("onerror");
- this.onbegin = this.getAttribute("onbegin");
- this.oncomplete = this.getAttribute("oncomplete");
- this.onbeforedomupdate = this.getAttribute("onbeforedomupdate");
- this.wrapping = isWrapping();
- }
-
- public void apply(FaceletContext fContext, UIComponent parent) throws IOException {
- String eventName = getEventName();
-
- if (this.wrapping) {
- applyWrapping(fContext, parent, eventName);
- } else {
- applyNested(fContext, parent, eventName);
- }
- }
-
- private static List<AttachedObjectHandler> getOrCreateRetargetableHandlersList(UIComponent component) {
- Map<String, Object> attrs = component.getAttributes();
- @SuppressWarnings({
- "unchecked"}) List<AttachedObjectHandler> list =
- (List<AttachedObjectHandler>) attrs.get(JAVAX_FACES_RETARGETABLE_HANDLERS);
-
- if (list == null) {
- list = new ArrayList<AttachedObjectHandler>();
- attrs.put(JAVAX_FACES_RETARGETABLE_HANDLERS, list);
- }
-
- return list;
- }
-
- private void applyNested(FaceletContext ctx, UIComponent parent, String eventName) {
- if (!ComponentHandler.isNew(parent)) {
- return;
- }
-
- if (UIComponent.isCompositeComponent(parent)) {
- BeanInfo componentBeanInfo = (BeanInfo) parent.getAttributes().get(UIComponent.BEANINFO_KEY);
-
- if (null == componentBeanInfo) {
- throw new TagException(tag, "Error: enclosing composite component does not have BeanInfo attribute");
- }
-
- BeanDescriptor componentDescriptor = componentBeanInfo.getBeanDescriptor();
-
- if (null == componentDescriptor) {
- throw new TagException(tag,
- "Error: enclosing composite component BeanInfo does not have BeanDescriptor");
- }
-
- @SuppressWarnings(
- "unchecked") List<AttachedObjectTarget> targetList =
- (List<AttachedObjectTarget>) componentDescriptor.getValue(
- AttachedObjectTarget.ATTACHED_OBJECT_TARGETS_KEY);
-
- if (null == targetList) {
- throw new TagException(tag, "Error: enclosing composite component does not support behavior events");
- }
-
- boolean supportedEvent = false;
-
- for (AttachedObjectTarget target : targetList) {
- if (target instanceof BehaviorHolderAttachedObjectTarget) {
- BehaviorHolderAttachedObjectTarget behaviorTarget = (BehaviorHolderAttachedObjectTarget) target;
-
- if ((null != eventName && eventName.equals(behaviorTarget.getName()))
- || (null == eventName && behaviorTarget.isDefaultEvent())) {
- supportedEvent = true;
-
- break;
- }
- }
- }
-
- if (supportedEvent) {
- getOrCreateRetargetableHandlersList(parent).add(this);
- } else {
- throw new TagException(tag, "Error: enclosing composite component does not support event " + eventName);
- }
- } else if (parent instanceof ClientBehaviorHolder) {
- applyAttachedObject(ctx, parent, eventName);
- } else {
- throw new TagException(this.tag, "Unable to attach <a4j:ajax> to non-ClientBehaviorHolder parent");
- }
- }
-
- private void applyWrapping(FaceletContext ctx, UIComponent parent, String eventName) throws IOException {
- AjaxBehavior ajaxBehavior = createAjaxBehavior(ctx, eventName);
- FacesContext context = ctx.getFacesContext();
- BehaviorStack ajaxBehaviors = BehaviorStack.getBehaviorStack(context, true);
-
- ajaxBehaviors.pushBehavior(context, ajaxBehavior, AjaxBehavior.BEHAVIOR_ID, eventName);
- nextHandler.apply(ctx, parent);
- ajaxBehaviors.popBehavior();
- }
-
- public void applyAttachedObject(FaceletContext fContext, UIComponent parent, String eventName) {
- ClientBehaviorHolder bHolder = (ClientBehaviorHolder) parent;
-
- if (null == eventName) {
- eventName = bHolder.getDefaultEventName();
-
- if (null == eventName) {
- throw new TagException(this.tag, "Event attribute could not be determined: " + eventName);
- }
- } else {
- Collection<String> eventNames = bHolder.getEventNames();
-
- if (!eventNames.contains(eventName)) {
- throw new TagException(this.tag,
- eventName + "event is not supported for the "
- + parent.getClass().getSimpleName());
- }
- }
-
- AjaxBehavior ajaxBehavior = createAjaxBehavior(fContext, eventName);
-
- bHolder.addClientBehavior(eventName, ajaxBehavior);
- }
-
- public AjaxBehavior createAjaxBehavior(FaceletContext fContext, String eventName) {
- Application application = fContext.getFacesContext().getApplication();
- AjaxBehavior ajaxBehavior = (AjaxBehavior) application.createBehavior(AjaxBehavior.BEHAVIOR_ID);
-
- setBehaviorAttribute(fContext, ajaxBehavior, this.disabled, Boolean.class);
- setBehaviorAttribute(fContext, ajaxBehavior, this.immediate, Boolean.class);
- setBehaviorAttribute(fContext, ajaxBehavior, this.execute, Object.class);
- setBehaviorAttribute(fContext, ajaxBehavior, this.render, Object.class);
- setBehaviorAttribute(fContext, ajaxBehavior, this.limitRender, Boolean.class);
- setBehaviorAttribute(fContext, ajaxBehavior, this.queueId, String.class);
- setBehaviorAttribute(fContext, ajaxBehavior, this.statusId, String.class);
- setBehaviorAttribute(fContext, ajaxBehavior, this.similarityGroupingId, String.class);
- setBehaviorAttribute(fContext, ajaxBehavior, this.onevent, String.class);
- setBehaviorAttribute(fContext, ajaxBehavior, this.onerror, String.class);
- setBehaviorAttribute(fContext, ajaxBehavior, this.onbegin, String.class);
- setBehaviorAttribute(fContext, ajaxBehavior, this.oncomplete, String.class);
- setBehaviorAttribute(fContext, ajaxBehavior, this.onbeforedomupdate, String.class);
- registerBehaviorListener(fContext, ajaxBehavior, listener);
-
- return ajaxBehavior;
- }
-
- public void applyAttachedObject(FacesContext context, UIComponent parent) {
- FaceletContext ctx = (FaceletContext) context.getAttributes().get(FaceletContext.FACELET_CONTEXT_KEY);
-
- applyAttachedObject(ctx, parent, getEventName());
- }
-
- private void setBehaviorAttribute(FaceletContext ctx, AjaxBehavior behavior, TagAttribute attr, Class<?> type) {
- if (attr != null) {
- behavior.setValueExpression(attr.getLocalName(), attr.getValueExpression(ctx, type));
- }
- }
-
- public String getEventName() {
- return (this.event != null) ? this.event.getValue() : null;
- }
-
- public String getFor() {
- return null;
- }
-
- private boolean isWrapping() {
- return (this.nextHandler instanceof TagHandler) || (this.nextHandler instanceof CompositeFaceletHandler);
- }
-
- public void registerBehaviorListener(FaceletContext fContext, AjaxBehavior behavior, TagAttribute listenerAttr) {
- if (listenerAttr != null) {
- MethodExpression mExpression = listenerAttr.getMethodExpression(fContext, Object.class,
- new Class[] {AjaxBehaviorEvent.class});
-
- behavior.addAjaxBehaviorListener(new AjaxBehaviorListenerImpl(mExpression));
- }
- }
-
- static class AjaxBehaviorListenerImpl implements AjaxBehaviorListener, Serializable {
- /**
- *
- */
- private static final long serialVersionUID = 1812543470662919310L;
-
- private MethodExpression methodExpression;
-
- public AjaxBehaviorListenerImpl() {}
-
- public AjaxBehaviorListenerImpl(MethodExpression expression) {
- this.methodExpression = expression;
- }
-
- public void processAjaxBehavior(AjaxBehaviorEvent event) throws AbortProcessingException {
- if (methodExpression != null) {
- ELContext elContext = FacesContext.getCurrentInstance().getELContext();
-
- try {
- methodExpression.invoke(elContext, new Object[] {event});
- } catch (Exception e) {
-
- // TODO: log or message ??
- throw new AbortProcessingException(e);
- }
- }
- }
- }
-}
Deleted: root/ui/trunk/components/core/src/main/java/org/richfaces/taglib/html/facelets/AjaxPushHandler.java
===================================================================
--- root/ui/trunk/components/core/src/main/java/org/richfaces/taglib/html/facelets/AjaxPushHandler.java 2010-04-20 15:42:52 UTC (rev 16776)
+++ root/ui/trunk/components/core/src/main/java/org/richfaces/taglib/html/facelets/AjaxPushHandler.java 2010-04-20 15:48:45 UTC (rev 16777)
@@ -1,84 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-
-
-package org.richfaces.taglib.html.facelets;
-
-import java.util.EventListener;
-
-import javax.faces.view.facelets.ComponentConfig;
-import javax.faces.view.facelets.ComponentHandler;
-import javax.faces.view.facelets.FaceletContext;
-import javax.faces.view.facelets.MetaRule;
-import javax.faces.view.facelets.MetaRuleset;
-import javax.faces.view.facelets.Metadata;
-import javax.faces.view.facelets.MetadataTarget;
-import javax.faces.view.facelets.TagAttribute;
-
-import org.richfaces.component.AbstractPush;
-
-public class AjaxPushHandler extends ComponentHandler {
- private static final MetaRule AJAX_PUSH_META_RULE = new AjaxPushMetaRule();
-
- public AjaxPushHandler(ComponentConfig config) {
- super(config);
- }
-
- @Override
- protected MetaRuleset createMetaRuleset(Class type) {
- MetaRuleset metaRules = super.createMetaRuleset(type);
-
- metaRules.addRule(AJAX_PUSH_META_RULE);
-
- return metaRules;
- }
-
- static class AjaxPushActionMapper extends Metadata {
- private static final Class<?>[] AJAX_PUSH_ACTION_SIG = new Class[] {EventListener.class};
- private final TagAttribute send;
-
- public AjaxPushActionMapper(TagAttribute attribute) {
- send = attribute;
- }
-
- public void applyMetadata(FaceletContext ctx, Object instance) {
- ((AbstractPush) instance).setEventProducer(this.send.getMethodExpression(ctx, null, AJAX_PUSH_ACTION_SIG));
- }
- }
-
- static class AjaxPushMetaRule extends MetaRule {
-
- public AjaxPushMetaRule() {
- super();
- }
-
- public Metadata applyRule(String name, TagAttribute attribute, MetadataTarget meta) {
- if (meta.isTargetInstanceOf(AbstractPush.class)) {
- if ("eventProducer".equals(name)) {
- return new AjaxPushActionMapper(attribute);
- }
- }
-
- return null;
- }
- }
-}
Deleted: root/ui/trunk/components/core/src/main/java/org/richfaces/taglib/html/facelets/BehaviorStack.java
===================================================================
--- root/ui/trunk/components/core/src/main/java/org/richfaces/taglib/html/facelets/BehaviorStack.java 2010-04-20 15:42:52 UTC (rev 16776)
+++ root/ui/trunk/components/core/src/main/java/org/richfaces/taglib/html/facelets/BehaviorStack.java 2010-04-20 15:48:45 UTC (rev 16777)
@@ -1,152 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2009, Red Hat, Inc. and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-
-
-
-package org.richfaces.taglib.html.facelets;
-
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import javax.faces.application.Application;
-import javax.faces.component.StateHolder;
-import javax.faces.component.behavior.ClientBehavior;
-import javax.faces.component.behavior.ClientBehaviorHint;
-import javax.faces.component.behavior.ClientBehaviorHolder;
-import javax.faces.context.FacesContext;
-
-/**
- * @author Nick Belaevski
- *
- * This class is necessary to handle nesting wrapping behaviors properly and is created
- * to work around this issue: https://javaserverfaces-spec-public.dev.java.net/issues/show_bug.cgi?id=655
- *
- */
-
-//TODO - check for bug resolution
-final class BehaviorStack {
- private static final String BEHAVIOR_STACK = "org.richfaces.BehaviorStack";
- private LinkedList<BehaviorInfo> behaviorStack = null;
-
- public BehaviorStack() {
- behaviorStack = new LinkedList<BehaviorInfo>();
- }
-
- public static BehaviorStack getBehaviorStack(FacesContext context, boolean createIfNull) {
- Map<Object, Object> attributes = context.getAttributes();
- BehaviorStack behaviorStack = (BehaviorStack) attributes.get(BEHAVIOR_STACK);
-
- if (behaviorStack == null && createIfNull) {
- behaviorStack = new BehaviorStack();
- attributes.put(BEHAVIOR_STACK, behaviorStack);
- }
-
- return behaviorStack;
- }
-
- public void addBehaviors(FacesContext context, ClientBehaviorHolder behaviorHolder) {
- if (behaviorStack == null || behaviorStack.isEmpty()) {
- return;
- }
-
- for (BehaviorInfo behaviorInfo : behaviorStack) {
- behaviorInfo.addBehavior(context, behaviorHolder);
- }
- }
-
- public void pushBehavior(FacesContext context, ClientBehavior clientBehavior, String behaviorId, String eventName) {
- Object behaviorState = ((StateHolder) clientBehavior).saveState(context);
-
- // closer behaviors are processed earlier
- behaviorStack.addFirst(new BehaviorInfo(behaviorId, eventName, behaviorState));
- }
-
- public void popBehavior() {
- if (!behaviorStack.isEmpty()) {
- behaviorStack.removeFirst();
- }
- }
-
- private static class BehaviorInfo {
- private String behaviorId;
- private Object behaviorState;
- private String eventName;
-
- public BehaviorInfo(String behaviorId, String eventName, Object behaviorState) {
- this.behaviorId = behaviorId;
- this.eventName = eventName;
- this.behaviorState = behaviorState;
- }
-
- public void addBehavior(FacesContext context, ClientBehaviorHolder behaviorHolder) {
- String eventName = this.eventName;
-
- if (eventName == null) {
- eventName = behaviorHolder.getDefaultEventName();
-
- if (eventName == null) {
- return;
- }
- }
-
- if (shouldAddBehavior(behaviorHolder, eventName)) {
- ClientBehavior behavior = createBehavior(context);
-
- behaviorHolder.addClientBehavior(eventName, behavior);
- }
- }
-
- private boolean shouldAddBehavior(ClientBehaviorHolder behaviorHolder, String eventName) {
- if (!behaviorHolder.getEventNames().contains(eventName)) {
- return false;
- }
-
- Map<String, List<ClientBehavior>> clientBehaviorsMap = behaviorHolder.getClientBehaviors();
- List<ClientBehavior> clientBehaviors = clientBehaviorsMap.get(eventName);
-
- if (clientBehaviors == null || clientBehaviors.isEmpty()) {
- return true;
- }
-
- for (ClientBehavior behavior : clientBehaviors) {
- Set<ClientBehaviorHint> hints = behavior.getHints();
-
- if (hints.contains(ClientBehaviorHint.SUBMITTING)) {
- return false;
- }
- }
-
- return true;
- }
-
- private ClientBehavior createBehavior(FacesContext context) {
- Application application = context.getApplication();
- ClientBehavior behavior = (ClientBehavior) application.createBehavior(this.behaviorId);
-
- ((StateHolder) behavior).restoreState(context, behaviorState);
-
- return behavior;
- }
- }
-}
Deleted: root/ui/trunk/components/core/src/main/java/org/richfaces/taglib/html/facelets/BehaviorsAddingComponentHandlerWrapper.java
===================================================================
--- root/ui/trunk/components/core/src/main/java/org/richfaces/taglib/html/facelets/BehaviorsAddingComponentHandlerWrapper.java 2010-04-20 15:42:52 UTC (rev 16776)
+++ root/ui/trunk/components/core/src/main/java/org/richfaces/taglib/html/facelets/BehaviorsAddingComponentHandlerWrapper.java 2010-04-20 15:48:45 UTC (rev 16777)
@@ -1,118 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2009, Red Hat, Inc. and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-
-
-
-package org.richfaces.taglib.html.facelets;
-
-import java.io.IOException;
-
-import javax.el.ELException;
-
-import javax.faces.FacesException;
-import javax.faces.component.UIComponent;
-import javax.faces.component.behavior.ClientBehaviorHolder;
-import javax.faces.context.FacesContext;
-import javax.faces.view.facelets.ComponentConfig;
-import javax.faces.view.facelets.ComponentHandler;
-import javax.faces.view.facelets.FaceletContext;
-import javax.faces.view.facelets.Tag;
-import javax.faces.view.facelets.TagAttribute;
-
-/**
- * @author Nick Belaevski
- */
-public class BehaviorsAddingComponentHandlerWrapper extends ComponentHandler {
- private ComponentHandler componentHandler;
-
- public BehaviorsAddingComponentHandlerWrapper(ComponentHandler componentHandler) {
- super(componentHandler.getComponentConfig());
- this.componentHandler = componentHandler;
- }
-
- public void apply(FaceletContext ctx, UIComponent parent) throws IOException {
- componentHandler.apply(ctx, parent);
- }
-
- public void applyNextHandler(FaceletContext ctx, UIComponent c) throws IOException, FacesException, ELException {
- componentHandler.applyNextHandler(ctx, c);
- }
-
- public TagAttribute getBinding() {
- return componentHandler.getBinding();
- }
-
- public ComponentConfig getComponentConfig() {
- return componentHandler.getComponentConfig();
- }
-
- public Tag getTag() {
- return componentHandler.getTag();
- }
-
- public TagAttribute getTagAttribute(String localName) {
- return componentHandler.getTagAttribute(localName);
- }
-
- public String getTagId() {
- return componentHandler.getTagId();
- }
-
- public boolean equals(Object obj) {
- return componentHandler.equals(obj);
- }
-
- public int hashCode() {
- return componentHandler.hashCode();
- }
-
- public String toString() {
- return componentHandler.toString();
- }
-
- public boolean isDisabled(FaceletContext ctx) {
- return componentHandler.isDisabled(ctx);
- }
-
- public void onComponentCreated(FaceletContext ctx, UIComponent c, UIComponent parent) {
- componentHandler.onComponentCreated(ctx, c, parent);
- }
-
- public void onComponentPopulated(FaceletContext ctx, UIComponent c, UIComponent parent) {
- FacesContext facesContext = ctx.getFacesContext();
- BehaviorStack behaviorStack = BehaviorStack.getBehaviorStack(facesContext, false);
-
- if (behaviorStack != null) {
- if (c instanceof ClientBehaviorHolder) {
- ClientBehaviorHolder behaviorHolder = (ClientBehaviorHolder) c;
-
- behaviorStack.addBehaviors(facesContext, behaviorHolder);
- }
- }
-
- componentHandler.onComponentPopulated(ctx, c, parent);
- }
-
- public void setAttributes(FaceletContext ctx, Object instance) {
- componentHandler.setAttributes(ctx, instance);
- }
-}
Deleted: root/ui/trunk/components/core/src/main/java/org/richfaces/taglib/html/facelets/BehaviorsTagHandlerDelegateFactoryImpl.java
===================================================================
--- root/ui/trunk/components/core/src/main/java/org/richfaces/taglib/html/facelets/BehaviorsTagHandlerDelegateFactoryImpl.java 2010-04-20 15:42:52 UTC (rev 16776)
+++ root/ui/trunk/components/core/src/main/java/org/richfaces/taglib/html/facelets/BehaviorsTagHandlerDelegateFactoryImpl.java 2010-04-20 15:48:45 UTC (rev 16777)
@@ -1,82 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2009, Red Hat, Inc. and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-
-
-
-package org.richfaces.taglib.html.facelets;
-
-import javax.faces.view.facelets.BehaviorHandler;
-import javax.faces.view.facelets.ComponentHandler;
-import javax.faces.view.facelets.ConverterHandler;
-import javax.faces.view.facelets.TagHandlerDelegate;
-import javax.faces.view.facelets.TagHandlerDelegateFactory;
-import javax.faces.view.facelets.ValidatorHandler;
-
-/**
- * @author Nick Belaevski
- */
-public class BehaviorsTagHandlerDelegateFactoryImpl extends TagHandlerDelegateFactory {
- private TagHandlerDelegateFactory factory;
-
- public BehaviorsTagHandlerDelegateFactoryImpl(TagHandlerDelegateFactory factory) {
- this.factory = factory;
- }
-
- /*
- * (non-Javadoc)
- * @see javax.faces.view.facelets.TagHandlerDelegateFactory#createBehaviorHandlerDelegate(javax.faces.view.facelets.BehaviorHandler)
- */
- @Override
- public TagHandlerDelegate createBehaviorHandlerDelegate(BehaviorHandler owner) {
- return factory.createBehaviorHandlerDelegate(owner);
- }
-
- /*
- * (non-Javadoc)
- * @see javax.faces.view.facelets.TagHandlerDelegateFactory#createComponentHandlerDelegate(javax.faces.view.facelets.ComponentHandler)
- */
- @Override
- public TagHandlerDelegate createComponentHandlerDelegate(ComponentHandler owner) {
-
- // TagHandlers structure is created when view is compiled
- // so there's no need to check for BehaviorsStack
- return factory.createComponentHandlerDelegate(new BehaviorsAddingComponentHandlerWrapper(owner));
- }
-
- /*
- * (non-Javadoc)
- * @see javax.faces.view.facelets.TagHandlerDelegateFactory#createConverterHandlerDelegate(javax.faces.view.facelets.ConverterHandler)
- */
- @Override
- public TagHandlerDelegate createConverterHandlerDelegate(ConverterHandler owner) {
- return factory.createConverterHandlerDelegate(owner);
- }
-
- /*
- * (non-Javadoc)
- * @see javax.faces.view.facelets.TagHandlerDelegateFactory#createValidatorHandlerDelegate(javax.faces.view.facelets.ValidatorHandler)
- */
- @Override
- public TagHandlerDelegate createValidatorHandlerDelegate(ValidatorHandler owner) {
- return factory.createValidatorHandlerDelegate(owner);
- }
-}
Deleted: root/ui/trunk/components/core/src/main/java/org/richfaces/taglib/html/facelets/MediaOutputHandler.java
===================================================================
--- root/ui/trunk/components/core/src/main/java/org/richfaces/taglib/html/facelets/MediaOutputHandler.java 2010-04-20 15:42:52 UTC (rev 16776)
+++ root/ui/trunk/components/core/src/main/java/org/richfaces/taglib/html/facelets/MediaOutputHandler.java 2010-04-20 15:48:45 UTC (rev 16777)
@@ -1,123 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-
-
-package org.richfaces.taglib.html.facelets;
-
-import java.io.OutputStream;
-
-import javax.faces.view.facelets.ComponentConfig;
-import javax.faces.view.facelets.ComponentHandler;
-import javax.faces.view.facelets.FaceletContext;
-import javax.faces.view.facelets.MetaRule;
-import javax.faces.view.facelets.MetaRuleset;
-import javax.faces.view.facelets.Metadata;
-import javax.faces.view.facelets.MetadataTarget;
-import javax.faces.view.facelets.TagAttribute;
-
-import org.richfaces.component.AbstractMediaOutput;
-
-/**
- * @author shura (latest modification by $Author: alexsmirnov $)
- * @version $Revision: 1.1.2.1 $ $Date: 2007/02/01 15:31:22 $
- *
- */
-public class MediaOutputHandler extends ComponentHandler {
- private static final MetaRule MMEDIA_META_RULE = new MMediaMetaRule();
-
- /**
- * @param config
- */
- public MediaOutputHandler(ComponentConfig config) {
- super(config);
- }
-
- @Override
- protected MetaRuleset createMetaRuleset(Class type) {
- MetaRuleset metaRules = super.createMetaRuleset(type);
-
- metaRules.addRule(MMEDIA_META_RULE);
-
- return metaRules;
- }
-
- /**
- * @author shura (latest modification by $Author: alexsmirnov $)
- * @version $Revision: 1.1.2.1 $ $Date: 2007/02/01 15:31:22 $
- *
- */
- static class MMediaActionMapper extends Metadata {
- private static final Class<?>[] MMEDIA_ACTION_SIG = new Class[] {OutputStream.class, Object.class};
- private final TagAttribute send;
-
- /**
- * @param attribute
- */
- public MMediaActionMapper(TagAttribute attribute) {
- send = attribute;
- }
-
- /*
- * (non-Javadoc)
- *
- * @seecom.sun.facelets.tag.Metadata#applyMetadata(com.sun.facelets.
- * FaceletContext, java.lang.Object)
- */
- public void applyMetadata(FaceletContext ctx, Object instance) {
- ((AbstractMediaOutput) instance).setCreateContentExpression(this.send.getMethodExpression(ctx, null,
- MMEDIA_ACTION_SIG));
- }
- }
-
-
- /**
- * @author shura (latest modification by $Author: alexsmirnov $)
- * @version $Revision: 1.1.2.1 $ $Date: 2007/02/01 15:31:22 $
- *
- */
- static class MMediaMetaRule extends MetaRule {
-
- /**
- *
- */
- public MMediaMetaRule() {
- super();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see com.sun.facelets.tag.MetaRule#applyRule(java.lang.String,
- * com.sun.facelets.tag.TagAttribute,
- * com.sun.facelets.tag.MetadataTarget)
- */
- public Metadata applyRule(String name, TagAttribute attribute, MetadataTarget meta) {
- if (meta.isTargetInstanceOf(AbstractMediaOutput.class)) {
- if ("createContent".equals(name)) {
- return new MMediaActionMapper(attribute);
- }
- }
-
- return null;
- }
- }
-}
Copied: root/ui/trunk/components/core/src/main/java/org/richfaces/view/facelets/html/AjaxHandler.java (from rev 16773, root/ui/trunk/components/core/src/main/java/org/richfaces/taglib/html/facelets/AjaxHandler.java)
===================================================================
--- root/ui/trunk/components/core/src/main/java/org/richfaces/view/facelets/html/AjaxHandler.java (rev 0)
+++ root/ui/trunk/components/core/src/main/java/org/richfaces/view/facelets/html/AjaxHandler.java 2010-04-20 15:48:45 UTC (rev 16777)
@@ -0,0 +1,272 @@
+package org.richfaces.view.facelets.html;
+
+import java.beans.BeanDescriptor;
+import java.beans.BeanInfo;
+import java.io.IOException;
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+import java.util.Map;
+
+import javax.el.ELContext;
+import javax.el.MethodExpression;
+import javax.faces.application.Application;
+import javax.faces.component.UIComponent;
+import javax.faces.component.behavior.ClientBehaviorHolder;
+import javax.faces.context.FacesContext;
+import javax.faces.event.AbortProcessingException;
+import javax.faces.event.AjaxBehaviorEvent;
+import javax.faces.event.AjaxBehaviorListener;
+import javax.faces.view.AttachedObjectHandler;
+import javax.faces.view.AttachedObjectTarget;
+import javax.faces.view.BehaviorHolderAttachedObjectHandler;
+import javax.faces.view.BehaviorHolderAttachedObjectTarget;
+import javax.faces.view.facelets.BehaviorConfig;
+import javax.faces.view.facelets.ComponentHandler;
+import javax.faces.view.facelets.CompositeFaceletHandler;
+import javax.faces.view.facelets.FaceletContext;
+import javax.faces.view.facelets.TagAttribute;
+import javax.faces.view.facelets.TagException;
+import javax.faces.view.facelets.TagHandler;
+
+import org.ajax4jsf.component.behavior.AjaxBehavior;
+
+public class AjaxHandler extends TagHandler implements BehaviorHolderAttachedObjectHandler {
+
+ // TODO - is that implementation dependency?
+ private static final String JAVAX_FACES_RETARGETABLE_HANDLERS = "javax.faces.RetargetableHandlers";
+ private final TagAttribute disabled;
+ private final TagAttribute event;
+ private final TagAttribute execute;
+ private final TagAttribute immediate;
+ private final TagAttribute limitRender;
+ private final TagAttribute listener;
+ private final TagAttribute onbeforedomupdate;
+ private final TagAttribute onbegin;
+ private final TagAttribute oncomplete;
+ private final TagAttribute onerror;
+ private final TagAttribute onevent;
+ private final TagAttribute queueId;
+ private final TagAttribute render;
+ private final TagAttribute similarityGroupingId;
+ private final TagAttribute statusId;
+ private final boolean wrapping;
+
+ public AjaxHandler(BehaviorConfig config) {
+ super(config);
+ this.event = this.getAttribute("event");
+ this.execute = this.getAttribute("execute");
+ this.render = this.getAttribute("render");
+ this.disabled = this.getAttribute("disabled");
+ this.immediate = this.getAttribute("immediate");
+ this.listener = this.getAttribute("listener");
+ this.limitRender = this.getAttribute("limitRender");
+ this.queueId = this.getAttribute("queueId");
+ this.statusId = this.getAttribute("status");
+ this.similarityGroupingId = this.getAttribute("similarityGroupingId");
+ this.onevent = this.getAttribute("onevent");
+ this.onerror = this.getAttribute("onerror");
+ this.onbegin = this.getAttribute("onbegin");
+ this.oncomplete = this.getAttribute("oncomplete");
+ this.onbeforedomupdate = this.getAttribute("onbeforedomupdate");
+ this.wrapping = isWrapping();
+ }
+
+ public void apply(FaceletContext fContext, UIComponent parent) throws IOException {
+ String eventName = getEventName();
+
+ if (this.wrapping) {
+ applyWrapping(fContext, parent, eventName);
+ } else {
+ applyNested(fContext, parent, eventName);
+ }
+ }
+
+ private static List<AttachedObjectHandler> getOrCreateRetargetableHandlersList(UIComponent component) {
+ Map<String, Object> attrs = component.getAttributes();
+ @SuppressWarnings({
+ "unchecked"}) List<AttachedObjectHandler> list =
+ (List<AttachedObjectHandler>) attrs.get(JAVAX_FACES_RETARGETABLE_HANDLERS);
+
+ if (list == null) {
+ list = new ArrayList<AttachedObjectHandler>();
+ attrs.put(JAVAX_FACES_RETARGETABLE_HANDLERS, list);
+ }
+
+ return list;
+ }
+
+ private void applyNested(FaceletContext ctx, UIComponent parent, String eventName) {
+ if (!ComponentHandler.isNew(parent)) {
+ return;
+ }
+
+ if (UIComponent.isCompositeComponent(parent)) {
+ BeanInfo componentBeanInfo = (BeanInfo) parent.getAttributes().get(UIComponent.BEANINFO_KEY);
+
+ if (null == componentBeanInfo) {
+ throw new TagException(tag, "Error: enclosing composite component does not have BeanInfo attribute");
+ }
+
+ BeanDescriptor componentDescriptor = componentBeanInfo.getBeanDescriptor();
+
+ if (null == componentDescriptor) {
+ throw new TagException(tag,
+ "Error: enclosing composite component BeanInfo does not have BeanDescriptor");
+ }
+
+ @SuppressWarnings(
+ "unchecked") List<AttachedObjectTarget> targetList =
+ (List<AttachedObjectTarget>) componentDescriptor.getValue(
+ AttachedObjectTarget.ATTACHED_OBJECT_TARGETS_KEY);
+
+ if (null == targetList) {
+ throw new TagException(tag, "Error: enclosing composite component does not support behavior events");
+ }
+
+ boolean supportedEvent = false;
+
+ for (AttachedObjectTarget target : targetList) {
+ if (target instanceof BehaviorHolderAttachedObjectTarget) {
+ BehaviorHolderAttachedObjectTarget behaviorTarget = (BehaviorHolderAttachedObjectTarget) target;
+
+ if ((null != eventName && eventName.equals(behaviorTarget.getName()))
+ || (null == eventName && behaviorTarget.isDefaultEvent())) {
+ supportedEvent = true;
+
+ break;
+ }
+ }
+ }
+
+ if (supportedEvent) {
+ getOrCreateRetargetableHandlersList(parent).add(this);
+ } else {
+ throw new TagException(tag, "Error: enclosing composite component does not support event " + eventName);
+ }
+ } else if (parent instanceof ClientBehaviorHolder) {
+ applyAttachedObject(ctx, parent, eventName);
+ } else {
+ throw new TagException(this.tag, "Unable to attach <a4j:ajax> to non-ClientBehaviorHolder parent");
+ }
+ }
+
+ private void applyWrapping(FaceletContext ctx, UIComponent parent, String eventName) throws IOException {
+ AjaxBehavior ajaxBehavior = createAjaxBehavior(ctx, eventName);
+ FacesContext context = ctx.getFacesContext();
+ BehaviorStack ajaxBehaviors = BehaviorStack.getBehaviorStack(context, true);
+
+ ajaxBehaviors.pushBehavior(context, ajaxBehavior, AjaxBehavior.BEHAVIOR_ID, eventName);
+ nextHandler.apply(ctx, parent);
+ ajaxBehaviors.popBehavior();
+ }
+
+ public void applyAttachedObject(FaceletContext fContext, UIComponent parent, String eventName) {
+ ClientBehaviorHolder bHolder = (ClientBehaviorHolder) parent;
+
+ if (null == eventName) {
+ eventName = bHolder.getDefaultEventName();
+
+ if (null == eventName) {
+ throw new TagException(this.tag, "Event attribute could not be determined: " + eventName);
+ }
+ } else {
+ Collection<String> eventNames = bHolder.getEventNames();
+
+ if (!eventNames.contains(eventName)) {
+ throw new TagException(this.tag,
+ eventName + "event is not supported for the "
+ + parent.getClass().getSimpleName());
+ }
+ }
+
+ AjaxBehavior ajaxBehavior = createAjaxBehavior(fContext, eventName);
+
+ bHolder.addClientBehavior(eventName, ajaxBehavior);
+ }
+
+ public AjaxBehavior createAjaxBehavior(FaceletContext fContext, String eventName) {
+ Application application = fContext.getFacesContext().getApplication();
+ AjaxBehavior ajaxBehavior = (AjaxBehavior) application.createBehavior(AjaxBehavior.BEHAVIOR_ID);
+
+ setBehaviorAttribute(fContext, ajaxBehavior, this.disabled, Boolean.class);
+ setBehaviorAttribute(fContext, ajaxBehavior, this.immediate, Boolean.class);
+ setBehaviorAttribute(fContext, ajaxBehavior, this.execute, Object.class);
+ setBehaviorAttribute(fContext, ajaxBehavior, this.render, Object.class);
+ setBehaviorAttribute(fContext, ajaxBehavior, this.limitRender, Boolean.class);
+ setBehaviorAttribute(fContext, ajaxBehavior, this.queueId, String.class);
+ setBehaviorAttribute(fContext, ajaxBehavior, this.statusId, String.class);
+ setBehaviorAttribute(fContext, ajaxBehavior, this.similarityGroupingId, String.class);
+ setBehaviorAttribute(fContext, ajaxBehavior, this.onevent, String.class);
+ setBehaviorAttribute(fContext, ajaxBehavior, this.onerror, String.class);
+ setBehaviorAttribute(fContext, ajaxBehavior, this.onbegin, String.class);
+ setBehaviorAttribute(fContext, ajaxBehavior, this.oncomplete, String.class);
+ setBehaviorAttribute(fContext, ajaxBehavior, this.onbeforedomupdate, String.class);
+ registerBehaviorListener(fContext, ajaxBehavior, listener);
+
+ return ajaxBehavior;
+ }
+
+ public void applyAttachedObject(FacesContext context, UIComponent parent) {
+ FaceletContext ctx = (FaceletContext) context.getAttributes().get(FaceletContext.FACELET_CONTEXT_KEY);
+
+ applyAttachedObject(ctx, parent, getEventName());
+ }
+
+ private void setBehaviorAttribute(FaceletContext ctx, AjaxBehavior behavior, TagAttribute attr, Class<?> type) {
+ if (attr != null) {
+ behavior.setValueExpression(attr.getLocalName(), attr.getValueExpression(ctx, type));
+ }
+ }
+
+ public String getEventName() {
+ return (this.event != null) ? this.event.getValue() : null;
+ }
+
+ public String getFor() {
+ return null;
+ }
+
+ private boolean isWrapping() {
+ return (this.nextHandler instanceof TagHandler) || (this.nextHandler instanceof CompositeFaceletHandler);
+ }
+
+ public void registerBehaviorListener(FaceletContext fContext, AjaxBehavior behavior, TagAttribute listenerAttr) {
+ if (listenerAttr != null) {
+ MethodExpression mExpression = listenerAttr.getMethodExpression(fContext, Object.class,
+ new Class[] {AjaxBehaviorEvent.class});
+
+ behavior.addAjaxBehaviorListener(new AjaxBehaviorListenerImpl(mExpression));
+ }
+ }
+
+ static class AjaxBehaviorListenerImpl implements AjaxBehaviorListener, Serializable {
+ /**
+ *
+ */
+ private static final long serialVersionUID = 1812543470662919310L;
+
+ private MethodExpression methodExpression;
+
+ public AjaxBehaviorListenerImpl() {}
+
+ public AjaxBehaviorListenerImpl(MethodExpression expression) {
+ this.methodExpression = expression;
+ }
+
+ public void processAjaxBehavior(AjaxBehaviorEvent event) throws AbortProcessingException {
+ if (methodExpression != null) {
+ ELContext elContext = FacesContext.getCurrentInstance().getELContext();
+
+ try {
+ methodExpression.invoke(elContext, new Object[] {event});
+ } catch (Exception e) {
+
+ // TODO: log or message ??
+ throw new AbortProcessingException(e);
+ }
+ }
+ }
+ }
+}
Copied: root/ui/trunk/components/core/src/main/java/org/richfaces/view/facelets/html/AjaxPushHandler_.java (from rev 16773, root/ui/trunk/components/core/src/main/java/org/richfaces/taglib/html/facelets/AjaxPushHandler.java)
===================================================================
--- root/ui/trunk/components/core/src/main/java/org/richfaces/view/facelets/html/AjaxPushHandler_.java (rev 0)
+++ root/ui/trunk/components/core/src/main/java/org/richfaces/view/facelets/html/AjaxPushHandler_.java 2010-04-20 15:48:45 UTC (rev 16777)
@@ -0,0 +1,83 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+
+package org.richfaces.view.facelets.html;
+
+import java.util.EventListener;
+
+import javax.faces.view.facelets.ComponentConfig;
+import javax.faces.view.facelets.ComponentHandler;
+import javax.faces.view.facelets.FaceletContext;
+import javax.faces.view.facelets.MetaRule;
+import javax.faces.view.facelets.MetaRuleset;
+import javax.faces.view.facelets.Metadata;
+import javax.faces.view.facelets.MetadataTarget;
+import javax.faces.view.facelets.TagAttribute;
+
+import org.richfaces.component.AbstractPush;
+
+public class AjaxPushHandler_ extends ComponentHandler {
+ private static final MetaRule AJAX_PUSH_META_RULE = new AjaxPushMetaRule();
+
+ public AjaxPushHandler_(ComponentConfig config) {
+ super(config);
+ }
+
+ @Override
+ protected MetaRuleset createMetaRuleset(Class type) {
+ MetaRuleset metaRules = super.createMetaRuleset(type);
+
+ metaRules.addRule(AJAX_PUSH_META_RULE);
+
+ return metaRules;
+ }
+
+ static class AjaxPushActionMapper extends Metadata {
+ private static final Class<?>[] AJAX_PUSH_ACTION_SIG = new Class[] {EventListener.class};
+ private final TagAttribute send;
+
+ public AjaxPushActionMapper(TagAttribute attribute) {
+ send = attribute;
+ }
+
+ public void applyMetadata(FaceletContext ctx, Object instance) {
+ ((AbstractPush) instance).setEventProducer(this.send.getMethodExpression(ctx, null, AJAX_PUSH_ACTION_SIG));
+ }
+ }
+
+ static class AjaxPushMetaRule extends MetaRule {
+
+ public AjaxPushMetaRule() {
+ super();
+ }
+
+ public Metadata applyRule(String name, TagAttribute attribute, MetadataTarget meta) {
+ if (meta.isTargetInstanceOf(AbstractPush.class)) {
+ if ("eventProducer".equals(name)) {
+ return new AjaxPushActionMapper(attribute);
+ }
+ }
+
+ return null;
+ }
+ }
+}
Property changes on: root/ui/trunk/components/core/src/main/java/org/richfaces/view/facelets/html/AjaxPushHandler_.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Date Revision Author
Copied: root/ui/trunk/components/core/src/main/java/org/richfaces/view/facelets/html/BehaviorStack.java (from rev 16773, root/ui/trunk/components/core/src/main/java/org/richfaces/taglib/html/facelets/BehaviorStack.java)
===================================================================
--- root/ui/trunk/components/core/src/main/java/org/richfaces/view/facelets/html/BehaviorStack.java (rev 0)
+++ root/ui/trunk/components/core/src/main/java/org/richfaces/view/facelets/html/BehaviorStack.java 2010-04-20 15:48:45 UTC (rev 16777)
@@ -0,0 +1,151 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2009, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+
+package org.richfaces.view.facelets.html;
+
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import javax.faces.application.Application;
+import javax.faces.component.StateHolder;
+import javax.faces.component.behavior.ClientBehavior;
+import javax.faces.component.behavior.ClientBehaviorHint;
+import javax.faces.component.behavior.ClientBehaviorHolder;
+import javax.faces.context.FacesContext;
+
+/**
+ * @author Nick Belaevski
+ *
+ * This class is necessary to handle nesting wrapping behaviors properly and is created
+ * to work around this issue: https://javaserverfaces-spec-public.dev.java.net/issues/show_bug.cgi?id=655
+ *
+ */
+
+//TODO - check for bug resolution
+final class BehaviorStack {
+ private static final String BEHAVIOR_STACK = "org.richfaces.BehaviorStack";
+ private LinkedList<BehaviorInfo> behaviorStack = null;
+
+ public BehaviorStack() {
+ behaviorStack = new LinkedList<BehaviorInfo>();
+ }
+
+ public static BehaviorStack getBehaviorStack(FacesContext context, boolean createIfNull) {
+ Map<Object, Object> attributes = context.getAttributes();
+ BehaviorStack behaviorStack = (BehaviorStack) attributes.get(BEHAVIOR_STACK);
+
+ if (behaviorStack == null && createIfNull) {
+ behaviorStack = new BehaviorStack();
+ attributes.put(BEHAVIOR_STACK, behaviorStack);
+ }
+
+ return behaviorStack;
+ }
+
+ public void addBehaviors(FacesContext context, ClientBehaviorHolder behaviorHolder) {
+ if (behaviorStack == null || behaviorStack.isEmpty()) {
+ return;
+ }
+
+ for (BehaviorInfo behaviorInfo : behaviorStack) {
+ behaviorInfo.addBehavior(context, behaviorHolder);
+ }
+ }
+
+ public void pushBehavior(FacesContext context, ClientBehavior clientBehavior, String behaviorId, String eventName) {
+ Object behaviorState = ((StateHolder) clientBehavior).saveState(context);
+
+ // closer behaviors are processed earlier
+ behaviorStack.addFirst(new BehaviorInfo(behaviorId, eventName, behaviorState));
+ }
+
+ public void popBehavior() {
+ if (!behaviorStack.isEmpty()) {
+ behaviorStack.removeFirst();
+ }
+ }
+
+ private static class BehaviorInfo {
+ private String behaviorId;
+ private Object behaviorState;
+ private String eventName;
+
+ public BehaviorInfo(String behaviorId, String eventName, Object behaviorState) {
+ this.behaviorId = behaviorId;
+ this.eventName = eventName;
+ this.behaviorState = behaviorState;
+ }
+
+ public void addBehavior(FacesContext context, ClientBehaviorHolder behaviorHolder) {
+ String eventName = this.eventName;
+
+ if (eventName == null) {
+ eventName = behaviorHolder.getDefaultEventName();
+
+ if (eventName == null) {
+ return;
+ }
+ }
+
+ if (shouldAddBehavior(behaviorHolder, eventName)) {
+ ClientBehavior behavior = createBehavior(context);
+
+ behaviorHolder.addClientBehavior(eventName, behavior);
+ }
+ }
+
+ private boolean shouldAddBehavior(ClientBehaviorHolder behaviorHolder, String eventName) {
+ if (!behaviorHolder.getEventNames().contains(eventName)) {
+ return false;
+ }
+
+ Map<String, List<ClientBehavior>> clientBehaviorsMap = behaviorHolder.getClientBehaviors();
+ List<ClientBehavior> clientBehaviors = clientBehaviorsMap.get(eventName);
+
+ if (clientBehaviors == null || clientBehaviors.isEmpty()) {
+ return true;
+ }
+
+ for (ClientBehavior behavior : clientBehaviors) {
+ Set<ClientBehaviorHint> hints = behavior.getHints();
+
+ if (hints.contains(ClientBehaviorHint.SUBMITTING)) {
+ return false;
+ }
+ }
+
+ return true;
+ }
+
+ private ClientBehavior createBehavior(FacesContext context) {
+ Application application = context.getApplication();
+ ClientBehavior behavior = (ClientBehavior) application.createBehavior(this.behaviorId);
+
+ ((StateHolder) behavior).restoreState(context, behaviorState);
+
+ return behavior;
+ }
+ }
+}
Copied: root/ui/trunk/components/core/src/main/java/org/richfaces/view/facelets/html/BehaviorsAddingComponentHandlerWrapper.java (from rev 16773, root/ui/trunk/components/core/src/main/java/org/richfaces/taglib/html/facelets/BehaviorsAddingComponentHandlerWrapper.java)
===================================================================
--- root/ui/trunk/components/core/src/main/java/org/richfaces/view/facelets/html/BehaviorsAddingComponentHandlerWrapper.java (rev 0)
+++ root/ui/trunk/components/core/src/main/java/org/richfaces/view/facelets/html/BehaviorsAddingComponentHandlerWrapper.java 2010-04-20 15:48:45 UTC (rev 16777)
@@ -0,0 +1,117 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2009, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+
+package org.richfaces.view.facelets.html;
+
+import java.io.IOException;
+
+import javax.el.ELException;
+
+import javax.faces.FacesException;
+import javax.faces.component.UIComponent;
+import javax.faces.component.behavior.ClientBehaviorHolder;
+import javax.faces.context.FacesContext;
+import javax.faces.view.facelets.ComponentConfig;
+import javax.faces.view.facelets.ComponentHandler;
+import javax.faces.view.facelets.FaceletContext;
+import javax.faces.view.facelets.Tag;
+import javax.faces.view.facelets.TagAttribute;
+
+/**
+ * @author Nick Belaevski
+ */
+public class BehaviorsAddingComponentHandlerWrapper extends ComponentHandler {
+ private ComponentHandler componentHandler;
+
+ public BehaviorsAddingComponentHandlerWrapper(ComponentHandler componentHandler) {
+ super(componentHandler.getComponentConfig());
+ this.componentHandler = componentHandler;
+ }
+
+ public void apply(FaceletContext ctx, UIComponent parent) throws IOException {
+ componentHandler.apply(ctx, parent);
+ }
+
+ public void applyNextHandler(FaceletContext ctx, UIComponent c) throws IOException, FacesException, ELException {
+ componentHandler.applyNextHandler(ctx, c);
+ }
+
+ public TagAttribute getBinding() {
+ return componentHandler.getBinding();
+ }
+
+ public ComponentConfig getComponentConfig() {
+ return componentHandler.getComponentConfig();
+ }
+
+ public Tag getTag() {
+ return componentHandler.getTag();
+ }
+
+ public TagAttribute getTagAttribute(String localName) {
+ return componentHandler.getTagAttribute(localName);
+ }
+
+ public String getTagId() {
+ return componentHandler.getTagId();
+ }
+
+ public boolean equals(Object obj) {
+ return componentHandler.equals(obj);
+ }
+
+ public int hashCode() {
+ return componentHandler.hashCode();
+ }
+
+ public String toString() {
+ return componentHandler.toString();
+ }
+
+ public boolean isDisabled(FaceletContext ctx) {
+ return componentHandler.isDisabled(ctx);
+ }
+
+ public void onComponentCreated(FaceletContext ctx, UIComponent c, UIComponent parent) {
+ componentHandler.onComponentCreated(ctx, c, parent);
+ }
+
+ public void onComponentPopulated(FaceletContext ctx, UIComponent c, UIComponent parent) {
+ FacesContext facesContext = ctx.getFacesContext();
+ BehaviorStack behaviorStack = BehaviorStack.getBehaviorStack(facesContext, false);
+
+ if (behaviorStack != null) {
+ if (c instanceof ClientBehaviorHolder) {
+ ClientBehaviorHolder behaviorHolder = (ClientBehaviorHolder) c;
+
+ behaviorStack.addBehaviors(facesContext, behaviorHolder);
+ }
+ }
+
+ componentHandler.onComponentPopulated(ctx, c, parent);
+ }
+
+ public void setAttributes(FaceletContext ctx, Object instance) {
+ componentHandler.setAttributes(ctx, instance);
+ }
+}
Copied: root/ui/trunk/components/core/src/main/java/org/richfaces/view/facelets/html/BehaviorsTagHandlerDelegateFactoryImpl.java (from rev 16773, root/ui/trunk/components/core/src/main/java/org/richfaces/taglib/html/facelets/BehaviorsTagHandlerDelegateFactoryImpl.java)
===================================================================
--- root/ui/trunk/components/core/src/main/java/org/richfaces/view/facelets/html/BehaviorsTagHandlerDelegateFactoryImpl.java (rev 0)
+++ root/ui/trunk/components/core/src/main/java/org/richfaces/view/facelets/html/BehaviorsTagHandlerDelegateFactoryImpl.java 2010-04-20 15:48:45 UTC (rev 16777)
@@ -0,0 +1,81 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2009, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+
+package org.richfaces.view.facelets.html;
+
+import javax.faces.view.facelets.BehaviorHandler;
+import javax.faces.view.facelets.ComponentHandler;
+import javax.faces.view.facelets.ConverterHandler;
+import javax.faces.view.facelets.TagHandlerDelegate;
+import javax.faces.view.facelets.TagHandlerDelegateFactory;
+import javax.faces.view.facelets.ValidatorHandler;
+
+/**
+ * @author Nick Belaevski
+ */
+public class BehaviorsTagHandlerDelegateFactoryImpl extends TagHandlerDelegateFactory {
+ private TagHandlerDelegateFactory factory;
+
+ public BehaviorsTagHandlerDelegateFactoryImpl(TagHandlerDelegateFactory factory) {
+ this.factory = factory;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see javax.faces.view.facelets.TagHandlerDelegateFactory#createBehaviorHandlerDelegate(javax.faces.view.facelets.BehaviorHandler)
+ */
+ @Override
+ public TagHandlerDelegate createBehaviorHandlerDelegate(BehaviorHandler owner) {
+ return factory.createBehaviorHandlerDelegate(owner);
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see javax.faces.view.facelets.TagHandlerDelegateFactory#createComponentHandlerDelegate(javax.faces.view.facelets.ComponentHandler)
+ */
+ @Override
+ public TagHandlerDelegate createComponentHandlerDelegate(ComponentHandler owner) {
+
+ // TagHandlers structure is created when view is compiled
+ // so there's no need to check for BehaviorsStack
+ return factory.createComponentHandlerDelegate(new BehaviorsAddingComponentHandlerWrapper(owner));
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see javax.faces.view.facelets.TagHandlerDelegateFactory#createConverterHandlerDelegate(javax.faces.view.facelets.ConverterHandler)
+ */
+ @Override
+ public TagHandlerDelegate createConverterHandlerDelegate(ConverterHandler owner) {
+ return factory.createConverterHandlerDelegate(owner);
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see javax.faces.view.facelets.TagHandlerDelegateFactory#createValidatorHandlerDelegate(javax.faces.view.facelets.ValidatorHandler)
+ */
+ @Override
+ public TagHandlerDelegate createValidatorHandlerDelegate(ValidatorHandler owner) {
+ return factory.createValidatorHandlerDelegate(owner);
+ }
+}
Copied: root/ui/trunk/components/core/src/main/java/org/richfaces/view/facelets/html/MediaOutputHandler.java (from rev 16764, root/ui/trunk/components/core/src/main/java/org/richfaces/taglib/html/facelets/MediaOutputHandler.java)
===================================================================
--- root/ui/trunk/components/core/src/main/java/org/richfaces/view/facelets/html/MediaOutputHandler.java (rev 0)
+++ root/ui/trunk/components/core/src/main/java/org/richfaces/view/facelets/html/MediaOutputHandler.java 2010-04-20 15:48:45 UTC (rev 16777)
@@ -0,0 +1,73 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+
+package org.richfaces.view.facelets.html;
+
+import org.richfaces.MethodMetadata;
+import org.richfaces.component.AbstractMediaOutput;
+
+import javax.faces.view.facelets.ComponentConfig;
+import javax.faces.view.facelets.ComponentHandler;
+import javax.faces.view.facelets.FaceletContext;
+import javax.faces.view.facelets.MetaRule;
+import javax.faces.view.facelets.MetaRuleset;
+import javax.faces.view.facelets.Metadata;
+import javax.faces.view.facelets.MetadataTarget;
+import javax.faces.view.facelets.TagAttribute;
+import java.io.OutputStream;
+
+/**
+ * @author shura (latest modification by $Author: alexsmirnov $)
+ * @version $Revision: 1.1.2.1 $ $Date: 2007/02/01 15:31:22 $
+ *
+ */
+public class MediaOutputHandler extends ComponentHandler {
+
+ private static final MediaOutputHandlerMetaRule META_RULE = new MediaOutputHandlerMetaRule();
+
+
+ public MediaOutputHandler(ComponentConfig config) {
+ super(config);
+ }
+
+ protected MetaRuleset createMetaRuleset(Class type) {
+ MetaRuleset m = super.createMetaRuleset(type);
+ m.addRule(META_RULE);
+ return m;
+ }
+
+ static class MediaOutputHandlerMetaRule extends MetaRule{
+
+ public Metadata applyRule(String name, TagAttribute attribute, MetadataTarget meta) {
+ if (meta.isTargetInstanceOf(AbstractMediaOutput.class)) {
+ if ("createContent".equals(name)) {
+ return new MethodMetadata(attribute, OutputStream.class, Object.class) {
+ public void applyMetadata(FaceletContext ctx, Object instance) {
+ ((AbstractMediaOutput) instance).setCreateContentExpression(getMethodExpression(ctx));
+ }
+ };
+ }
+ }
+ return null;
+ }
+ }
+}
14 years, 8 months
JBoss Rich Faces SVN: r16776 - branches/community/3.3.X/samples/richfaces-demo/functional-test.
by richfaces-svn-commits@lists.jboss.org
Author: lfryc(a)redhat.com
Date: 2010-04-20 11:42:52 -0400 (Tue, 20 Apr 2010)
New Revision: 16776
Modified:
branches/community/3.3.X/samples/richfaces-demo/functional-test/pom.xml
branches/community/3.3.X/samples/richfaces-demo/functional-test/profiles.jboss-qa.xml
Log:
- richfaces-demo - pom.xml - use maven lifecycle to inject jsf2 libraries to jboss home
Modified: branches/community/3.3.X/samples/richfaces-demo/functional-test/pom.xml
===================================================================
--- branches/community/3.3.X/samples/richfaces-demo/functional-test/pom.xml 2010-04-20 15:13:08 UTC (rev 16775)
+++ branches/community/3.3.X/samples/richfaces-demo/functional-test/pom.xml 2010-04-20 15:42:52 UTC (rev 16776)
@@ -249,7 +249,45 @@
<properties>
<demo.artifactId.suffix>-jsf2</demo.artifactId.suffix>
<jsf.majorVersion>2</jsf.majorVersion>
+ <jsf.version>2.0.2</jsf.version>
+ <jsf.libs.target>${project.build.directory}/installs/jsf-libs</jsf.libs.target>
</properties>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>copy-jsf-libs</id>
+ <goals>
+ <goal>copy</goal>
+ </goals>
+ <phase>package</phase>
+ <configuration>
+ <artifactItems>
+ <artifactItem>
+ <groupId>com.sun.faces</groupId>
+ <artifactId>jsf-api</artifactId>
+ <version>${jsf.version}</version>
+ <overWrite>true</overWrite>
+ <outputDirectory>${jsf.libs.target}</outputDirectory>
+ <destFileName>jsf-api.jar</destFileName>
+ </artifactItem>
+ <artifactItem>
+ <groupId>com.sun.faces</groupId>
+ <artifactId>jsf-impl</artifactId>
+ <version>${jsf.version}</version>
+ <overWrite>true</overWrite>
+ <outputDirectory>${jsf.libs.target}</outputDirectory>
+ <destFileName>jsf-impl.jar</destFileName>
+ </artifactItem>
+ </artifactItems>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
</profile>
<!-- Container Profile -->
<profile>
@@ -267,6 +305,13 @@
<version>1.0-beta-2</version>
<executions>
<execution>
+ <id>install-container</id>
+ <phase>process-test-resources</phase>
+ <goals>
+ <goal>install</goal>
+ </goals>
+ </execution>
+ <execution>
<id>start-container</id>
<phase>pre-integration-test</phase>
<goals>
@@ -412,6 +457,8 @@
</activation>
<properties>
<container.home>${project.build.directory}/installs/jboss-${container.version}/${container.unflatted.dir}</container.home>
+ <container.configuration>default</container.configuration>
+ <container.configuration.home>${container.home}/server/${container.configuration}</container.configuration.home>
</properties>
<build>
<plugins>
@@ -430,10 +477,10 @@
</executions>
<configuration>
<configuration>
- <home>${container.home}/server/default</home>
+ <home>${container.configuration.home}</home>
<type>existing</type>
<properties>
- <cargo.jboss.configuration>default</cargo.jboss.configuration>
+ <cargo.jboss.configuration>${container.configuration}</cargo.jboss.configuration>
<cargo.rmi.port>1099</cargo.rmi.port>
</properties>
</configuration>
@@ -467,6 +514,9 @@
</activation>
<properties>
<container.home>${project.build.directory}/installs/jboss-${container.version}/jboss-${container.version}</container.home>
+ <container.configuration>default</container.configuration>
+ <container.configuration.home>${container.home}/server/${container.configuration}</container.configuration.home>
+ <jsf.libs.target>${container.configuration.home}/deploy/jbossweb.sar/jsf-libs</jsf.libs.target>
</properties>
<build>
<plugins>
@@ -485,10 +535,10 @@
</executions>
<configuration>
<configuration>
- <home>${container.home}/server/default</home>
+ <home>${container.configuration.home}</home>
<type>existing</type>
<properties>
- <cargo.jboss.configuration>default</cargo.jboss.configuration>
+ <cargo.jboss.configuration>${container.configuration}</cargo.jboss.configuration>
<cargo.rmi.port>1099</cargo.rmi.port>
</properties>
</configuration>
Modified: branches/community/3.3.X/samples/richfaces-demo/functional-test/profiles.jboss-qa.xml
===================================================================
--- branches/community/3.3.X/samples/richfaces-demo/functional-test/profiles.jboss-qa.xml 2010-04-20 15:13:08 UTC (rev 16775)
+++ branches/community/3.3.X/samples/richfaces-demo/functional-test/profiles.jboss-qa.xml 2010-04-20 15:42:52 UTC (rev 16776)
@@ -131,19 +131,6 @@
</properties>
</profile>
<profile>
- <id>container-installation-jsf2</id>
- <activation>
- <property>
- <name>jsf2</name>
- </property>
- </activation>
- <properties>
- <jboss5x.version>5.1.0.GA</jboss5x.version>
- <jboss5x.installer.url.unix>file:/qa/home/hudson/lfryc/hudson-dependencies--keep/jboss-jsf2/jboss-${jboss5x.version}.zip</jboss5x.installer.url.unix>
- <jboss5x.installer.url.windows>file:h:\hudson\lfryc\hudson-dependencies--keep\jboss-jsf2\jboss-${jboss5x.version}.zip</jboss5x.installer.url.windows>
- </properties>
- </profile>
- <profile>
<id>container-tomcat6x-installation</id>
<activation>
<property>
14 years, 8 months
JBoss Rich Faces SVN: r16775 - in root/framework/trunk/impl/src: main/java/org/richfaces/context and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2010-04-20 11:13:08 -0400 (Tue, 20 Apr 2010)
New Revision: 16775
Added:
root/framework/trunk/impl/src/main/java/org/ajax4jsf/renderkit/IdSplitBuilder.java
root/framework/trunk/impl/src/test/java/org/ajax4jsf/renderkit/IdSplitBuilderTest.java
Modified:
root/framework/trunk/impl/src/main/java/org/richfaces/context/ComponentMatcherNode.java
Log:
https://jira.jboss.org/jira/browse/RF-7856
Added: root/framework/trunk/impl/src/main/java/org/ajax4jsf/renderkit/IdSplitBuilder.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/ajax4jsf/renderkit/IdSplitBuilder.java (rev 0)
+++ root/framework/trunk/impl/src/main/java/org/ajax4jsf/renderkit/IdSplitBuilder.java 2010-04-20 15:13:08 UTC (rev 16775)
@@ -0,0 +1,150 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.ajax4jsf.renderkit;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @author Nick Belaevski
+ */
+final class IdSplitBuilder {
+
+ private static final int INITIAL_SPLIT_LIST_SIZE = 3;
+
+ private enum State {
+ IN_ID (true) {
+
+ @Override
+ public State getNextState(char c) {
+ if (c == '[') {
+ return State.IN_ID_INSIDE_BRACKETS;
+ } else if (isSeparator(c)) {
+ return State.OUTSIDE_ID;
+ } else {
+ return this;
+ }
+ }
+ },
+ IN_ID_INSIDE_BRACKETS (true) {
+
+ @Override
+ public State getNextState(char c) {
+ if (c == ']') {
+ return State.IN_ID;
+ } else {
+ return this;
+ }
+ }
+ },
+ OUTSIDE_ID (false) {
+
+ @Override
+ public State getNextState(char c) {
+ if (!isSeparator(c)) {
+ if (c == '[') {
+ return State.IN_ID_INSIDE_BRACKETS;
+ } else {
+ return State.IN_ID;
+ }
+ }
+
+ return this;
+ }
+ };
+
+ private final boolean idSegment;
+
+ private State(boolean idSegment) {
+ this.idSegment = idSegment;
+ }
+
+ private static boolean isSeparator(char c) {
+ return c == ',' || Character.isWhitespace(c);
+ }
+
+ public abstract State getNextState(char c);
+
+ public boolean isIdSegment() {
+ return idSegment;
+ }
+
+ public void processChar(IdSplitBuilder builder, char c, int charIdx) {
+ State nextState = getNextState(c);
+
+ if (nextState.isIdSegment() ^ isIdSegment()) {
+ if (nextState.isIdSegment()) {
+ builder.setStartIndex(charIdx);
+ } else {
+ builder.flushBuilder(charIdx);
+ builder.setStartIndex(-1);
+ }
+ }
+
+ builder.state = nextState;
+ }
+ }
+
+ private int startIdx = -1;
+
+ private String sourceString;
+
+ private List<String> result = new ArrayList<String>(INITIAL_SPLIT_LIST_SIZE);
+
+ private State state = State.OUTSIDE_ID;
+
+ private IdSplitBuilder(String sourceString) {
+ super();
+ this.sourceString = sourceString;
+ }
+
+ private void setStartIndex(int idx) {
+ startIdx = idx;
+ }
+
+ private void flushBuilder(int endIdx) {
+ if (startIdx >= 0 && endIdx > startIdx) {
+ String id = sourceString.substring(startIdx, endIdx);
+ result.add(id);
+ }
+ }
+
+ private void build() {
+ int length = sourceString.length();
+ for (int i = 0; i < length; i++) {
+ char c = sourceString.charAt(i);
+ state.processChar(this, c, i);
+ }
+ flushBuilder(length);
+ }
+
+ private String[] getSplit() {
+ return result.toArray(new String[result.size()]);
+ }
+
+ public static String[] split(String s) {
+ IdSplitBuilder splitBuilder = new IdSplitBuilder(s);
+ splitBuilder.build();
+ return splitBuilder.getSplit();
+ }
+
+}
\ No newline at end of file
Modified: root/framework/trunk/impl/src/main/java/org/richfaces/context/ComponentMatcherNode.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/richfaces/context/ComponentMatcherNode.java 2010-04-20 15:05:30 UTC (rev 16774)
+++ root/framework/trunk/impl/src/main/java/org/richfaces/context/ComponentMatcherNode.java 2010-04-20 15:13:08 UTC (rev 16775)
@@ -48,6 +48,14 @@
private Set<String> subtreeIds;
+ private static boolean isEmpty(Collection<?> c) {
+ return c == null || c.isEmpty();
+ }
+
+ private static boolean isEmpty(Map<?, ?> m) {
+ return m == null || m.isEmpty();
+ }
+
void setParentNode(ComponentMatcherNode parentNode) {
this.parentNode = parentNode;
}
@@ -222,11 +230,11 @@
}
public boolean hasDirectIdChildren() {
- return idChildren != null && !idChildren.isEmpty();
+ return !isEmpty(idChildren);
}
public boolean hasDirectPatternChildren() {
- return patternChildren != null && !patternChildren.isEmpty();
+ return !isEmpty(patternChildren);
}
public boolean hasKidPatternNodes() {
@@ -257,6 +265,10 @@
return subtreeIds;
}
+ public boolean hasSubtreeIds() {
+ return !isEmpty(subtreeIds);
+ }
+
public void addAllSubtreeIds(Collection<String> ids) {
if (ids != null) {
if (subtreeIds == null) {
Added: root/framework/trunk/impl/src/test/java/org/ajax4jsf/renderkit/IdSplitBuilderTest.java
===================================================================
--- root/framework/trunk/impl/src/test/java/org/ajax4jsf/renderkit/IdSplitBuilderTest.java (rev 0)
+++ root/framework/trunk/impl/src/test/java/org/ajax4jsf/renderkit/IdSplitBuilderTest.java 2010-04-20 15:13:08 UTC (rev 16775)
@@ -0,0 +1,80 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.ajax4jsf.renderkit;
+
+import static org.junit.Assert.assertArrayEquals;
+
+import org.junit.Test;
+
+
+/**
+ * @author Nick Belaevski
+ *
+ */
+public class IdSplitBuilderTest {
+
+ private static String[] asArray(String... strings) {
+ return strings;
+ }
+
+ @Test
+ public void testEmptyString() throws Exception {
+ assertArrayEquals(asArray(), IdSplitBuilder.split(""));
+ assertArrayEquals(asArray(), IdSplitBuilder.split(" \r\t\n "));
+ }
+
+ @Test
+ public void testOneStrings() throws Exception {
+ assertArrayEquals(asArray("test"), IdSplitBuilder.split("test"));
+ assertArrayEquals(asArray("some:id"), IdSplitBuilder.split("some:id"));
+ assertArrayEquals(asArray("table:[1]"), IdSplitBuilder.split("table:[1]"));
+ assertArrayEquals(asArray("table:[1, 2]"), IdSplitBuilder.split("table:[1, 2]"));
+ assertArrayEquals(asArray("table:[1, 2]:nestedTable:[*]"), IdSplitBuilder.split("table:[1, 2]:nestedTable:[*]"));
+ assertArrayEquals(asArray("table:[1, 2]:[*]:group"), IdSplitBuilder.split("table:[1, 2]:[*]:group"));
+ assertArrayEquals(asArray("table:[1 2]:nestedTable:[*]"), IdSplitBuilder.split("table:[1 2]:nestedTable:[*]"));
+ assertArrayEquals(asArray("table:[1 2]:[*]:group"), IdSplitBuilder.split("table:[1 2]:[*]:group"));
+ }
+
+ @Test
+ public void testTwoStrings() throws Exception {
+ assertArrayEquals(asArray("test", "abc"), IdSplitBuilder.split("test abc"));
+ assertArrayEquals(asArray("some:id", "form:table"), IdSplitBuilder.split("some:id form:table"));
+ assertArrayEquals(asArray("test", "abc"), IdSplitBuilder.split("test, abc"));
+ assertArrayEquals(asArray("some:id", "form:table"), IdSplitBuilder.split("some:id, form:table"));
+
+ assertArrayEquals(asArray("test:[1 2 3]:abc", "form:[2]"), IdSplitBuilder.split("test:[1 2 3]:abc form:[2]"));
+ assertArrayEquals(asArray("[1 2]:some", "[3\t4]:id"), IdSplitBuilder.split(" [1 2]:some [3\t4]:id "));
+ }
+
+ @Test
+ public void testSeveralStrings() throws Exception {
+ assertArrayEquals(asArray("test", "abc", "def", "ghi"), IdSplitBuilder.split("test abc def ghi"));
+ assertArrayEquals(asArray("test:[1 2]abc", "def", "ghi"), IdSplitBuilder.split("test:[1 2]abc def ghi"));
+ assertArrayEquals(asArray("[1 2]abc", "[3, 4]def", "ghi[5 6 7]"),
+ IdSplitBuilder.split("[1 2]abc [3, 4]def ghi[5 6 7]"));
+
+ assertArrayEquals(
+ asArray("test:[1 2]:abc", "table", "form:table:[ * ]:child", "extTable:[ 0, 3 ]:child:[1 8]:@header"),
+ IdSplitBuilder.split(" test:[1 2]:abc, table," +
+ " form:table:[ * ]:child, extTable:[ 0, 3 ]:child:[1 8]:@header" ));
+ }
+}
14 years, 8 months