Author: estherbin
Date: 2008-05-29 08:39:23 -0400 (Thu, 29 May 2008)
New Revision: 8426
Added:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/comboBox/
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/comboBox/background-arrows.gif
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/comboBox/comboBox.css
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/comboBox/down.gif
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/fileUpload/
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/fileUpload/fileUpload.css
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/fileUpload/ico_add.gif
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/inplaceInput/
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/inplaceInput/applyButton.gif
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/inplaceInput/bg_shadow.png
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/inplaceInput/cancelButton.gif
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/inplaceInput/inplaceInput.css
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/inplaceInput/red_arrow.gif
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/inplaceInput/spacer.gif
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/inplaceSelect/
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/inplaceSelect/arrow.gif
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/inplaceSelect/bg_shadow.png
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/inplaceSelect/button_bg.gif
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/inplaceSelect/inplaceSelect.css
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/inplaceSelect/spacer.gif
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/pickList/
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/pickList/arrow_copy.gif
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/pickList/arrow_copy_all.gif
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/pickList/arrow_down.gif
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/pickList/arrow_first.gif
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/pickList/arrow_last.gif
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/pickList/arrow_remove.gif
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/pickList/arrow_remove_all.gif
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/pickList/arrow_up.gif
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/pickList/button.gif
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/pickList/header.gif
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/pickList/pickList.css
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/pickList/spacer.gif
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/progressBar/
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/progressBar/progressBar.css
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/progressBar/upload_status.gif
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesAbstractInplaceTemplate.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesColumnsTemplate.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesComboBoxTemplate.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesFileUploadTemplate.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesInplaceInputTemplate.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesInplaceSelectTemplate.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesPickListTemplate.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesProgressBarTemplate.java
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/ComponentUtil.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/AbstractRichFacesTemplate.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/util/RichFaces.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/templates/vpe-templates-richfaces.xml
Log:
Implements
http://jira.jboss.com/jira/browse/JBIDE-2196
Added:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/comboBox/background-arrows.gif
===================================================================
(Binary files differ)
Property changes on:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/comboBox/background-arrows.gif
___________________________________________________________________
Name: svn:mime-type
+ image/gif
Added:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/comboBox/comboBox.css
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/comboBox/comboBox.css
(rev 0)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/comboBox/comboBox.css 2008-05-29
12:39:23 UTC (rev 8426)
@@ -0,0 +1,92 @@
+.rich-combobox-font {
+ color: #000000;
+ font-family: Arial, Verdana, sans-serif;
+ font-size: 11px;
+}
+
+.rich-combobox {
+
+}
+
+.rich-combobox-shell {
+ position: relative;
+}
+
+.rich-combobox-font-disabled {
+ font-family: Arial, Verdana, sans-serif;
+ font-size: 11px;
+}
+
+input.rich-combobox-font-disabled {
+ color: #AAAAAA;
+}
+
+input.rich-combobox-input-inactive {
+ background-position: left top;
+ background-repeat: repeat-x;
+ border-left: 1px solid #000000;
+ border-style: solid;
+ border-top: 1px solid #000000;
+ border-width: 1px;
+ left: 0pt;
+ margin: 0pt;
+ padding-left: 3px;
+ position: absolute;
+ top: 0pt;
+ width: 240px;
+}
+
+.rich-combobox-input-inactive {
+ background-color: #FFFFFF;
+ border-bottom-color: #C4C0B9;
+ border-right-color: #C4C0B9;
+}
+
+.rich-combobox-font-inactive {
+ color: #000000;
+ font-family: Arial, Verdana, sans-serif;
+ font-size: 11px;
+}
+
+
+.rich-combobox-button-background {
+ background-color: #E3DED5;
+ background-image: url(background-arrows.jpg);
+}
+
+input.rich-combobox-button-inactive {
+ border-bottom: 1px solid #000000;
+ border-right: 1px solid #000000;
+ border-style: solid;
+ border-width: 1px;
+ margin: 0pt;
+ padding-left: 0pt;
+ padding-right: 0pt;
+ position: absolute;
+ right: 0pt;
+ top: 0pt;
+ width: 17px;
+}
+
+input.rich-combobox-button-inactive {
+ border-left-color: #C4C0B9;
+ border-top-color: #C4C0B9;
+}
+
+input.rich-combobox-button-icon-inactive {
+ background: transparent none no-repeat scroll center;
+ cursor: pointer;
+}
+
+input.rich-combobox-button-icon-inactive {
+ background-image: url(down.gif);
+}
+
+.rich-combobox-strut {
+ border: 1px solid #C0C0C0;
+ margin: 0pt;
+ padding-left: 3px;
+ position: relative;
+ visibility: hidden;
+ width: 240px;
+}
\ No newline at end of file
Property changes on:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/comboBox/comboBox.css
___________________________________________________________________
Name: svn:mime-type
+ text/css
Name: svn:eol-style
+ native
Added: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/comboBox/down.gif
===================================================================
(Binary files differ)
Property changes on:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/comboBox/down.gif
___________________________________________________________________
Name: svn:mime-type
+ image/gif
Added:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/fileUpload/fileUpload.css
===================================================================
---
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/fileUpload/fileUpload.css
(rev 0)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/fileUpload/fileUpload.css 2008-05-29
12:39:23 UTC (rev 8426)
@@ -0,0 +1,40 @@
+.rich-fileupload-list-decor {
+ background-color: #FFFFFF;
+ border: 1px solid #C4C0C9;
+}
+
+.rich-fileupload-toolbar-decor {
+ background-color: #F1EEE9;
+ border-bottom: 1px solid #C4C0C9;
+ border-left: 1px solid #FFFFFF;
+ border-top: 1px solid #FFFFFF;
+ padding: 2px;
+ width: 100%;
+}
+
+.rich-fileupload-button-border {
+ border: 1px solid #C4C0C9;
+ margin: 2px;
+}
+
+.rich-fileupload-button-content {
+ padding: 2px 6px 2px 3px;
+ text-align: left;
+ white-space: nowrap;
+}
+
+.rich-fileupload-font {
+ font-family: Arial, Verdana, sans-serif;
+ font-size: 11px;
+}
+
+.rich-fileupload-ico {
+ background-position: 0pt 50%;
+ background-repeat: no-repeat;
+ padding-left: 19px;
+ vertical-align: middle;
+}
+
+.rich-fileupload-ico-add {
+ background-image: url(ico_add.gif);
+}
\ No newline at end of file
Property changes on:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/fileUpload/fileUpload.css
___________________________________________________________________
Name: svn:mime-type
+ text/css
Name: svn:eol-style
+ native
Added:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/fileUpload/ico_add.gif
===================================================================
(Binary files differ)
Property changes on:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/fileUpload/ico_add.gif
___________________________________________________________________
Name: svn:mime-type
+ image/gif
Added:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/inplaceInput/applyButton.gif
===================================================================
(Binary files differ)
Property changes on:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/inplaceInput/applyButton.gif
___________________________________________________________________
Name: svn:mime-type
+ image/gif
Added:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/inplaceInput/bg_shadow.png
===================================================================
(Binary files differ)
Property changes on:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/inplaceInput/bg_shadow.png
___________________________________________________________________
Name: svn:mime-type
+ image/png
Added:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/inplaceInput/cancelButton.gif
===================================================================
(Binary files differ)
Property changes on:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/inplaceInput/cancelButton.gif
___________________________________________________________________
Name: svn:mime-type
+ image/gif
Added:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/inplaceInput/inplaceInput.css
===================================================================
---
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/inplaceInput/inplaceInput.css
(rev 0)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/inplaceInput/inplaceInput.css 2008-05-29
12:39:23 UTC (rev 8426)
@@ -0,0 +1,84 @@
+.rich-inplace-changed {
+ background-color: #F1F1F1;
+ background-image: url(red_arrow.gif);
+ border-bottom-color: #000000;
+ background-position: left top;
+ background-repeat: no-repeat;
+ border-bottom-style: dashed;
+ border-bottom-width: 1px;
+}
+
+.rich-inplace-view {
+ border:0px;
+ background-color: #F1F1F1;
+ border-bottom-color: #000000;
+ border-bottom-style: dashed;
+ border-bottom-width: 1px;
+
+ white-space: nowrap;
+}
+
+.rich-inplace-edit {
+
+}
+
+input.rich-inplace-field {
+ border-style: inset;
+ border-width: 1px;
+ left: 0pt;
+ margin: 0pt;
+ padding: 0pt;
+ position: relative;
+ top: 0pt;
+ background-color: #FEFFDA;
+ background-image: url(spacer.gif);
+ border-color: #C4C0B9;
+}
+
+.rich-inplace-input-controls-set {
+ white-space: nowrap;
+ z-index: 3;
+}
+
+.rich-inplace-shadow {
+ font-size: 11px;
+ position: absolute;
+}
+
+.rich-inplace-shadow-tl {
+ background-position: left top;
+ background-repeat: repeat-x;
+ border: 0pt none !important; .
+ background-image: url(bg_shadow.png);
+}
+
+.rich-inplace-shadow-tr {
+ background-position: right top;
+ background-repeat: repeat-x;
+ border: 0pt none !important;
+ background-image: url(bg_shadow.png);
+}
+
+.rich-inplace-shadow-bl {
+ background-position: left bottom;
+ background-repeat: repeat-x;
+ border: 0pt none !important;
+ background-image: url(bg_shadow.png);
+}
+
+.rich-inplace-shadow-br {
+ background-position: right bottom;
+ background-repeat: repeat-x;
+ border: 0pt none !important;
+ background-image: url(bg_shadow.png);
+}
+
+.rich-inplace-control {
+ background-position: center top;
+ background-repeat: repeat-x;
+ border-style: outset;
+ border-width: 1px;
+ margin: 0pt;
+ padding: 0pt;
+}
+
Property changes on:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/inplaceInput/inplaceInput.css
___________________________________________________________________
Name: svn:mime-type
+ text/css
Name: svn:eol-style
+ native
Added:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/inplaceInput/red_arrow.gif
===================================================================
(Binary files differ)
Property changes on:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/inplaceInput/red_arrow.gif
___________________________________________________________________
Name: svn:mime-type
+ image/gif
Added:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/inplaceInput/spacer.gif
===================================================================
(Binary files differ)
Property changes on:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/inplaceInput/spacer.gif
___________________________________________________________________
Name: svn:mime-type
+ image/gif
Added:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/inplaceSelect/arrow.gif
===================================================================
(Binary files differ)
Property changes on:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/inplaceSelect/arrow.gif
___________________________________________________________________
Name: svn:mime-type
+ image/gif
Added:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/inplaceSelect/bg_shadow.png
===================================================================
(Binary files differ)
Property changes on:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/inplaceSelect/bg_shadow.png
___________________________________________________________________
Name: svn:mime-type
+ image/png
Added:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/inplaceSelect/button_bg.gif
===================================================================
(Binary files differ)
Property changes on:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/inplaceSelect/button_bg.gif
___________________________________________________________________
Name: svn:mime-type
+ image/gif
Added:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/inplaceSelect/inplaceSelect.css
===================================================================
---
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/inplaceSelect/inplaceSelect.css
(rev 0)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/inplaceSelect/inplaceSelect.css 2008-05-29
12:39:23 UTC (rev 8426)
@@ -0,0 +1,186 @@
+.rich-inplace-view {
+ BORDER-BOTTOM-COLOR: #000;
+ BACKGROUND-COLOR: #f1f1f1
+}
+
+.rich-inplace-select-view {
+ border-bottom-style: dashed;
+ border-bottom-width: 1px;
+ white-space: nowrap;
+}
+
+.rich-inplace-select-edit {
+
+}
+
+input.rich-inplace-select-field {
+ border-style: inset;
+ border-width: 1px;
+ font-family: inherit;
+ font-size: inherit;
+ font-size-adjust: inherit;
+ font-stretch: inherit;
+ font-style: inherit;
+ font-variant: inherit;
+ font-weight: inherit;
+ left: 0pt;
+ line-height: inherit;
+ margin: 0pt;
+ padding: 0pt;
+ position: relative;
+ top: 0pt;
+}
+
+.rich-inplace-select-field {
+ border-style: inset;
+ border-width: 1px;
+ font-family: inherit;
+ font-size: inherit;
+ font-size-adjust: inherit;
+ font-stretch: inherit;
+ font-style: inherit;
+ font-variant: inherit;
+ font-weight: inherit;
+ left: 0pt;
+ line-height: inherit;
+ margin: 0pt;
+ padding: 0pt;
+ position: absolute;
+ top: 0pt;
+}
+
+input.rich-inplace-select-field {
+ background-color: #FEFFDA;
+ background-image: url(spacer.gif);
+ border-color: #C4C0B9;
+}
+
+.rich-inplace-select-field {
+ background-color: #FEFFDA;
+ border-color: #C4C0B9;
+}
+
+input.rich-inplace-select-arrow {
+ background-position: right center;
+ background-repeat: no-repeat;
+ border: 0pt none;
+ font-family: inherit;
+ font-size: inherit;
+ font-size-adjust: inherit;
+ font-stretch: inherit;
+ font-style: inherit;
+ font-variant: inherit;
+ font-weight: inherit;
+ line-height: inherit;
+ margin: 0pt;
+ padding: 0pt;
+ position: absolute;
+ width: 12px;
+}
+
+input.rich-inplace-select-arrow {
+ background-color: #FEFFDA;
+ background-image: url(arrow.gif);
+}
+
+.rich-inplace-select-shadow-tl {
+ background-position: left top;
+ background-repeat: repeat-x;
+ border: 0pt none !important;
+ background-image: url(bg_shadow.png);
+}
+
+.rich-inplace-select-shadow-tl {
+ background-position: left top;
+ background-repeat: repeat-x;
+ border: 0pt none !important;
+ background-image: url(bg_shadow.png);
+}
+
+.rich-inplace-select-shadow-tl {
+ background-position: left top;
+ background-repeat: repeat-x;
+ border: 0pt none !important;
+ background-image: url(bg_shadow.png);
+}
+
+.rich-inplace-select-shadow-br {
+ background-position: right bottom;
+ background-repeat: repeat-x;
+ border: 0pt none !important;
+ background-image: url(bg_shadow.png);
+}
+
+.rich-inplace-select-list-position {
+ left: 0pt;
+ position: absolute;
+ top: -1px;
+}
+
+.rich-inplace-select-list-decoration {
+ border-style: outset;
+ border-width: 1px;
+ padding: 0pt;
+ background-color: #FEFFDA;
+ border-color: #C4C0B9;
+}
+
+.rich-inplace-select-item {
+ display: block;
+ padding: 2px;
+}
+
+.rich-inplace-select-font {
+ white-space: nowrap;
+}
+
+.rich-inplace-select-control-set {
+ white-space: nowrap;
+}
+
+.rich-inplace-select-shadow {
+ font-size: 11px;
+ left: 0pt;
+ position: absolute;
+ top: 0pt;
+}
+
+.rich-inplace-select-shadow-tl {
+ background-position: left top;
+ background-repeat: repeat-x;
+ border: 0pt none !important;
+ background-image: url(bg_shadow.png);
+}
+
+.rich-inplace-select-shadow-tr {
+ background-position: right top;
+ background-repeat: repeat-x;
+ border: 0pt none !important;
+ background-image: url(bg_shadow.png);
+}
+
+.rich-inplace-select-shadow-bl {
+ background-position: left bottom;
+ background-repeat: repeat-x;
+ border: 0pt none !important;
+ background-image: url(bg_shadow.png);
+}
+
+.rich-inplace-select-shadow-br {
+ background-position: right bottom;
+ background-repeat: repeat-x;
+ border: 0pt none !important;
+ background-image: url(bg_shadow.png);
+}
+
+.rich-inplace-select-control {
+ background-position: center top;
+ background-repeat: repeat-x;
+ border-style: outset;
+ border-width: 1px;
+ margin: 0pt;
+ padding: 0pt;
+ background-color: #E3DED5;
+ background-image: url(button_bg.gif);
+ border-color: #C4C0B9;
+}
\ No newline at end of file
Property changes on:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/inplaceSelect/inplaceSelect.css
___________________________________________________________________
Name: svn:mime-type
+ text/css
Name: svn:eol-style
+ native
Added:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/inplaceSelect/spacer.gif
===================================================================
(Binary files differ)
Property changes on:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/inplaceSelect/spacer.gif
___________________________________________________________________
Name: svn:mime-type
+ image/gif
Copied:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/pickList/arrow_copy.gif
(from rev 8046,
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/shuttle/arrow_copy.gif)
===================================================================
(Binary files differ)
Copied:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/pickList/arrow_copy_all.gif
(from rev 8046,
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/shuttle/arrow_copy_all.gif)
===================================================================
(Binary files differ)
Copied:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/pickList/arrow_down.gif
(from rev 8046,
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/shuttle/arrow_down.gif)
===================================================================
(Binary files differ)
Copied:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/pickList/arrow_first.gif
(from rev 8046,
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/shuttle/arrow_first.gif)
===================================================================
(Binary files differ)
Copied:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/pickList/arrow_last.gif
(from rev 8046,
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/shuttle/arrow_last.gif)
===================================================================
(Binary files differ)
Copied:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/pickList/arrow_remove.gif
(from rev 8046,
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/shuttle/arrow_remove.gif)
===================================================================
(Binary files differ)
Copied:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/pickList/arrow_remove_all.gif
(from rev 8046,
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/shuttle/arrow_remove_all.gif)
===================================================================
(Binary files differ)
Copied:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/pickList/arrow_up.gif (from
rev 8046,
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/shuttle/arrow_up.gif)
===================================================================
(Binary files differ)
Copied: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/pickList/button.gif
(from rev 8046,
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/shuttle/button.gif)
===================================================================
(Binary files differ)
Copied: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/pickList/header.gif
(from rev 8046,
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/shuttle/header.gif)
===================================================================
(Binary files differ)
Added:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/pickList/pickList.css
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/pickList/pickList.css
(rev 0)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/pickList/pickList.css 2008-05-29
12:39:23 UTC (rev 8426)
@@ -0,0 +1,78 @@
+.rich-list-picklist {
+ moz-user-select: -moz-none;
+}
+.rich-picklist-list {
+ background-color:#FFFFFF;
+ border-style:none;
+ border-width:0pt;
+}
+.rich-picklist-target-items {
+ BORDER-RIGHT: #c4c0c9 1px solid;
+ BORDER-TOP: #c4c0c9 1px solid;
+ BORDER-LEFT: #c4c0c9 1px solid;
+ BORDER-BOTTOM: #c4c0c9 1px solid;
+ BACKGROUND-COLOR: #fff
+}
+
+.rich-picklist-source-items {
+ BORDER-RIGHT: #c4c0c9 1px solid;
+ BORDER-TOP: #c4c0c9 1px solid;
+ BORDER-LEFT: #c4c0c9 1px solid;
+ BORDER-BOTTOM: #c4c0c9 1px solid;
+ BACKGROUND-COLOR: #fff
+}
+
+.rich-picklist-controls {
+ PADDING-RIGHT: 8px;
+ PADDING-LEFT: 8px;
+ PADDING-BOTTOM: 5px;
+ PADDING-TOP: 0px
+}
+
+.rich-picklist-list-content {
+ overflow:auto;
+}
+
+.rich-picklist-control-button-class {
+ BORDER-RIGHT: 1px solid;
+ BORDER-TOP: 1px solid;
+ MARGIN-BOTTOM: 3px;
+ BORDER-LEFT: 1px solid;
+ BORDER-BOTTOM: 1px solid;
+ BORDER-LEFT-COLOR: #c4c0c9;
+ BORDER-BOTTOM-COLOR: #c4c0c9;
+ BORDER-TOP-COLOR: #c4c0c9;
+ BORDER-RIGHT-COLOR: #c4c0c9
+}
+
+.rich-list-picklist-button {
+ color: #000000;
+ font-family: Arial, Verdana, sans-serif;
+ font-size: 11px;
+ cursor: pointer;
+}
+.rich-list-picklist-button-content{
+ PADDING-RIGHT: 4px;
+ PADDING-LEFT: 1px;
+ PADDING-BOTTOM: 0px;
+ PADDING-TOP: 0px;
+ WHITE-SPACE: nowrap;
+ TEXT-ALIGN: left;
+ FONT-SIZE: 11px;
+ FONT-FAMILY: Arial,Verdana,sans-serif
+
+}
+.rich-list-picklist-button-content IMG {
+ VERTICAL-ALIGN: middle;
+ MARGIN-RIGHT: 2px
+}
+.rich-picklist-internal-tab {
+width:100%;
+}
+
+.rich-picklist-source-cell, .rich-picklist-target-cell, .rich-picklist-source-cell *,
.rich-picklist-target-cell * {
+color:#000000;
+font-family:Arial,Verdana,sans-serif;
+font-size:11px;
+white-space:nowrap;
+}
Property changes on:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/pickList/pickList.css
___________________________________________________________________
Name: svn:mime-type
+ text/css
Name: svn:eol-style
+ native
Added: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/pickList/spacer.gif
===================================================================
(Binary files differ)
Property changes on:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/pickList/spacer.gif
___________________________________________________________________
Name: svn:mime-type
+ image/gif
Added:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/progressBar/progressBar.css
===================================================================
---
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/progressBar/progressBar.css
(rev 0)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/progressBar/progressBar.css 2008-05-29
12:39:23 UTC (rev 8426)
@@ -0,0 +1,22 @@
+.rich-progress-bar-block {
+ white-space: nowrap;
+}
+
+.rich-progress-bar-width {
+ width: 200px;
+}
+
+.rich-progress-bar-shell {
+ border: 1px solid;
+ margin-bottom: 2px;
+}
+
+.rich-progress-bar-height {
+ height: 13px;
+}
+
+.rich-progress-bar-uploaded {
+ background-repeat: repeat-x;
+ background-color: #E79A00;
+ background-image: url(upload_status.gif);
+}
Property changes on:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/progressBar/progressBar.css
___________________________________________________________________
Name: svn:mime-type
+ text/css
Name: svn:eol-style
+ native
Added:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/progressBar/upload_status.gif
===================================================================
(Binary files differ)
Property changes on:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/progressBar/upload_status.gif
___________________________________________________________________
Name: svn:mime-type
+ image/gif
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/ComponentUtil.java
===================================================================
---
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/ComponentUtil.java 2008-05-29
12:37:27 UTC (rev 8425)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/ComponentUtil.java 2008-05-29
12:39:23 UTC (rev 8426)
@@ -8,8 +8,11 @@
* Contributors:
* Exadel, Inc. and Red Hat, Inc. - initial API and implementation
******************************************************************************/
+
+
package org.jboss.tools.jsf.vpe.richfaces;
+
import java.io.File;
import java.util.ArrayList;
import java.util.List;
@@ -20,7 +23,9 @@
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.IFileEditorInput;
import org.eclipse.ui.editors.text.ILocationProvider;
+import org.eclipse.wst.xml.core.internal.document.NodeListImpl;
import org.eclipse.wst.xml.core.internal.provisional.document.IDOMAttr;
+import org.jboss.tools.jsf.vpe.richfaces.template.util.RichFaces;
import org.jboss.tools.vpe.editor.bundle.BundleMap;
import org.jboss.tools.vpe.editor.context.VpePageContext;
import org.mozilla.interfaces.nsIDOMElement;
@@ -34,576 +39,694 @@
import org.w3c.dom.NodeList;
import org.w3c.dom.Text;
+
+/**
+ * The Class ComponentUtil.
+ */
public class ComponentUtil {
+
/**
+ *
+ */
+ private static final String EMPTY_SELECT_ITEM_VALUE =
"<f:selectItem/>";
+
+ /**
+ *
+ */
+ private static final String EMPTY_SELECT_ITEMS_VALUE =
"<f:selectItems/>";
+
+ /**
+ *
+ */
+ private static final String SELECT_ITEMS = "selectItems";
+
+ /** The Constant PX_SUFFIX. */
+ private static final String PX_SUFFIX = "px";
+
+ /** The Constant SELECT_ITEM. */
+ private static final String SELECT_ITEM = "selectItem";
+
+ /**
* Gets child of Facet element by name. If facet has a few children the
* method will return first one.
*
- * @param sourceElement
- * @param facetName
- * @param returnTextNode
- * return child text node if facet doesn't have any child
- * elements;
- * @return
+ * @param sourceElement the source element
+ * @param facetName the facet name
+ * @param returnTextNode return child text node if facet doesn't have any child
elements;
+ *
+ * @return the facet
*/
- public static Node getFacet(Element sourceElement, String facetName,
- boolean returnTextNode) {
- NodeList children = sourceElement.getChildNodes();
- for (int i = 0; i < children.getLength(); i++) {
- Node node = children.item(i);
- if (node instanceof Element && node.getNodeName() != null
- && node.getNodeName().indexOf(":facet") > 0) { //$NON-NLS-1$
- Element element = (Element) node;
- String name = element.getAttribute("name"); //$NON-NLS-1$
- if (facetName.equals(name)) {
- NodeList childNodes = element.getChildNodes();
- Text textNode = null;
- for (int j = 0; j < childNodes.getLength(); j++) {
- Node child = childNodes.item(j);
- if (child instanceof Element) {
- return child;
- } else if (child instanceof Text) {
- textNode = (Text) child;
- }
- }
- if (returnTextNode) {
- return textNode;
- }
- }
- }
- }
- return null;
+ public static Node getFacet(Element sourceElement, String facetName, boolean
returnTextNode) {
+ NodeList children = sourceElement.getChildNodes();
+ for (int i = 0; i < children.getLength(); i++) {
+ Node node = children.item(i);
+ if (node instanceof Element && node.getNodeName() != null &&
node.getNodeName().indexOf(":facet") > 0) { //$NON-NLS-1$
+ Element element = (Element) node;
+ String name = element.getAttribute("name"); //$NON-NLS-1$
+ if (facetName.equals(name)) {
+ NodeList childNodes = element.getChildNodes();
+ Text textNode = null;
+ for (int j = 0; j < childNodes.getLength(); j++) {
+ Node child = childNodes.item(j);
+ if (child instanceof Element) {
+ return child;
+ } else if (child instanceof Text) {
+ textNode = (Text) child;
+ }
+ }
+ if (returnTextNode) {
+ return textNode;
+ }
+ }
+ }
+ }
+ return null;
}
/**
* Gets all facets of sourceElement. If facet has a few children the method
* will return first one.
*
- * @param sourceElement
- * @param facetName
- * @param returnTextNode
- * return child text node if facet doesn't have any child
- * elements;
- * @return
+ * @param sourceElement the source element
+ * @param facetName *
+ * param returnTextNode return child text node if facet doesn't have
+ * any child elements;
+ * @param returnTextNode the return text node
+ *
+ * @return the facets
*/
- public static ArrayList<Node> getFacets(Element sourceElement,
- boolean returnTextNode) {
- ArrayList<Node> facets = new ArrayList<Node>();
- NodeList children = sourceElement.getChildNodes();
- for (int i = 0; i < children.getLength(); i++) {
- Node node = children.item(i);
- if (node instanceof Element &&
"f:facet".equals(node.getNodeName())) { //$NON-NLS-1$
- Element element = (Element) node;
- NodeList childNodes = element.getChildNodes();
- Text textNode = null;
- for (int j = 0; j < childNodes.getLength(); j++) {
- Node child = childNodes.item(j);
- if (child instanceof Element) {
- facets.add(child);
- break;
- } else if (child instanceof Text) {
- textNode = (Text) child;
- }
- }
- if (returnTextNode && facets.isEmpty()) {
- facets.add(textNode);
- }
- }
- }
- return facets;
+ public static ArrayList<Node> getFacets(Element sourceElement, boolean
returnTextNode) {
+ ArrayList<Node> facets = new ArrayList<Node>();
+ NodeList children = sourceElement.getChildNodes();
+ for (int i = 0; i < children.getLength(); i++) {
+ Node node = children.item(i);
+ if (node instanceof Element &&
"f:facet".equals(node.getNodeName())) { //$NON-NLS-1$
+ Element element = (Element) node;
+ NodeList childNodes = element.getChildNodes();
+ Text textNode = null;
+ for (int j = 0; j < childNodes.getLength(); j++) {
+ Node child = childNodes.item(j);
+ if (child instanceof Element) {
+ facets.add(child);
+ break;
+ } else if (child instanceof Text) {
+ textNode = (Text) child;
+ }
+ }
+ if (returnTextNode && facets.isEmpty()) {
+ facets.add(textNode);
+ }
+ }
+ }
+ return facets;
}
/**
* Gets child of Facet element by name. If facet has a few children the
* method will return first one.
*
- * @param sourceElement
- * @param facetName
- * @return
+ * @param sourceElement the source element
+ * @param facetName the facet name
+ *
+ * @return the facet
*/
public static Element getFacet(Element sourceElement, String facetName) {
- return (Element) getFacet(sourceElement, facetName, false);
+ return (Element) getFacet(sourceElement, facetName, false);
}
/**
* Returns true if "rendered" attribute of source element does not contain
* "false" value.
*
- * @param sourceElement
- * @return
+ * @param sourceElement the source element
+ *
+ * @return true, if is rendered
*/
public static boolean isRendered(Element sourceElement) {
- return !"false" //$NON-NLS-1$
- .equalsIgnoreCase(sourceElement.getAttribute("rendered")); //$NON-NLS-1$
+ return !"false" //$NON-NLS-1$
+ .equalsIgnoreCase(sourceElement.getAttribute("rendered"));
//$NON-NLS-1$
}
/**
* Sets CSS link in visual html document.
*
- * @param pageContext
- * @param cssHref
+ * @param ext the ext
+ * @param pageContext the page context
+ * @param cssHref the css href
*/
- public static void setCSSLink(VpePageContext pageContext, String cssHref,
- String ext) {
- String pluginPath = RichFacesTemplatesActivator.getPluginResourcePath();
- IPath pluginFile = new Path(pluginPath);
- File cssFile = pluginFile.append(cssHref).toFile();
- if (cssFile.exists()) {
- String cssPath = "file:///" + cssFile.getPath(); //$NON-NLS-1$
- pageContext.getVisualBuilder().replaceLinkNodeToHead(cssPath, ext);
- }
+ public static void setCSSLink(VpePageContext pageContext, String cssHref, String ext)
{
+ String pluginPath = RichFacesTemplatesActivator.getPluginResourcePath();
+ IPath pluginFile = new Path(pluginPath);
+ File cssFile = pluginFile.append(cssHref).toFile();
+ if (cssFile.exists()) {
+ String cssPath = "file:///" + cssFile.getPath(); //$NON-NLS-1$
+ pageContext.getVisualBuilder().replaceLinkNodeToHead(cssPath, ext);
+ }
}
+ /**
+ * Gets the absolute resource path.
+ *
+ * @param resourcePathInPlugin the resource path in plugin
+ *
+ * @return the absolute resource path
+ */
public static String getAbsoluteResourcePath(String resourcePathInPlugin) {
- String pluginPath = RichFacesTemplatesActivator.getPluginResourcePath();
- IPath pluginFile = new Path(pluginPath);
- File file = pluginFile.append(resourcePathInPlugin).toFile();
- if (file.exists()) {
- return file.getAbsolutePath();
- } else {
- throw new RuntimeException("Can't get path for " //$NON-NLS-1$
- + resourcePathInPlugin);
- }
+ String pluginPath = RichFacesTemplatesActivator.getPluginResourcePath();
+ IPath pluginFile = new Path(pluginPath);
+ File file = pluginFile.append(resourcePathInPlugin).toFile();
+ if (file.exists()) {
+ return file.getAbsolutePath();
+ } else {
+ throw new RuntimeException("Can't get path for " //$NON-NLS-1$
+ + resourcePathInPlugin);
+ }
}
/**
- * Adds image as attribute to IMG tag
+ * Adds image as attribute to IMG tag.
*
- * @param img
- * @param fileImageName
+ * @param img the img
+ * @param fileImageName the file image name
*/
public static void setImg(nsIDOMElement img, String fileImageName) {
- img.setAttribute("src", "file://" //$NON-NLS-1$//$NON-NLS-2$
- + getAbsoluteResourcePath(fileImageName));
+ img.setAttribute("src", "file://" //$NON-NLS-1$//$NON-NLS-2$
+ + getAbsoluteResourcePath(fileImageName));
}
/**
* Returns all child source elements of component but facets.
*
- * @param sourceElement
- * @param returnTextNodes
- * return child text nodes and elements or elements only;
- * @return
+ * @param sourceElement the source element
+ * @param returnTextNodes return child text nodes and elements or elements only;
+ *
+ * @return the children
*/
- public static List<Node> getChildren(Element sourceElement,
- boolean returnTextNodes) {
- ArrayList<Node> children = new ArrayList<Node>();
- NodeList nodeList = sourceElement.getChildNodes();
- for (int i = 0; i < nodeList.getLength(); i++) {
- Node child = nodeList.item(i);
- if ((child instanceof Element || returnTextNodes)
- && (!child.getNodeName().equals("f:facet"))) { //$NON-NLS-1$
- children.add(child);
- }
- }
- return children;
+ public static List<Node> getChildren(Element sourceElement, boolean
returnTextNodes) {
+ ArrayList<Node> children = new ArrayList<Node>();
+ NodeList nodeList = sourceElement.getChildNodes();
+ for (int i = 0; i < nodeList.getLength(); i++) {
+ Node child = nodeList.item(i);
+ if ((child instanceof Element || returnTextNodes) &&
(!child.getNodeName().equals("f:facet"))) { //$NON-NLS-1$
+ children.add(child);
+ }
+ }
+ return children;
}
/**
* Returns all child source elements of component but facets.
*
- * @param sourceElement
- * @return
+ * @param sourceElement the source element
+ *
+ * @return the children
*/
public static List<Node> getChildren(Element sourceElement) {
- return getChildren(sourceElement, false);
+ return getChildren(sourceElement, false);
}
/**
* Returns all child visual elements of component but facets.
*
- * @param visualElement
- * @param
- * @return returnTextNodes return child text nodes and elements or elements
- * only;
+ * @param returnTextNodes the return text nodes
+ * @param visualElement the visual element
+ *
+ * @return the children
+ *
+ * return returnTextNodes return child text nodes and elements or elements
+ * only;
*/
- public static List<nsIDOMNode> getChildren(nsIDOMElement visualElement,
- boolean returnTextNodes) {
- ArrayList<nsIDOMNode> children = new ArrayList<nsIDOMNode>();
- nsIDOMNodeList nodeList = visualElement.getChildNodes();
- for (int i = 0; i < nodeList.getLength(); i++) {
- nsIDOMNode child = nodeList.item(i);
- if ((child instanceof nsIDOMElement || returnTextNodes)
- && (!child.getNodeName().equals("f:facet"))) { //$NON-NLS-1$
- children.add(child);
- }
- }
- return children;
+ public static List<nsIDOMNode> getChildren(nsIDOMElement visualElement, boolean
returnTextNodes) {
+ ArrayList<nsIDOMNode> children = new ArrayList<nsIDOMNode>();
+ nsIDOMNodeList nodeList = visualElement.getChildNodes();
+ for (int i = 0; i < nodeList.getLength(); i++) {
+ nsIDOMNode child = nodeList.item(i);
+ if ((child instanceof nsIDOMElement || returnTextNodes) &&
(!child.getNodeName().equals("f:facet"))) { //$NON-NLS-1$
+ children.add(child);
+ }
+ }
+ return children;
}
/**
* Returns all child visual elements of component but facets.
*
- * @param visualElement
- * @return
+ * @param visualElement the visual element
+ *
+ * @return the children
*/
public static List<nsIDOMNode> getChildren(nsIDOMElement visualElement) {
- return getChildren(visualElement, false);
+ return getChildren(visualElement, false);
}
/**
* Copies all attributes from source node to visual node.
*
- * @param sourceNode
- * @param visualNode
+ * @param visualNode *
+ * param sourceNode the source node
+ * @param sourceNode the source node
+ * @param visualElement the visual element
*/
- public static void copyAttributes(Node sourceNode,
- nsIDOMElement visualElement) {
- NamedNodeMap namedNodeMap = sourceNode.getAttributes();
- for (int i = 0; i < namedNodeMap.getLength(); i++) {
- Node attribute = namedNodeMap.item(i);
- // added by Max Areshkau fix for JBIDE-1568
- try {
+ public static void copyAttributes(Node sourceNode, nsIDOMElement visualElement) {
+ NamedNodeMap namedNodeMap = sourceNode.getAttributes();
+ for (int i = 0; i < namedNodeMap.getLength(); i++) {
+ Node attribute = namedNodeMap.item(i);
+ // added by Max Areshkau fix for JBIDE-1568
+ try {
- visualElement.setAttribute(attribute.getNodeName(), attribute
- .getNodeValue());
- } catch (XPCOMException ex) {
- // if error-code not equals error for incorrect name throws
- // exception
- // error code is NS_ERROR_DOM_INVALID_CHARACTER_ERR=0x80530005
- if (ex.errorcode != 2152923141L) {
- throw ex;
- }
- // else we ignore this exception
- }
- }
+ visualElement.setAttribute(attribute.getNodeName(),
attribute.getNodeValue());
+ } catch (XPCOMException ex) {
+ // if error-code not equals error for incorrect name throws
+ // exception
+ // error code is NS_ERROR_DOM_INVALID_CHARACTER_ERR=0x80530005
+ if (ex.errorcode != 2152923141L) {
+ throw ex;
+ }
+ // else we ignore this exception
+ }
+ }
}
/**
* Copies attributes from source node to visual node.
*
- * @param attributes -
- * list names of attributes which will copy
- * @param sourceNode
- * @param visualNode
+ * @param sourceElement the source element
+ * @param attributes - list names of attributes which will copy
+ * @param visualNode *
+ * param sourceNode * @param visualElement the visual element
+ * @param visualElement the visual element
*/
- public static void copyAttributes(Element sourceElement,
- List<String> attributes, nsIDOMElement visualElement) {
+ public static void copyAttributes(Element sourceElement, List<String>
attributes, nsIDOMElement visualElement) {
- if (attributes == null)
- return;
+ if (attributes == null)
+ return;
- for (String attributeName : attributes) {
+ for (String attributeName : attributes) {
- String attributeValue = sourceElement.getAttribute(attributeName);
- if (attributeValue != null)
- visualElement.setAttribute(attributeName, attributeValue);
- }
+ String attributeValue = sourceElement.getAttribute(attributeName);
+ if (attributeValue != null)
+ visualElement.setAttribute(attributeName, attributeValue);
+ }
}
/**
- * Returns true if sourceNode is Facet
+ * Returns true if sourceNode is Facet.
*
- * @param sourceNode
- * @param facetName
- * @return
+ * @param sourceNode the source node
+ * @param facetName the facet name
+ *
+ * @return true, if is facet
*/
public static boolean isFacet(Node sourceNode, String facetName) {
- if (sourceNode != null && sourceNode instanceof Element
- && sourceNode.getNodeName().equals("f:facet")) { //$NON-NLS-1$
- String name = ((Element) sourceNode).getAttribute("name"); //$NON-NLS-1$
- if (facetName.equals(name)) {
- return true;
- }
- }
- return false;
+ if (sourceNode != null && sourceNode instanceof Element &&
sourceNode.getNodeName().equals("f:facet")) { //$NON-NLS-1$
+ String name = ((Element) sourceNode).getAttribute("name");
//$NON-NLS-1$
+ if (facetName.equals(name)) {
+ return true;
+ }
+ }
+ return false;
}
/**
* Returns Style with default background image for default RichFaces skin.
*
- * @return
+ * @return the header backgound img style
*/
public static String getHeaderBackgoundImgStyle() {
- return getBackgoundImgStyle("common/background.gif"); //$NON-NLS-1$
+ return getBackgoundImgStyle("common/background.gif"); //$NON-NLS-1$
}
/**
* Returns Style with background image for default RichFaces skin.
*
- * @return
+ * @param imagePath the image path
+ *
+ * @return the backgound img style
*/
public static String getBackgoundImgStyle(String imagePath) {
- String imgPath = ComponentUtil.getAbsoluteResourcePath(imagePath);
- String style = "background-image: url(file:///" //$NON-NLS-1$
- + imgPath.replace('\\', '/') + ");"; //$NON-NLS-1$
- return style;
+ String imgPath = ComponentUtil.getAbsoluteResourcePath(imagePath);
+ String style = "background-image: url(file:///" //$NON-NLS-1$
+ + imgPath.replace('\\', '/') + ");";
//$NON-NLS-1$
+ return style;
}
// public static createStyleClass(String content){
- //
+ //
// }
/**
* Returns value of attribute.
*
- * @param sourceElement
- * @param attributeName
- * @return
+ * @param sourceElement the source element
+ * @param attributeName the attribute name
+ *
+ * @return the attribute
*/
- public static String getAttribute(Element sourceElement,
- String attributeName) {
- String attribute = sourceElement.getAttribute(attributeName);
- if (attribute == null) {
- attribute = ""; //$NON-NLS-1$
- }
- return attribute;
+ public static String getAttribute(Element sourceElement, String attributeName) {
+ String attribute = sourceElement.getAttribute(attributeName);
+ if (attribute == null) {
+ attribute = ""; //$NON-NLS-1$
+ }
+ return attribute;
}
/**
* Returns value of attribute.
*
- * @param sourceElement
- * @param attributeName
- * @return
+ * @param sourceElement the source element
+ * @param attributeName the attribute name
+ *
+ * @return the attribute
*/
- public static String getAttribute(nsIDOMElement sourceElement,
- String attributeName) {
- String attribute = sourceElement.getAttribute(attributeName);
- if (attribute == null) {
- attribute = ""; //$NON-NLS-1$
- }
- return attribute;
+ public static String getAttribute(nsIDOMElement sourceElement, String attributeName)
{
+ String attribute = sourceElement.getAttribute(attributeName);
+ if (attribute == null) {
+ attribute = ""; //$NON-NLS-1$
+ }
+ return attribute;
}
/**
- * @param style
- * @param name
- * @return
+ * Parameter present.
+ *
+ * @param style the style
+ * @param name the name
+ *
+ * @return true, if parameter present
*/
public static boolean parameterPresent(String style, String name) {
- if (style != null && style.length() > 0) {
- String[] styles = style.split(";"); //$NON-NLS-1$
- for (int i = 0; i < styles.length; i++) {
- String[] pair = styles[i].split(":"); //$NON-NLS-1$
- if (pair[0].trim().equals(name)) {
- return true;
- }
- }
- }
- return false;
+ if (style != null && style.length() > 0) {
+ String[] styles = style.split(";"); //$NON-NLS-1$
+ for (int i = 0; i < styles.length; i++) {
+ String[] pair = styles[i].split(":"); //$NON-NLS-1$
+ if (pair[0].trim().equals(name)) {
+ return true;
+ }
+ }
+ }
+ return false;
}
/**
- * @param style
- * @param name
- * @return
+ * Gets the style parametr.
+ *
+ * @param style the style
+ * @param name the name
+ *
+ * @return the style parametr
*/
public static String getStyleParametr(String style, String name) {
- if (style != null && style.length() > 0) {
- String[] styles = style.split(";"); //$NON-NLS-1$
- for (int i = 0; i < styles.length; i++) {
- String[] pair = styles[i].split(":"); //$NON-NLS-1$
- if (pair[0].trim().equals(name)) {
- return pair[1].trim();
- }
- }
- }
- return null;
+ if (style != null && style.length() > 0) {
+ String[] styles = style.split(";"); //$NON-NLS-1$
+ for (int i = 0; i < styles.length; i++) {
+ String[] pair = styles[i].split(":"); //$NON-NLS-1$
+ if (pair[0].trim().equals(name)) {
+ return pair[1].trim();
+ }
+ }
+ }
+ return null;
}
/**
+ * Adds the parameter.
*
- * @param style
- * @param element
- * @return
+ * @param element the element
+ * @param style the style
+ *
+ * @return the string
*/
public static String addParameter(String style, String element) {
- String s = style.trim();
- return style + (s.length() == 0 || s.endsWith(";") ? "" :
";") //$NON-NLS-1$//$NON-NLS-2$//$NON-NLS-3$
- + element;
+ String s = style.trim();
+ return style + (s.length() == 0 || s.endsWith(";") ? "" :
";") //$NON-NLS-1$//$NON-NLS-2$//$NON-NLS-3$
+ + element;
}
/**
- * Adds image as attribute to IMG tag from users worcpace
+ * Adds image as attribute to IMG tag from users worcpace.
*
- * @param pageContext
- * Page Context
- * @param img
- * img element to which set picture
- * @param fileImageName
- * image name
- * @param undefinedImgName
- * default image when image is undefined
+ * @param img img element to which set picture
+ * @param pageContext Page Context
+ * @param undefinedImgName default image when image is undefined
+ * @param fileImageName image name
*/
- public static void setImgFromResources(VpePageContext pageContext,
- nsIDOMElement img, String fileImageName, String undefinedImgName) {
- IEditorInput input = pageContext.getEditPart().getEditorInput();
- IPath inputPath = getInputParentPath(input);
- File file = new File(inputPath.toOSString() + File.separator
- + fileImageName);
- if (file.exists()) {
- img.setAttribute(HtmlComponentUtil.HTML_ATR_SRC,
- HtmlComponentUtil.FILE_PROTOCOL + inputPath.toOSString()
- + File.separator + fileImageName);
- } else {
- img.setAttribute(HtmlComponentUtil.HTML_ATR_SRC, undefinedImgName);
- }
+ public static void setImgFromResources(VpePageContext pageContext, nsIDOMElement img,
String fileImageName, String undefinedImgName) {
+ IEditorInput input = pageContext.getEditPart().getEditorInput();
+ IPath inputPath = getInputParentPath(input);
+ File file = new File(inputPath.toOSString() + File.separator + fileImageName);
+ if (file.exists()) {
+ img.setAttribute(HtmlComponentUtil.HTML_ATR_SRC,
HtmlComponentUtil.FILE_PROTOCOL + inputPath.toOSString() + File.separator
+ + fileImageName);
+ } else {
+ img.setAttribute(HtmlComponentUtil.HTML_ATR_SRC, undefinedImgName);
+ }
}
/**
- * Open file
+ * Open file.
*
- * @param pageContext
- * Page Context
- * @param fileName
- * file name
+ * @param fileName file name
+ * @param pageContext Page Context
+ *
* @return file
*/
public static File openFile(VpePageContext pageContext, String fileName) {
- IEditorInput input = pageContext.getEditPart().getEditorInput();
- IPath inputPath = getInputParentPath(input);
- File file = new File(inputPath.toOSString() + File.separator + fileName);
- return file;
+ IEditorInput input = pageContext.getEditPart().getEditorInput();
+ IPath inputPath = getInputParentPath(input);
+ File file = new File(inputPath.toOSString() + File.separator + fileName);
+ return file;
}
/**
- * Returns locale of user input
+ * Returns locale of user input.
*
- * @param input
- * @return
+ * @param input the input
+ *
+ * @return the input parent path
*/
public static IPath getInputParentPath(IEditorInput input) {
- IPath inputPath = null;
- if (input instanceof ILocationProvider) {
- inputPath = ((ILocationProvider) input).getPath(input);
- } else if (input instanceof IFileEditorInput) {
- IFile inputFile = ((IFileEditorInput) input).getFile();
- if (inputFile != null) {
- inputPath = inputFile.getLocation();
- }
- }
- if (inputPath != null && !inputPath.isEmpty()) {
- inputPath = inputPath.removeLastSegments(1);
- }
- return inputPath;
+ IPath inputPath = null;
+ if (input instanceof ILocationProvider) {
+ inputPath = ((ILocationProvider) input).getPath(input);
+ } else if (input instanceof IFileEditorInput) {
+ IFile inputFile = ((IFileEditorInput) input).getFile();
+ if (inputFile != null) {
+ inputPath = inputFile.getLocation();
+ }
+ }
+ if (inputPath != null && !inputPath.isEmpty()) {
+ inputPath = inputPath.removeLastSegments(1);
+ }
+ return inputPath;
}
/**
- * Move attributes from sourceNode to html
+ * Move attributes from sourceNode to html.
*
- * @param sourceNode
- * @param visualNode
- * @param attrName
- * @param htmlAttrName
- * @param prefValue
- * @param defValue
+ * @param visualNode the visual node
+ * @param sourceNode the source node
+ * @param htmlAttrName the html attr name
+ * @param defValue the def value
+ * @param attrName the attr name
+ * @param prefValue the pref value
*/
- public static void correctAttribute(Element sourceNode,
- nsIDOMElement visualNode, String attrName, String htmlAttrName,
- String prefValue, String defValue) {
- String attrValue = ((Element) sourceNode).getAttribute(attrName);
- if (prefValue != null && prefValue.trim().length() > 0
- && attrValue != null) {
- attrValue = prefValue.trim() + " " + attrValue; //$NON-NLS-1$
- }
- if (attrValue != null) {
- visualNode.setAttribute(htmlAttrName, attrValue);
- } else if (defValue != null) {
- visualNode.setAttribute(htmlAttrName, defValue);
- } else
- visualNode.removeAttribute(attrName);
+ public static void correctAttribute(Element sourceNode, nsIDOMElement visualNode,
String attrName, String htmlAttrName,
+ String prefValue, String defValue) {
+ String attrValue = ((Element) sourceNode).getAttribute(attrName);
+ if (prefValue != null && prefValue.trim().length() > 0 &&
attrValue != null) {
+ attrValue = prefValue.trim() + " " + attrValue; //$NON-NLS-1$
+ }
+ if (attrValue != null) {
+ visualNode.setAttribute(htmlAttrName, attrValue);
+ } else if (defValue != null) {
+ visualNode.setAttribute(htmlAttrName, defValue);
+ } else
+ visualNode.removeAttribute(attrName);
}
/**
* Parses string value retrieved from sourceElement.getAttribure(..) method
* to its boolean value.
* <p>
- * <code>false</code> is returned only if it specified explicitly,
- * otherwise <code>true</code> is returned.
+ * <code>false</code> is returned only if it specified explicitly,
otherwise
+ * <code>true</code> is returned.
*
- * @param str
- * the string to parse
+ * @param str the string to parse
+ *
* @return boolean value from string
*/
public static boolean string2boolean(String str) {
- if ((str == null) || ("".equals(str))) { //$NON-NLS-1$
- return true;
- } else if (("true".equalsIgnoreCase(str)) //$NON-NLS-1$
- || ("false".equalsIgnoreCase(str))) { //$NON-NLS-1$
- return new Boolean(str).booleanValue();
- }
- return true;
+ if ((str == null) || ("".equals(str))) { //$NON-NLS-1$
+ return true;
+ } else if (("true".equalsIgnoreCase(str)) //$NON-NLS-1$
+ || ("false".equalsIgnoreCase(str))) { //$NON-NLS-1$
+ return new Boolean(str).booleanValue();
+ }
+ return true;
}
/**
- * find elements by name
+ * find elements by name.
*
- * @param node -
- * current node
- * @param elements -
- * list of found elements
- * @param name -
- * name element
+ * @param node - current node
+ * @param name - name element
+ * @param elements - list of found elements
*/
- static public void findElementsByName(Node node, List<Node> elements,
- String name) {
- // get children
- NodeList children = node.getChildNodes();
- for (int i = 0; i < children.getLength(); i++) {
- Node child = children.item(i);
- // if current child is required then add his to list
- if (name.equalsIgnoreCase((child.getNodeName()))) {
- elements.add(child);
- } else {
- findElementsByName(child, elements, name);
- }
- }
+ static public void findElementsByName(Node node, List<Node> elements, String
name) {
+ // get children
+ NodeList children = node.getChildNodes();
+ for (int i = 0; i < children.getLength(); i++) {
+ Node child = children.item(i);
+ // if current child is required then add his to list
+ if (name.equalsIgnoreCase((child.getNodeName()))) {
+ elements.add(child);
+ } else {
+ findElementsByName(child, elements, name);
+ }
+ }
}
/**
- * find all elements by name
+ * find all elements by name.
*
- * @param node -
- * current node
- * @param elements -
- * list of found elements
- * @param name -
- * name element
+ * @param node - current node
+ * @param name - name element
+ * @param elements - list of found elements
*/
- static public void findAllElementsByName(nsIDOMNode node,
- List<nsIDOMNode> elements, String name) {
+ static public void findAllElementsByName(nsIDOMNode node, List<nsIDOMNode>
elements, String name) {
- try {
- nsIDOMNodeList list = node.getChildNodes();
- if (node.getNodeName().equalsIgnoreCase(name)) {
- elements.add(node);
- }
- for (int i = 0; i < list.getLength(); i++) {
- findAllElementsByName(list.item(i), elements, name);
- }
- } catch (XPCOMException e) {
- // Ignore
- return;
- }
+ try {
+ nsIDOMNodeList list = node.getChildNodes();
+ if (node.getNodeName().equalsIgnoreCase(name)) {
+ elements.add(node);
+ }
+ for (int i = 0; i < list.getLength(); i++) {
+ findAllElementsByName(list.item(i), elements, name);
+ }
+ } catch (XPCOMException e) {
+ // Ignore
+ return;
+ }
}
/**
+ * Gets the bundle value.
*
- * @param pageContext
- * @param value
- * @param offfset
- * @return
+ * @param value the value
+ * @param offfset *
+ * param pageContext the page context
+ * @param pageContext the page context
+ * @param offset the offset
+ *
+ * @return the bundle value
*/
- public static String getBundleValue(VpePageContext pageContext,
- String value, int offset) {
- BundleMap bundle = pageContext.getBundle();
- return bundle.getBundleValue(value, offset);
+ public static String getBundleValue(VpePageContext pageContext, String value, int
offset) {
+ BundleMap bundle = pageContext.getBundle();
+ return bundle.getBundleValue(value, offset);
}
/**
- * get bundle
+ * get bundle.
*
- * @param pageContext
- * @param attr
- * @return
+ * @param pageContext the page context
+ * @param attr the attr
+ *
+ * @return the bundle value
*/
public static String getBundleValue(VpePageContext pageContext, Attr attr) {
- return getBundleValue(pageContext, attr.getNodeValue(),
- ((IDOMAttr) attr).getValueRegionStartOffset());
+ return getBundleValue(pageContext, attr.getNodeValue(), ((IDOMAttr)
attr).getValueRegionStartOffset());
}
+ /**
+ * Parses the width height value.
+ *
+ * @param value the value
+ *
+ * @return the integer
+ */
+ public static Integer parseWidthHeightValue(String value) {
+ Integer rst = null;
+
+ if ((value == null) || (value.trim().length() == 0)) {
+ throw new NumberFormatException("Passed value is empty ");
+ }
+
+ if (value.endsWith(PX_SUFFIX)) {
+ rst = Integer.parseInt(value.substring(0, value.length() - 2));
+ } else {
+ rst = Integer.parseInt(value);
+ }
+
+ return rst;
+ }
+
+ /**
+ * Checks if is blank.
+ *
+ * @param value the value
+ *
+ * @return true, if is blank
+ */
+ public static boolean isBlank(String value) {
+ return ((value == null) || (value.trim().length() == 0));
+ }
+
+ /**
+ * Checks if is not blank.
+ *
+ * @param value the value
+ *
+ * @return true, if is not blank
+ */
+ public static boolean isNotBlank(String value) {
+ return !isBlank(value);
+ }
+
+ /**
+ * Gets the select items.
+ *
+ * @param children the children
+ *
+ * @return the select items
+ */
+ public static List<Element> getSelectItems(NodeList children) {
+ final List<Element> selectItems = new ArrayList<Element>();
+
+ for (int i = 0; i < children.getLength(); i++) {
+ final Node child = children.item(i);
+
+ if ((child instanceof Element) &&
(child.getNodeName().indexOf(SELECT_ITEM)) > 1) {
+ selectItems.add((Element) child);
+ }
+ }
+ return selectItems;
+ }
+
+ /**
+ * @param e
+ * @return
+ */
+ public static String getSelectItemValue(Element e) {
+ String value = e.getAttribute(RichFaces.ATTR_SELECT_ITEM_LABEL);
+
+ if (isBlank(value)) {
+ value = e.getAttribute(RichFaces.ATTR_SELECT_ITEM_VALUE);
+ if (ComponentUtil.isBlank(value)) {
+ if (e.getNodeName().endsWith(SELECT_ITEMS)) {
+ value = e.getAttribute(RichFaces.ATTR_VALUE);
+
+ if (ComponentUtil.isBlank(value)) {
+ value = EMPTY_SELECT_ITEMS_VALUE;
+ }
+ } else if (e.getNodeName().endsWith(SELECT_ITEM)) {
+ value = EMPTY_SELECT_ITEM_VALUE;
+ }
+ }
+ }
+ return value;
+ }
+
}
\ No newline at end of file
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/AbstractRichFacesTemplate.java
===================================================================
---
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/AbstractRichFacesTemplate.java 2008-05-29
12:37:27 UTC (rev 8425)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/AbstractRichFacesTemplate.java 2008-05-29
12:39:23 UTC (rev 8426)
@@ -16,13 +16,27 @@
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
-public abstract class AbstractRichFacesTemplate extends VpeAbstractTemplate {
- /**
- * Getting value attribute by name
- *
- * @param nameAttr
- * name of attribute
- * @return value of attribute
+/**
+ * The Class AbstractRichFacesTemplate.
+ */
+public abstract class AbstractRichFacesTemplate extends VpeAbstractTemplate {
+
+ /** The source style. */
+ protected String sourceStyle;
+
+ /** The source style class. */
+ protected String sourceStyleClass;
+
+ /** The source width. */
+ protected String sourceWidth;
+
+ /**
+ * Getting value attribute by name.
+ *
+ * @param sourceNode the source node
+ * @param nameAttr name of attribute
+ *
+ * @return value of attribute
*/
public String getAttribute(String nameAttr, Node sourceNode) {
String returnValue = "";
@@ -37,13 +51,13 @@
return returnValue;
}
- /**
- *
- * @param nameAttr
- * name of attribute
- * @param sourceNode
- * The current node of the source tree.
- * @return True if value of attribute is empty or attribute dont exist
+ /**
+ * Checks if is empty attribute.
+ *
+ * @param sourceNode The current node of the source tree.
+ * @param nameAttr name of attribute
+ *
+ * @return True if value of attribute is empty or attribute dont exist
*/
public boolean isEmptyAttribute(String nameAttr, Node sourceNode) {
@@ -51,11 +65,12 @@
}
- /**
- *
- * @param sourceNode
- * The current node of the source tree.
- * @return
+ /**
+ * Parses the style.
+ *
+ * @param sourceNode The current node of the source tree.
+ *
+ * @return the string
*/
public String parseStyle(Node sourceNode) {
String style = getAttribute("style", sourceNode);
@@ -74,11 +89,12 @@
return str;
}
- /**
- *
- * @param sourceNode
- * The current node of the source tree.
- * @return width value
+ /**
+ * Parses the style width.
+ *
+ * @param sourceNode The current node of the source tree.
+ *
+ * @return width value
*/
public String parseStyleWidth(Node sourceNode) {
Added:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesAbstractInplaceTemplate.java
===================================================================
---
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesAbstractInplaceTemplate.java
(rev 0)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesAbstractInplaceTemplate.java 2008-05-29
12:39:23 UTC (rev 8426)
@@ -0,0 +1,544 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2008 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at
http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
+
+package org.jboss.tools.jsf.vpe.richfaces.template;
+
+
+import java.text.MessageFormat;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.jboss.tools.jsf.vpe.richfaces.ComponentUtil;
+import org.jboss.tools.jsf.vpe.richfaces.HtmlComponentUtil;
+import org.jboss.tools.jsf.vpe.richfaces.template.util.RichFaces;
+import org.jboss.tools.vpe.editor.VpeVisualDomBuilder;
+import org.jboss.tools.vpe.editor.context.VpePageContext;
+import org.jboss.tools.vpe.editor.template.VpeToggableTemplate;
+import org.jboss.tools.vpe.editor.util.HTML;
+import org.mozilla.interfaces.nsIDOMDocument;
+import org.mozilla.interfaces.nsIDOMElement;
+import org.mozilla.interfaces.nsIDOMNode;
+import org.mozilla.interfaces.nsIDOMText;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+
+
+/**
+ * Base class for both {@link RichFacesInplaceInputTemplate} and {@link
+ * RichFacesInplaceSelectTemplate}.
+ *
+ * @author Eugene Stherbin
+ * @see RichFacesInplaceInputTemplate
+ * @see RichFacesInplaceSelectTemplate
+ */
+public abstract class RichFacesAbstractInplaceTemplate extends AbstractRichFacesTemplate
implements VpeToggableTemplate {
+
+ /**
+ *
+ */
+ private static final String CONTROLS_VERTICAL_POSITION_DEFAULT_VALUE =
"center";
+
+ /**
+ *
+ */
+ private static final String CONTROLS_HORIZONTAL_POSITION_DEFAULT_VALUE =
"right";
+
+ /** The Constant APPLY_BUTTON_GIF. */
+ protected static final String APPLY_BUTTON_GIF = "/applyButton.gif";
+
+ /** The Constant CANCEL_BUTTON_GIF. */
+ protected static final String CANCEL_BUTTON_GIF = "/cancelButton.gif";
+
+ /** The Constant controlsVerticalPositions. */
+ protected final Map<String, String> controlsVerticalPositions = new
HashMap<String, String>();
+
+ /** The Constant DEFAULT_INPUT_WIDTH_VALUE. */
+ protected static final String DEFAULT_INPUT_WIDTH_VALUE = "66px";
+
+ /** The Constant DEFAULT_NULL_VALUE. */
+ protected static final String DEFAULT_NULL_VALUE = "null";
+
+ /** The Constant DEFAULT_VERTICAL_POSITION. */
+ protected static final String DEFAULT_VERTICAL_POSITION = null;
+
+ /** The Constant defaultButtonImages. */
+ protected static final Map<String, String> defaultButtonImages = new
HashMap<String, String>();
+
+ /** The default style classes. */
+ protected static final Map<String, String> defaultStyleClasses = new
HashMap<String, String>();
+
+ /** The Constant RICH_INPLACE_VIEW_DEFAULT_STYLE_CLASS. */
+ protected static final String RICH_INPLACE_VIEW_DEFAULT_STYLE_CLASS =
"rich-inplace-view";
+
+ /** The Constant VPE_USER_TOGGLE_ID_ATTR. */
+ protected static final String VPE_USER_TOGGLE_ID_ATTR =
"vpe-user-toggle-id";
+
+ /** The button images. */
+ protected final Map<String, String> buttonImages = new HashMap<String,
String>();
+
+ /** The controls horizontal position. */
+ protected String controlsHorizontalPosition;
+
+ /** The controls horizontal positions. */
+ protected final Map<String, String> controlsHorizontalPositions = new
HashMap<String, String>();
+
+ /** The controls vertical position. */
+ protected String controlsVerticalPosition;
+
+ /** The default label. */
+ protected String defaultLabel;
+
+ /** The edit class. */
+ protected String editClass;
+
+ /** The is show input. */
+ protected boolean isToggle = false;
+
+ /** The show controls. */
+ protected boolean showControls;
+
+ /** The source value. */
+ protected String sourceValue;
+
+ /** The Constant SPACER_GIF. */
+ protected final String SPACER_GIF = getCssExtension()+"/spacer.gif";
+
+ /** The style class. */
+ protected String styleClass;
+
+ /** The view class. */
+ protected String viewClass;
+
+ /**
+ * The Constructor.
+ */
+ public RichFacesAbstractInplaceTemplate() {
+ super();
+ initDefaultStyleClasses();
+ initDefaultButtonImages();
+ initPositions();
+ }
+
+
+
+ /**
+ * Creates the root span template method.
+ *
+ * @param visualDocument the visual document
+ * @param source the source
+ *
+ * @return the ns IDOM element
+ */
+ protected nsIDOMElement createRootSpanTemplateMethod(Element source, nsIDOMDocument
visualDocument) {
+ final nsIDOMElement rootSpan =
visualDocument.createElement(HtmlComponentUtil.HTML_TAG_SPAN);
+ // if(!(this.showControls && this.isToggle)){
+ rootSpan.setAttribute(VPE_USER_TOGGLE_ID_ATTR, String.valueOf(this.isToggle));
+ // }
+ final String rootClass =
MessageFormat.format(defaultStyleClasses.get("rootSpan"),
getRootSpanClasses());
+ rootSpan.setAttribute(HTML.ATTR_CLASS, rootClass);
+ String style = "";
+ if (this.isToggle) {
+ style = "position: relative;";
+ }
+ rootSpan.setAttribute(HTML.ATTR_STYLE, style);
+ return rootSpan;
+
+ }
+
+
+ /**
+ * Gets the css extension.
+ *
+ * @return the css extension
+ */
+ protected abstract String getCssExtension();
+
+ /**
+ * Gets the css style.
+ *
+ * @return the css style
+ */
+ protected abstract String getCssStyle();
+
+ /**
+ * Gets the css styles suffix.
+ *
+ * @return the css styles suffix
+ */
+ protected abstract String getCssStylesSuffix();
+
+ /**
+ * Gets the root span classes.
+ *
+ * @return the root span classes
+ */
+ protected abstract Object[] getRootSpanClasses();
+
+ /**
+ * Gets the value.
+ *
+ * @return the value
+ */
+ protected String getValue() {
+ String rst = "";
+ if (ComponentUtil.isNotBlank(this.defaultLabel)) {
+ rst = this.defaultLabel;
+ } else if (ComponentUtil.isBlank(this.defaultLabel) &&
ComponentUtil.isNotBlank(this.sourceValue)) {
+ rst = this.sourceValue;
+ } else {
+ rst = DEFAULT_NULL_VALUE;
+ }
+ return rst;
+ }
+
+ /**
+ * Inits the default button images.
+ */
+ protected void initDefaultButtonImages() {
+ if (defaultButtonImages.isEmpty()) {
+ defaultButtonImages.put("cancelControlIcon", getCssExtension() +
CANCEL_BUTTON_GIF);
+ defaultButtonImages.put("saveControlIcon", getCssExtension() +
APPLY_BUTTON_GIF);
+ }
+
+ }
+
+ /**
+ * Inits the default style classes.
+ */
+ protected void initDefaultStyleClasses() {
+ if (defaultStyleClasses.isEmpty()) {
+ defaultStyleClasses.put("rootSpan", "rich-inplace" +
getCssStylesSuffix() + " {0} {1}");
+ }
+
+ }
+
+ /**
+ * Inits the positions.
+ */
+ protected void initPositions() {
+ if (controlsVerticalPositions.isEmpty()) {
+ controlsVerticalPositions.put("bottom", "18px");
+ controlsVerticalPositions.put("top", "-12px");
+ controlsVerticalPositions.put(CONTROLS_VERTICAL_POSITION_DEFAULT_VALUE,
"0px");
+ }
+ if (controlsHorizontalPositions.isEmpty()) {
+ controlsHorizontalPositions.put("left", "0px");
+ controlsHorizontalPositions.put(CONTROLS_VERTICAL_POSITION_DEFAULT_VALUE,
"53px");
+ }
+ }
+
+ /**
+ * Checks if is in key set.
+ *
+ * @param controlsVerticalPosition2 *
+ * param value2 the value2
+ * @param value2 the value2
+ * @param map the map
+ * @param controlsVerticalPositions2 *
+ *
+ * @return true, if is in key set
+ */
+ protected boolean isInKeySet(Map<String, String> map, String value2) {
+ boolean rst = false;
+ for (String key : map.keySet()) {
+ if (key.equalsIgnoreCase(value2)) {
+ rst = true;
+ break;
+ }
+ }
+ return rst;
+ }
+
+ /**
+ * Checks if is recreate at attr change.
+ *
+ * @param sourceElement the source element
+ * @param value the value
+ * @param visualDocument the visual document
+ * @param visualNode the visual node
+ * @param data the data
+ * @param pageContext the page context
+ * @param name the name
+ *
+ * @return true, if is recreate at attr change
+ */
+ @Override
+ public boolean isRecreateAtAttrChange(VpePageContext pageContext, Element
sourceElement, nsIDOMDocument visualDocument,
+ nsIDOMElement visualNode, Object data, String name, String value) {
+ return true;
+ }
+
+ /**
+ * Prepare data.
+ *
+ * @param source the source
+ */
+ protected void prepareData(Element source) {
+ this.styleClass = source.getAttribute(RichFaces.ATTR_STYLE_CLASS);
+ this.editClass = source.getAttribute("editClass");
+ this.viewClass = source.getAttribute("viewClass");
+ this.sourceValue = source.getAttribute(RichFaces.ATTR_VALUE);
+ this.defaultLabel = source.getAttribute("defaultLabel");
+ if (ComponentUtil.isBlank(this.sourceValue)) {
+ this.sourceValue = DEFAULT_NULL_VALUE;
+ }
+
+ this.showControls =
Boolean.parseBoolean(source.getAttribute("showControls"));
+ this.controlsVerticalPosition =
source.getAttribute("controlsVerticalPosition");
+ if (ComponentUtil.isBlank(this.controlsVerticalPosition) ||
!isInKeySet(controlsVerticalPositions, this.controlsVerticalPosition)) {
+ this.controlsVerticalPosition = CONTROLS_VERTICAL_POSITION_DEFAULT_VALUE;
+ }
+ this.controlsHorizontalPosition =
source.getAttribute("controlsHorizontalPosition");
+
+ if (ComponentUtil.isBlank(this.controlsHorizontalPosition)
+ || !isInKeySet(controlsHorizontalPositions,
this.controlsHorizontalPosition)) {
+ this.controlsHorizontalPosition =
CONTROLS_HORIZONTAL_POSITION_DEFAULT_VALUE;
+ }
+
+ prepareImages(source);
+
+ }
+
+ /**
+ * Prepare images.
+ *
+ * @param source the source
+ */
+ protected void prepareImages(Element source) {
+ for (String key : defaultButtonImages.keySet()) {
+ String value = ComponentUtil.getAttribute(source, key);
+ // if (ComponentUtil.isNotBlank(value)) {
+ // this.buttonImages.put(key, value);
+ // } else {
+ this.buttonImages.put(key, defaultButtonImages.get(key));
+ // }
+ }
+
+ }
+
+ /**
+ * Read attributes.
+ *
+ * @param source the source
+ */
+ protected void readAttributes(Element source) {
+ this.styleClass = ComponentUtil.getAttribute(source,
RichFaces.ATTR_STYLE_CLASS);
+ this.sourceValue = ComponentUtil.getAttribute(source, RichFaces.ATTR_VALUE);
+
+ }
+
+ /**
+ * Removes the attribute.
+ *
+ * @param sourceElement the source element
+ * @param visualDocument the visual document
+ * @param visualNode the visual node
+ * @param data the data
+ * @param pageContext the page context
+ * @param name the name
+ */
+ @Override
+ public void removeAttribute(VpePageContext pageContext, Element sourceElement,
nsIDOMDocument visualDocument, nsIDOMNode visualNode,
+ Object data, String name) {
+ super.removeAttribute(pageContext, sourceElement, visualDocument, visualNode,
data, name);
+ final nsIDOMElement span = (nsIDOMElement)
visualNode.queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID);
+
+ if (RichFaces.ATTR_STYLE_CLASS.equals(name)) {
+ span.setAttribute(HTML.ATTR_CLASS, DEFAULT_NULL_VALUE);
+ } else if (RichFaces.ATTR_VALUE.equals(name)) {
+ span.removeChild(span.getFirstChild());
+ span.appendChild(visualDocument.createTextNode(DEFAULT_NULL_VALUE));
+ }
+
+ }
+
+ /**
+ * Sets the attribute.
+ *
+ * @param sourceElement the source element
+ * @param value the value
+ * @param visualDocument the visual document
+ * @param visualNode the visual node
+ * @param data the data
+ * @param pageContext the page context
+ * @param name the name
+ */
+ @Override
+ public void setAttribute(VpePageContext pageContext, Element sourceElement,
nsIDOMDocument visualDocument, nsIDOMNode visualNode,
+ Object data, String name, String value) {
+ super.setAttribute(pageContext, sourceElement, visualDocument, visualNode, data,
name, value);
+
+ final nsIDOMElement span = (nsIDOMElement)
visualNode.queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID);
+ if (RichFaces.ATTR_VALUE.equals(name)) {
+ final nsIDOMText text = visualDocument.createTextNode(((value == null) ||
(value.length() == 0) ? DEFAULT_NULL_VALUE : value));
+
+ span.removeChild(span.getFirstChild());
+ span.appendChild(text);
+ } else if (RichFaces.ATTR_STYLE_CLASS.equals(name)) {
+ span.setAttribute(HTML.ATTR_CLASS, ((value == null) || (value.length() == 0)
? RICH_INPLACE_VIEW_DEFAULT_STYLE_CLASS : value));
+ }
+ }
+
+ /**
+ * Sets the up img.
+ *
+ * @param i * @param width the width
+ * @param height the height
+ * @param img the img
+ * @param image the image
+ * @param j * @param border the border
+ * @param td1Img */
+ protected void setUpImg(nsIDOMElement img, int width, int height, int border, String
image) {
+ ComponentUtil.setImg(img, image);
+ img.setAttribute(HTML.ATTR_WIDTH, String.valueOf(width));
+ img.setAttribute(HTML.ATTR_HEIGHT, String.valueOf(height));
+ img.setAttribute(HTML.ATTR_BORDER, String.valueOf(border));
+
+ }
+
+ /**
+ * Sets the up span root.
+ *
+ * @param visualDocument the visual document
+ * @param spanRoot the span root
+ * @param source the source
+ */
+ protected void setUpSpanRoot(nsIDOMElement spanRoot, Element source, nsIDOMDocument
visualDocument) {
+ if (this.styleClass.length() > 0) {
+ spanRoot.setAttribute(HTML.ATTR_CLASS, this.styleClass);
+ } else {
+ spanRoot.setAttribute(HTML.ATTR_CLASS,
RICH_INPLACE_VIEW_DEFAULT_STYLE_CLASS);
+ }
+ String value = DEFAULT_NULL_VALUE;
+ if (this.sourceValue.length() > 0) {
+ value = this.sourceValue;
+ }
+ final nsIDOMText text = visualDocument.createTextNode(value);
+ spanRoot.appendChild(text);
+ }
+
+
+ /**
+ * Stop toggling.
+ *
+ * @param sourceNode the source node
+ *
+ * @see
+ * org.jboss.tools.vpe.editor.template.VpeToggableTemplate#stopToggling(
+ * org.w3c.dom.Node)
+ */
+ public void stopToggling(Node sourceNode) {
+ this.isToggle = false;
+ }
+
+ /**
+ * Toggle.
+ *
+ * @param builder the builder
+ * @param sourceNode the source node
+ * @param toggleId the toggle id
+ *
+ * @see
+ * org.jboss.tools.vpe.editor.template.VpeToggableTemplate#toggle(org.jboss
+ * .tools.vpe.editor.VpeVisualDomBuilder, org.w3c.dom.Node,
+ * java.lang.String)
+ */
+ public void toggle(VpeVisualDomBuilder builder, Node sourceNode, String toggleId) {
+ isToggle = !isToggle;
+
+ }
+
+
+ /**
+ * Creates the controls div.
+ *
+ * @param visualDocument the visual document
+ * @param sourceNode the source node
+ * @param pageContext the page context
+ *
+ * @return the ns IDOM element
+ */
+ protected nsIDOMElement createControlsDiv(VpePageContext pageContext, Node
sourceNode, nsIDOMDocument visualDocument) {
+ final nsIDOMElement element =
visualDocument.createElement(HtmlComponentUtil.HTML_TAG_DIV);
+
+ element.setAttribute(HTML.ATTR_CLASS,
"rich-inplace"+getCssStylesSuffix()+"-controls-set");
+ element.setAttribute(HTML.ATTR_STYLE, "position: absolute; top: " +
controlsVerticalPositions.get(this.controlsVerticalPosition)
+ + ";left:" + " " +
controlsHorizontalPositions.get(this.controlsHorizontalPosition) + ";");
+
+ final nsIDOMElement divShadov =
visualDocument.createElement(HtmlComponentUtil.HTML_TAG_DIV);
+
+ divShadov.setAttribute(HTML.ATTR_CLASS,
"rich-inplace"+getCssExtension()+"-shadow");
+ final nsIDOMElement divShadovTable =
visualDocument.createElement(HtmlComponentUtil.HTML_TAG_TABLE);
+ divShadovTable.setAttribute(HTML.ATTR_CELLPADDING, "0");
+ divShadovTable.setAttribute(HTML.ATTR_CELLSPACING, "0");
+ divShadovTable.setAttribute(HTML.ATTR_BORDER, "0");
+ final nsIDOMElement divShadovTBody =
visualDocument.createElement(HtmlComponentUtil.HTML_TAG_TBODY);
+ final nsIDOMElement divShadovTr1 =
visualDocument.createElement(HtmlComponentUtil.HTML_TAG_TR);
+ final nsIDOMElement divShadovTr2 =
visualDocument.createElement(HtmlComponentUtil.HTML_TAG_TR);
+ final nsIDOMElement divShadovTd1 =
visualDocument.createElement(HtmlComponentUtil.HTML_TAG_TD);
+ final nsIDOMElement divShadovTd2 =
visualDocument.createElement(HtmlComponentUtil.HTML_TAG_TD);
+ final nsIDOMElement divShadovTd1Tr2 =
visualDocument.createElement(HtmlComponentUtil.HTML_TAG_TD);
+ final nsIDOMElement divShadovTd2Tr2 =
visualDocument.createElement(HtmlComponentUtil.HTML_TAG_TD);
+
+ final nsIDOMElement td1Img =
visualDocument.createElement(HtmlComponentUtil.HTML_TAG_IMG);
+ final nsIDOMElement td2Img =
visualDocument.createElement(HtmlComponentUtil.HTML_TAG_IMG);
+ final nsIDOMElement td3Img =
visualDocument.createElement(HtmlComponentUtil.HTML_TAG_IMG);
+ final nsIDOMElement td4Img =
visualDocument.createElement(HtmlComponentUtil.HTML_TAG_IMG);
+ setUpImg(td1Img, 10, 1, 0, SPACER_GIF);
+ setUpImg(td2Img, 1, 10, 0, SPACER_GIF);
+ setUpImg(td3Img, 1, 10, 0, SPACER_GIF);
+ setUpImg(td4Img, 10, 1, 0, SPACER_GIF);
+ divShadovTd1.setAttribute(HTML.ATTR_CLASS,
"rich-inplace"+getCssStylesSuffix()+"-shadow-tl");
+ divShadovTd2.setAttribute(HTML.ATTR_CLASS,
"rich-inplace"+getCssStylesSuffix()+"-shadow-tr");
+
+ divShadovTd1Tr2.setAttribute(HTML.ATTR_CLASS,
"rich-inplace"+getCssStylesSuffix()+"-shadow-bl");
+ divShadovTd2Tr2.setAttribute(HTML.ATTR_CLASS,
"rich-inplace"+getCssStylesSuffix()+"-shadow-br");
+
+ final nsIDOMElement divButtons =
visualDocument.createElement(HtmlComponentUtil.HTML_TAG_DIV);
+ divButtons.setAttribute(HTML.ATTR_STYLE, "position: relative; height:
18px;");
+ final nsIDOMElement applyButtonImg =
visualDocument.createElement(HtmlComponentUtil.HTML_TAG_INPUT);
+
+ applyButtonImg.setAttribute(HTML.ATTR_TYPE, "image");
+ applyButtonImg.setAttribute(HTML.ATTR_CLASS,
"rich-inplace"+getCssStylesSuffix()+"-control");
+ ComponentUtil.setImg(applyButtonImg,
buttonImages.get("saveControlIcon"));
+ applyButtonImg.setAttribute(VPE_USER_TOGGLE_ID_ATTR, String.valueOf(0));
+
+ final nsIDOMElement cancelButtonImg =
visualDocument.createElement(HtmlComponentUtil.HTML_TAG_INPUT);
+
+ cancelButtonImg.setAttribute(HTML.ATTR_TYPE, "image");
+ cancelButtonImg.setAttribute(HTML.ATTR_CLASS,
"rich-inplace"+getCssStylesSuffix()+"-control");
+ cancelButtonImg.setAttribute(VPE_USER_TOGGLE_ID_ATTR, String.valueOf(0));
+ ComponentUtil.setImg(cancelButtonImg,
buttonImages.get("cancelControlIcon"));
+
+ cancelButtonImg.setAttribute(HTML.ATTR_TYPE, "image");
+
+ element.appendChild(divShadov);
+ element.appendChild(divButtons);
+ divButtons.appendChild(applyButtonImg);
+ divButtons.appendChild(cancelButtonImg);
+ divShadov.appendChild(divShadovTable);
+ divShadovTable.appendChild(divShadovTBody);
+ divShadovTBody.appendChild(divShadovTr1);
+ divShadovTr1.appendChild(divShadovTd1);
+ divShadovTd1.appendChild(td1Img);
+ divShadovTr1.appendChild(divShadovTd2);
+ divShadovTd2.appendChild(td2Img);
+
+ divShadovTBody.appendChild(divShadovTr2);
+ divShadovTr2.appendChild(divShadovTd1Tr2);
+ divShadovTd1Tr2.appendChild(td3Img);
+ divShadovTr2.appendChild(divShadovTd2Tr2);
+ divShadovTd2Tr2.appendChild(td4Img);
+ return element;
+ }
+
+}
Property changes on:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesAbstractInplaceTemplate.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native
Added:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesColumnsTemplate.java
===================================================================
---
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesColumnsTemplate.java
(rev 0)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesColumnsTemplate.java 2008-05-29
12:39:23 UTC (rev 8426)
@@ -0,0 +1,110 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2008 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at
http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
+
+package org.jboss.tools.jsf.vpe.richfaces.template;
+
+
+import java.util.List;
+
+import org.jboss.tools.jsf.vpe.richfaces.ComponentUtil;
+import org.jboss.tools.jsf.vpe.richfaces.HtmlComponentUtil;
+import org.jboss.tools.jsf.vpe.richfaces.template.util.RichFaces;
+import org.jboss.tools.vpe.editor.context.VpePageContext;
+import org.jboss.tools.vpe.editor.template.VpeChildrenInfo;
+import org.jboss.tools.vpe.editor.template.VpeCreationData;
+import org.jboss.tools.vpe.editor.util.HTML;
+import org.mozilla.interfaces.nsIDOMDocument;
+import org.mozilla.interfaces.nsIDOMElement;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+
+
+/**
+ * Template for the <rich:columns/>.
+ *
+ * @author Eugene Stherbin
+ */
+public class RichFacesColumnsTemplate extends AbstractRichFacesTemplate {
+
+ /** The Constant DEFAULT_CLASSES. */
+ private static final String DEFAULT_CLASSES = "dr-table-cell
rich-table-cell";
+
+ /**
+ * Create.
+ *
+ * @param visualDocument the visual document
+ * @param sourceNode the source node
+ * @param pageContext the page context
+ *
+ * @return the vpe creation data
+ *
+ * @see
+ * org.jboss.tools.vpe.editor.template.VpeTemplate#create(org.jboss.tools
+ * .vpe.editor.context.VpePageContext, org.w3c.dom.Node,
+ * org.mozilla.interfaces.nsIDOMDocument)
+ */
+ public VpeCreationData create(VpePageContext pageContext, Node sourceNode,
nsIDOMDocument visualDocument) {
+ final Element sourceElement = (Element) sourceNode;
+ final nsIDOMElement td =
visualDocument.createElement(HtmlComponentUtil.HTML_TAG_TD);
+ prepareData(sourceElement);
+ final VpeCreationData data = new VpeCreationData(td);
+ // Create mapping to Encode body
+ final VpeChildrenInfo tdInfo = new VpeChildrenInfo(td);
+
+ String clazz = DEFAULT_CLASSES;
+ if(ComponentUtil.isNotBlank(this.sourceStyleClass)){
+ clazz = clazz+" "+this.sourceStyleClass;
+ }
+ if(ComponentUtil.isNotBlank(this.sourceWidth)){
+ td.setAttribute(RichFaces.ATTR_WIDTH, this.sourceWidth);
+ }
+ td.setAttribute(HTML.ATTR_CLASS, clazz);
+ td.setAttribute(HTML.ATTR_STYLE, this.sourceStyle);
+
+ final List<Node> children = ComponentUtil.getChildren(sourceElement,
true);
+ for (Node child : children) {
+ tdInfo.addSourceChild(child);
+ }
+ data.addChildrenInfo(tdInfo);
+ return data;
+ }
+
+ /**
+ * @param sourceElement
+ */
+ private void prepareData(Element sourceElement) {
+ this.sourceStyleClass = ComponentUtil.getAttribute(sourceElement,
RichFaces.ATTR_STYLE_CLASS);
+ this.sourceStyle = ComponentUtil.getAttribute(sourceElement, HTML.ATTR_STYLE);
+ this.sourceWidth = ComponentUtil.getAttribute(sourceElement,
RichFaces.ATTR_WIDTH);
+
+ }
+
+ /**
+ * Checks if is recreate at attr change.
+ *
+ * @param sourceElement the source element
+ * @param value the value
+ * @param visualDocument the visual document
+ * @param visualNode the visual node
+ * @param data the data
+ * @param pageContext the page context
+ * @param name the name
+ *
+ * @return true, if is recreate at attr change
+ */
+ @Override
+ public boolean isRecreateAtAttrChange(VpePageContext pageContext, Element
sourceElement, nsIDOMDocument visualDocument,
+ nsIDOMElement visualNode, Object data, String name, String value) {
+ return true;
+ }
+
+}
Property changes on:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesColumnsTemplate.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native
Added:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesComboBoxTemplate.java
===================================================================
---
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesComboBoxTemplate.java
(rev 0)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesComboBoxTemplate.java 2008-05-29
12:39:23 UTC (rev 8426)
@@ -0,0 +1,504 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Exadel, Inc. and Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at
http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
+
+package org.jboss.tools.jsf.vpe.richfaces.template;
+
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.jboss.tools.jsf.vpe.richfaces.ComponentUtil;
+import org.jboss.tools.jsf.vpe.richfaces.HtmlComponentUtil;
+import org.jboss.tools.jsf.vpe.richfaces.template.util.RichFaces;
+import org.jboss.tools.vpe.editor.context.VpePageContext;
+import org.jboss.tools.vpe.editor.mapping.VpeAttributeData;
+import org.jboss.tools.vpe.editor.mapping.VpeElementData;
+import org.jboss.tools.vpe.editor.template.VpeCreationData;
+import org.jboss.tools.vpe.editor.util.HTML;
+import org.jboss.tools.vpe.editor.util.VpeStyleUtil;
+import org.jboss.tools.vpe.xulrunner.browser.util.DOMTreeDumper;
+import org.mozilla.interfaces.nsIDOMDocument;
+import org.mozilla.interfaces.nsIDOMElement;
+import org.mozilla.interfaces.nsIDOMNode;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+
+
+/**
+ * The Class RichFacesComboBox2Template.
+ *
+ * @author Eugene Stherbin
+ */
+public class RichFacesComboBoxTemplate extends AbstractEditableRichFacesTemplate {
+
+ /** CSS_FILE_NAME. */
+ private static final String CSS_FILE_NAME = "comboBox/comboBox.css";
+
+ private static final String DEFAULT_ALIGN = "left";
+
+ /** DEFAULT_INPUT_SIZE. */
+ private static final String DEFAULT_INPUT_SIZE = "10";
+
+ /** DEFAULT_INPUT_STYLE. */
+ private static final String DEFAULT_INPUT_STYLE =
"rich-combobox-default-input";
+
+ private static final String DEFAULT_LIST_WIDTH = "150px";
+
+ private static final String DEFAULT_WIDTH = "width : 150px";
+
+ /** IMAGE_NAME_DOWN. */
+ private static final String IMAGE_NAME_DOWN = "/comboBox/down.gif";
+
+ /** The Constant RICH_COMBOBOX_BUTTON_STYLE_CLASS. */
+ private static final String RICH_COMBOBOX_BUTTON_STYLE_CLASS =
"rich-combobox-button";
+
+ /** The Constant RICH_COMBOBOX_IMAGE_STYLE_CLASS. */
+ private static final String RICH_COMBOBOX_IMAGE_STYLE_CLASS =
"rich-combobox-image";
+
+ /** The Constant RICH_COMBOBOX_INPUT_CELL_STYLE. */
+ private static final String RICH_COMBOBOX_INPUT_CELL_STYLE =
"rich-combobox-inputCell";
+
+ private static final String SECOND_INPUT = "secondInput";
+
+ /** The Constant STYLE_EXT. */
+ private static final String STYLE_EXT = "richFacesComboBox";
+
+ private static Map<String, String> styleClasess = new HashMap<String,
String>();
+
+ /** The Constant ZERO_STRING. */
+ private static final String ZERO_STRING = "0";
+
+ private String sourceAlign;
+
+ private String sourceButtonStyle;
+
+ private String sourceDefaultLabel = null;
+
+ private String sourceListHeight;
+
+ private String sourceListWidth;
+
+ private String sourceValue;
+
+ private String sourceWidth;
+
+ /**
+ *
+ */
+ public RichFacesComboBoxTemplate() {
+ super();
+ initDefaultClasses();
+ }
+
+ private String calculateWithForDiv(String with, int minus) {
+ try {
+ Integer intValue = 0;
+ if (with.endsWith("px")) {
+ intValue = Integer.parseInt(with.substring(0, with.length() - 2));
+ } else {
+ intValue = Integer.parseInt(with);
+ }
+ return String.valueOf((intValue - minus)) + String.valueOf("px");
+ } catch (NumberFormatException e) {
+ System.err.println(e.getMessage());
+ return with;
+ }
+
+ }
+
+
+ public VpeCreationData create(VpePageContext pageContext, Node sourceNode,
nsIDOMDocument visualDocument) {
+ ComponentUtil.setCSSLink(pageContext, CSS_FILE_NAME, STYLE_EXT);
+
+ final Element source = (Element) sourceNode;
+
+ prepareData(source);
+ final nsIDOMElement rootDiv =
visualDocument.createElement(HtmlComponentUtil.HTML_TAG_DIV);
+ final nsIDOMElement secondDiv =
visualDocument.createElement(HtmlComponentUtil.HTML_TAG_DIV);
+ secondDiv.setAttribute("align", this.sourceAlign);
+ secondDiv.setAttribute(HTML.ATTR_CLASS,
styleClasess.get("secondDiv"));
+ // TODO add ATTR_STYLE.
+ secondDiv.setAttribute(HTML.ATTR_STYLE, VpeStyleUtil.PARAMETER_WIDTH +
VpeStyleUtil.COLON_STRING + this.sourceListWidth);
+ final nsIDOMElement thirdDiv =
visualDocument.createElement(HtmlComponentUtil.HTML_TAG_DIV);
+ thirdDiv.setAttribute(HTML.ATTR_CLASS, styleClasess.get("thirdDiv"));
+ thirdDiv.setAttribute(HTML.ATTR_STYLE, VpeStyleUtil.PARAMETER_WIDTH +
VpeStyleUtil.COLON_STRING + this.sourceWidth
+ + "; z-index: 1;");
+
+ final nsIDOMElement thirdEmptyDiv =
visualDocument.createElement(HtmlComponentUtil.HTML_TAG_DIV);
+ thirdEmptyDiv.setAttribute(HTML.ATTR_CLASS,
styleClasess.get("thirdEmptyDiv"));
+
+ final nsIDOMElement firstInput =
visualDocument.createElement(HtmlComponentUtil.HTML_TAG_INPUT);
+ firstInput.setAttribute(HTML.ATTR_TYPE, "text");
+ ;
+ firstInput.setAttribute(HTML.ATTR_CLASS,
styleClasess.get("firstInput"));
+ firstInput.setAttribute("autocomplete", "off");
+ firstInput.setAttribute(HTML.ATTR_STYLE, "width: " +
calculateWithForDiv(this.sourceWidth, 17));
+ String value = null;
+ if (ComponentUtil.isNotBlank(this.sourceDefaultLabel)) {
+ value = this.sourceDefaultLabel;
+ } else if (ComponentUtil.isNotBlank(this.sourceValue) &&
ComponentUtil.isBlank(this.sourceDefaultLabel)) {
+ value = this.sourceValue;
+ }
+
+ if (value != null) {
+ firstInput.setAttribute(RichFaces.ATTR_VALUE, value);
+ }
+ final nsIDOMElement secondInput =
visualDocument.createElement(HtmlComponentUtil.HTML_TAG_INPUT);
+ secondInput.setAttribute(HTML.ATTR_TYPE, "text");
+ ;
+ secondInput.setAttribute(HTML.ATTR_CLASS, styleClasess.get(SECOND_INPUT));
+ secondInput.setAttribute("readonly", String.valueOf(Boolean.TRUE));
+ if (this.sourceButtonStyle != null) {
+ secondInput.setAttribute(HTML.ATTR_STYLE, sourceButtonStyle);
+ }
+ //
+ final nsIDOMElement thirdInput =
visualDocument.createElement(HtmlComponentUtil.HTML_TAG_INPUT);
+ thirdInput.setAttribute(HTML.ATTR_TYPE, "text");
+ ;
+ thirdInput.setAttribute(HTML.ATTR_CLASS,
styleClasess.get("thirdInput"));
+ thirdInput.setAttribute("readonly", String.valueOf(Boolean.TRUE));
+ if (this.sourceButtonStyle != null) {
+ thirdInput.setAttribute(HTML.ATTR_STYLE, sourceButtonStyle);
+ }
+
+ final nsIDOMElement forthEmptyDiv =
visualDocument.createElement(HtmlComponentUtil.HTML_TAG_DIV);
+ forthEmptyDiv.setAttribute(HTML.ATTR_CLASS,
styleClasess.get("forthEmptyDiv"));
+ forthEmptyDiv.setAttribute(HTML.ATTR_STYLE, VpeStyleUtil.PARAMETER_WIDTH +
VpeStyleUtil.COLON_STRING
+ + calculateWithForDiv(this.sourceWidth, 10));
+ forthEmptyDiv.appendChild(visualDocument.createTextNode("Struts"));
+
+ rootDiv.appendChild(secondDiv);
+ secondDiv.appendChild(thirdEmptyDiv);
+ secondDiv.appendChild(thirdDiv);
+ thirdDiv.appendChild(firstInput);
+ thirdDiv.appendChild(secondInput);
+ thirdDiv.appendChild(thirdInput);
+ thirdDiv.appendChild(forthEmptyDiv);
+
+ final VpeCreationData creationData = new VpeCreationData(rootDiv);
+// final DOMTreeDumper dumper = new DOMTreeDumper();
+// dumper.dumpToStream(System.err, rootDiv);
+ return creationData;
+ }
+
+ /**
+ * Creates the button table.
+ *
+ * @param visualDocument
+ * the visual document
+ * @param sourceNode
+ * the source node
+ *
+ * @return the ns IDOM element
+ */
+ private nsIDOMElement createButtonTable(nsIDOMDocument visualDocument, Node
sourceNode) {
+ nsIDOMElement table = visualDocument.createElement(HTML.TAG_TABLE);
+
+ setUpTable(table);
+
+ nsIDOMElement rowUp = visualDocument.createElement(HTML.TAG_TR);
+
+ table.appendChild(rowUp);
+
+ nsIDOMElement rowDown = visualDocument.createElement(HTML.TAG_TR);
+ nsIDOMElement cellDown = visualDocument.createElement(HTML.TAG_TD);
+
+ nsIDOMElement imageDownElement = visualDocument.createElement(HTML.TAG_INPUT);
+
+ ComponentUtil.setImg(imageDownElement, IMAGE_NAME_DOWN);
+
+ imageDownElement.setAttribute(HTML.ATTR_BORDER, ZERO_STRING);
+ imageDownElement.setAttribute(HTML.ATTR_TYPE, HTML.VALUE_IMAGE_TYPE);
+ imageDownElement.setAttribute(HTML.ATTR_CLASS, RICH_COMBOBOX_IMAGE_STYLE_CLASS);
+ cellDown.appendChild(imageDownElement);
+ rowDown.appendChild(cellDown);
+ table.appendChild(rowDown);
+
+ return table;
+ }
+
+ /**
+ * Create a HTML-part containg input element.
+ *
+ * @param sourceElement
+ * the source element
+ * @param visualDocument
+ * The current node of the source tree.
+ * @param sourceNode
+ * The document of the visual tree.
+ * @param elementData
+ * the element data
+ *
+ * @return a HTML-part containg input element
+ */
+ private nsIDOMElement createInputElement(nsIDOMDocument visualDocument, Element
sourceElement, VpeElementData elementData) {
+ nsIDOMElement inputElement = visualDocument.createElement(HTML.TAG_INPUT);
+
+ inputElement.setAttribute(HTML.ATTR_CLASS, getInputClass(sourceElement));
+
+ inputElement.setAttribute(HTML.ATTR_STYLE, getInputStyle(sourceElement));
+
+ inputElement.setAttribute(HTML.ATTR_TYPE, HTML.VALUE_TEXT_TYPE);
+
+ inputElement.setAttribute(HTML.ATTR_SIZE, getInputSize(sourceElement));
+ inputElement.setAttribute(HTML.ATTR_VALUE, getInputValue(sourceElement));
+
+ if ((sourceElement).hasAttribute(RichFaces.ATTR_VALUE)) {
+ elementData.addAttributeData(new
VpeAttributeData(sourceElement.getAttributeNode(RichFaces.ATTR_VALUE), inputElement,
true));
+ } else {
+ elementData.addAttributeData(new VpeAttributeData(RichFaces.ATTR_VALUE,
inputElement, true));
+ }
+
+ return inputElement;
+ }
+
+ /**
+ * Gets the default input class.
+ *
+ * @return the default input class
+ */
+ public String getDefaultInputClass() {
+ return DEFAULT_INPUT_STYLE;
+ }
+
+ /**
+ * Gets the default input size.
+ *
+ * @return the default input size
+ */
+ public String getDefaultInputSize() {
+ return DEFAULT_INPUT_SIZE;
+ }
+
+ /**
+ * Return a input class.
+ *
+ * @param sourceElement
+ * the source element
+ * @param sourceNode
+ * a sourceNode
+ *
+ * @return a input class
+ */
+ public String getInputClass(Element sourceElement) {
+ String returnValue = getDefaultInputClass();
+ String tmp = getAttribute(sourceElement, RichFaces.ATTR_INPUT_CLASS);
+ if (tmp.length() != 0) {
+ returnValue = new StringBuffer().append(returnValue).append(" ")
//$NON-NLS-1$
+ .append(tmp).toString();
+ }
+ return returnValue;
+ }
+
+ /**
+ * Return a input size.
+ *
+ * @param sourceElement
+ * the source element
+ * @param sourceNode
+ * a sourceNode
+ *
+ * @return a input size
+ */
+ protected String getInputSize(Element sourceElement) {
+ String returnValue = getDefaultInputSize();
+ String tmp = getAttribute(sourceElement, RichFaces.ATTR_INPUT_SIZE);
+ if (tmp.length() != 0) {
+ returnValue = tmp;
+ }
+ return returnValue;
+ }
+
+ /**
+ * Return a input style.
+ *
+ * @param sourceElement
+ * the source element
+ * @param sourceNode
+ * a sourceNode
+ *
+ * @return a input style
+ */
+ private String getInputStyle(Element sourceElement) {
+ String returnValue = getAttribute(sourceElement, RichFaces.ATTR_INPUT_STYLE);
+ return returnValue;
+ }
+
+ /**
+ * Return a input value.
+ *
+ * @param sourceElement
+ * the source element
+ * @param sourceNode
+ * a sourceNode
+ *
+ * @return a input value
+ */
+ private String getInputValue(Element sourceElement) {
+ String returnValue = getAttribute(sourceElement, RichFaces.ATTR_VALUE);
+ final String defaultLabel = getAttribute(sourceElement,
RichFaces.ATTR_DEFAULT_LABEL);
+
+ if (defaultLabel != null && defaultLabel.length() > 0) {
+ returnValue = defaultLabel;
+ }
+ return returnValue;
+ }
+
+ private void initDefaultClasses() {
+ styleClasess.put("secondDiv", "rich-combobox-font
rich-combobox");
+ styleClasess.put("thirdDiv", "rich-combobox-font
rich-combobox-shell");
+ styleClasess.put("thirdEmptyDiv",
"rich-combobox-list-cord");
+ styleClasess.put("firstInput", "rich-combobox-font-disabled
rich-combobox-input-inactive");
+ styleClasess.put(SECOND_INPUT, "rich-combobox-font-inactive
rich-combobox-button-background rich-combobox-button-inactive");
+ styleClasess.put("thirdInput", "rich-combobox-font-inactive
rich-combobox-button-icon-inactive rich-combobox-button-inactive");
+ styleClasess.put("forthEmptyDiv", "rich-combobox-strut
rich-combobox-font");
+ }
+
+ @Override
+ public boolean isRecreateAtAttrChange(VpePageContext pageContext, Element
sourceElement, nsIDOMDocument visualDocument,
+ nsIDOMElement visualNode, Object data, String name, String value) {
+ // TODO Auto-generated method stub
+ return true;
+ }
+
+ /**
+ * @param source
+ */
+ private void prepareData(Element source) {
+ this.sourceAlign = source.getAttribute("align");
+ if (ComponentUtil.isBlank(this.sourceAlign)) {
+ this.sourceAlign = DEFAULT_ALIGN;
+ }
+ this.sourceListWidth = source.getAttribute("listWidth");
+
+ if (ComponentUtil.isBlank(this.sourceListWidth)) {
+ this.sourceListWidth = DEFAULT_LIST_WIDTH;
+ }
+ this.sourceListHeight = source.getAttribute("");
+
+ this.sourceWidth = source.getAttribute("width");
+ if (ComponentUtil.isBlank(this.sourceWidth)) {
+ this.sourceWidth = DEFAULT_LIST_WIDTH;
+ }
+
+ this.sourceDefaultLabel = source.getAttribute("defaultLabel");
+ this.sourceValue = source.getAttribute("value");
+
+ this.sourceButtonStyle = source.getAttribute("buttonStyle");
+
+ final String sourceStyleClasess =
source.getAttribute(RichFaces.ATTR_STYLE_CLASS);
+
+ if (ComponentUtil.isNotBlank(sourceStyleClasess)) {
+ styleClasess.put("secondDiv",
styleClasess.get("secondDiv") + " " + sourceStyleClasess);
+ }
+
+ }
+
+ /**
+ * Sets the attribute.
+ *
+ * @param sourceElement
+ * the source element
+ * @param visualDocument
+ * the visual document
+ * @param value
+ * the value
+ * @param visualNode
+ * the visual node
+ * @param data
+ * the data
+ * @param pageContext
+ * the page context
+ * @param name
+ * the name
+ *
+ * @see com.exadel.vpe.editor.template.VpeAbstractTemplate#setAttribute(com.
+ * exadel.vpe.editor.context.VpePageContext, org.w3c.dom.Element,
+ * org.w3c.dom.Document, org.w3c.dom.Node, java.lang.Object,
+ * java.lang.String, java.lang.String)
+ */
+ @Override
+ public void setAttribute(VpePageContext pageContext, Element sourceElement,
nsIDOMDocument visualDocument, nsIDOMNode visualNode,
+ Object data, String name, String value) {
+ // 1. Call super method
+ super.setAttribute(pageContext, sourceElement, visualDocument, visualNode, data,
name, value);
+
+ // nsIDOMElement table = (nsIDOMElement) visualNode.queryInterface(
+ // nsIDOMElement.NS_IDOMELEMENT_IID);
+ // nsIDOMNodeList listTable = table.getChildNodes();
+ // nsIDOMNode nodeTr = listTable.item(0);
+ // nsIDOMNodeList listTr = nodeTr.getChildNodes();
+ // nsIDOMNode nodeTd = listTr.item(0);
+ //
+ // nsIDOMNodeList listTd = nodeTd.getChildNodes();
+ // nsIDOMNode entry0 = listTd.item(0);
+ //
+ // nsIDOMElement inputElement = (nsIDOMElement) entry0.queryInterface(
+ // nsIDOMElement.NS_IDOMELEMENT_IID);
+ //
+ // inputElement.setAttribute(HTML.ATTR_CLASS, getInputClass(
+ // sourceElement));
+ //
+ // inputElement.setAttribute(HTML.ATTR_STYLE, getInputStyle(
+ // sourceElement));
+ // inputElement.setAttribute(HTML.ATTR_SIZE, getInputSize(sourceElement)
+ // );
+ // inputElement.setAttribute(HTML.ATTR_VALUE, getInputValue(
+ // sourceElement));
+ //
+ // // 3. Set a style for main container
+ // String strStyle = getAttribute(sourceElement, RichFaces.ATTR_STYLE);
+ // strStyle = ((strStyle.length() == 0) ? DEFAULT_WIDTH : strStyle);
+ //
+ // table.setAttribute(HTML.ATTR_STYLE, strStyle);
+
+ }
+
+ /**
+ * Sets the up table.
+ *
+ * @param table
+ * the table
+ */
+ private void setUpTable(final nsIDOMElement table) {
+ table.setAttribute(HTML.ATTR_BORDER, ZERO_STRING);
+ table.setAttribute(HTML.ATTR_CELLPADDING, ZERO_STRING);
+ table.setAttribute(HTML.ATTR_CELLSPACING, ZERO_STRING);
+ }
+
+ /**
+ * Sets the up td.
+ *
+ * @param visualDocument
+ * the visual document
+ * @param elementData
+ * the element data
+ * @param cellInput
+ * the cell input
+ * @param source
+ * the source
+ */
+ private void setUpTd(nsIDOMDocument visualDocument, final Element source, final
VpeElementData elementData,
+ final nsIDOMElement cellInput) {
+ cellInput.setAttribute(HTML.ATTR_CLASS, RICH_COMBOBOX_INPUT_CELL_STYLE);
+ cellInput.setAttribute(HTML.ATTR_VALIGN, HTML.VALUE_TOP_ALIGN);
+ cellInput.appendChild(createInputElement(visualDocument, source, elementData));
+ }
+
+ // @Override
+ // public boolean isRecreateAtAttrChange(VpePageContext pageContext, Element
+ // sourceElement, nsIDOMDocument visualDocument,
+ // nsIDOMElement visualNode, Object data, String name, String value) {
+ // return true;
+ // }
+
+}
Property changes on:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesComboBoxTemplate.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native
Added:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesFileUploadTemplate.java
===================================================================
---
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesFileUploadTemplate.java
(rev 0)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesFileUploadTemplate.java 2008-05-29
12:39:23 UTC (rev 8426)
@@ -0,0 +1,202 @@
+
+
+package org.jboss.tools.jsf.vpe.richfaces.template;
+
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.jboss.tools.jsf.vpe.richfaces.ComponentUtil;
+import org.jboss.tools.vpe.editor.context.VpePageContext;
+import org.jboss.tools.vpe.editor.template.VpeAbstractTemplate;
+import org.jboss.tools.vpe.editor.template.VpeCreationData;
+import org.jboss.tools.vpe.editor.util.HTML;
+import org.jboss.tools.vpe.editor.util.VpeStyleUtil;
+import org.jboss.tools.vpe.xulrunner.browser.util.DOMTreeDumper;
+import org.mozilla.interfaces.nsIDOMDocument;
+import org.mozilla.interfaces.nsIDOMElement;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+
+
+/**
+ * The template for the <rich:fileUpload/>.
+ *
+ * @author Eugene Stherbin
+ */
+public class RichFacesFileUploadTemplate extends VpeAbstractTemplate {
+
+ /** The Constant DEFAULT_CONTROL_LABEL_VALUE. */
+ private static final String DEFAULT_CONTROL_LABEL_VALUE = "Add...";
+
+ /** The Constant DEFAULT_LIST_HEIGHT. */
+ private static final String DEFAULT_LIST_HEIGHT = "210px";
+
+ /** The Constant DEFAULT_LIST_WIDTH. */
+ private static final String DEFAULT_LIST_WIDTH = "400px";
+
+ /** The Constant FILE_UPLOAD_FILE_UPLOAD_CSS. */
+ private static final String FILE_UPLOAD_FILE_UPLOAD_CSS =
"fileUpload/fileUpload.css";
+
+ /** The Constant RICH_FACES_FILE_UPLOAD_EXT. */
+ private static final String RICH_FACES_FILE_UPLOAD_EXT =
"richFacesFileUpload";
+
+ /** The add control label. */
+ private String addControlLabel;
+
+ /** The default style classes. */
+ private final Map<String, String> defaultStyleClasses = new HashMap<String,
String>();
+
+ /** The list height. */
+ private String listHeight;
+
+ /** The list width. */
+ private String listWidth;
+
+ /**
+ * The Constructor.
+ */
+ public RichFacesFileUploadTemplate() {
+ super();
+ initDefaultStyleClasses();
+ }
+
+ /**
+ * Create.
+ *
+ * @param visualDocument the visual document
+ * @param sourceNode the source node
+ * @param pageContext the page context
+ *
+ * @return the vpe creation data
+ */
+ public VpeCreationData create(VpePageContext pageContext, Node sourceNode,
nsIDOMDocument visualDocument) {
+
+ final Element source = (Element) sourceNode;
+ prepareData(source);
+ VpeCreationData data = null;
+ ComponentUtil.setCSSLink(pageContext, FILE_UPLOAD_FILE_UPLOAD_CSS,
RICH_FACES_FILE_UPLOAD_EXT); //$NON-NLS-1$ //$NON-NLS-2$
+
+ final nsIDOMElement rootDiv = visualDocument.createElement(HTML.TAG_DIV);
+
+ rootDiv.setAttribute(HTML.ATTR_CLASS, "rich-fileupload-list-decor");
+ rootDiv.setAttribute(HTML.ATTR_STYLE, VpeStyleUtil.PARAMETER_WIDTH +
VpeStyleUtil.COLON_STRING + this.listWidth);
+ final nsIDOMElement table = visualDocument.createElement(HTML.TAG_TABLE);
+
+ table.setAttribute(HTML.ATTR_CLASS, "rich-fileupload-toolbar-decor");
+ final nsIDOMElement tr = visualDocument.createElement(HTML.TAG_TR);
+ final nsIDOMElement td = visualDocument.createElement(HTML.TAG_TD);
+ final nsIDOMElement buttonBorderDiv =
visualDocument.createElement(HTML.TAG_DIV);
+
+ buttonBorderDiv.setAttribute(HTML.ATTR_CLASS,
"rich-fileupload-button-border");
+ buttonBorderDiv.setAttribute(HTML.ATTR_STYLE, "float: left;");
+
+ final nsIDOMElement fileuploadButtonDiv =
visualDocument.createElement(HTML.TAG_DIV);
+ fileuploadButtonDiv.setAttribute(HTML.ATTR_CLASS,
defaultStyleClasses.get("addButtonClass"));
+ fileuploadButtonDiv.setAttribute(HTML.ATTR_STYLE, "position:
relative;");
+
+ final nsIDOMElement labelDiv = visualDocument.createElement(HTML.TAG_DIV);
+
+ labelDiv.setAttribute(HTML.ATTR_CLASS,
defaultStyleClasses.get("addButtonClassDiv2"));
+
+ rootDiv.appendChild(table);
+ rootDiv.appendChild(createPanelDiv(pageContext, source, visualDocument));
+ table.appendChild(tr);
+ tr.appendChild(td);
+ td.appendChild(buttonBorderDiv);
+ buttonBorderDiv.appendChild(fileuploadButtonDiv);
+ fileuploadButtonDiv.appendChild(labelDiv);
+ labelDiv.appendChild(visualDocument.createTextNode(this.addControlLabel));
+
+// DOMTreeDumper dumper = new DOMTreeDumper();
+// dumper.dumpToStream(System.err, rootDiv);
+
+ data = new VpeCreationData(rootDiv);
+ return data;
+ }
+
+ /**
+ * Creates the panel div.
+ *
+ * @param visualDocument the visual document
+ * @param pageContext the page context
+ * @param source the source
+ *
+ * @return the ns IDOM element
+ */
+ private nsIDOMElement createPanelDiv(VpePageContext pageContext, Element source,
nsIDOMDocument visualDocument) {
+ final nsIDOMElement div = visualDocument.createElement(HTML.TAG_DIV);
+
+ div.setAttribute(HTML.ATTR_CLASS,
defaultStyleClasses.get("uploadListClass"));
+ div.setAttribute(HTML.ATTR_STYLE, VpeStyleUtil.PARAMETER_WIDTH +
VpeStyleUtil.COLON_STRING + "100%" + VpeStyleUtil.SEMICOLON_STRING
+ + VpeStyleUtil.PARAMETER_HEIGHT + VpeStyleUtil.COLON_STRING +
this.listHeight);
+ return div;
+ }
+
+ /**
+ * Inits the default style classes.
+ */
+ private void initDefaultStyleClasses() {
+ defaultStyleClasses.put("addButtonClass", "rich-fileupload-button
rich-fileupload-font");
+ defaultStyleClasses.put("addButtonClassDiv2",
+ " rich-fileupload-button-content rich-fileupload-font
rich-fileupload-ico rich-fileupload-ico-add");
+ defaultStyleClasses.put("uploadListClass",
"rich-fileupload-list-overflow");
+
+ }
+
+ /**
+ * Checks if is recreate at attr change.
+ *
+ * @param sourceElement the source element
+ * @param visualDocument the visual document
+ * @param value the value
+ * @param visualNode the visual node
+ * @param data the data
+ * @param pageContext the page context
+ * @param name the name
+ *
+ * @return true, if is recreate at attr change
+ */
+ @Override
+ public boolean isRecreateAtAttrChange(VpePageContext pageContext, Element
sourceElement, nsIDOMDocument visualDocument,
+ nsIDOMElement visualNode, Object data, String name, String value) {
+ return true;
+ }
+
+ /**
+ * Prepare data.
+ *
+ * @param sourceElement the source element
+ */
+ private void prepareData(Element sourceElement) {
+ try {
+ listHeight =
String.valueOf(ComponentUtil.parseWidthHeightValue(sourceElement.getAttribute("listHeight")));
+ } catch (NumberFormatException e) {
+ listHeight = DEFAULT_LIST_HEIGHT;
+ }
+ try {
+ listWidth =
String.valueOf(ComponentUtil.parseWidthHeightValue(sourceElement.getAttribute("listWidth")));
+ } catch (NumberFormatException e) {
+ listWidth = DEFAULT_LIST_WIDTH;
+ }
+
+ addControlLabel = sourceElement.getAttribute("addControlLabel");
+ if (addControlLabel == null) {
+ addControlLabel = DEFAULT_CONTROL_LABEL_VALUE;
+ }
+
+ String addButtonClass = sourceElement.getAttribute("addButtonClass");
+
+ if (ComponentUtil.isNotBlank(addButtonClass)) {
+ defaultStyleClasses.put("addButtonClass",
defaultStyleClasses.get("addButtonClass") + " " + addButtonClass);
+ defaultStyleClasses.put("addButtonClassDiv2",
defaultStyleClasses.get("addButtonClassDiv2") + " " +
addButtonClass);
+ }
+
+ String uploadListClass =
sourceElement.getAttribute("uploadListClass");
+
+ if (ComponentUtil.isNotBlank(uploadListClass)) {
+ defaultStyleClasses.put("uploadListClass",
defaultStyleClasses.get("uploadListClass") + " " + uploadListClass);
+ }
+ }
+
+}
Property changes on:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesFileUploadTemplate.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native
Added:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesInplaceInputTemplate.java
===================================================================
---
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesInplaceInputTemplate.java
(rev 0)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesInplaceInputTemplate.java 2008-05-29
12:39:23 UTC (rev 8426)
@@ -0,0 +1,166 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2008 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at
http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
+
+package org.jboss.tools.jsf.vpe.richfaces.template;
+
+
+import org.jboss.tools.jsf.vpe.richfaces.ComponentUtil;
+import org.jboss.tools.jsf.vpe.richfaces.HtmlComponentUtil;
+import org.jboss.tools.vpe.editor.context.VpePageContext;
+import org.jboss.tools.vpe.editor.template.VpeCreationData;
+import org.jboss.tools.vpe.editor.util.HTML;
+import org.jboss.tools.vpe.xulrunner.browser.util.DOMTreeDumper;
+import org.mozilla.interfaces.nsIDOMDocument;
+import org.mozilla.interfaces.nsIDOMElement;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+
+
+/**
+ * Template for the <rich:inplaceInput> component.
+ *
+ * @author Eugene Stherbin
+ */
+public class RichFacesInplaceInputTemplate extends RichFacesAbstractInplaceTemplate {
+
+ /** The input width. */
+ protected String inputWidth;
+
+ /**
+ * The Constructor.
+ */
+ public RichFacesInplaceInputTemplate() {
+ super();
+
+ }
+
+ /**
+ * Create0.
+ *
+ * @param visualDocument the visual document
+ * @param sourceNode the source node
+ * @param pageContext the page context
+ *
+ * @return the vpe creation data
+ */
+ public VpeCreationData create(VpePageContext pageContext, Node sourceNode,
nsIDOMDocument visualDocument) {
+ VpeCreationData data = null;
+ // <span id="j_id5" class="rich-inplace rich-inplace-view"
style="">
+ ComponentUtil.setCSSLink(pageContext, getCssStyle(), getCssExtension());
+ final Element source = (Element) sourceNode;
+ prepareData(source);
+ final nsIDOMElement rootSpan = createRootSpanTemplateMethod(source,
visualDocument);
+ final nsIDOMElement innerInput1 =
visualDocument.createElement(HtmlComponentUtil.HTML_TAG_INPUT);
+
+ String clazz = "";
+ if (this.isToggle) {
+ rootSpan.appendChild(innerInput1);
+ innerInput1.setAttribute(VPE_USER_TOGGLE_ID_ATTR, String.valueOf(0));
+ innerInput1.setAttribute(HTML.ATTR_CLASS, "rich-inplace-field");
+ innerInput1.setAttribute(HTML.ATTR_STYLE, "top: 0px; width: " +
this.inputWidth + ";");
+ innerInput1.setAttribute(HTML.ATTR_TYPE, "text");
+ innerInput1.setAttribute("autocomplete", "off");
+ if (showControls) {
+ rootSpan.appendChild(createControlsDiv(pageContext, sourceNode,
visualDocument));
+ }
+ } else {
+ innerInput1.setAttribute(HTML.ATTR_STYLE, "width: " +
this.inputWidth + "; position: absolute; left: -32767px;");
+ innerInput1.setAttribute(HTML.ATTR_TYPE, "button");
+ }
+ data = new VpeCreationData(rootSpan);
+// final DOMTreeDumper dumper = new DOMTreeDumper();
+
+ if (!isToggle) {
+
+ rootSpan.appendChild(visualDocument.createTextNode(getValue()));
+ } else {
+ innerInput1.setAttribute(HTML.ATTR_VALUE, this.sourceValue);
+ }
+// dumper.dumpToStream(System.err, rootSpan);
+
+ return data;
+ }
+
+
+ /**
+ * Gets the css extension.
+ *
+ * @return the css extension
+ */
+ protected String getCssExtension() {
+ return "inplaceInput";
+ }
+
+ /**
+ * Gets the css style.
+ *
+ * @return the css style
+ */
+ protected String getCssStyle() {
+ return "inplaceInput/inplaceInput.css";
+ }
+
+ /**
+ * Gets the css styles suffix.
+ *
+ * @return the css styles suffix
+ *
+ * @see org.jboss.tools.jsf.vpe.richfaces.template.
+ * RichFacesAbstractInplaceTemplate#getCssStylesSuffix()
+ */
+ @Override
+ protected String getCssStylesSuffix() {
+ return "";
+ }
+
+ /**
+ * Gets the root span classes.
+ *
+ * @return the root span classes
+ */
+ protected Object[] getRootSpanClasses() {
+ String[] rst = new String[2];
+ String clazz = "";
+
+ if (this.isToggle) {
+ rst[0] = "rich-inplace-edit";
+ if (ComponentUtil.isNotBlank(this.editClass)) {
+ clazz = this.editClass;
+ }
+ } else {
+ rst[0] = "rich-inplace-view";
+ if (ComponentUtil.isNotBlank(this.styleClass)) {
+ clazz = this.styleClass;
+ }
+
+ }
+ rst[1] = clazz;
+ return rst;
+ }
+
+ /**
+ * Prepare data.
+ *
+ * @param source the source
+ */
+ protected void prepareData(Element source) {
+ try {
+ this.inputWidth =
String.valueOf(ComponentUtil.parseWidthHeightValue(source.getAttribute("inputWidth")));
+ } catch (NumberFormatException e) {
+ this.inputWidth = DEFAULT_INPUT_WIDTH_VALUE;
+ }
+ this.controlsHorizontalPositions.put("right", this.inputWidth);
+ super.prepareData(source);
+
+ }
+
+}
Property changes on:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesInplaceInputTemplate.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native
Added:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesInplaceSelectTemplate.java
===================================================================
---
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesInplaceSelectTemplate.java
(rev 0)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesInplaceSelectTemplate.java 2008-05-29
12:39:23 UTC (rev 8426)
@@ -0,0 +1,293 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2008 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at
http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
+
+package org.jboss.tools.jsf.vpe.richfaces.template;
+
+
+import java.util.List;
+
+import org.jboss.tools.jsf.vpe.richfaces.ComponentUtil;
+import org.jboss.tools.jsf.vpe.richfaces.HtmlComponentUtil;
+import org.jboss.tools.jsf.vpe.richfaces.template.util.RichFaces;
+import org.jboss.tools.vpe.editor.context.VpePageContext;
+import org.jboss.tools.vpe.editor.template.VpeCreationData;
+import org.jboss.tools.vpe.editor.util.HTML;
+import org.jboss.tools.vpe.xulrunner.browser.util.DOMTreeDumper;
+import org.mozilla.interfaces.nsIDOMDocument;
+import org.mozilla.interfaces.nsIDOMElement;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+
+
+/**
+ * Template for <rich:inplaceSelect/> tag.
+ *
+ * @author Eugene Stherbin
+ */
+public class RichFacesInplaceSelectTemplate extends RichFacesAbstractInplaceTemplate {
+
+ /** The Constant INPLACE_SELECT_CSS. */
+ private static final String INPLACE_SELECT_CSS =
"inplaceSelect/inplaceSelect.css";
+
+ /** The Constant INPLACE_SELECT_EXT. */
+ private static final String INPLACE_SELECT_EXT = "inplaceSelect";
+
+ /** The select width. */
+ private String selectWidth;
+
+ /**
+ * Create.
+ *
+ * @param visualDocument the visual document
+ * @param sourceNode the source node
+ * @param pageContext the page context
+ *
+ * @return the vpe creation data
+ */
+ public VpeCreationData create(VpePageContext pageContext, Node sourceNode,
nsIDOMDocument visualDocument) {
+ VpeCreationData data = null;
+ // <span id="j_id5" class="rich-inplace rich-inplace-view"
style="">
+ ComponentUtil.setCSSLink(pageContext, getCssStyle(), getCssExtension());
+ final Element source = (Element) sourceNode;
+ prepareData(source);
+ final nsIDOMElement rootSpan = createRootSpanTemplateMethod(source,
visualDocument);
+
+ if (isToggle) {
+ final nsIDOMElement innerInput1 =
visualDocument.createElement(HtmlComponentUtil.HTML_TAG_INPUT);
+ final nsIDOMElement innerInput2 =
visualDocument.createElement(HtmlComponentUtil.HTML_TAG_INPUT);
+
+ preapareInputBase(innerInput1);
+ preapareInputBase(innerInput2);
+ innerInput1.setAttribute(VPE_USER_TOGGLE_ID_ATTR, String.valueOf(0));
+ innerInput1.setAttribute("autocomplete", "off");
+ innerInput1.setAttribute(HTML.ATTR_CLASS,
"rich-inplace-select-field");
+ innerInput1.setAttribute(HTML.ATTR_VALUE, ((this.defaultLabel == null) ?
"" : this.defaultLabel));
+ // TODO
+ innerInput1.setAttribute(HTML.ATTR_STYLE, "top: 1px ;
width:100px");
+ innerInput1.setAttribute(HTML.ATTR_VALUE,getValue());
+ innerInput2.setAttribute(HTML.ATTR_CLASS,
"rich-inplace-select-arrow");
+ // TODO
+ innerInput2.setAttribute(HTML.ATTR_STYLE, "top: 2px; left:
89px;");
+
+ rootSpan.appendChild(innerInput1);
+ rootSpan.appendChild(innerInput2);
+ if (ComponentUtil.getSelectItems(source.getChildNodes()).size() > 0) {
+ final nsIDOMElement selectList = createSelectedList(source,
visualDocument);
+ rootSpan.appendChild(selectList);
+ }
+ if(this.showControls){
+ rootSpan.appendChild(createControlsDiv(pageContext, sourceNode,
visualDocument));
+ }
+
+ } else {
+ rootSpan.appendChild(visualDocument.createTextNode(getValue()));
+ }
+ data = new VpeCreationData(rootSpan);
+ // DOMTreeDumper d = new DOMTreeDumper();
+ // d.dumpToStream(System.err, rootSpan);
+ return data;
+ }
+
+ /**
+ * Creates the selected list.
+ *
+ * @param visualDocument the visual document
+ * @param source the source
+ *
+ * @return the ns IDOM element
+ */
+ private nsIDOMElement createSelectedList(Element source, nsIDOMDocument
visualDocument) {
+ // rich-inplace-select-width-list
+ final nsIDOMElement div =
visualDocument.createElement(HtmlComponentUtil.HTML_TAG_DIV);
+
+ div.setAttribute(HTML.ATTR_CLASS, "rich-inplace-select-width-list");
+ div.setAttribute(VPE_USER_TOGGLE_ID_ATTR, String.valueOf(0));
+ div.setAttribute(HTML.ATTR_STYLE, "position: absolute; height: 100px; left:
0px; top: 22px; visibility: visible;");
+
+ final nsIDOMElement shadowDiv =
visualDocument.createElement(HtmlComponentUtil.HTML_TAG_DIV);
+
+ shadowDiv.setAttribute(HTML.ATTR_CLASS,
"rich-inplace-select-list-shadow");
+ shadowDiv.setAttribute(HTML.ATTR_STYLE, "");
+
+ final nsIDOMElement table =
visualDocument.createElement(HtmlComponentUtil.HTML_TAG_TABLE);
+ final nsIDOMElement tr1 =
visualDocument.createElement(HtmlComponentUtil.HTML_TAG_TR);
+ final nsIDOMElement tr2 =
visualDocument.createElement(HtmlComponentUtil.HTML_TAG_TR);
+
+ final nsIDOMElement td1 =
visualDocument.createElement(HtmlComponentUtil.HTML_TAG_TD);
+ final nsIDOMElement td2 =
visualDocument.createElement(HtmlComponentUtil.HTML_TAG_TD);
+ final nsIDOMElement td3 =
visualDocument.createElement(HtmlComponentUtil.HTML_TAG_TD);
+ final nsIDOMElement td4 =
visualDocument.createElement(HtmlComponentUtil.HTML_TAG_TD);
+
+ td1.setAttribute(HTML.ATTR_CLASS, "rich-inplace-select-shadow-tl");
+ td2.setAttribute(HTML.ATTR_CLASS, "rich-inplace-select-shadow-tr");
+ td3.setAttribute(HTML.ATTR_CLASS, "rich-inplace-select-shadow-bl");
+ td4.setAttribute(HTML.ATTR_CLASS, "rich-inplace-select-shadow-br");
+
+ final nsIDOMElement img1 =
visualDocument.createElement(HtmlComponentUtil.HTML_TAG_IMG);
+ final nsIDOMElement img2 =
visualDocument.createElement(HtmlComponentUtil.HTML_TAG_IMG);
+ final nsIDOMElement img3 =
visualDocument.createElement(HtmlComponentUtil.HTML_TAG_IMG);
+ final nsIDOMElement img4 =
visualDocument.createElement(HtmlComponentUtil.HTML_TAG_IMG);
+
+ setUpImg(img1, 10, 1, 0, SPACER_GIF);
+ setUpImg(img2, 1, 10, 0, SPACER_GIF);
+ setUpImg(img3, 1, 10, 0, SPACER_GIF);
+ setUpImg(img4, 10, 10, 0, SPACER_GIF);
+
+ final nsIDOMElement listPositionDiv =
visualDocument.createElement(HtmlComponentUtil.HTML_TAG_DIV);
+ listPositionDiv.setAttribute(HTML.ATTR_CLASS,
"rich-inplace-select-list-position");
+ listPositionDiv.setAttribute(VPE_USER_TOGGLE_ID_ATTR, String.valueOf(0));
+
+ final nsIDOMElement listDecarationDiv =
visualDocument.createElement(HtmlComponentUtil.HTML_TAG_DIV);
+ listDecarationDiv.setAttribute(HTML.ATTR_CLASS,
"rich-inplace-select-list-decoration");
+
+ final nsIDOMElement listScrollDiv =
visualDocument.createElement(HtmlComponentUtil.HTML_TAG_DIV);
+
+ listScrollDiv.setAttribute(HTML.ATTR_CLASS,
"rich-inplace-select-list-scroll");
+ listScrollDiv.setAttribute(HTML.ATTR_STYLE, "height: 72px; width:
151px;");
+
+ //
+
+ final List<Element> elements =
ComponentUtil.getSelectItems(source.getChildNodes());
+ if (elements.size() > 0) {
+ for (Element e : elements) {
+ final nsIDOMElement span =
visualDocument.createElement(HtmlComponentUtil.HTML_TAG_SPAN);
+
+ span.setAttribute(HTML.ATTR_CLASS, "rich-inplace-select-item
rich-inplace-select-font");
+
span.appendChild(visualDocument.createTextNode(ComponentUtil.getSelectItemValue(e)));
+ listScrollDiv.appendChild(span);
+ }
+
+ }
+
+ div.appendChild(shadowDiv);
+ div.appendChild(listPositionDiv);
+ listPositionDiv.appendChild(listDecarationDiv);
+ listDecarationDiv.appendChild(listScrollDiv);
+
+ shadowDiv.appendChild(table);
+
+ table.appendChild(tr1);
+ tr1.appendChild(td1);
+
+ tr1.appendChild(td2);
+ td1.appendChild(img1);
+ td1.appendChild(visualDocument.createElement(HtmlComponentUtil.HTML_TAG_BR));
+
+ td2.appendChild(img2);
+ td2.appendChild(visualDocument.createElement(HtmlComponentUtil.HTML_TAG_BR));
+
+ table.appendChild(tr2);
+ tr2.appendChild(td3);
+ tr2.appendChild(td4);
+ td3.appendChild(img3);
+ td3.appendChild(visualDocument.createElement(HtmlComponentUtil.HTML_TAG_BR));
+ td4.appendChild(img4);
+ td4.appendChild(visualDocument.createElement(HtmlComponentUtil.HTML_TAG_BR));
+
+ return div;
+ }
+
+
+
+ /**
+ * Gets the css extension.
+ *
+ * @return the css extension
+ *
+ * @see org.jboss.tools.jsf.vpe.richfaces.template.
+ * RichFacesAbstractInplaceTemplate#getCssExtension()
+ */
+ @Override
+ protected String getCssExtension() {
+ return INPLACE_SELECT_EXT;
+ }
+
+ /**
+ * Gets the css style.
+ *
+ * @return the css style
+ *
+ * @see org.jboss.tools.jsf.vpe.richfaces.template.
+ * RichFacesAbstractInplaceTemplate#getCssStyle()
+ */
+ @Override
+ protected String getCssStyle() {
+ return INPLACE_SELECT_CSS;
+ }
+
+
+ /**
+ * Gets the css styles suffix.
+ *
+ * @return the css styles suffix
+ */
+ @Override
+ protected String getCssStylesSuffix() {
+ return "-select";
+ }
+
+ /**
+ * Gets the root span classes.
+ *
+ * @return the root span classes
+ *
+ * @see org.jboss.tools.jsf.vpe.richfaces.template.
+ * RichFacesAbstractInplaceTemplate#getRootSpanClasses()
+ */
+ @Override
+ protected Object[] getRootSpanClasses() {
+ String[] result = new String[2];
+ String clazz = "";
+
+ if (this.isToggle) {
+ result[0] = "rich-inplace-select-edit";
+ if (ComponentUtil.isNotBlank(this.editClass)) {
+ clazz = this.editClass;
+ }
+ } else {
+ result[0] = "rich-inplace-select-view";
+ if (ComponentUtil.isNotBlank(this.viewClass)) {
+ clazz = this.viewClass;
+ }
+ }
+ result[1] = clazz;
+ return result;
+ }
+
+ /**
+ * Preapare input base.
+ *
+ * @param innerInput the inner input
+ * @param innerInput1 */
+ private void preapareInputBase(nsIDOMElement innerInput) {
+ innerInput.setAttribute(HTML.ATTR_TYPE, "text");
+ innerInput.setAttribute(HtmlComponentUtil.HTML_READONLY_ATTR, "text");
+
+ }
+
+ /**
+ * Prepare data.
+ *
+ * @param source the source
+ */
+ @Override
+ protected void prepareData(Element source) {
+ super.prepareData(source);
+
+ }
+
+ @Override
+ protected void initPositions() {
+ this.controlsVerticalPositions.put("center", "100px");
+ }
+
+}
Property changes on:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesInplaceSelectTemplate.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native
Added:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesPickListTemplate.java
===================================================================
---
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesPickListTemplate.java
(rev 0)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesPickListTemplate.java 2008-05-29
12:39:23 UTC (rev 8426)
@@ -0,0 +1,648 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2008 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at
http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
+
+package org.jboss.tools.jsf.vpe.richfaces.template;
+
+
+import java.text.MessageFormat;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import org.jboss.tools.jsf.vpe.richfaces.ComponentUtil;
+import org.jboss.tools.jsf.vpe.richfaces.template.util.RichFaces;
+import org.jboss.tools.vpe.editor.context.VpePageContext;
+import org.jboss.tools.vpe.editor.template.VpeAbstractTemplate;
+import org.jboss.tools.vpe.editor.template.VpeChildrenInfo;
+import org.jboss.tools.vpe.editor.template.VpeCreationData;
+import org.jboss.tools.vpe.editor.util.HTML;
+import org.jboss.tools.vpe.editor.util.VpeStyleUtil;
+import org.jboss.tools.vpe.xulrunner.browser.util.DOMTreeDumper;
+import org.mozilla.interfaces.nsIDOMDocument;
+import org.mozilla.interfaces.nsIDOMElement;
+import org.mozilla.interfaces.nsIDOMText;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+
+/**
+ * Template for <rich:pickList/>.
+ *
+ * @author Eugene Stherbin
+ */
+public class RichFacesPickListTemplate extends VpeAbstractTemplate {
+
+ /** attribute name of height of source list. */
+ private static final String ATTR_LISTS_HEIGHT = "listsHeight";
//$NON-NLS-1$
+
+ /** Customizes vertically a position of move/copy controls relatively to lists. */
+ private static final String ATTR_MOVE_CONTROLS_VERTICAL_ALIGN =
"moveControlsVerticalAlign"; //$NON-NLS-1$
+
+ /** The Constant ATTR_SHOW_BUTTON_LABELS. */
+ private static final String ATTR_SHOW_BUTTON_LABELS = "showButtonsLabel";
+
+ /** attribute name of width of source list. */
+ private static final String ATTR_SOURCE_LIST_WIDTH = "sourceListWidth";
//$NON-NLS-1$
+
+ /** attribute name of width of target list. */
+ private static final String ATTR_TARGET_LIST_WIDTH = "targetListWidth";
//$NON-NLS-1$
+
+ /** path to img. */
+ private static final String BUTTON_IMG_PATH = "pickList/button.gif";
//$NON-NLS-1$
+
+ /** The Constant CLASS_SUFFIX. */
+ private static final String CLASS_SUFFIX = "Class";
+
+ /** The Constant CONTROL_MAP_KEY. */
+ private static final String CONTROL_MAP_KEY = "control";
+
+ /** The Constant CSS_EXTENSION. */
+ private static final String CSS_EXTENSION = "pickList";
+
+ /** default button align. */
+ private static final String DEFAULT_BUTTON_ALIGN = HTML.VALUE_MIDDLE_ALIGN;
+
+ /** default value of height of box(list). */
+ private static final String DEFAULT_LIST_HEIGHT = "140px"; //$NON-NLS-1$
+
+ /** default value of width of box(list). */
+ private static final String DEFAULT_LIST_WIDTH = "140px"; //$NON-NLS-1$
+
+ /** The Constant LABEL_SUFFIX. */
+ private static final String LABEL_SUFFIX = "Label";
+
+ /** The Constant LIST_MAP_KEY. */
+ private static final String LIST_MAP_KEY = "list";
+
+ /** The Constant RICH_LIST_PICKLIST_BUTTON_CONTENT_CSS_CLASS. */
+ private static final String RICH_LIST_PICKLIST_BUTTON_CONTENT_CSS_CLASS =
"rich-list-picklist-button-content";
+
+ /** The Constant RICH_LIST_PICKLIST_BUTTON_CSS_CLASS. */
+ private static final String RICH_LIST_PICKLIST_BUTTON_CSS_CLASS =
"rich-list-picklist-button";
+
+ /** The Constant RICH_PICKLIST_CONTROL_BUTTON_CSS_CLASS. */
+ private static final String RICH_PICKLIST_CONTROL_BUTTON_CSS_CLASS =
"rich-picklist-control-button-class";
+
+ /** The Constant RICH_PICKLIST_INTERNAL_TAB_CSS_CLASS. */
+ private static final String RICH_PICKLIST_INTERNAL_TAB_CSS_CLASS =
"rich-picklist-internal-tab";
+
+ /** The Constant RICH_PICKLIST_LIST_CONTENT_CSS_CLASS. */
+ private static final String RICH_PICKLIST_LIST_CONTENT_CSS_CLASS =
"rich-picklist-list-content";
+
+ /** The Constant RICH_PICKLIST_LIST_CSS_CLASS. */
+ private static final String RICH_PICKLIST_LIST_CSS_CLASS =
"rich-picklist-list";
+
+ /** The Constant RICH_PICKLIST_SOURCE_CELL_CSS_CLASS. */
+ private static final String RICH_PICKLIST_SOURCE_CELL_CSS_CLASS =
"rich-picklist-source-cell";
+
+ /** The Constant SELECT_ITEM. */
+ private static final String SELECT_ITEM = "selectItem";
+
+ /** The Constant SOURCE_LIST. */
+ private static final String SOURCE_LIST = "source"; //$NON-NLS-1$
+
+ /** The Constant SPACER_GIF. */
+ private static final String SPACER_GIF = "/spacer.gif";
+
+ /** path to css. */
+ private static final String STYLE_PATH = CSS_EXTENSION + "/pickList.css";
+
+ /** The Constant styleClasses. */
+ private static final Map<String, String> styleClasses = new HashMap<String,
String>();
+
+ /** The Constant TARGET_LIST. */
+ private static final String TARGET_LIST = "target";
+
+ /** The Constant TD_STYLE_1. */
+ private static final String TD_STYLE_1 = "border: 0px none ; padding:
0px;";
+
+ /** The Constant WIDTH_15. */
+ private static final String WIDTH_15 = "15";
+
+ /**
+ * Gets the children.
+ *
+ * @param sourceNode the source node
+ *
+ * @return the children
+ */
+ public static List<Node> getChildren(Node sourceNode) {
+ final ArrayList<Node> children = new ArrayList<Node>();
+ final NodeList nodeList = sourceNode.getChildNodes();
+
+ for (int i = 0; i < nodeList.getLength(); i++) {
+ final Node child = nodeList.item(i);
+
+ children.add(child);
+ }
+ return children;
+ }
+
+ /** button images. */
+ private final Map<String, String> buttonImages = new HashMap<String,
String>();
+
+ /** default labels. */
+ private final Map<String, String> defaultLabels = new HashMap<String,
String>();
+
+ /** style classes. */
+ private final Map<String, String> defaultStyleClasses = new HashMap<String,
String>();
+
+ /** facetLabels. */
+ private final Map<String, Node> facetLabels = new HashMap<String,
Node>();
+
+ /** The is show button labels. */
+ private boolean isShowButtonLabels;
+
+ /** labels for controls. */
+ private final Map<String, String> labels = new HashMap<String,
String>();
+
+ /** value of height attribute of lists (source/target). */
+ private String listsHeight;
+
+ /** value of vertical-align attribute for source (copy/remove) buttons. */
+ private String moveControlsAlign;
+
+ /** source buttons. */
+ private final List<String> sourceButtons = new ArrayList<String>();
+
+ /** value of width attribute of source list. */
+ private String sourceListsWidth;
+
+ /** target buttons. */
+ private final List<String> targetButtons = new ArrayList<String>();
+
+ /** value of vertical-align attribute for source (up/down/top/bottom) buttons. */
+ private String targetButtonsAlign;
+
+ /** value of width attribute of target list. */
+ private String targetListsWidth;
+
+ /**
+ * The Constructor.
+ */
+ public RichFacesPickListTemplate() {
+ super();
+ init();
+ }
+
+ /**
+ * Adds the childrens.
+ *
+ * @param td the td
+ * @param visualDocument the visual document
+ * @param creationData the creation data
+ * @param children the children
+ */
+ private void addChildrens(nsIDOMDocument visualDocument, List<Node> children,
nsIDOMElement td, VpeCreationData creationData) {
+ List<Element> selectItems = new ArrayList<Element>();
+ for (Node child : children) {
+ if ((child instanceof Element) &&
(child.getNodeName().indexOf(SELECT_ITEM)) > 1) {
+ // createItemDiv(visualDocument,(Element)child,td);
+ selectItems.add((Element) child);
+ }
+ }
+ if (selectItems.size() > 0) {
+ final nsIDOMElement topItemDiv = visualDocument.createElement(HTML.TAG_DIV);
+
+ topItemDiv.setAttribute(HTML.ATTR_CLASS, RICH_PICKLIST_LIST_CSS_CLASS);
+
+ final nsIDOMElement pickListContentItemDiv =
visualDocument.createElement(HTML.TAG_DIV);
+
+ pickListContentItemDiv.setAttribute(HTML.ATTR_CLASS,
RICH_PICKLIST_LIST_CONTENT_CSS_CLASS);
+ pickListContentItemDiv.setAttribute(HTML.ATTR_STYLE,
VpeStyleUtil.PARAMETER_WIDTH + VpeStyleUtil.COLON_STRING
+ + sourceListsWidth + VpeStyleUtil.SEMICOLON_STRING +
VpeStyleUtil.PARAMETER_HEIGHT + VpeStyleUtil.COLON_STRING
+ + listsHeight);
+
+ final nsIDOMElement itemsTable =
visualDocument.createElement(HTML.TAG_TABLE);
+ final nsIDOMElement itemsTableTBody =
visualDocument.createElement(HTML.TAG_TBODY);
+
+ itemsTable.setAttribute(HTML.ATTR_CLASS,
RICH_PICKLIST_INTERNAL_TAB_CSS_CLASS);
+ itemsTable.setAttribute(HTML.ATTR_CELLPADDING, "0");
+ itemsTable.setAttribute(HTML.ATTR_CELLPADDING, "0");
+ final VpeChildrenInfo childrensInfo = new VpeChildrenInfo(itemsTableTBody);
+ creationData.addChildrenInfo(childrensInfo);
+ for (Element selectItem : selectItems) {
+ // itemsTableTBody.appendChild(createItemTr(visualDocument,
+ // selectItem));
+ childrensInfo.addSourceChild(selectItem);
+ }
+ td.appendChild(topItemDiv);
+
+ topItemDiv.appendChild(pickListContentItemDiv);
+
+ pickListContentItemDiv.appendChild(itemsTable);
+
+ itemsTable.appendChild(itemsTableTBody);
+ }
+
+ }
+
+
+ /**
+ * Clear data.
+ */
+ private void clearData() {
+
+ labels.clear();
+ styleClasses.clear();
+ sourceButtons.clear();
+ targetButtons.clear();
+ facetLabels.clear();
+
+ }
+
+ /**
+ * Create.
+ *
+ * @param visualDocument the visual document
+ * @param sourceNode the source node
+ * @param pageContext the page context
+ *
+ * @return the vpe creation data
+ */
+ @SuppressWarnings("unchecked")
+ public VpeCreationData create(VpePageContext pageContext, Node sourceNode,
nsIDOMDocument visualDocument) {
+
+ // cast to Element
+ Element sourceElement = (Element) sourceNode;
+
+ // prepare data
+ prepareData(sourceElement);
+ ComponentUtil.setCSSLink(pageContext, STYLE_PATH, CSS_EXTENSION); //$NON-NLS-1$
+ // create table element
+ final nsIDOMElement rootTable = visualDocument.createElement(HTML.TAG_TABLE);
+ final nsIDOMElement rootTBody = visualDocument.createElement(HTML.TAG_TBODY);
+ final nsIDOMElement rootTr = visualDocument.createElement(HTML.TAG_TR);
+ final VpeCreationData creationData = new VpeCreationData(rootTable);
+ rootTable.setAttribute(HTML.ATTR_CLASS, styleClasses.get(RichFaces.ATTR_STYLE));
//$NON-NLS-1$
+ rootTable.setAttribute(HTML.ATTR_STYLE,
sourceElement.getAttribute(RichFaces.ATTR_STYLE));
+
+ // create source box
+ final nsIDOMElement sourceBoxTd = visualDocument.createElement(HTML.TAG_TD);
+ final nsIDOMElement sourceBox = createBox(visualDocument, creationData,
getChildren(sourceNode), SOURCE_LIST); //$NON-NLS-1$
+ sourceBox.setAttribute(HTML.ATTR_STYLE, VpeStyleUtil.PARAMETER_WIDTH +
VpeStyleUtil.COLON_STRING + sourceListsWidth
+ + VpeStyleUtil.SEMICOLON_STRING + VpeStyleUtil.PARAMETER_HEIGHT +
VpeStyleUtil.COLON_STRING + listsHeight
+ + VpeStyleUtil.SEMICOLON_STRING);
+
+ sourceBoxTd.appendChild(sourceBox);
+ // create source buttons
+ nsIDOMElement controlsButtonsTd = visualDocument.createElement(HTML.TAG_TD);
+ Map<String, String> cloneDefaultLabels = (Map<String, String>)
((HashMap<String, String>) defaultLabels).clone();
+ nsIDOMElement sourceButtonsBlock = createButtonsBlock(visualDocument,
creationData, cloneDefaultLabels.keySet());
+ controlsButtonsTd.appendChild(sourceButtonsBlock);
+
+ // set vertical-align attribute for source buttons
+ controlsButtonsTd.setAttribute(HTML.ATTR_STYLE,
VpeStyleUtil.PARAMETR_VERTICAL_ALIGN + VpeStyleUtil.COLON_STRING
+ + moveControlsAlign);
+
+ // create target box
+ final nsIDOMElement targetBoxTd = visualDocument.createElement(HTML.TAG_TD);
+ final nsIDOMElement targetBox = createBox(visualDocument, creationData,
getChildren(sourceNode), TARGET_LIST); //$NON-NLS-1$
+ targetBox.setAttribute(HTML.ATTR_STYLE, VpeStyleUtil.PARAMETER_WIDTH +
VpeStyleUtil.COLON_STRING + targetListsWidth
+ + VpeStyleUtil.SEMICOLON_STRING + VpeStyleUtil.PARAMETER_HEIGHT +
VpeStyleUtil.COLON_STRING + listsHeight
+ + VpeStyleUtil.SEMICOLON_STRING);
+ targetBoxTd.appendChild(targetBox);
+
+ // add all blocks to "tr"
+ rootTr.appendChild(sourceBoxTd);
+ rootTr.appendChild(controlsButtonsTd);
+ rootTr.appendChild(targetBoxTd);
+
+ rootTBody.appendChild(rootTr);
+ // add "tr" to table
+ rootTable.appendChild(rootTBody);
+// DOMTreeDumper dumpber = new DOMTreeDumper();
+// dumpber.dumpToStream(System.err, rootTable);
+ clearData();
+
+ return creationData;
+ }
+
+ /**
+ * create box (list).
+ *
+ * @param visualDocument the visual document
+ * @param creationData the creation data
+ * @param boxId the box id
+ * @param children the children
+ *
+ * @return the ns IDOM element
+ */
+ private nsIDOMElement createBox(nsIDOMDocument visualDocument, VpeCreationData
creationData, List<Node> children, String boxId) {
+
+ nsIDOMElement div = visualDocument.createElement(HTML.TAG_DIV);
+ div.setAttribute(HTML.ATTR_CLASS,
MessageFormat.format(styleClasses.get(LIST_MAP_KEY), boxId)); //$NON-NLS-1$
+ // create table element
+ nsIDOMElement box = visualDocument.createElement(HTML.TAG_TABLE);
+ box.setAttribute(HTML.ATTR_CELLSPACING, "0"); //$NON-NLS-1$
+ box.setAttribute(HTML.ATTR_CELLPADDING, "0"); //$NON-NLS-1$
+ box.setAttribute(HTML.ATTR_WIDTH, "100%"); //$NON-NLS-1$
+ box.setAttribute(HTML.ATTR_CLASS, "rich-picklist-body");
+ final nsIDOMElement td = visualDocument.createElement(HTML.TAG_TD);
+ final nsIDOMElement tr = visualDocument.createElement(HTML.TAG_TR);
+
+ td.setAttribute(HTML.ATTR_STYLE, TD_STYLE_1);
+ if (SOURCE_LIST.equalsIgnoreCase(boxId)) {
+ addChildrens(visualDocument, children, td, creationData);
+ }
+ box.appendChild(tr);
+ tr.appendChild(td);
+ div.appendChild(box);
+ return div;
+ }
+
+ /**
+ * create button.
+ *
+ * @param buttonId the button id
+ * @param visualDocument the visual document
+ * @param creationData the creation data
+ * @param buttonImage *
+ * param buttonValue *
+ *
+ * @return the ns IDOM element
+ */
+ private nsIDOMElement createButton(nsIDOMDocument visualDocument, VpeCreationData
creationData, String buttonId) {
+
+ nsIDOMElement buttonSpace = visualDocument.createElement(HTML.TAG_DIV);
+ buttonSpace.setAttribute(HTML.ATTR_CLASS,
RICH_PICKLIST_CONTROL_BUTTON_CSS_CLASS); //$NON-NLS-1$
+
+ // button represent "div" element
+ nsIDOMElement metaButton = visualDocument.createElement(HTML.TAG_DIV);
+
+ metaButton.setAttribute(HTML.ATTR_STYLE,
ComponentUtil.getBackgoundImgStyle(BUTTON_IMG_PATH));
+ metaButton.setAttribute(HTML.ATTR_CLASS, RICH_LIST_PICKLIST_BUTTON_CSS_CLASS);
//$NON-NLS-1$
+
+ nsIDOMElement buttonContent = visualDocument.createElement(HTML.TAG_DIV);
+ buttonContent.setAttribute(HTML.ATTR_CLASS,
RICH_LIST_PICKLIST_BUTTON_CONTENT_CSS_CLASS); //$NON-NLS-1$
+
+ nsIDOMElement buttonImage = visualDocument.createElement(HTML.TAG_IMG);
+
+ buttonImage.setAttribute(HTML.ATTR_WIDTH, WIDTH_15); //$NON-NLS-1$
+ buttonImage.setAttribute(HTML.ATTR_HEIGHT, WIDTH_15); //$NON-NLS-1$
+ ComponentUtil.setImg(buttonImage, buttonImages.get(buttonId));
+ buttonContent.appendChild(buttonImage);
+
+ if (isShowButtonLabels) {
+ nsIDOMText buttonText = visualDocument.createTextNode(labels.get(buttonId));
+
+ buttonContent.appendChild(buttonText);
+ }
+
+ buttonSpace.appendChild(metaButton);
+ metaButton.appendChild(buttonContent);
+ return buttonSpace;
+
+ }
+
+ /**
+ * create buttons block.
+ *
+ * @param visualDocument the visual document
+ * @param creationData the creation data
+ * @param buttonNames the button names
+ *
+ * @return the ns IDOM element
+ */
+ private nsIDOMElement createButtonsBlock(nsIDOMDocument visualDocument,
VpeCreationData creationData, Collection<String> buttonNames) {
+
+ // create "div"
+ nsIDOMElement buttonsBlock = visualDocument.createElement(HTML.TAG_DIV);
+ buttonsBlock.setAttribute(HTML.ATTR_CLASS, styleClasses.get(CONTROL_MAP_KEY));
//$NON-NLS-1$
+
+ for (String buttonId : buttonNames) {
+
+ buttonsBlock.appendChild(createButton(visualDocument, creationData,
buttonId));
+
+ }
+
+ return buttonsBlock;
+
+ }
+
+ /**
+ * Creates the item tr.
+ *
+ * @param td *
+ * param child the child
+ * @param child the child
+ * @param visualDocument the visual document
+ *
+ * @return the ns IDOM element
+ */
+ private nsIDOMElement createItemTr(nsIDOMDocument visualDocument, Element child) {
+ final nsIDOMElement tr = visualDocument.createElement(HTML.TAG_TR);
+ final nsIDOMElement td = visualDocument.createElement(HTML.TAG_TD);
+ // tr.setAttribute(HTML.ATTR_CLASS, "rich-picklist-source-row");
+ td.setAttribute(HTML.ATTR_CLASS, RICH_PICKLIST_SOURCE_CELL_CSS_CLASS);
+ nsIDOMElement itemImage = visualDocument.createElement(HTML.TAG_IMG);
+
+ itemImage.setAttribute(HTML.ATTR_WIDTH, "1px"); //$NON-NLS-1$
+ itemImage.setAttribute(HTML.ATTR_HEIGHT, "1px"); //$NON-NLS-1$
+ ComponentUtil.setImg(itemImage, getCssExtension() + SPACER_GIF);
+ tr.appendChild(td);
+ td.appendChild(itemImage);
+ td.appendChild(visualDocument.createTextNode(getTextForSelectItem(child)));
+ return tr;
+
+ }
+
+ /**
+ * Gets the css extension.
+ *
+ * @return the css extension
+ */
+ protected String getCssExtension() {
+ return CSS_EXTENSION;
+ }
+
+ /**
+ * Gets the text for select item.
+ *
+ * @param child the child
+ *
+ * @return the text for select item
+ */
+ private String getTextForSelectItem(Element child) {
+ String result = "";
+ String attrName = RichFaces.ATTR_SELECT_ITEM_LABEL;
+ String defaultValue = "<h:selectItem/>";
+ if (child.getNodeName().endsWith("selectItems")) {
+ attrName = RichFaces.ATTR_VALUE;
+ defaultValue = "<h:selectItems/>";
+ }
+ result = ComponentUtil.getAttribute(child, attrName);
+
+ if (result.trim().length() == 0) {
+ result = defaultValue;
+ }
+ return result;
+ }
+
+ /**
+ * Init.
+ */
+ private void init() {
+ initButtonImagesMap();
+ initDefaultLabelsMap();
+ initDefaultStyleClasses();
+ }
+
+ /**
+ * Inits the button images map.
+ */
+ private void initButtonImagesMap() {
+ // images of the first set of buttons
+ buttonImages.put("copyAllControl", getCssExtension() +
"/arrow_copy_all.gif"); //$NON-NLS-1$ //$NON-NLS-2$
+ buttonImages.put("copyControl", getCssExtension() +
"/arrow_copy.gif"); //$NON-NLS-1$ //$NON-NLS-2$
+ buttonImages.put("removeControl", getCssExtension() +
"/arrow_remove.gif"); //$NON-NLS-1$ //$NON-NLS-2$
+ buttonImages.put("removeAllControl", getCssExtension() +
"/arrow_remove_all.gif"); //$NON-NLS-1$ //$NON-NLS-2$
+
+ }
+
+ /**
+ * Inits the default labels map.
+ */
+ private void initDefaultLabelsMap() {
+ // values of the first set of buttons
+ defaultLabels.put("copyAllControl", "Copy all");
//$NON-NLS-1$ //$NON-NLS-2$
+ defaultLabels.put("copyControl", "Copy"); //$NON-NLS-1$
//$NON-NLS-2$
+ defaultLabels.put("removeControl", "Remove"); //$NON-NLS-1$
//$NON-NLS-2$
+ defaultLabels.put("removeAllControl", "Remove All");
//$NON-NLS-1$ //$NON-NLS-2$
+ }
+
+ /**
+ * Inits the default style classes.
+ */
+ private void initDefaultStyleClasses() {
+ // general style
+ defaultStyleClasses.put("style", "rich-list-picklist");
//$NON-NLS-1$ //$NON-NLS-2$
+
+ defaultStyleClasses.put(LIST_MAP_KEY, "rich-picklist-{0}-items");
//$NON-NLS-1$ //$NON-NLS-2$
+
+ // styles of button's block
+ defaultStyleClasses.put(CONTROL_MAP_KEY, "rich-picklist-controls");
//$NON-NLS-1$ //$NON-NLS-2$
+
+ }
+
+ /**
+ * Checks if is recreate at attr change.
+ *
+ * @param sourceElement the source element
+ * @param value the value
+ * @param visualDocument the visual document
+ * @param visualNode the visual node
+ * @param data the data
+ * @param pageContext the page context
+ * @param name the name
+ *
+ * @return true, if is recreate at attr change
+ */
+ @Override
+ public boolean isRecreateAtAttrChange(VpePageContext pageContext, Element
sourceElement, nsIDOMDocument visualDocument,
+ nsIDOMElement visualNode, Object data, String name, String value) {
+ // TODO Auto-generated method stub
+ return true;
+ }
+
+ /**
+ * prepare data.
+ *
+ * @param sourceElement the source element
+ */
+ private void prepareData(Element sourceElement) {
+ prepareLabels(sourceElement);
+ prepareStyleClasses(sourceElement);
+ prepareOtherParameters(sourceElement);
+ }
+
+ /**
+ * Prepare labels.
+ *
+ * @param sourceElement the source element
+ */
+ private void prepareLabels(Element sourceElement) {
+ // prepare labels
+ final Set<String> labelsKeys = defaultLabels.keySet();
+ for (String key : labelsKeys) {
+
+ String label = sourceElement.getAttribute(key + LABEL_SUFFIX); //$NON-NLS-1$
+
+ if (label != null) {
+ labels.put(key, label);
+ } else {
+ labels.put(key, defaultLabels.get(key));
+ }
+ }
+ }
+
+ /**
+ * Prepare other parameters.
+ *
+ * @param sourceElement the source element
+ */
+ private void prepareOtherParameters(Element sourceElement) {
+
+ isShowButtonLabels = !Boolean.FALSE.toString().equalsIgnoreCase(sourceElement
//$NON-NLS-1$
+ .getAttribute(ATTR_SHOW_BUTTON_LABELS));
+ // prepare buttons attributes
+ moveControlsAlign = sourceElement.getAttribute(ATTR_MOVE_CONTROLS_VERTICAL_ALIGN)
!= null ? sourceElement
+ .getAttribute(ATTR_MOVE_CONTROLS_VERTICAL_ALIGN) : DEFAULT_BUTTON_ALIGN;
+
+ // prepare lists attributes
+
+ String listsHeightString = sourceElement.getAttribute(ATTR_LISTS_HEIGHT);
+ try {
+ listsHeight =
String.valueOf(ComponentUtil.parseWidthHeightValue(listsHeightString));
+ } catch (NumberFormatException e) {
+ listsHeight = DEFAULT_LIST_HEIGHT;
+ }
+
+ String sourceListWithString =
sourceElement.getAttribute(ATTR_SOURCE_LIST_WIDTH);
+ try {
+ sourceListsWidth =
String.valueOf(ComponentUtil.parseWidthHeightValue(sourceListWithString));
+ } catch (NumberFormatException e) {
+ sourceListsWidth = DEFAULT_LIST_WIDTH;
+ }
+
+ String targetListWithString =
sourceElement.getAttribute(ATTR_TARGET_LIST_WIDTH);
+ try {
+ targetListsWidth =
String.valueOf(ComponentUtil.parseWidthHeightValue(targetListWithString));
+ } catch (NumberFormatException e) {
+ targetListsWidth = DEFAULT_LIST_WIDTH;
+ }
+ }
+
+ /**
+ * Prepare style classes.
+ *
+ * @param sourceElement the source element
+ */
+ private void prepareStyleClasses(Element sourceElement) {
+ // prepare style classes
+ Set<String> styleClassesKeys = defaultStyleClasses.keySet();
+ for (String key : styleClassesKeys) {
+
+ String styleClass = sourceElement.getAttribute(key + CLASS_SUFFIX);
//$NON-NLS-1$
+ if (styleClass != null) {
+ styleClasses.put(key, defaultStyleClasses.get(key) + " "
//$NON-NLS-1$
+ + styleClass);
+ } else {
+ styleClasses.put(key, defaultStyleClasses.get(key));
+ }
+ }
+ }
+}
Property changes on:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesPickListTemplate.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native
Added:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesProgressBarTemplate.java
===================================================================
---
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesProgressBarTemplate.java
(rev 0)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesProgressBarTemplate.java 2008-05-29
12:39:23 UTC (rev 8426)
@@ -0,0 +1,169 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2008 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at
http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
+
+package org.jboss.tools.jsf.vpe.richfaces.template;
+
+
+import java.util.List;
+
+import org.jboss.tools.jsf.vpe.richfaces.ComponentUtil;
+import org.jboss.tools.jsf.vpe.richfaces.HtmlComponentUtil;
+import org.jboss.tools.jsf.vpe.richfaces.template.util.RichFaces;
+import org.jboss.tools.vpe.editor.context.VpePageContext;
+import org.jboss.tools.vpe.editor.template.VpeChildrenInfo;
+import org.jboss.tools.vpe.editor.template.VpeCreationData;
+import org.jboss.tools.vpe.editor.util.HTML;
+import org.jboss.tools.vpe.editor.util.VpeStyleUtil;
+import org.mozilla.interfaces.nsIDOMDocument;
+import org.mozilla.interfaces.nsIDOMElement;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+
+
+/**
+ * Template for <rich:progressBar/> tag.
+ *
+ * @author Eugene Stherbin
+ */
+public class RichFacesProgressBarTemplate extends AbstractRichFacesTemplate {
+
+ /** The Constant CSS_EXTENSION. */
+ private static final String CSS_EXTENSION = "progressBar";
+
+ /** The Constant CSS_STYLE. */
+ private static final String CSS_STYLE = "/progressBar.css";
+
+ /** The Constant FACET. */
+ private static final String FACET = "facet";
+
+ /** The Constant OUTPUT_TEXT. */
+ private static final String OUTPUT_TEXT = "outputText";
+
+ /** The Constant PROGRESS_DIV_STYLE_CLASSES. */
+ private static final String PROGRESS_DIV_STYLE_CLASSES =
"rich-progress-bar-block rich-progress-bar-width rich-progress-bar-shell";
+
+ /** The Constant TEXT_ALIGN_LEFT. */
+ private static final String TEXT_ALIGN_LEFT = "; text-align:left;";
+
+ /** The Constant UPLOADED_DIV. */
+ private static final String UPLOADED_DIV = "rich-progress-bar-height
rich-progress-bar-uploaded null";
+
+ /** The percentage. */
+ private String percentage = "60%";
+
+ /** The style. */
+ private String style;
+
+ /** The style class. */
+ private String styleClass;
+
+ /**
+ * Create.
+ *
+ * @param visualDocument the visual document
+ * @param sourceNode the source node
+ * @param pageContext the page context
+ *
+ * @return the vpe creation data
+ *
+ * @see
+ * org.jboss.tools.vpe.editor.template.VpeTemplate#create(org.jboss.tools
+ * .vpe.editor.context.VpePageContext, org.w3c.dom.Node,
+ * org.mozilla.interfaces.nsIDOMDocument)
+ */
+ public VpeCreationData create(VpePageContext pageContext, Node sourceNode,
nsIDOMDocument visualDocument) {
+
+ ComponentUtil.setCSSLink(pageContext, getCssStyle(), getCssExtension());
+ final Element source = (Element) sourceNode;
+ prepareData(source);
+
+ final nsIDOMElement progressDiv =
visualDocument.createElement(HtmlComponentUtil.HTML_TAG_DIV);
+ final nsIDOMElement uploadDiv =
visualDocument.createElement(HtmlComponentUtil.HTML_TAG_DIV);
+ String clazz = PROGRESS_DIV_STYLE_CLASSES;
+ if (ComponentUtil.isNotBlank(this.styleClass)) {
+ clazz = clazz + " " + this.styleClass;
+ }
+ progressDiv.setAttribute(HTML.ATTR_CLASS, clazz);
+ progressDiv.setAttribute(HTML.ATTR_STYLE, this.style + TEXT_ALIGN_LEFT);
+ uploadDiv.setAttribute(HTML.ATTR_CLASS, UPLOADED_DIV);
+
+ uploadDiv.setAttribute(HTML.ATTR_STYLE, this.style +
VpeStyleUtil.SEMICOLON_STRING + VpeStyleUtil.PARAMETER_WIDTH
+ + VpeStyleUtil.COLON_STRING + this.percentage);
+ // rootDiv.appendChild(progressDiv);
+ progressDiv.appendChild(uploadDiv);
+ List<Node> childrens = ComponentUtil.getChildren(source);
+ final VpeCreationData data = new VpeCreationData(progressDiv);
+ if (childrens.size() > 0) {
+ final VpeChildrenInfo info = new VpeChildrenInfo(progressDiv);
+ data.addChildrenInfo(info);
+ for (Node n : childrens) {
+ if (n.getNodeName().indexOf(FACET) > 1 ||
n.getNodeName().indexOf(OUTPUT_TEXT) > 1) {
+ info.addSourceChild(n);
+ }
+ }
+ }
+
+// DOMTreeDumper dump = new DOMTreeDumper();
+// dump.dumpToStream(System.err, progressDiv);
+
+ return data;
+ }
+
+ /**
+ * Gets the css extension.
+ *
+ * @return the css extension
+ */
+ private String getCssExtension() {
+ return CSS_EXTENSION;
+ }
+
+ /**
+ * Gets the css style.
+ *
+ * @return the css style
+ */
+ private String getCssStyle() {
+ return getCssExtension() + CSS_STYLE;
+ }
+
+ /**
+ * Checks if is recreate at attr change.
+ *
+ * @param sourceElement the source element
+ * @param value the value
+ * @param visualDocument the visual document
+ * @param visualNode the visual node
+ * @param data the data
+ * @param pageContext the page context
+ * @param name the name
+ *
+ * @return true, if is recreate at attr change
+ */
+ @Override
+ public boolean isRecreateAtAttrChange(VpePageContext pageContext, Element
sourceElement, nsIDOMDocument visualDocument,
+ nsIDOMElement visualNode, Object data, String name, String value) {
+ return true;
+ }
+
+ /**
+ * Prepare data.
+ *
+ * @param source the source
+ */
+ private void prepareData(Element source) {
+ this.styleClass = ComponentUtil.getAttribute(source,
RichFaces.ATTR_STYLE_CLASS);
+ this.style = ComponentUtil.getAttribute(source, HTML.ATTR_STYLE);
+
+ }
+
+}
Property changes on:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesProgressBarTemplate.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/util/RichFaces.java
===================================================================
---
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/util/RichFaces.java 2008-05-29
12:37:27 UTC (rev 8425)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/util/RichFaces.java 2008-05-29
12:39:23 UTC (rev 8426)
@@ -8,35 +8,74 @@
* Contributors:
* Red Hat, Inc. - initial API and implementation
******************************************************************************/
+
+
package org.jboss.tools.jsf.vpe.richfaces.template.util;
+
/**
- * contain rich faces tags and general attributes
+ * contain rich faces tags and general attributes.
*
* @author Sergey Dzmitrovich
- *
*/
public class RichFaces {
- private RichFaces() {
- }
+ /**
+ * The Constructor.
+ */
+ private RichFaces() {
+ }
- /**
- * jsf tags which are used with richFaces
- */
- public static final String TAG_COLUMN = "column"; //$NON-NLS-1$
- public static final String TAG_FACET = "facet"; //$NON-NLS-1$
+ /** jsf tags which are used with richFaces. */
+ public static final String TAG_COLUMN = "column"; //$NON-NLS-1$
- public static final String ATTR_NAME = "name"; //$NON-NLS-1$
- public static final String ATTR_STYLE = "style"; //$NON-NLS-1$
- public static final String ATTR_WIDTH = "width"; //$NON-NLS-1$
- public static final String ATTR_VALUE = "value"; //$NON-NLS-1$
- public static final String ATTR_INPUT_SIZE = "inputSize"; //$NON-NLS-1$
- public static final String ATTR_INPUT_CLASS = "inputClass"; //$NON-NLS-1$
- public static final String ATTR_INPUT_STYLE = "inputStyle"; //$NON-NLS-1$
- public static final String ATTR_ROW_CLASSES = "rowClasses"; //$NON-NLS-1$
- public static final String ATTR_COLUMN_CLASSES = "columnClasses";
//$NON-NLS-1$
- public static final String ATTR_CONTROLS_TYPE = "controlsType"; //$NON-NLS-1$
- public static final String ATTR_SHOW_BUTTON_LABELS = "showButtonLabels";
//$NON-NLS-1$
+ /** The Constant TAG_FACET. */
+ public static final String TAG_FACET = "facet"; //$NON-NLS-1$
+ /** The Constant ATTR_NAME. */
+ public static final String ATTR_NAME = "name"; //$NON-NLS-1$
+
+ /** The Constant ATTR_STYLE. */
+ public static final String ATTR_STYLE = "style"; //$NON-NLS-1$
+
+ /** The Constant ATTR_WIDTH. */
+ public static final String ATTR_WIDTH = "width"; //$NON-NLS-1$
+
+ /** The Constant ATTR_VALUE. */
+ public static final String ATTR_VALUE = "value"; //$NON-NLS-1$
+
+ /** The Constant ATTR_INPUT_SIZE. */
+ public static final String ATTR_INPUT_SIZE = "inputSize"; //$NON-NLS-1$
+
+ /** The Constant ATTR_INPUT_CLASS. */
+ public static final String ATTR_INPUT_CLASS = "inputClass"; //$NON-NLS-1$
+
+ /** The Constant ATTR_INPUT_STYLE. */
+ public static final String ATTR_INPUT_STYLE = "inputStyle"; //$NON-NLS-1$
+
+ /** The Constant ATTR_ROW_CLASSES. */
+ public static final String ATTR_ROW_CLASSES = "rowClasses"; //$NON-NLS-1$
+
+ /** The Constant ATTR_COLUMN_CLASSES. */
+ public static final String ATTR_COLUMN_CLASSES = "columnClasses";
//$NON-NLS-1$
+
+ /** The Constant ATTR_CONTROLS_TYPE. */
+ public static final String ATTR_CONTROLS_TYPE = "controlsType";
//$NON-NLS-1$
+
+ /** The Constant ATTR_SHOW_BUTTON_LABELS. */
+ public static final String ATTR_SHOW_BUTTON_LABELS = "showButtonLabels";
//$NON-NLS-1$
+
+ /** The Constant ATTR_DEFAULT_LABEL. */
+ public static final String ATTR_DEFAULT_LABEL = "defaultLabel";
+
+ /** The Constant ATTR_ADD_CONTROL_LABEL. */
+ public static final String ATTR_ADD_CONTROL_LABEL = "addControlLabel";
+
+ /** The Constant ATTR_STYLE_CLASS. */
+ public static final String ATTR_STYLE_CLASS = "styleClass";
+
+ public static final String ATTR_SELECT_ITEM_LABEL = "itemLabel";
//$NON-NLS-1$
+
+ public static final String ATTR_SELECT_ITEM_VALUE = "itemValue";
//$NON-NLS-1$
+
}
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/templates/vpe-templates-richfaces.xml
===================================================================
---
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/templates/vpe-templates-richfaces.xml 2008-05-29
12:37:27 UTC (rev 8425)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/templates/vpe-templates-richfaces.xml 2008-05-29
12:39:23 UTC (rev 8426)
@@ -86,7 +86,66 @@
class="org.jboss.tools.jsf.vpe.richfaces.template.RichFacesTreeNodeTemplate">
</vpe:template>
</vpe:tag>
-
+ <vpe:tag name="rich:inplaceInput" case-sensitive="yes">
+ <vpe:template children="no" modify="no"
+ class="org.jboss.tools.jsf.vpe.richfaces.template.RichFacesInplaceInputTemplate">
+ <vpe:dnd>
+ <vpe:drag start-enable="yes" />
+ <vpe:drop container="no" />
+ </vpe:dnd>
+ </vpe:template>
+ </vpe:tag>
+ <vpe:tag name="rich:inplaceSelect" case-sensitive="yes">
+ <vpe:template children="no" modify="no"
+ class="org.jboss.tools.jsf.vpe.richfaces.template.RichFacesInplaceSelectTemplate">
+ <vpe:resize>
+ <vpe:width width-attr="style.width" />
+ <vpe:height height-attr="style.height" />
+ </vpe:resize>
+ <vpe:dnd>
+ <vpe:drag start-enable="yes" />
+ <vpe:drop container="no" />
+ </vpe:dnd>
+ </vpe:template>
+ </vpe:tag>
+ <vpe:tag name="rich:fileUpload" case-sensitive="yes">
+ <vpe:template children="yes" modify="no"
+ class="org.jboss.tools.jsf.vpe.richfaces.template.RichFacesFileUploadTemplate">
+ <vpe:dnd>
+ <vpe:drag start-enable="yes" />
+ <vpe:drop container="no" />
+ <vpe:container-child tag-name="f:facet" />
+ </vpe:dnd>
+ </vpe:template>
+ </vpe:tag>
+ <vpe:tag name="rich:comboBox" case-sensitive="yes">
+ <vpe:template children="no" modify="no"
+ class="org.jboss.tools.jsf.vpe.richfaces.template.RichFacesComboBoxTemplate">
+ <!--vpe:resize>
+ <vpe:width width-attr="style.width" />
+ </vpe:resize-->
+ <vpe:dnd>
+ <vpe:drag start-enable="yes" />
+ <vpe:drop container="no">
+ </vpe:drop>
+ </vpe:dnd>
+ </vpe:template>
+ </vpe:tag>
+ <vpe:tag name="rich:pickList" case-sensitive="yes">
+ <vpe:copy attrs="style" />
+ <vpe:template children="yes" modify="yes"
+ class="org.jboss.tools.jsf.vpe.richfaces.template.RichFacesPickListTemplate">
+ <vpe:dnd>
+ <vpe:drag start-enable="yes" />
+ <vpe:drop container="yes">
+ <vpe:container-child tag-name="selectItem" />
+ <vpe:container-child tag-name="selectItems" />
+ </vpe:drop>
+ </vpe:dnd>
+ <vpe:textFormatting use-default-formats="yes">
+ </vpe:textFormatting>
+ </vpe:template>
+ </vpe:tag>
<vpe:tag name="rich:inputNumberSpinner" case-sensitive="yes">
<vpe:template children="no" modify="no"
class="org.jboss.tools.jsf.vpe.richfaces.template.RichFacesInputNumberSpinnerTemplate">
@@ -100,7 +159,10 @@
</vpe:dnd>
</vpe:template>
</vpe:tag>
-
+ <vpe:tag name="rich:columns" case-sensitive="yes">
+ <vpe:template children="yes" modify="yes"
class="org.jboss.tools.jsf.vpe.richfaces.template.RichFacesColumnsTemplate">
+ </vpe:template>
+ </vpe:tag>
<vpe:tag name="rich:inputNumberSlider" case-sensitive="yes">
<vpe:template children="no" modify="yes"
class="org.jboss.tools.jsf.vpe.richfaces.template.InputNumberSliderTemplate">
@@ -112,6 +174,22 @@
<vpe:drop container="no" />
</vpe:dnd>
</vpe:template>
+ </vpe:tag>
+ <vpe:tag name="rich:progressBar" case-sensitive="yes">
+ <vpe:template children="yes" modify="yes"
+ class="org.jboss.tools.jsf.vpe.richfaces.template.RichFacesProgressBarTemplate">
+ <vpe:resize>
+ <vpe:width width-attr="style.width" />
+ <vpe:height height-attr="style.height" />
+ </vpe:resize>
+ <vpe:dnd>
+ <vpe:drag start-enable="yes" />
+ <vpe:drop container="yes">
+ <vpe:container-child tag-name="outputText" />
+ <vpe:container-child tag-name="facet" />
+ </vpe:drop>
+ </vpe:dnd>
+ </vpe:template>
</vpe:tag>
<vpe:tag name="rich:dataDefinitionList" case-sensitive="yes">