JBoss Tools SVN: r10419 - documentation/trunk/movies/archiving.
by jbosstools-commits@lists.jboss.org
Author: smukhina
Date: 2008-09-23 12:14:03 -0400 (Tue, 23 Sep 2008)
New Revision: 10419
Removed:
documentation/trunk/movies/archiving/archiving.htm
documentation/trunk/movies/archiving/archiving.js
documentation/trunk/movies/archiving/archiving.swf
Log:
https://jira.jboss.org/jira/browse/JBDS-348
generated files are not required in SVN
Deleted: documentation/trunk/movies/archiving/archiving.htm
===================================================================
--- documentation/trunk/movies/archiving/archiving.htm 2008-09-23 15:58:50 UTC (rev 10418)
+++ documentation/trunk/movies/archiving/archiving.htm 2008-09-23 16:14:03 UTC (rev 10419)
@@ -1,27 +0,0 @@
-<!-- saved from url=(0014)about:internet -->
-<HTML>
-<head>
-<link rel="stylesheet" href="../resources/tools.css" type="text/css"/>
-<link xmlns="" rel="shortcut icon" type="image/vnd.microsoft.icon" href="../resources/images/favicon.ico"/>
-</head>
-
-<BODY>
-<div class="book">
-<p id="title"><a href="http://www.jboss.org" class="site_href">
-<strong>JBoss.org</strong></a><a href="http://docs.jboss.org/" class="doc_href">
-<strong >Community Demos</strong></a></p>
-
-<center><OBJECT CLASSID="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" WIDTH="824" HEIGHT="638" CODEBASE="http://active.macromedia.com/flash5/cabs/swflash.cab#version=7,0,0,0">
-<PARAM NAME=movie VALUE="archiving.swf">
-<PARAM NAME=play VALUE=true>
-<PARAM NAME=loop VALUE=false>
-<PARAM NAME=wmode VALUE=transparent>
-<PARAM NAME=quality VALUE=low>
-<EMBED SRC="archiving.swf" WIDTH=824 HEIGHT=638 quality=low loop=false wmode=transparent TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=Sh...">
-</EMBED>
-</OBJECT></center>
-
-</div>
-<SCRIPT src='archiving.js'></script>
-</BODY>
-</HTML>
Deleted: documentation/trunk/movies/archiving/archiving.js
===================================================================
--- documentation/trunk/movies/archiving/archiving.js 2008-09-23 15:58:50 UTC (rev 10418)
+++ documentation/trunk/movies/archiving/archiving.js 2008-09-23 16:14:03 UTC (rev 10419)
@@ -1,3 +0,0 @@
-obj=document.getElementsByTagName('object');
-for (var i=0; i<obj.length; ++i)
- obj[i].outerHTML=obj[i].outerHTML;
Deleted: documentation/trunk/movies/archiving/archiving.swf
===================================================================
(Binary files differ)
15 years, 9 months
JBoss Tools SVN: r10418 - in documentation/trunk/movies: common_resources and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: smukhina
Date: 2008-09-23 11:58:50 -0400 (Tue, 23 Sep 2008)
New Revision: 10418
Added:
documentation/trunk/movies/common_resources/
documentation/trunk/movies/common_resources/custom_box.svg
documentation/trunk/movies/common_resources/custom_left.svg
documentation/trunk/movies/common_resources/custom_left_bottom.svg
documentation/trunk/movies/common_resources/custom_left_top.svg
documentation/trunk/movies/common_resources/custom_right.svg
documentation/trunk/movies/common_resources/custom_right_bottom.svg
documentation/trunk/movies/common_resources/custom_right_top.svg
documentation/trunk/movies/common_resources/custom_top_left.svg
documentation/trunk/movies/common_resources/custom_top_right.svg
documentation/trunk/movies/common_resources/palette_for_demo_movies_(256_colors).pal
Log:
https://jira.jboss.org/jira/browse/JBDS-426
the folder contains standard style elements for movies creation
Added: documentation/trunk/movies/common_resources/custom_box.svg
===================================================================
--- documentation/trunk/movies/common_resources/custom_box.svg (rev 0)
+++ documentation/trunk/movies/common_resources/custom_box.svg 2008-09-23 15:58:50 UTC (rev 10418)
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN"
+ "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
+<svg width="117px" height="75px">
+<polygon points="10 10, 10 64, 106 64, 106 10"
+ style="stroke-width:0;fill:rgb(215,229,244);fill-opacity:0.949;" />
+<polyline points="18 18, 98 18, 98 55, 18 55, 18 18"
+ style="stroke:rgb(0,0,0);fill:none;" />
+<g id="appdata_0_255_255_255_1" />
+</svg>
Added: documentation/trunk/movies/common_resources/custom_left.svg
===================================================================
--- documentation/trunk/movies/common_resources/custom_left.svg (rev 0)
+++ documentation/trunk/movies/common_resources/custom_left.svg 2008-09-23 15:58:50 UTC (rev 10418)
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN"
+ "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
+<svg width="126px" height="114px">
+<path d="M13.848 68.816 C13.848,76.336 21.568,80.583 28.145,80.583 C34.336,80.583 38.05,79.842 40.758,80.170 C43.081,83.454 54.858,96.718 57.567,100.966 C57.567,93.805 57.002,84.923 57.002,81.001 C62.416,81.001 93.957,80.583 99.757,80.583 C105.560,80.583 115.130,74.077 114.754,68.197 C114.754,59.043 115.005,37.625 115.005,26.833 C115.005,18.669 111.302,12.5 103.175,12.5 C95.827,12.5 32.829,12.5 26.633,12.5 C19.079,12.832 13.830,18.625 13.830,25.169 C13.830,30.4 13.848,62.283 13.848,68.816 Z"
+ style="stroke-width:0;fill:rgb(215,229,244);fill-opacity:0.949;" />
+<path d="M10 66.675 C10,74.420 17.973,78.788 24.764,78.788 C31.145,78.788 36.346,78.452 39.133,78.788 C41.525,82.15 53.904,98.641 56.698,103.001 C56.698,95.600 56.698,82.822 56.698,78.788 C62.283,78.788 92.683,78.788 98.670,78.788 C104.649,78.788 114.067,72.725 113.670,66.675 C113.670,57.264 112,33.545 112,22.441 C112,14.043 106.037,10.336 97.670,10.336 C90.084,10.336 28.394,10 22,10 C14.425,9.663 10.336,16.725 10.336,23.454 C10.336,28.833 10,59.949 10,66.675 Z"
+ style="stroke-width:0;fill:rgb(215,229,244);fill-opacity:0.85;" />
+<polyline points="103.408 66.334, 103.408 21.169, 22.4 21.169, 22.4 66.334, 103.408 66.334"
+ style="stroke:rgb(0,0,0);fill:none;" />
+<g id="appdata_0_0_0_0_1" />
+</svg>
Added: documentation/trunk/movies/common_resources/custom_left_bottom.svg
===================================================================
--- documentation/trunk/movies/common_resources/custom_left_bottom.svg (rev 0)
+++ documentation/trunk/movies/common_resources/custom_left_bottom.svg 2008-09-23 15:58:50 UTC (rev 10418)
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN"
+ "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
+<svg width="170px" height="124px">
+<path d="M48.75 111.466 C41.233,111.466 36.983,104.007 36.983,97.663 C36.983,91.697 37.312,86.841 36.983,84.232 C33.703,81.990 17.703,70.416 13.466,67.804 C20.625,67.804 33.069,67.804 36.983,67.804 C36.983,62.574 36.983,34.163 36.983,28.568 C36.983,22.966 42.859,14.163 48.75,14.532 C57.9,14.532 137.3,14.532 148.082,14.532 C156.257,14.532 159.533,20.107 159.533,27.949 C159.533,35.031 159.533,92.066 159.533,98.037 C158.283,105.466 154.283,109.708 147.433,111.466 C142.202,111.466 55.288,111.466 48.75,111.466 Z"
+ style="stroke-width:0;fill:rgb(215,229,244);fill-opacity:0.6;" />
+<path d="M46 113.666 C38.331,113.666 34,105.692 34,98.9 C34,92.516 34.331,87.324 34,84.531 C30.663,82.137 14.330,69.766 10,66.966 C17.329,66.966 30,66.966 34,66.966 C34,61.382 34,30.983 34,25 C34,19.014 40,9.591 46,10 C55.331,10 136.332,10 147.332,10 C155.666,10 159,15.955 159,24.334 C159,31.913 159,92.916 159,99.308 C159.332,106.882 153.332,113.666 146.666,113.666 C141.332,113.666 52.666,113.666 46,113.666 Z"
+ style="stroke-width:0;fill:rgb(215,229,244);fill-opacity:0.85;" />
+<polyline points="46.331 21.163, 147.332 21.163, 147.332 100.166, 46.331 100.166, 46.331 21.163"
+ style="stroke:rgb(0,0,0);fill:none;" />
+<g id="appdata_0_0_0_0_1" />
+</svg>
Added: documentation/trunk/movies/common_resources/custom_left_top.svg
===================================================================
--- documentation/trunk/movies/common_resources/custom_left_top.svg (rev 0)
+++ documentation/trunk/movies/common_resources/custom_left_top.svg 2008-09-23 15:58:50 UTC (rev 10418)
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN"
+ "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
+<svg width="170px" height="124px">
+<path d="M47.733 11.531 C40.218,11.531 35.966,19.362 35.966,26.037 C35.966,32.316 36.291,37.420 35.966,40.172 C32.687,42.529 16.675,54.692 12.437,57.441 C19.597,57.441 32.045,57.441 35.966,57.441 C35.966,62.937 35.966,92.824 35.966,98.708 C35.966,104.594 41.848,113.850 47.733,113.469 C56.889,113.469 136.327,113.469 147.115,113.469 C155.288,113.469 158.562,107.608 158.562,99.358 C158.562,91.908 158.562,31.929 158.562,25.644 C158.875,18.197 153,11.531 146.461,11.531 C141.225,11.531 54.276,11.531 47.733,11.531 Z"
+ style="stroke-width:0;fill:rgb(215,229,244);fill-opacity:0.6;" />
+<path d="M46 10 C38.331,10 34,17.973 34,24.764 C34,31.149 34.331,36.341 34,39.134 C30.663,41.529 14.330,53.899 10,56.697 C17.329,56.697 30,56.697 34,56.697 C34,62.283 34,92.678 34,98.666 C34,104.649 40,114.062 46,113.666 C55.331,113.666 136.332,113.666 147.332,113.666 C155.666,113.666 159,107.702 159,99.332 C159,91.749 159,30.75 159,24.358 C159.332,16.783 153.332,10 146.666,10 C141.332,10 52.666,10 46,10 Z"
+ style="stroke-width:0;fill:rgb(215,229,244);fill-opacity:0.85;" />
+<polyline points="46.331 24.5, 147.332 24.5, 147.332 103.5, 46.331 103.5, 46.331 24.5"
+ style="stroke:rgb(0,0,0);fill:none;" />
+<g id="appdata_0_0_0_0_1" />
+</svg>
Added: documentation/trunk/movies/common_resources/custom_right.svg
===================================================================
--- documentation/trunk/movies/common_resources/custom_right.svg (rev 0)
+++ documentation/trunk/movies/common_resources/custom_right.svg 2008-09-23 15:58:50 UTC (rev 10418)
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN"
+ "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
+<svg width="125px" height="124px">
+<path d="M114.408 68.348 C112.5,75.898 106.3,79.362 99.3,80.362 C93.021,80.362 87.045,79.975 84.3,80.3 C81.949,83.576 84,83 108,109 C81,80 68.3,83.891 68.3,79.966 C62.804,79.966 33.179,80.362 27.3,80.362 C21.407,80.362 12.086,74.233 12.466,68.348 C12.466,59.19 11.764,37.15 11.764,26.358 C11.764,18.187 15.519,12.026 23.764,12.026 C31.216,12.026 95.149,12.026 101.433,12.026 C109.098,12.358 114.433,18.158 114.433,24.699 C114.433,29.931 114.408,61.810 114.408,68.348 Z"
+ style="stroke-width:0;fill:rgb(215,229,244);fill-opacity:0.6;" />
+<path d="M113.668 66.675 C113.668,74.416 105.695,78.788 98.904,78.788 C92.519,78.788 87.324,78.452 84.537,78.788 C82.139,82.15 81,78 109,113 C78,81 66.966,82.824 66.966,78.788 C61.383,78.788 30.983,78.788 25,78.788 C19.014,78.788 9.591,72.725 10,66.675 C10,57.264 11.668,33.545 11.668,22.441 C11.668,14.037 17.625,10.336 26,10.336 C33.574,10.336 95.274,10 101.668,10 C109.239,9.663 113.332,16.722 113.332,23.454 C113.332,28.833 113.668,59.949 113.668,66.675 Z"
+ style="stroke-width:0;fill:rgb(215,229,244);fill-opacity:0.85;" />
+<polyline points="20.262 66.334, 20.262 21.169, 101.262 21.169, 101.262 66.334, 20.262 66.334"
+ style="stroke:rgb(0,0,0);fill:none;" />
+<g id="appdata_0_0_0_0_1" />
+</svg>
Added: documentation/trunk/movies/common_resources/custom_right_bottom.svg
===================================================================
--- documentation/trunk/movies/common_resources/custom_right_bottom.svg (rev 0)
+++ documentation/trunk/movies/common_resources/custom_right_bottom.svg 2008-09-23 15:58:50 UTC (rev 10418)
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN"
+ "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
+<svg width="170px" height="124px">
+<path d="M122.214 112.465 C129.725,112.465 133.975,105.007 133.975,98.661 C133.975,92.697 133.653,87.843 133.975,85.231 C137.258,82.984 153.262,71.416 157.499,68.805 C150.340,68.805 137.894,68.805 133.975,68.805 C133.975,63.578 133.975,35.163 133.975,29.568 C133.975,23.966 128.098,15.163 122.214,15.532 C113.066,15.532 33.658,15.532 22.876,15.532 C14.706,15.532 11.436,21.103 11.436,28.949 C11.436,36.031 11.436,93.065 11.436,99.037 C12.686,106.465 16.686,110.710 23.531,112.465 C28.764,112.465 115.675,112.465 122.214,112.465 Z"
+ style="stroke-width:0;fill:rgb(215,229,244);fill-opacity:0.6;" />
+<path d="M122.999 113.666 C130.664,113.666 135,105.692 135,98.899 C135,92.516 134.664,87.324 135,84.531 C138.332,82.137 154.664,69.766 159,66.966 C151.669,66.966 139,66.966 135,66.966 C135,61.382 135,30.983 135,25 C135,19.014 129,9.593 122.999,10 C113.665,10 32.663,10 21.663,10 C13.330,10 10,15.955 10,24.334 C10,31.913 10,92.916 10,99.308 C9.663,106.882 15.663,113.666 22.333,113.666 C27.663,113.666 116.327,113.666 122.999,113.666 Z"
+ style="stroke-width:0;fill:rgb(215,229,244);fill-opacity:0.85;" />
+<polyline points="21.75 21.163, 123.749 21.163, 123.749 100.166, 21.75 100.166, 21.75 21.163"
+ style="stroke:rgb(0,0,0);fill:none;" />
+<g id="appdata_0_0_0_0_1" />
+</svg>
Added: documentation/trunk/movies/common_resources/custom_right_top.svg
===================================================================
--- documentation/trunk/movies/common_resources/custom_right_top.svg (rev 0)
+++ documentation/trunk/movies/common_resources/custom_right_top.svg 2008-09-23 15:58:50 UTC (rev 10418)
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN"
+ "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
+<svg width="170px" height="125px">
+<path d="M124.202 12.062 C131.716,12.062 135.966,19.896 135.966,26.568 C135.966,32.848 135.640,37.953 135.966,40.703 C139.25,43.06 155.258,55.222 159.5,57.967 C152.332,57.967 139.890,57.967 135.966,57.967 C135.966,63.470 135.966,93.351 135.966,99.239 C135.966,105.130 130.081,114.382 124.202,114 C115.045,114 35.608,114 24.816,114 C16.645,114 13.375,108.139 13.375,99.891 C13.375,92.441 13.375,32.460 13.375,26.175 C13.056,18.724 18.936,12.062 25.473,12.062 C30.708,12.062 117.661,12.062 124.202,12.062 Z"
+ style="stroke-width:0;fill:rgb(215,229,244);fill-opacity:0.6;" />
+<path d="M123 10 C130.666,10 135,17.973 135,24.764 C135,31.145 134.666,36.341 135,39.134 C138.332,41.529 154.666,53.896 159,56.698 C151.671,56.698 139,56.698 135,56.698 C135,62.283 135,92.675 135,98.666 C135,104.65 129,114.062 123,113.666 C113.666,113.666 32.663,113.666 21.663,113.666 C13.330,113.666 10,107.702 10,99.332 C10,91.745 10,30.75 10,24.358 C9.663,16.783 15.663,10 22.333,10 C27.663,10 116.332,10 123,10 Z"
+ style="stroke-width:0;fill:rgb(215,229,244);fill-opacity:0.85;" />
+<polyline points="122.666 24.495, 21.663 24.495, 21.663 103.5, 122.666 103.5, 122.666 24.495"
+ style="stroke:rgb(0,0,0);fill:none;" />
+<g id="appdata_0_0_0_0_1" />
+</svg>
Added: documentation/trunk/movies/common_resources/custom_top_left.svg
===================================================================
--- documentation/trunk/movies/common_resources/custom_top_left.svg (rev 0)
+++ documentation/trunk/movies/common_resources/custom_top_left.svg 2008-09-23 15:58:50 UTC (rev 10418)
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN"
+ "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
+<svg width="125px" height="116px">
+<path d="M12.932 49.429 C12.932,41.913 20.649,37.663 27.226,37.663 C33.420,37.663 37.135,38.404 39.842,38.079 C42.164,34.795 54.127,18.490 56.835,14.25 C56.835,21.413 56.086,33.324 56.086,37.25 C61.501,37.25 93.045,37.663 98.841,37.663 C104.644,37.663 114.210,44.170 113.833,50.05 C113.833,59.206 114.086,80.625 114.086,91.413 C114.086,99.580 110.389,105.75 102.260,105.75 C94.908,105.75 31.908,105.75 25.717,105.75 C18.164,105.413 12.908,99.620 12.908,93.081 C12.908,87.843 12.932,55.966 12.932,49.429 Z"
+ style="stroke-width:0;fill:rgb(215,229,244);fill-opacity:0.6;" />
+<path d="M10 46.322 C10,38.574 17.973,34.210 24.764,34.210 C31.145,34.210 36.346,34.548 39.133,34.210 C41.525,30.848 53.904,14.358 56.698,10 C56.698,17.394 56.698,30.175 56.698,34.210 C62.283,34.210 92.683,34.210 98.670,34.210 C104.649,34.210 114.067,40.268 113.670,46.322 C113.670,55.733 112,79.454 112,90.553 C112,98.957 106.037,102.661 97.670,102.661 C90.084,102.661 28.394,103 22,103 C14.425,103.334 10.336,96.269 10.336,89.543 C10.336,84.163 10,53.05 10,46.322 Z"
+ style="stroke-width:0;fill:rgb(215,229,244);fill-opacity:0.85;" />
+<polyline points="103.408 46.666, 103.408 91.832, 22.4 91.832, 22.4 46.666, 103.408 46.666"
+ style="stroke:rgb(0,0,0);fill:none;" />
+<g id="appdata_0_0_0_0_1" />
+</svg>
Added: documentation/trunk/movies/common_resources/custom_top_right.svg
===================================================================
--- documentation/trunk/movies/common_resources/custom_top_right.svg (rev 0)
+++ documentation/trunk/movies/common_resources/custom_top_right.svg 2008-09-23 15:58:50 UTC (rev 10418)
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN"
+ "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
+<svg width="125px" height="121px">
+<path d="M114.733 53.807 C114.733,46.288 106.904,42.041 100.228,42.041 C93.949,42.041 90.177,42.781 87.428,42.456 C85.077,39.175 97.875,25.75 102.875,12.25 C94.074,19.25 76.8,31.525 68.828,42.041 C63.333,42.041 33.444,42.041 27.562,42.041 C21.670,42.041 12.413,47.923 12.8,53.807 C12.8,62.964 12.09,85.005 12.09,95.791 C12.09,103.965 15.848,110.125 24.095,110.125 C31.548,110.125 95.478,110.125 101.762,110.125 C109.428,109.791 114.762,103.999 114.762,97.457 C114.762,92.220 114.733,60.345 114.733,53.807 Z"
+ style="stroke-width:0;fill:rgb(215,229,244);fill-opacity:0.6;" />
+<path d="M113.668 51.444 C113.668,43.708 105.695,39.335 98.904,39.335 C92.519,39.335 91.661,39.086 88.875,38.75 C85.101,36.574 106.173,14.358 103.375,10 C98.875,16.25 72.125,34.711 72.125,38.75 C66.541,38.75 30.983,39.335 25,39.335 C19.014,39.335 9.593,45.393 10,51.444 C10,60.858 11.669,84.576 11.669,95.678 C11.669,104.082 17.625,107.786 26,107.786 C33.583,107.786 95.274,108.125 101.668,108.125 C109.239,108.458 113.332,101.394 113.332,94.668 C113.332,89.288 113.668,58.175 113.668,51.444 Z"
+ style="stroke-width:0;fill:rgb(215,229,244);fill-opacity:0.85;" />
+<polyline points="20.262 51.791, 20.262 96.957, 101.262 96.957, 101.262 51.791, 20.262 51.791"
+ style="stroke:rgb(0,0,0);fill:none;" />
+<g id="appdata_0_0_0_0_1" />
+</svg>
Added: documentation/trunk/movies/common_resources/palette_for_demo_movies_(256_colors).pal
===================================================================
--- documentation/trunk/movies/common_resources/palette_for_demo_movies_(256_colors).pal (rev 0)
+++ documentation/trunk/movies/common_resources/palette_for_demo_movies_(256_colors).pal 2008-09-23 15:58:50 UTC (rev 10418)
@@ -0,0 +1,257 @@
+JASC-PAL
+0100
+254
+15 15 15
+25 29 34
+28 36 31
+30 36 42
+30 39 49
+32 30 30
+32 32 30
+56 54 52
+29 8 89
+28 50 71
+30 59 96
+47 59 71
+13 78 15
+6 103 11
+26 111 49
+37 92 35
+48 111 51
+24 64 65
+19 87 126
+51 70 87
+51 80 108
+47 123 65
+48 106 117
+64 62 61
+120 22 24
+118 41 50
+64 63 78
+127 0 85
+123 58 70
+122 50 97
+66 64 61
+67 109 62
+121 82 45
+109 109 63
+80 80 79
+77 90 103
+82 104 83
+87 101 112
+98 92 91
+125 84 104
+102 100 90
+112 111 110
+33 4 147
+38 2 210
+56 17 254
+53 93 132
+57 102 144
+59 120 176
+65 28 254
+78 44 254
+91 79 153
+93 75 161
+80 112 144
+72 120 169
+100 89 158
+104 91 162
+100 116 132
+101 123 173
+94 67 254
+111 84 254
+124 99 254
+35 135 31
+49 141 50
+18 134 80
+54 136 72
+59 153 99
+67 169 54
+124 136 63
+126 190 63
+75 147 83
+85 152 101
+85 171 82
+87 163 101
+106 151 85
+110 145 112
+112 175 81
+111 173 113
+121 196 54
+116 194 80
+120 203 105
+58 139 151
+61 129 190
+63 191 159
+62 130 193
+85 141 141
+75 133 186
+84 165 136
+80 166 177
+108 130 136
+105 130 154
+99 144 153
+122 131 137
+119 134 151
+126 157 129
+121 148 158
+113 141 176
+117 175 133
+103 170 182
+74 143 207
+92 162 218
+106 154 202
+115 167 214
+114 174 230
+82 200 144
+125 201 137
+97 205 202
+141 23 20
+146 33 30
+144 46 45
+168 27 16
+173 42 30
+170 49 40
+130 7 90
+139 26 102
+149 46 116
+186 56 79
+144 93 50
+150 108 59
+178 92 20
+182 65 51
+181 113 21
+169 113 47
+144 83 79
+137 85 106
+142 113 80
+132 123 111
+180 86 82
+172 117 75
+184 112 107
+203 57 41
+204 26 65
+211 58 91
+232 60 66
+205 69 53
+194 120 19
+228 73 53
+208 86 71
+207 76 103
+201 103 86
+209 111 105
+241 77 83
+255 92 98
+228 99 82
+237 115 112
+154 62 128
+156 67 131
+130 127 149
+131 119 176
+166 80 139
+176 102 154
+183 118 165
+141 126 193
+136 113 254
+221 104 129
+251 124 128
+142 157 63
+150 182 63
+189 132 28
+180 141 48
+187 164 63
+150 136 78
+142 135 120
+148 175 75
+140 175 115
+179 144 78
+172 151 109
+182 162 86
+180 169 120
+148 213 61
+166 206 63
+186 249 63
+140 199 86
+147 200 103
+165 203 91
+166 203 113
+170 235 79
+197 135 26
+198 143 56
+207 175 56
+227 157 22
+200 148 76
+207 143 109
+206 165 84
+207 174 112
+233 134 123
+239 176 77
+229 186 108
+243 220 63
+219 207 81
+214 192 121
+251 192 95
+240 202 119
+245 242 111
+153 147 136
+141 153 170
+143 176 142
+151 165 176
+162 154 140
+182 141 177
+179 169 154
+182 177 169
+140 154 193
+152 136 254
+147 175 204
+136 182 227
+165 154 205
+168 152 254
+172 184 202
+179 171 249
+144 199 144
+155 197 168
+173 203 148
+178 202 178
+190 224 170
+155 198 209
+155 193 230
+157 227 203
+181 196 210
+173 202 230
+214 150 140
+199 145 181
+206 183 144
+195 187 175
+240 143 139
+242 158 161
+232 165 157
+241 174 171
+194 155 193
+209 177 202
+195 184 254
+249 189 192
+213 196 149
+205 197 185
+207 233 177
+241 212 142
+231 212 177
+251 227 147
+246 232 179
+214 209 201
+201 216 237
+215 228 210
+212 227 242
+225 220 213
+230 217 241
+232 227 219
+39 35 29
+229 235 246
+235 243 234
+232 242 253
+240 237 233
+243 235 245
+243 241 237
+14 14 14
+255 255 255
15 years, 9 months
JBoss Tools SVN: r10416 - trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2008-09-23 11:44:48 -0400 (Tue, 23 Sep 2008)
New Revision: 10416
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el/ElVarSearcher.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el/Var.java
Log:
JBIDE-1497.
ElVarSearcher and Var classes are transferred to new EL parser.
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el/ElVarSearcher.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el/ElVarSearcher.java 2008-09-23 15:42:06 UTC (rev 10415)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el/ElVarSearcher.java 2008-09-23 15:44:48 UTC (rev 10416)
@@ -24,6 +24,7 @@
import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
import org.eclipse.wst.sse.ui.internal.contentassist.ContentAssistUtils;
import org.eclipse.wst.xml.core.internal.provisional.document.IDOMAttr;
+import org.jboss.tools.common.el.core.model.ELExpression;
import org.jboss.tools.seam.core.ISeamProject;
import org.jboss.tools.seam.core.SeamCorePlugin;
import org.w3c.dom.Element;
@@ -248,14 +249,14 @@
if(vars!=null) {
ArrayList<Var> parentVars = new ArrayList<Var>();
for (Var var : vars) {
- ELToken token = var.getElToken();
+ ELExpression token = var.getElToken();
if(token!=null && !token.getText().endsWith(".")) {
String varName = var.getName();
- if(el.equals(varName) || el.startsWith(varName + ".")) {
+ if(el.equals(varName)) {
if(var.getElToken()!=null && initializeNestedVars) {
Var parentVar = findVarForEl(var.getElToken().getText(), parentVars, true);
if(parentVar!=null) {
- ELToken resolvedToken = parentVar.getResolvedElToken();
+ ELExpression resolvedToken = parentVar.getResolvedElToken();
if(resolvedToken==null && parentVar.getElToken()!=null) {
try {
// Initialize parent vars.
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el/Var.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el/Var.java 2008-09-23 15:42:06 UTC (rev 10415)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el/Var.java 2008-09-23 15:44:48 UTC (rev 10416)
@@ -1,3 +1,13 @@
+/*******************************************************************************
+ * Copyright (c) 2007 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:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
package org.jboss.tools.seam.internal.core.el;
import java.util.List;
@@ -2,2 +12,8 @@
+import org.jboss.tools.common.el.core.model.ELExpression;
+import org.jboss.tools.common.el.core.model.ELInstance;
+import org.jboss.tools.common.el.core.model.ELModel;
+import org.jboss.tools.common.el.core.parser.ELParser;
+import org.jboss.tools.common.el.core.parser.ELParserFactory;
+
/**
@@ -9,9 +25,9 @@
public class Var {
String name;
String value;
- ELToken elToken;
+ ELExpression elToken;
String resolvedValue;
- ELToken resolvedElToken;
+ ELExpression resolvedElToken;
int declOffset;
int declLength;
@@ -38,16 +54,14 @@
this(name, value, 0, 0);
}
- ELToken parseEl(String el) {
+ ELExpression parseEl(String el) {
if(el.length()>3 && el.startsWith("#{") && el.endsWith("}")) {
- String elBody = el.substring(0, el.length()-1).substring(2);
- SeamELTokenizer elTokenizer = new SeamELTokenizer(elBody);
- List<ELToken> tokens = elTokenizer.getTokens();
- for (ELToken token : tokens) {
- if(token.getType()==ELToken.EL_VARIABLE_TOKEN) {
- return token;
- }
- }
+ ELParser parser = ELParserFactory.createJbossParser();
+ ELModel model = parser.parse(el);
+ if(model == null || parser.getSyntaxErrors().size() > 0) return null;
+ List<ELInstance> is = model.getInstances();
+ if(is.size() == 0) return null;
+ return is.get(0).getExpression();
}
return null;
}
@@ -73,14 +87,14 @@
/**
* @return parsed EL from "value" attribute. Returns null if EL is not valid.
*/
- public ELToken getElToken() {
+ public ELExpression getElToken() {
return elToken;
}
/**
* @return parsed resolved EL from "value" attribute. May be null.
*/
- public ELToken getResolvedElToken() {
+ public ELExpression getResolvedElToken() {
return resolvedElToken;
}
15 years, 9 months
JBoss Tools SVN: r10415 - in trunk/common/tests/org.jboss.tools.common.el.core.test: META-INF and 8 other directories.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2008-09-23 11:42:06 -0400 (Tue, 23 Sep 2008)
New Revision: 10415
Added:
trunk/common/tests/org.jboss.tools.common.el.core.test/.classpath
trunk/common/tests/org.jboss.tools.common.el.core.test/.cvsignore
trunk/common/tests/org.jboss.tools.common.el.core.test/.project
trunk/common/tests/org.jboss.tools.common.el.core.test/META-INF/
trunk/common/tests/org.jboss.tools.common.el.core.test/META-INF/MANIFEST.MF
trunk/common/tests/org.jboss.tools.common.el.core.test/about.html
trunk/common/tests/org.jboss.tools.common.el.core.test/ant.properties
trunk/common/tests/org.jboss.tools.common.el.core.test/build.properties
trunk/common/tests/org.jboss.tools.common.el.core.test/info.xml
trunk/common/tests/org.jboss.tools.common.el.core.test/src/
trunk/common/tests/org.jboss.tools.common.el.core.test/src/org/
trunk/common/tests/org.jboss.tools.common.el.core.test/src/org/jboss/
trunk/common/tests/org.jboss.tools.common.el.core.test/src/org/jboss/tools/
trunk/common/tests/org.jboss.tools.common.el.core.test/src/org/jboss/tools/common/
trunk/common/tests/org.jboss.tools.common.el.core.test/src/org/jboss/tools/common/el/
trunk/common/tests/org.jboss.tools.common.el.core.test/src/org/jboss/tools/common/el/core/
trunk/common/tests/org.jboss.tools.common.el.core.test/src/org/jboss/tools/common/el/core/test/
trunk/common/tests/org.jboss.tools.common.el.core.test/src/org/jboss/tools/common/el/core/test/CommonELAllTests.java
trunk/common/tests/org.jboss.tools.common.el.core.test/src/org/jboss/tools/common/el/core/test/ELParserTest.java
Log:
JBIDE-1497.
Initial import.
Added: trunk/common/tests/org.jboss.tools.common.el.core.test/.classpath
===================================================================
--- trunk/common/tests/org.jboss.tools.common.el.core.test/.classpath (rev 0)
+++ trunk/common/tests/org.jboss.tools.common.el.core.test/.classpath 2008-09-23 15:42:06 UTC (rev 10415)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
Added: trunk/common/tests/org.jboss.tools.common.el.core.test/.cvsignore
===================================================================
--- trunk/common/tests/org.jboss.tools.common.el.core.test/.cvsignore (rev 0)
+++ trunk/common/tests/org.jboss.tools.common.el.core.test/.cvsignore 2008-09-23 15:42:06 UTC (rev 10415)
@@ -0,0 +1 @@
+bin
Added: trunk/common/tests/org.jboss.tools.common.el.core.test/.project
===================================================================
--- trunk/common/tests/org.jboss.tools.common.el.core.test/.project (rev 0)
+++ trunk/common/tests/org.jboss.tools.common.el.core.test/.project 2008-09-23 15:42:06 UTC (rev 10415)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.jboss.tools.common.el.core.test</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
Added: trunk/common/tests/org.jboss.tools.common.el.core.test/META-INF/MANIFEST.MF
===================================================================
--- trunk/common/tests/org.jboss.tools.common.el.core.test/META-INF/MANIFEST.MF (rev 0)
+++ trunk/common/tests/org.jboss.tools.common.el.core.test/META-INF/MANIFEST.MF 2008-09-23 15:42:06 UTC (rev 10415)
@@ -0,0 +1,16 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: JSF Tests Plug-in
+Bundle-SymbolicName: org.jboss.tools.common.el.core.test;singleton:=true
+Bundle-Version: 2.0.0
+Bundle-ClassPath: common-el-tests.jar
+Bundle-Vendor: Red Hat, Inc.
+Export-Package: org.jboss.tools.common.el.core.test
+Require-Bundle:
+ org.junit,
+ org.eclipse.core.runtime,
+ org.eclipse.core.resources,
+ org.jboss.tools.common.el.core,
+ org.jboss.tools.common.test,
+ org.jboss.tools.tests
+Provide-Package: org.jboss.tools.common.el.core.test
Added: trunk/common/tests/org.jboss.tools.common.el.core.test/about.html
===================================================================
--- trunk/common/tests/org.jboss.tools.common.el.core.test/about.html (rev 0)
+++ trunk/common/tests/org.jboss.tools.common.el.core.test/about.html 2008-09-23 15:42:06 UTC (rev 10415)
@@ -0,0 +1,34 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
+<HTML>
+
+<head>
+<title>About</title>
+<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
+</head>
+
+<BODY lang="EN-US">
+
+<H3>About This Content</H3>
+
+<P>©2007 Red Hat, Inc. All rights reserved</P>
+
+<H3>License</H3>
+
+<P>Red Hat Inc., through its JBoss division, makes available all content in this plug-in
+("Content"). Unless otherwise indicated below, the Content is provided to you
+under the terms and conditions of the Eclipse Public License Version 1.0
+("EPL"). A copy of the EPL is available at
+<A href="http://www.eclipse.org/org/documents/epl-v10.php">http://www.eclipse.org/org/documents/epl-v10.php</A>.
+For purposes of the EPL, "Program" will mean the Content.</P>
+
+<P>If you did not receive this Content directly from Red Hat Inc., the
+Content is being redistributed by another party ("Redistributor") and different
+terms and conditions may apply to your use of any object code in the Content.
+Check the Redistributor's license that was provided with the Content. If no such
+license exists, contact the Redistributor. Unless otherwise indicated below, the
+terms and conditions of the EPL still apply to any source code in the Content
+and such source code may be obtained at
+ <A href="http://www.jboss.org/tools">http://www.jboss.org/tools</A>.</P>
+
+</BODY>
+</HTML>
\ No newline at end of file
Added: trunk/common/tests/org.jboss.tools.common.el.core.test/ant.properties
===================================================================
Added: trunk/common/tests/org.jboss.tools.common.el.core.test/build.properties
===================================================================
--- trunk/common/tests/org.jboss.tools.common.el.core.test/build.properties (rev 0)
+++ trunk/common/tests/org.jboss.tools.common.el.core.test/build.properties 2008-09-23 15:42:06 UTC (rev 10415)
@@ -0,0 +1,14 @@
+bin.includes = plugin.xml,\
+ META-INF/,\
+ common-el-tests.jar,\
+ info.xml,\
+ projects/
+src.includes = META-INF/,\
+ ant.properties,\
+ build.properties,\
+ info.xml,\
+ plugin.xml,\
+ src/,\
+ test.xml
+source.common-el-tests.jar = src/
+jars.compile.order =
Added: trunk/common/tests/org.jboss.tools.common.el.core.test/info.xml
===================================================================
--- trunk/common/tests/org.jboss.tools.common.el.core.test/info.xml (rev 0)
+++ trunk/common/tests/org.jboss.tools.common.el.core.test/info.xml 2008-09-23 15:42:06 UTC (rev 10415)
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<plugin name="org.jboss.tools.common.model">
+ <classes>
+ <class path="/XModelEntityGroup/MAPPINGS/MAPPING/PAIR@value" />
+ <class path="/XModelEntityGroup/XModelEntity@AdoptManagerClass" />
+ <class path="/XModelEntityGroup/XModelEntity@ImplementationLoadingClass" />
+ <class path="/XModelEntityGroup/XModelEntity@ImplementingClass" />
+ </classes>
+</plugin>
\ No newline at end of file
Added: trunk/common/tests/org.jboss.tools.common.el.core.test/src/org/jboss/tools/common/el/core/test/CommonELAllTests.java
===================================================================
--- trunk/common/tests/org.jboss.tools.common.el.core.test/src/org/jboss/tools/common/el/core/test/CommonELAllTests.java (rev 0)
+++ trunk/common/tests/org.jboss.tools.common.el.core.test/src/org/jboss/tools/common/el/core/test/CommonELAllTests.java 2008-09-23 15:42:06 UTC (rev 10415)
@@ -0,0 +1,28 @@
+/*******************************************************************************
+ * 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.common.el.core.test;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+/**
+ * @author V.Kabanovich
+ *
+ */
+public class CommonELAllTests {
+ public static final String PLUGIN_ID = "org.jboss.tools.common.el.core";
+ //
+ public static Test suite() {
+ TestSuite suite = new TestSuite();
+ suite.setName("All tests for " + PLUGIN_ID);
+ suite.addTestSuite(ELParserTest.class);
+ return suite;
+ }
+}
Added: trunk/common/tests/org.jboss.tools.common.el.core.test/src/org/jboss/tools/common/el/core/test/ELParserTest.java
===================================================================
--- trunk/common/tests/org.jboss.tools.common.el.core.test/src/org/jboss/tools/common/el/core/test/ELParserTest.java (rev 0)
+++ trunk/common/tests/org.jboss.tools.common.el.core.test/src/org/jboss/tools/common/el/core/test/ELParserTest.java 2008-09-23 15:42:06 UTC (rev 10415)
@@ -0,0 +1,96 @@
+/*******************************************************************************
+ * 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.common.el.core.test;
+
+import java.util.List;
+
+import org.jboss.tools.common.el.core.parser.LexicalToken;
+import org.jboss.tools.common.el.core.parser.SyntaxError;
+import org.jboss.tools.common.el.core.parser.Tokenizer;
+import org.jboss.tools.common.el.core.parser.TokenizerFactory;
+
+import junit.framework.TestCase;
+
+public class ELParserTest extends TestCase {
+
+ public ELParserTest() {}
+
+ protected void setUp() throws Exception {
+ }
+
+ public void testTokenizerOnCorrectEL() {
+ Tokenizer t = TokenizerFactory.createJbossTokenizer();
+
+ //1. One variable
+ checkCorrectEL(t, "#{a}");
+ //2. Two EL instances
+ checkCorrectEL(t, "#{a}#{b}");
+ //3. Property invocation
+ checkCorrectEL(t, "#{a.b}");
+ //4. Argument invocation
+ checkCorrectEL(t, "#{a.b['xxx']}");
+ //5a. Method invocation
+ checkCorrectEL(t, "#{a.b()}");
+ //5b. Method invocation with one parameter
+ checkCorrectEL(t, "#{a.b(c)}");
+ //5b. Method invocation with two parameters
+ checkCorrectEL(t, "#{a.b(c.d , e['u'])}");
+ //6. Numeric
+ checkCorrectEL(t, "#{a.b(16.900)}");
+ //7. Boolean
+ checkCorrectEL(t, "#{a.b(false)}");
+ //8. Operators
+ checkCorrectEL(t, "#{a.b(7 + 8) * 4 / 2 - 1}");
+ //9. Complex expressions
+ checkCorrectEL(t, "#{a.b(7 + 8) * (4 / 2 - 1)/c.d}");
+ }
+
+ private void checkCorrectEL(Tokenizer t, String test) {
+ LexicalToken token = t.parse(test);
+ assertEquals(test, restore(token));
+ List<SyntaxError> errors = t.getErrors();
+ assertEquals("EL '" + test + "' has no syntax problems.", 0, errors.size());
+ System.out.println("Passed correct EL '" + test + "'");
+ }
+
+ public void testTokenizerOnIncorrectEL() {
+ Tokenizer t = TokenizerFactory.createJbossTokenizer();
+
+ //1. Dot unfollowed by name
+ checkIncorrectEL(t, "#{a.}", 4);
+
+ //2. Incorrect use of ')'
+ checkIncorrectEL(t, "#{a.b + -c.d + g)}", 16);
+ //2. Incorrect use of ')' in second EL instance
+ checkIncorrectEL(t, "#{a.b + -c.d + g}#{hh.vv..m()}", 16);
+ }
+
+ private void checkIncorrectEL(Tokenizer t, String test, int expectedErrorPosition) {
+ LexicalToken token = t.parse(test);
+ List<SyntaxError> errors = t.getErrors();
+ assertTrue("EL '" + test + "' has syntax problems. ", errors.size() > 0);
+ assertEquals(expectedErrorPosition, errors.get(0).getPosition());
+ String correctPart = test.substring(0, expectedErrorPosition);
+ String parsed = restore(token);
+ assertTrue("Parsed value should be identical to source at least until first problem.", parsed.startsWith(correctPart));
+ System.out.println("Passed incorrect EL '" + test + "'");
+ }
+
+ private String restore(LexicalToken token) {
+ StringBuffer sb = new StringBuffer();
+ while(token != null) {
+ sb.append(token.getText());
+ token = token.getNextToken();
+ }
+ return sb.toString();
+ }
+
+}
15 years, 9 months
JBoss Tools SVN: r10414 - trunk/common/tests.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2008-09-23 11:41:29 -0400 (Tue, 23 Sep 2008)
New Revision: 10414
Added:
trunk/common/tests/org.jboss.tools.common.el.core.test/
Log:
JBIDE-1497.
Initial import.
15 years, 9 months
JBoss Tools SVN: r10413 - in trunk/common/plugins/org.jboss.tools.common.el.core: src/org/jboss/tools/common/el and 9 other directories.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2008-09-23 11:37:49 -0400 (Tue, 23 Sep 2008)
New Revision: 10413
Added:
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/model/
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/model/ELArgument.java
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/model/ELArgumentInvocation.java
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/model/ELExpression.java
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/model/ELInstance.java
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/model/ELInvocationExpression.java
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/model/ELMethodInvocation.java
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/model/ELModel.java
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/model/ELObject.java
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/model/ELObjectType.java
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/model/ELParameters.java
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/model/ELPropertyInvocation.java
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/parser/
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/parser/ELParser.java
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/parser/ELParserFactory.java
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/parser/IRule.java
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/parser/ITokenDescription.java
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/parser/LexicalToken.java
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/parser/SyntaxError.java
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/parser/Tokenizer.java
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/parser/TokenizerFactory.java
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/model/
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/model/ELArgumentExpressionImpl.java
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/model/ELArgumentImpl.java
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/model/ELComplexExpressionImpl.java
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/model/ELExpressionImpl.java
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/model/ELInstanceImpl.java
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/model/ELInvocationExpressionImpl.java
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/model/ELMethodInvocationImpl.java
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/model/ELModelImpl.java
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/model/ELMultiExpressionImpl.java
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/model/ELObjectImpl.java
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/model/ELOperatorImpl.java
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/model/ELParametersImpl.java
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/model/ELPropertyInvocationImpl.java
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/model/ELValueExpressionImpl.java
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/parser/
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/parser/ELParserImpl.java
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/parser/rule/
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/parser/rule/ArgRule.java
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/parser/rule/BasicStates.java
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/parser/rule/CallRule.java
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/parser/rule/ErrorRecoveryRule.java
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/parser/rule/ExpressionRule.java
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/parser/rule/OperationRule.java
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/parser/token/
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/parser/token/ArgEndTokenDescription.java
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/parser/token/ArgStartTokenDescription.java
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/parser/token/CommaTokenDescription.java
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/parser/token/ConstantTokenDescription.java
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/parser/token/DotTokenDescription.java
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/parser/token/EndELTokenDescription.java
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/parser/token/ExprEndTokenDescription.java
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/parser/token/ExprStartTokenDescription.java
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/parser/token/JavaNameTokenDescription.java
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/parser/token/OperationTokenDescription.java
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/parser/token/ParamEndTokenDescription.java
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/parser/token/ParamStartTokenDescription.java
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/parser/token/ParamUtil.java
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/parser/token/PrimitiveValueTokenDescription.java
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/parser/token/StartELTokenDescription.java
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/parser/token/StringTokenDescription.java
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/parser/token/UnaryTokenDescription.java
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/parser/token/WhiteSpaceTokenDescription.java
Modified:
trunk/common/plugins/org.jboss.tools.common.el.core/META-INF/MANIFEST.MF
Log:
JBIDE-1497
Initial implementation of new EL parser
Modified: trunk/common/plugins/org.jboss.tools.common.el.core/META-INF/MANIFEST.MF
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.el.core/META-INF/MANIFEST.MF 2008-09-23 15:37:42 UTC (rev 10412)
+++ trunk/common/plugins/org.jboss.tools.common.el.core/META-INF/MANIFEST.MF 2008-09-23 15:37:49 UTC (rev 10413)
@@ -5,9 +5,12 @@
Bundle-Name: El Plug-in
Bundle-SymbolicName: org.jboss.tools.common.el.core
Bundle-Version: 2.0.0
-Provide-Package: org.jboss.tools.common.el.core
+Provide-Package: org.jboss.tools.common.el.core,
+ org.jboss.tools.common.el.core.model,
+ org.jboss.tools.common.el.core.parser
Bundle-Activator: org.jboss.tools.common.el.core.Activator
Require-Bundle: org.eclipse.ui,
org.eclipse.core.runtime,
org.eclipse.core.resources,
+ org.eclipse.jface.text,
org.jboss.tools.common.resref.core;reprovide=true
Added: trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/model/ELArgument.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/model/ELArgument.java (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/model/ELArgument.java 2008-09-23 15:37:49 UTC (rev 10413)
@@ -0,0 +1,31 @@
+/*******************************************************************************
+ * Copyright (c) 2007 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:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.common.el.core.model;
+
+import org.jboss.tools.common.el.core.parser.LexicalToken;
+
+/**
+ * Argument object includes opening token, the argument expression proper,
+ * and closing token:
+ * '[' expression ']'
+ *
+ * @author V. Kabanovich
+ *
+ */
+public interface ELArgument {
+
+ public LexicalToken getOpenArgumentToken();
+
+ public ELExpression getArgument();
+
+ public LexicalToken getCloseArgumentToken();
+
+}
Added: trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/model/ELArgumentInvocation.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/model/ELArgumentInvocation.java (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/model/ELArgumentInvocation.java 2008-09-23 15:37:49 UTC (rev 10413)
@@ -0,0 +1,24 @@
+/*******************************************************************************
+ * Copyright (c) 2007 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:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.common.el.core.model;
+
+/**
+ * Kind of invocation in which argument is represented as
+ * '[' expression ']'.
+ * Details are returned by method getArgument().
+ *
+ * @author V. Kabanovich
+ */
+public interface ELArgumentInvocation extends ELInvocationExpression {
+
+ public ELArgument getArgument();
+
+}
Added: trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/model/ELExpression.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/model/ELExpression.java (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/model/ELExpression.java 2008-09-23 15:37:49 UTC (rev 10413)
@@ -0,0 +1,20 @@
+/*******************************************************************************
+ * Copyright (c) 2007 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:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.common.el.core.model;
+
+/**
+ *
+ * @author V. Kabanovich
+ *
+ */
+public interface ELExpression extends ELObject {
+
+}
Added: trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/model/ELInstance.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/model/ELInstance.java (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/model/ELInstance.java 2008-09-23 15:37:49 UTC (rev 10413)
@@ -0,0 +1,32 @@
+/*******************************************************************************
+ * Copyright (c) 2007 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:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.common.el.core.model;
+
+import org.jboss.tools.common.el.core.parser.LexicalToken;
+
+/**
+ * Instance of EL includes opening token, the expression proper,
+ * and closing token:
+ * '#{' expression '}'
+ * '${' expression '}'
+ *
+ * @author V. Kabanovich
+ *
+ */
+public interface ELInstance extends ELObject {
+
+ public LexicalToken getOpenInstanceToken();
+
+ public ELExpression getExpression();
+
+ public LexicalToken getCloseInstanceToken();
+
+}
Added: trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/model/ELInvocationExpression.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/model/ELInvocationExpression.java (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/model/ELInvocationExpression.java 2008-09-23 15:37:49 UTC (rev 10413)
@@ -0,0 +1,37 @@
+/*******************************************************************************
+ * Copyright (c) 2007 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:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.common.el.core.model;
+
+/**
+ * Generic interface for all kinds of expressions that involve
+ * resolving variables, properties, methods etc. in underlying
+ * model (i.e. Java model).
+ * The important property of such an expression is that it
+ * can be associated to left operand that serves as scope
+ * for its resolution. If left operand is not explicitly set,
+ * it is implied.
+ *
+ * @author V. Kabanovich
+ *
+ */
+public interface ELInvocationExpression extends ELExpression {
+
+ /**
+ *
+ * @return Preceding expression, that serves
+ * as scope for resolving this expression,
+ * Two expressions are connected syntactically,
+ * for instance expr1.expr2 or expr1[expr2]
+ * or in other ways specified by language.
+ */
+ public ELInvocationExpression getLeft();
+
+}
Added: trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/model/ELMethodInvocation.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/model/ELMethodInvocation.java (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/model/ELMethodInvocation.java 2008-09-23 15:37:49 UTC (rev 10413)
@@ -0,0 +1,30 @@
+/*******************************************************************************
+ * Copyright (c) 2007 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:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.common.el.core.model;
+
+import org.jboss.tools.common.el.core.parser.LexicalToken;
+
+/**
+ * Invocation with syntax
+ * LEFT . NAME PARAMETERS
+ *
+ * @author V. Kabanovich
+ *
+ */
+public interface ELMethodInvocation extends ELInvocationExpression {
+
+ public LexicalToken getSeparator();
+
+ public LexicalToken getName();
+
+ public ELParameters getParameters();
+
+}
Added: trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/model/ELModel.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/model/ELModel.java (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/model/ELModel.java 2008-09-23 15:37:49 UTC (rev 10413)
@@ -0,0 +1,28 @@
+/*******************************************************************************
+ * Copyright (c) 2007 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:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.common.el.core.model;
+
+import java.util.List;
+
+/**
+ * ELModel object is the result of EL parsing that includes
+ * all found instances of EL in the source string.
+ *
+ * @author V. Kabanovich
+ *
+ */
+public interface ELModel extends ELObject {
+
+ public String getSource();
+
+ public List<ELInstance> getInstances();
+
+}
Added: trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/model/ELObject.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/model/ELObject.java (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/model/ELObject.java 2008-09-23 15:37:49 UTC (rev 10413)
@@ -0,0 +1,40 @@
+/*******************************************************************************
+ * Copyright (c) 2007 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:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.common.el.core.model;
+
+import java.util.List;
+
+import org.jboss.tools.common.el.core.parser.LexicalToken;
+
+/**
+ * Super type for all objects in EL model.
+ * @author V. Kabanovich
+ *
+ */
+public interface ELObject {
+
+ public ELObjectType getType();
+
+ public ELModel getModel();
+
+ public int getLength();
+
+ public String getText();
+
+ public ELObject getParent();
+
+ public List<ELObject> getChildren();
+
+ public LexicalToken getFirstToken();
+
+ public LexicalToken getLastToken();
+
+}
Added: trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/model/ELObjectType.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/model/ELObjectType.java (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/model/ELObjectType.java 2008-09-23 15:37:49 UTC (rev 10413)
@@ -0,0 +1,33 @@
+/*******************************************************************************
+ * Copyright (c) 2007 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:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.common.el.core.model;
+
+/**
+ *
+ * @author V. Kabanovich
+ *
+ */
+public enum ELObjectType {
+ EL_UNKNOWN,
+ EL_MODEL,
+ EL_INSTANCE,
+ EL_METHOD_INVOCATION,
+ EL_QUALIFIED_NAME,
+ EL_PROPERTY_INVOCATION,
+ EL_ARGUMENT_INVOCATION,
+ EL_OPERATOR,
+ EL_VALUE,
+ EL_COMPLEX_EXPRESSION,
+ EL_MULTI_EXPRESSION,
+ EL_ARGUMENT,
+ EL_PARAMETERS;
+
+}
Added: trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/model/ELParameters.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/model/ELParameters.java (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/model/ELParameters.java 2008-09-23 15:37:49 UTC (rev 10413)
@@ -0,0 +1,32 @@
+/*******************************************************************************
+ * Copyright (c) 2007 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:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.common.el.core.model;
+
+import java.util.List;
+
+import org.jboss.tools.common.el.core.parser.LexicalToken;
+
+/**
+ * Details of parameters in method invocation
+ * '(' (expr (, expr)*)? ')'
+ *
+ * @author V. Kabanovich
+ *
+ */
+public interface ELParameters extends ELObject {
+
+ public LexicalToken getOpenParametersToken();
+
+ public List<ELExpression> getParameters();
+
+ public LexicalToken getCloseParametersToken();
+
+}
Added: trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/model/ELPropertyInvocation.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/model/ELPropertyInvocation.java (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/model/ELPropertyInvocation.java 2008-09-23 15:37:49 UTC (rev 10413)
@@ -0,0 +1,38 @@
+/*******************************************************************************
+ * Copyright (c) 2007 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:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.common.el.core.model;
+
+import org.jboss.tools.common.el.core.parser.LexicalToken;
+
+/**
+ *
+ * @author V. Kabanovich
+ *
+ */
+public interface ELPropertyInvocation extends ELInvocationExpression {
+
+ public LexicalToken getSeparator();
+
+ public LexicalToken getName();
+
+ /**
+ * If all left expressions are also property invocations
+ * (or variable names in terms of underlying model),
+ * this method returns qualified name as
+ * NAME (. NAME)*
+ * Otherwise, (i.e. if some left expression is method or
+ * argument invocation), null is returned.
+ *
+ * @return
+ */
+ public String getQualifiedName();
+
+}
Added: trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/parser/ELParser.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/parser/ELParser.java (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/parser/ELParser.java 2008-09-23 15:37:49 UTC (rev 10413)
@@ -0,0 +1,28 @@
+/*******************************************************************************
+ * Copyright (c) 2007 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:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.common.el.core.parser;
+
+import java.util.List;
+
+import org.jboss.tools.common.el.core.model.ELModel;
+
+/**
+ *
+ * @author V. Kabanovich
+ *
+ */
+public interface ELParser {
+
+ public ELModel parse(String source);
+
+ public List<SyntaxError> getSyntaxErrors();
+
+}
Added: trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/parser/ELParserFactory.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/parser/ELParserFactory.java (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/parser/ELParserFactory.java 2008-09-23 15:37:49 UTC (rev 10413)
@@ -0,0 +1,72 @@
+/*******************************************************************************
+ * Copyright (c) 2007 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:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.common.el.core.parser;
+
+import java.util.List;
+
+import org.jboss.tools.common.el.core.model.ELModel;
+import org.jboss.tools.common.el.internal.core.model.ELModelImpl;
+import org.jboss.tools.common.el.internal.core.parser.ELParserImpl;
+
+/**
+ *
+ * @author V. Kabanovich
+ *
+ */
+public class ELParserFactory {
+
+ public static ELParser createDefaultParser() {
+ return new ELParser() {
+ ELParserImpl impl = new ELParserImpl();
+ List<SyntaxError> errors = null;
+
+ public ELModel parse(String source) {
+ Tokenizer t = TokenizerFactory.createDefaultTokenizer();
+ LexicalToken token = t.parse(source);
+ errors = t.getErrors();
+ if(token == null) {
+ return null;
+ }
+ ELModelImpl model = impl.parse(token);
+ model.setSource(source);
+ return model;
+ }
+
+ public List<SyntaxError> getSyntaxErrors() {
+ return errors;
+ }
+ };
+ }
+
+ public static ELParser createJbossParser() {
+ return new ELParser() {
+ ELParserImpl impl = new ELParserImpl();
+ List<SyntaxError> errors = null;
+
+ public ELModel parse(String source) {
+ Tokenizer t = TokenizerFactory.createJbossTokenizer();
+ LexicalToken token = t.parse(source);
+ errors = t.getErrors();
+ if(token == null) {
+ return null;
+ }
+ ELModelImpl model = impl.parse(token);
+ model.setSource(source);
+ return model;
+ }
+
+ public List<SyntaxError> getSyntaxErrors() {
+ return errors;
+ }
+ };
+ }
+
+}
Added: trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/parser/IRule.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/parser/IRule.java (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/parser/IRule.java 2008-09-23 15:37:49 UTC (rev 10413)
@@ -0,0 +1,26 @@
+/*******************************************************************************
+ * Copyright (c) 2007 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:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.common.el.core.parser;
+
+/**
+ *
+ * @author V. Kabanovich
+ *
+ */
+public interface IRule {
+
+ public int[] getStartStates();
+
+ public int[] getTokenTypes(int state);
+
+ public int getFinalState(int state, int token);
+
+}
Added: trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/parser/ITokenDescription.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/parser/ITokenDescription.java (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/parser/ITokenDescription.java 2008-09-23 15:37:49 UTC (rev 10413)
@@ -0,0 +1,50 @@
+/*******************************************************************************
+ * Copyright (c) 2007 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:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.common.el.core.parser;
+
+/**
+ *
+ * @author V. Kabanovich
+ *
+ */
+public interface ITokenDescription {
+
+ /**
+ *
+ * @return Unique type of this kind of token.
+ */
+ public int getType();
+
+ /**
+ *
+ * @return Human readable name.
+ */
+ public String getName();
+
+ /**
+ * Determines if this token is relevant at this point
+ * @param tokenizer
+ * @param last
+ * @param offset
+ * @return
+ */
+ public boolean isStart(Tokenizer tokenizer, int offset);
+
+ /**
+ *
+ * @param tokenizer
+ * @param last
+ * @param offset
+ * @return
+ */
+ public boolean read(Tokenizer tokenizer, int offset);
+
+}
Added: trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/parser/LexicalToken.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/parser/LexicalToken.java (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/parser/LexicalToken.java 2008-09-23 15:37:49 UTC (rev 10413)
@@ -0,0 +1,141 @@
+/*******************************************************************************
+ * Copyright (c) 2007 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:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.common.el.core.parser;
+
+import org.eclipse.jface.text.rules.IToken;
+
+public class LexicalToken implements IToken {
+ private LexicalToken previous;
+ private LexicalToken next;
+
+ private int start;
+ private int length;
+ private CharSequence chars;
+ private int type;
+
+ /**
+ * Constructs the ELToken object
+ *
+ * @param start
+ * @param length
+ * @param chars
+ * @param type
+ */
+ public LexicalToken(int start, int length, CharSequence chars, int type) {
+ this.start = start;
+ this.length = length;
+ this.chars = chars;
+ this.type = type;
+ }
+
+ /**
+ * Returns string representation for the token
+ */
+ public String toString() {
+ return "ELToken(" + start + ", " + length + ", " + type + ") [" + (chars == null ? "<Empty>" : chars.toString()) + "]"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$
+ }
+
+ /*
+ * @see org.eclipse.jface.text.rules.IToken#getData()
+ */
+ public Object getData() {
+// return (chars == null ? null : chars.subSequence(start, start+length).toString());
+ return getText();
+ }
+
+ /**
+ * @return offset of token
+ */
+ public int getStart() {
+ return start;
+ }
+
+ /**
+ * @return length of token
+ */
+ public int getLength() {
+ return length;
+ }
+
+ /*
+ * @see org.eclipse.jface.text.rules.IToken#isEOF()
+ */
+ public boolean isEOF() {
+ return (start == -1 && length == -1 && chars == null);
+ }
+
+ /*
+ * @see org.eclipse.jface.text.rules.IToken#isOther()
+ */
+ public boolean isOther() {
+ return false;
+ }
+
+ /*
+ * @see org.eclipse.jface.text.rules.IToken#isUndefined()
+ */
+ public boolean isUndefined() {
+ return false;
+ }
+
+ /*
+ * @see org.eclipse.jface.text.rules.IToken#isWhitespace()
+ */
+ public boolean isWhitespace() {
+ return false;
+ }
+
+ /*
+ * Returns the token type
+ */
+ public int getType(){
+ return type;
+ }
+
+ /*
+ * Returns the token text
+ */
+ public String getText() {
+ return chars.toString();
+ }
+
+ public LexicalToken getPreviousToken() {
+ return previous;
+ }
+
+ public LexicalToken getNextToken() {
+ return next;
+ }
+
+ public void setNextToken(LexicalToken n) {
+ if(n != null) {
+ n.previous = this;
+ }
+ next = n;
+ }
+
+ void makeItFirst() {
+ previous = null;
+ }
+
+ public LexicalToken findTokenBackword(int type) {
+ if(previous == null) return null;
+ if(previous.type == type) return previous;
+ return previous.findTokenBackword(type);
+ }
+
+ public LexicalToken findTokenForward(int type) {
+ if(next == null) return null;
+ if(next.type == type) return next;
+ return next.findTokenForward(type);
+ }
+
+}
Added: trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/parser/SyntaxError.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/parser/SyntaxError.java (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/parser/SyntaxError.java 2008-09-23 15:37:49 UTC (rev 10413)
@@ -0,0 +1,35 @@
+/*******************************************************************************
+ * Copyright (c) 2007 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:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.common.el.core.parser;
+
+/**
+ *
+ * @author V. Kabanovich
+ *
+ */
+public class SyntaxError {
+ int position;
+ int state;
+
+ public SyntaxError(int position, int state) {
+ this.position = position;
+ this.state = state;
+ }
+
+ public int getState() {
+ return state;
+ }
+
+ public int getPosition() {
+ return position;
+ }
+
+}
Added: trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/parser/Tokenizer.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/parser/Tokenizer.java (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/parser/Tokenizer.java 2008-09-23 15:37:49 UTC (rev 10413)
@@ -0,0 +1,172 @@
+/*******************************************************************************
+ * Copyright (c) 2007 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:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.common.el.core.parser;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Properties;
+
+import org.jboss.tools.common.el.internal.core.parser.rule.BasicStates;
+
+/**
+ *
+ * @author V. Kabanovich
+ *
+ */
+public class Tokenizer {
+
+ private Map<Integer, ITokenDescription> tokenDescriptions = new HashMap<Integer, ITokenDescription>();
+ private Map<Integer, List<IRule>> rules = new HashMap<Integer, List<IRule>>();
+
+ private String sourceString;
+ private int index = 0;
+
+ private LexicalToken start = new LexicalToken(0, 0, "", -1000);
+ private LexicalToken last = start;
+
+ private int state;
+ private Properties context = new Properties();
+
+ List<SyntaxError> errors = new ArrayList<SyntaxError>();
+
+ public Tokenizer() {}
+
+ public void setTokenDescriptions(ITokenDescription[] ds) {
+ for (int i = 0; i < ds.length; i++) {
+ int type = ds[i].getType();
+ if(tokenDescriptions.containsKey(type)) {
+ throw new IllegalArgumentException("Token type " + type + " is not unique.");
+ }
+ tokenDescriptions.put(type, ds[i]);
+ }
+ }
+
+ public ITokenDescription getTokenDescription(int id) {
+ return tokenDescriptions.get(id);
+ }
+
+ public void setRules(IRule[] rules) {
+ for (int i = 0; i < rules.length; i++) {
+ int[] ss = rules[i].getStartStates();
+ for (int j = 0; j < ss.length; j++) {
+ List<IRule> rs = this.rules.get(ss[j]);
+ if(rs == null) {
+ rs = new ArrayList<IRule>();
+ this.rules.put(ss[j], rs);
+ }
+ rs.add(rules[i]);
+ }
+ }
+ }
+
+ public LexicalToken parse(String sourceString) {
+ this.sourceString = sourceString;
+ errors.clear();
+ index = 0;
+ start = new LexicalToken(0, 0, "", -1000);
+ last = start;
+ state = BasicStates.STATE_EXPECTING_EL;
+
+ while(index < sourceString.length()) {
+ boolean done = false;
+ List<IRule> rs = rules.get(state);
+ for (IRule rule : rs) {
+ int[] ts = rule.getTokenTypes(state);
+ for (int j = 0; !done && j < ts.length; j++) {
+ ITokenDescription td = tokenDescriptions.get(ts[j]);
+ if (td != null && td.isStart(this, index)) {
+ td.read(this, index);
+ state = rule.getFinalState(state, ts[j]);
+ done = true;
+ }
+ }
+ }
+ if(!done) {
+ if(state == BasicStates.STATE_EXPECTING_EL || state == BasicStates.STATE_ERROR) {
+ char ch = readNextChar();
+ if(ch == '\0') break;
+ } else {
+ errors.add(new SyntaxError(index, state));
+ state = BasicStates.STATE_ERROR;
+ }
+ }
+ }
+ LexicalToken result = start.getNextToken();
+ if(result != null) {
+ result.makeItFirst();
+ }
+ return result;
+ }
+
+ public List<SyntaxError> getErrors() {
+ return errors;
+ }
+
+ public void addToken(int type, int start, int end) {
+ if(end < 0) return;
+ LexicalToken t = new LexicalToken(start, end - start, getCharSequence(start, end), type);
+ last.setNextToken(t);
+ last = t;
+ index = end;
+ }
+
+ public Properties getContext() {
+ return context;
+ }
+
+ private CharSequence getCharSequence(int start, int end) {
+ String text = sourceString.substring(start, end);
+ return text.subSequence(0, text.length());
+ }
+
+ public char readNextChar() {
+ char c = '\0';
+ if (index < sourceString.length()) {
+ c = sourceString.charAt(index);
+ }
+ index++;
+ return c;
+ }
+
+ public char lookUpChar(int i) {
+ return (i < 0 || sourceString.length() <= i) ? '\0' : sourceString.charAt(i);
+ }
+
+ /*
+ * returns the character to the document
+ */
+ public void releaseChar() {
+ if (index > 0) {
+ index--;
+ }
+ }
+
+ public boolean startsWith(String s) {
+ int l = index + s.length();
+ if(l > sourceString.length()) return false;
+ for (int i = index; i < l; i++) {
+ if(lookUpChar(i) != s.charAt(i - index)) {
+ return false;
+ }
+ }
+ return true;
+ }
+
+ public LexicalToken getLastToken() {
+ return last;
+ }
+
+ public int getState() {
+ return state;
+ }
+}
Added: trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/parser/TokenizerFactory.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/parser/TokenizerFactory.java (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/parser/TokenizerFactory.java 2008-09-23 15:37:49 UTC (rev 10413)
@@ -0,0 +1,125 @@
+/*******************************************************************************
+ * Copyright (c) 2007 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:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.common.el.core.parser;
+
+import java.util.List;
+
+import org.jboss.tools.common.el.core.model.ELExpression;
+import org.jboss.tools.common.el.core.model.ELModel;
+import org.jboss.tools.common.el.internal.core.parser.rule.ArgRule;
+import org.jboss.tools.common.el.internal.core.parser.rule.CallRule;
+import org.jboss.tools.common.el.internal.core.parser.rule.ErrorRecoveryRule;
+import org.jboss.tools.common.el.internal.core.parser.rule.ExpressionRule;
+import org.jboss.tools.common.el.internal.core.parser.rule.OperationRule;
+import org.jboss.tools.common.el.internal.core.parser.token.ArgEndTokenDescription;
+import org.jboss.tools.common.el.internal.core.parser.token.ArgStartTokenDescription;
+import org.jboss.tools.common.el.internal.core.parser.token.CommaTokenDescription;
+import org.jboss.tools.common.el.internal.core.parser.token.DotTokenDescription;
+import org.jboss.tools.common.el.internal.core.parser.token.EndELTokenDescription;
+import org.jboss.tools.common.el.internal.core.parser.token.ExprEndTokenDescription;
+import org.jboss.tools.common.el.internal.core.parser.token.ExprStartTokenDescription;
+import org.jboss.tools.common.el.internal.core.parser.token.JavaNameTokenDescription;
+import org.jboss.tools.common.el.internal.core.parser.token.OperationTokenDescription;
+import org.jboss.tools.common.el.internal.core.parser.token.ParamEndTokenDescription;
+import org.jboss.tools.common.el.internal.core.parser.token.ParamStartTokenDescription;
+import org.jboss.tools.common.el.internal.core.parser.token.PrimitiveValueTokenDescription;
+import org.jboss.tools.common.el.internal.core.parser.token.StartELTokenDescription;
+import org.jboss.tools.common.el.internal.core.parser.token.StringTokenDescription;
+import org.jboss.tools.common.el.internal.core.parser.token.UnaryTokenDescription;
+import org.jboss.tools.common.el.internal.core.parser.token.WhiteSpaceTokenDescription;
+
+/**
+ *
+ * @author V. Kabanovich
+ *
+ */
+public class TokenizerFactory {
+
+ public static Tokenizer createDefaultTokenizer() {
+ Tokenizer t = new Tokenizer();
+ t.setTokenDescriptions(new ITokenDescription[]{
+ ArgEndTokenDescription.INSTANCE,
+ ArgStartTokenDescription.INSTANCE,
+ DotTokenDescription.INSTANCE,
+ EndELTokenDescription.INSTANCE,
+ JavaNameTokenDescription.INSTANCE,
+ OperationTokenDescription.INSTANCE,
+ UnaryTokenDescription.INSTANCE,
+ PrimitiveValueTokenDescription.INSTANCE,
+ StartELTokenDescription.INSTANCE,
+ StringTokenDescription.INSTANCE,
+ WhiteSpaceTokenDescription.INSTANCE,
+ });
+ t.setRules(new IRule[]{
+ ExpressionRule.INSTANCE,
+ ArgRule.INSTANCE,
+ CallRule.INSTANCE,
+ OperationRule.INSTANCE,
+ ErrorRecoveryRule.INSTANCE,
+ });
+ return t;
+ }
+
+ public static Tokenizer createJbossTokenizer() {
+ Tokenizer t = new Tokenizer();
+ t.setTokenDescriptions(new ITokenDescription[]{
+ ArgEndTokenDescription.INSTANCE,
+ ArgStartTokenDescription.INSTANCE,
+ CommaTokenDescription.INSTANCE,
+ DotTokenDescription.INSTANCE,
+ EndELTokenDescription.INSTANCE,
+ JavaNameTokenDescription.INSTANCE,
+ OperationTokenDescription.INSTANCE,
+ ParamEndTokenDescription.INSTANCE,
+ ParamStartTokenDescription.INSTANCE,
+ ExprStartTokenDescription.INSTANCE,
+ ExprEndTokenDescription.INSTANCE,
+ UnaryTokenDescription.INSTANCE,
+ PrimitiveValueTokenDescription.INSTANCE,
+ StartELTokenDescription.INSTANCE,
+ StringTokenDescription.INSTANCE,
+ WhiteSpaceTokenDescription.INSTANCE,
+ });
+ t.setRules(new IRule[]{
+ ExpressionRule.INSTANCE,
+ ArgRule.INSTANCE,
+ CallRule.INSTANCE,
+ OperationRule.INSTANCE,
+ ErrorRecoveryRule.INSTANCE,
+ });
+ return t;
+ }
+
+ public static void main(String[] args) {
+ String text = //"#{a.b.}";
+"#{a.b + s.h((6 != -8) & (7 + -iy88.g[9].h(7 div 8).i.j)+(8) ? 4 : 7,'p', a.b.c.d[null])}";
+//"q82#{a( g.h(7 + 8) + 8, g['h'].j(),'p')}k#{b}";
+ Tokenizer t = createJbossTokenizer();
+ LexicalToken token = t.parse(text);
+ LexicalToken ti = token;
+
+ while(ti != null) {
+ int type = ti.getType();
+ System.out.println(type + ":" + ti.getText() + ":");
+ ti = ti.getNextToken();
+ }
+ List<SyntaxError> errors = t.getErrors();
+ for (SyntaxError e: errors) {
+ System.out.println("state=" + e.getState() + " position=" + e.getPosition());
+ }
+ ELParser parser = ELParserFactory.createJbossParser();
+ ELModel model = parser.parse(text);
+ System.out.println(model);
+ ELExpression expr = model.getInstances().get(0).getExpression();
+ System.out.println("Expression=" + expr);
+ }
+
+}
Added: trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/model/ELArgumentExpressionImpl.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/model/ELArgumentExpressionImpl.java (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/model/ELArgumentExpressionImpl.java 2008-09-23 15:37:49 UTC (rev 10413)
@@ -0,0 +1,48 @@
+/*******************************************************************************
+ * Copyright (c) 2007 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:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.common.el.internal.core.model;
+
+import org.jboss.tools.common.el.core.model.ELArgumentInvocation;
+import org.jboss.tools.common.el.core.model.ELObjectType;
+
+/**
+ *
+ * @author V. Kabanovich
+ */
+public class ELArgumentExpressionImpl extends ELInvocationExpressionImpl implements ELArgumentInvocation {
+ ELArgumentImpl argument;
+
+ public ELArgumentExpressionImpl() {}
+
+ public void addChild(ELObjectImpl child) {
+ }
+
+ public ELArgumentImpl getArgument() {
+ return argument;
+ }
+
+ public void setArgument(ELArgumentImpl argument) {
+ this.argument = argument;
+ if(argument != null) {
+ argument.setParent(this);
+ setLastToken(argument.getLastToken());
+ }
+ }
+
+ public String toString() {
+ return super.toString() + ((argument != null) ? argument.toString() : "");
+ }
+
+ public ELObjectType getType() {
+ return ELObjectType.EL_ARGUMENT_INVOCATION;
+ }
+
+}
Added: trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/model/ELArgumentImpl.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/model/ELArgumentImpl.java (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/model/ELArgumentImpl.java 2008-09-23 15:37:49 UTC (rev 10413)
@@ -0,0 +1,88 @@
+/*******************************************************************************
+ * Copyright (c) 2007 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:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.common.el.internal.core.model;
+
+import org.jboss.tools.common.el.core.model.ELArgument;
+import org.jboss.tools.common.el.core.model.ELObjectType;
+import org.jboss.tools.common.el.core.parser.LexicalToken;
+import org.jboss.tools.common.el.internal.core.parser.token.ArgEndTokenDescription;
+import org.jboss.tools.common.el.internal.core.parser.token.ArgStartTokenDescription;
+
+/**
+ *
+ * @author V. Kabanovich
+ *
+ */
+public class ELArgumentImpl extends ELObjectImpl implements ELArgument {
+ ELExpressionImpl argument;
+
+ public ELArgumentImpl() {}
+
+ public ELExpressionImpl getArgument() {
+ return argument;
+ }
+
+ public LexicalToken getOpenArgumentToken() {
+ LexicalToken result = getFirstToken();
+ if(result != null && result.getType() == ArgStartTokenDescription.ARG_START) {
+ return result;
+ } else {
+ return null;
+ }
+ }
+
+ public LexicalToken getCloseArgumentToken() {
+ LexicalToken result = getLastToken();
+ if(result != null && result.getType() == ArgEndTokenDescription.ARG_END) {
+ return result;
+ } else {
+ return null;
+ }
+ }
+
+ public void addChild(ELObjectImpl child) {
+ if(child instanceof ELExpressionImpl) {
+ setArgument((ELExpressionImpl)child);
+ } else {
+ throw new IllegalArgumentException("EL argument can have only EL expression as its child.");
+ }
+ }
+
+ public void setArgument(ELExpressionImpl arg) {
+ if(argument == arg) return;
+ if(argument != null) {
+ removeChild(argument);
+ }
+ if(arg != null) {
+ super.addChild(arg);
+ }
+ argument = arg;
+ }
+
+ public String toString() {
+ StringBuffer sb = new StringBuffer();
+ if(getOpenArgumentToken() != null) {
+ sb.append(getOpenArgumentToken().getText());
+ }
+ if(argument != null) {
+ sb.append(argument.toString());
+ }
+ if(getCloseArgumentToken() != null) {
+ sb.append(getCloseArgumentToken().getText());
+ }
+ return sb.toString();
+ }
+
+ public ELObjectType getType() {
+ return ELObjectType.EL_ARGUMENT;
+ }
+
+}
Added: trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/model/ELComplexExpressionImpl.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/model/ELComplexExpressionImpl.java (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/model/ELComplexExpressionImpl.java 2008-09-23 15:37:49 UTC (rev 10413)
@@ -0,0 +1,92 @@
+/*******************************************************************************
+ * Copyright (c) 2007 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:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.common.el.internal.core.model;
+
+import org.jboss.tools.common.el.core.model.ELObjectType;
+import org.jboss.tools.common.el.core.parser.LexicalToken;
+import org.jboss.tools.common.el.internal.core.parser.token.ExprEndTokenDescription;
+import org.jboss.tools.common.el.internal.core.parser.token.ExprStartTokenDescription;
+import org.jboss.tools.common.el.internal.core.parser.token.UnaryTokenDescription;
+
+/**
+ * '(' expression ')'
+ * @author V. Kabanovich
+ */
+public class ELComplexExpressionImpl extends ELExpressionImpl {
+ ELExpressionImpl expression;
+
+ public ELComplexExpressionImpl() {
+ }
+
+ public ELExpressionImpl getExpression() {
+ return expression;
+ }
+
+ public LexicalToken getOpenExpressionToken() {
+ LexicalToken result = getFirstToken();
+ if(result != null &&
+ (result.getType() == ExprStartTokenDescription.EXPR_START
+ || result.getType() == UnaryTokenDescription.UNARY)) {
+ return result;
+ } else {
+ return null;
+ }
+ }
+
+ public LexicalToken getCloseExpressionToken() {
+ LexicalToken result = getLastToken();
+ if(result != null && result.getType() == ExprEndTokenDescription.EXPR_END) {
+ return result;
+ } else {
+ return null;
+ }
+ }
+
+ public void addChild(ELObjectImpl child) {
+ if(child instanceof ELExpressionImpl) {
+ setExpression((ELExpressionImpl)child);
+ } else {
+ throw new IllegalArgumentException("EL instance can have only EL expression as child.");
+ }
+ }
+
+ public void setExpression(ELExpressionImpl expression) {
+ if(this.expression == expression) {
+ return;
+ }
+ if(this.expression != null) {
+ removeChild(this.expression);
+ }
+ this.expression = expression;
+ if(expression != null) {
+ super.addChild(expression);
+ }
+ }
+
+ public String toString() {
+ StringBuffer sb = new StringBuffer();
+ if(getOpenExpressionToken() != null) {
+ sb.append(getOpenExpressionToken().getText());
+ }
+ if(expression != null) {
+ sb.append(expression.toString());
+ }
+ if(getCloseExpressionToken() != null) {
+ sb.append(getCloseExpressionToken().getText());
+ }
+ return sb.toString();
+ }
+
+ public ELObjectType getType() {
+ return ELObjectType.EL_COMPLEX_EXPRESSION;
+ }
+
+}
Added: trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/model/ELExpressionImpl.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/model/ELExpressionImpl.java (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/model/ELExpressionImpl.java 2008-09-23 15:37:49 UTC (rev 10413)
@@ -0,0 +1,24 @@
+/*******************************************************************************
+ * Copyright (c) 2007 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:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.common.el.internal.core.model;
+
+import org.jboss.tools.common.el.core.model.ELExpression;
+
+/**
+ *
+ * @author V. Kabanovich
+ *
+ */
+public abstract class ELExpressionImpl extends ELObjectImpl implements ELExpression {
+
+ public ELExpressionImpl() {}
+
+}
Added: trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/model/ELInstanceImpl.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/model/ELInstanceImpl.java (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/model/ELInstanceImpl.java 2008-09-23 15:37:49 UTC (rev 10413)
@@ -0,0 +1,91 @@
+/*******************************************************************************
+ * Copyright (c) 2007 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:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.common.el.internal.core.model;
+
+import org.jboss.tools.common.el.core.model.ELExpression;
+import org.jboss.tools.common.el.core.model.ELInstance;
+import org.jboss.tools.common.el.core.model.ELObjectType;
+import org.jboss.tools.common.el.core.parser.LexicalToken;
+import org.jboss.tools.common.el.internal.core.parser.token.EndELTokenDescription;
+import org.jboss.tools.common.el.internal.core.parser.token.StartELTokenDescription;
+
+/**
+ * '#{' expression '}'
+ * @author V. Kabanovich
+ */
+public class ELInstanceImpl extends ELObjectImpl implements ELInstance {
+ ELExpressionImpl expression;
+
+ public ELInstanceImpl() {
+ }
+
+ public LexicalToken getOpenInstanceToken() {
+ LexicalToken result = getFirstToken();
+ if(result != null && result.getType() == StartELTokenDescription.START_EL) {
+ return result;
+ } else {
+ return null;
+ }
+ }
+
+ public LexicalToken getCloseInstanceToken() {
+ LexicalToken result = getLastToken();
+ if(result != null && result.getType() == EndELTokenDescription.END_EL) {
+ return result;
+ } else {
+ return null;
+ }
+ }
+
+ public ELExpression getExpression() {
+ return expression;
+ }
+
+ public void addChild(ELObjectImpl child) {
+ if(child instanceof ELExpressionImpl) {
+ setExpression((ELExpressionImpl)child);
+ } else {
+ throw new IllegalArgumentException("EL instance can have only EL expression as child.");
+ }
+ }
+
+ public void setExpression(ELExpressionImpl expression) {
+ if(this.expression == expression) {
+ return;
+ }
+ if(this.expression != null) {
+ removeChild(this.expression);
+ }
+ this.expression = expression;
+ if(expression != null) {
+ super.addChild(expression);
+ }
+ }
+
+ public String toString() {
+ StringBuffer sb = new StringBuffer();
+ if(getOpenInstanceToken() != null) {
+ sb.append(getOpenInstanceToken().getText());
+ }
+ if(expression != null) {
+ sb.append(expression.toString());
+ }
+ if(getCloseInstanceToken() != null) {
+ sb.append(getCloseInstanceToken().getText());
+ }
+ return sb.toString();
+ }
+
+ public ELObjectType getType() {
+ return ELObjectType.EL_INSTANCE;
+ }
+
+}
Added: trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/model/ELInvocationExpressionImpl.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/model/ELInvocationExpressionImpl.java (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/model/ELInvocationExpressionImpl.java 2008-09-23 15:37:49 UTC (rev 10413)
@@ -0,0 +1,44 @@
+/*******************************************************************************
+ * Copyright (c) 2007 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:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.common.el.internal.core.model;
+
+import org.jboss.tools.common.el.core.model.ELInvocationExpression;
+
+/**
+ *
+ * @author V. Kabanovich
+ *
+ */
+public abstract class ELInvocationExpressionImpl extends ELExpressionImpl implements ELInvocationExpression {
+ protected ELInvocationExpressionImpl left;
+
+ public ELInvocationExpressionImpl() {}
+
+ public void addChild(ELObjectImpl child) {
+ }
+
+ public ELInvocationExpressionImpl getLeft() {
+ return left;
+ }
+
+ public void setLeft(ELInvocationExpressionImpl left) {
+ this.left = left;
+ if(left != null) {
+ left.setParent(this);
+ setFirstToken(left.getFirstToken());
+ }
+ }
+
+ public String toString() {
+ return left != null ? left.toString() : "";
+ }
+
+}
Added: trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/model/ELMethodInvocationImpl.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/model/ELMethodInvocationImpl.java (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/model/ELMethodInvocationImpl.java 2008-09-23 15:37:49 UTC (rev 10413)
@@ -0,0 +1,52 @@
+/*******************************************************************************
+ * Copyright (c) 2007 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:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.common.el.internal.core.model;
+
+import org.jboss.tools.common.el.core.model.ELMethodInvocation;
+import org.jboss.tools.common.el.core.model.ELObjectType;
+
+/**
+ * LEFT . name parameters
+ * @author V. Kabanovich
+ */
+public class ELMethodInvocationImpl extends ELPropertyInvocationImpl implements ELMethodInvocation {
+ ELParametersImpl parameters;
+
+ public ELMethodInvocationImpl() {}
+
+ public void addChild(ELObjectImpl child) {
+ }
+
+ public ELParametersImpl getParameters() {
+ return parameters;
+ }
+
+ public void setParameters(ELParametersImpl parameters) {
+ this.parameters = parameters;
+ if(parameters != null) {
+ parameters.setParent(this);
+ setLastToken(parameters.getLastToken());
+ }
+ }
+
+ public String getQualifiedName() {
+ return null;
+ }
+
+ public String toString() {
+ return super.toString() + ((parameters != null) ? parameters.toString() : "");
+ }
+
+ public ELObjectType getType() {
+ return ELObjectType.EL_METHOD_INVOCATION;
+ }
+
+}
Added: trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/model/ELModelImpl.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/model/ELModelImpl.java (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/model/ELModelImpl.java 2008-09-23 15:37:49 UTC (rev 10413)
@@ -0,0 +1,72 @@
+/*******************************************************************************
+ * Copyright (c) 2007 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:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.common.el.internal.core.model;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.jboss.tools.common.el.core.model.ELInstance;
+import org.jboss.tools.common.el.core.model.ELModel;
+import org.jboss.tools.common.el.core.model.ELObjectType;
+
+/**
+ *
+ * @author V. Kabanovich
+ *
+ */
+public class ELModelImpl extends ELObjectImpl implements ELModel {
+ String source;
+ List<ELInstance> instances = new ArrayList<ELInstance>();
+
+ public ELModelImpl() {}
+
+ public ELModelImpl getModel() {
+ return this;
+ }
+
+ public String getSource() {
+ return source;
+ }
+
+ public List<ELInstance> getInstances() {
+ return instances;
+ }
+
+ public void setSource(String source) {
+ this.source = source;
+ }
+
+ public void addChild(ELObjectImpl child) {
+ if(child instanceof ELInstanceImpl) {
+ addInstance((ELInstanceImpl)child);
+ } else {
+ throw new IllegalArgumentException("EL root can have onle ELInstances as its children.");
+ }
+ }
+
+ public void addInstance(ELInstanceImpl instance) {
+ super.addChild(instance);
+ instances.add(instance);
+ }
+
+ public String toString() {
+ StringBuffer sb = new StringBuffer();
+ for (ELInstance p: instances) {
+ sb.append(p.toString());
+ }
+ return sb.toString();
+ }
+
+ public ELObjectType getType() {
+ return ELObjectType.EL_MODEL;
+ }
+
+}
Added: trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/model/ELMultiExpressionImpl.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/model/ELMultiExpressionImpl.java (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/model/ELMultiExpressionImpl.java 2008-09-23 15:37:49 UTC (rev 10413)
@@ -0,0 +1,80 @@
+/*******************************************************************************
+ * Copyright (c) 2007 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:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.common.el.internal.core.model;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.jboss.tools.common.el.core.model.ELObject;
+import org.jboss.tools.common.el.core.model.ELObjectType;
+
+/**
+ * expression (operation expression)+
+ * @author V. Kabanovich
+ */
+public class ELMultiExpressionImpl extends ELExpressionImpl {
+ List<ELExpressionImpl> expressions = new ArrayList<ELExpressionImpl>();
+ List<ELOperatorImpl> operators = new ArrayList<ELOperatorImpl>();
+
+ public ELMultiExpressionImpl() {
+ }
+
+ public List<ELExpressionImpl> getExpressions() {
+ return expressions;
+ }
+
+ public List<ELOperatorImpl> getOperators() {
+ return operators;
+ }
+
+ public void addChild(ELObjectImpl child) {
+ if(child instanceof ELExpressionImpl) {
+ addExpression((ELExpressionImpl)child);
+ } else if(child instanceof ELOperatorImpl) {
+ addOperator((ELOperatorImpl)child);
+ } else {
+ throw new IllegalArgumentException("EL instance can have only EL expression as child.");
+ }
+ }
+
+ public void addExpression(ELExpressionImpl expression) {
+ if(expressions.size() > operators.size()) {
+ throw new IllegalArgumentException("Expecting operator");
+ }
+ super.addChild(expression);
+ expressions.add(expression);
+ }
+
+ public void addOperator(ELOperatorImpl operator) {
+ while(expressions.size() <= operators.size()) {
+ addChild(new ELExpressionImpl() {
+ public ELObjectType getType() {
+ return ELObjectType.EL_UNKNOWN;
+ }
+ });
+ }
+ super.addChild(operator);
+ operators.add(operator);
+ }
+
+ public String toString() {
+ StringBuffer sb = new StringBuffer();
+ if(children != null) for (ELObject c: children) {
+ sb.append(c.toString());
+ }
+ return sb.toString();
+ }
+
+ public ELObjectType getType() {
+ return ELObjectType.EL_MULTI_EXPRESSION;
+ }
+
+}
Added: trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/model/ELObjectImpl.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/model/ELObjectImpl.java (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/model/ELObjectImpl.java 2008-09-23 15:37:49 UTC (rev 10413)
@@ -0,0 +1,93 @@
+/*******************************************************************************
+ * Copyright (c) 2007 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:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.common.el.internal.core.model;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.jboss.tools.common.el.core.model.ELObject;
+import org.jboss.tools.common.el.core.parser.LexicalToken;
+
+/**
+ *
+ * @author V. Kabanovich
+ *
+ */
+public abstract class ELObjectImpl implements ELObject {
+ protected LexicalToken firstToken;
+ protected LexicalToken lastToken;
+ protected ELObjectImpl parent;
+ protected List<ELObject> children = new ArrayList<ELObject>();
+
+ public ELObjectImpl() {
+ }
+
+ public ELModelImpl getModel() {
+ return parent == null ? null : parent.getModel();
+ }
+
+ public int getLength() {
+ int start = firstToken.getStart();
+ LexicalToken lt = (lastToken != null) ? lastToken : firstToken;
+ int end = lt.getStart() + lt.getLength();
+ return end - start;
+ }
+
+ public String getText() {
+ if(getModel() == null) return null;
+ String source = getModel().getSource();
+ int start = firstToken.getStart();
+ LexicalToken lt = (lastToken != null) ? lastToken : firstToken;
+ int end = lt.getStart() + lt.getLength();
+ return source.substring(start, end);
+ }
+
+ public ELObjectImpl getParent() {
+ return parent;
+ }
+
+ public List<ELObject> getChildren() {
+ return children;
+ }
+
+ public LexicalToken getFirstToken() {
+ return firstToken;
+ }
+
+ public LexicalToken getLastToken() {
+ return lastToken;
+ }
+
+ public void setParent(ELObjectImpl parent) {
+ this.parent = parent;
+ }
+
+ public void addChild(ELObjectImpl child) {
+ children.add(child);
+ child.setParent(this);
+ }
+
+ protected void removeChild(ELObjectImpl child) {
+ if(children.contains(child)) {
+ children.remove(child);
+ child.setParent(null);
+ }
+ }
+
+ public void setFirstToken(LexicalToken firstToken) {
+ this.firstToken = firstToken;
+ }
+
+ public void setLastToken(LexicalToken lastToken) {
+ this.lastToken = lastToken;
+ }
+
+}
Added: trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/model/ELOperatorImpl.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/model/ELOperatorImpl.java (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/model/ELOperatorImpl.java 2008-09-23 15:37:49 UTC (rev 10413)
@@ -0,0 +1,35 @@
+/*******************************************************************************
+ * Copyright (c) 2007 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:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.common.el.internal.core.model;
+
+import org.jboss.tools.common.el.core.model.ELObjectType;
+
+/**
+ *
+ * @author V. Kabanovich
+ *
+ */
+public class ELOperatorImpl extends ELObjectImpl {
+
+ public ELOperatorImpl() {}
+
+ public void addChild(ELObjectImpl child) {
+ }
+
+ public String toString() {
+ return getFirstToken() != null ? getFirstToken().getText() : "";
+ }
+
+ public ELObjectType getType() {
+ return ELObjectType.EL_OPERATOR;
+ }
+
+}
Added: trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/model/ELParametersImpl.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/model/ELParametersImpl.java (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/model/ELParametersImpl.java 2008-09-23 15:37:49 UTC (rev 10413)
@@ -0,0 +1,91 @@
+/*******************************************************************************
+ * Copyright (c) 2007 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:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.common.el.internal.core.model;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.jboss.tools.common.el.core.model.ELExpression;
+import org.jboss.tools.common.el.core.model.ELObjectType;
+import org.jboss.tools.common.el.core.model.ELParameters;
+import org.jboss.tools.common.el.core.parser.LexicalToken;
+import org.jboss.tools.common.el.internal.core.parser.token.ParamEndTokenDescription;
+import org.jboss.tools.common.el.internal.core.parser.token.ParamStartTokenDescription;
+
+/**
+ *
+ * @author V. Kabanovich
+ *
+ */
+public class ELParametersImpl extends ELObjectImpl implements ELParameters {
+ List<ELExpression> parameters = new ArrayList<ELExpression>();
+
+ public ELParametersImpl() {}
+
+ public LexicalToken getOpenParametersToken() {
+ LexicalToken result = getFirstToken();
+ if(result != null && result.getType() == ParamStartTokenDescription.PARAM_START) {
+ return result;
+ } else {
+ return null;
+ }
+ }
+
+ public LexicalToken getCloseParametersToken() {
+ LexicalToken result = getLastToken();
+ if(result != null && result.getType() == ParamEndTokenDescription.PARAM_END) {
+ return result;
+ } else {
+ return null;
+ }
+ }
+
+ public List<ELExpression> getParameters() {
+ return parameters;
+ }
+
+ public void addChild(ELObjectImpl child) {
+ if(child instanceof ELExpressionImpl) {
+ addParameter((ELExpressionImpl)child);
+ } else {
+ throw new IllegalArgumentException("EL parameters can have only EL expressions as its children.");
+ }
+ }
+
+ public void addParameter(ELExpressionImpl param) {
+ super.addChild(param);
+ parameters.add(param);
+ }
+
+ public String toString() {
+ StringBuffer sb = new StringBuffer();
+ LexicalToken t = getOpenParametersToken();
+ if(t != null) sb.append(t.getText());
+ boolean first = true;
+ for (ELExpression p: parameters) {
+ if(!first) {
+ sb.append(',');
+ } else {
+ first = false;
+ }
+ sb.append(p.toString());
+
+ }
+ t = getCloseParametersToken();
+ if(t != null) sb.append(t.getText());
+ return sb.toString();
+ }
+
+ public ELObjectType getType() {
+ return ELObjectType.EL_PARAMETERS;
+ }
+
+}
Added: trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/model/ELPropertyInvocationImpl.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/model/ELPropertyInvocationImpl.java (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/model/ELPropertyInvocationImpl.java 2008-09-23 15:37:49 UTC (rev 10413)
@@ -0,0 +1,70 @@
+/*******************************************************************************
+ * Copyright (c) 2007 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:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.common.el.internal.core.model;
+
+import org.jboss.tools.common.el.core.model.ELObjectType;
+import org.jboss.tools.common.el.core.model.ELPropertyInvocation;
+import org.jboss.tools.common.el.core.parser.LexicalToken;
+
+/**
+ *
+ * @author V. Kabanovich
+ *
+ */
+public class ELPropertyInvocationImpl extends ELInvocationExpressionImpl implements ELPropertyInvocation {
+ LexicalToken dot;
+ LexicalToken name;
+
+ public ELPropertyInvocationImpl() {}
+
+ public void addChild(ELObjectImpl child) {
+ }
+
+ public LexicalToken getSeparator() {
+ return dot;
+ }
+
+ public LexicalToken getName() {
+ return name;
+ }
+
+ public void setName(LexicalToken name) {
+ this.name = name;
+ if(name != null) {
+ if(left == null) setFirstToken(name);
+ }
+ }
+
+ public void setSeparator(LexicalToken separator) {
+ dot = separator;
+ }
+
+ public String getQualifiedName() {
+ if(name == null) return null;
+ if(left == null) return name.getText();
+ if(!(left instanceof ELPropertyInvocationImpl)) {
+ return null;
+ }
+ String p = ((ELPropertyInvocationImpl)left).getQualifiedName();
+ if(p == null) return null;
+ return p + "." + name.getText();
+ }
+
+ public String toString() {
+ return super.toString() + (dot != null ? dot.getText() : "")
+ + (name != null ? name.getText() : "");
+ }
+
+ public ELObjectType getType() {
+ return ELObjectType.EL_PROPERTY_INVOCATION;
+ }
+
+}
Added: trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/model/ELValueExpressionImpl.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/model/ELValueExpressionImpl.java (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/model/ELValueExpressionImpl.java 2008-09-23 15:37:49 UTC (rev 10413)
@@ -0,0 +1,34 @@
+/*******************************************************************************
+ * Copyright (c) 2007 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:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.common.el.internal.core.model;
+
+import org.jboss.tools.common.el.core.model.ELObjectType;
+
+/**
+ * string | primitive
+ * @author V. Kabanovich
+ */
+public class ELValueExpressionImpl extends ELExpressionImpl {
+
+ public ELValueExpressionImpl() {}
+
+ public void addChild(ELObjectImpl child) {
+ }
+
+ public String toString() {
+ return getFirstToken() != null ? getFirstToken().getText() : "";
+ }
+
+ public ELObjectType getType() {
+ return ELObjectType.EL_VALUE;
+ }
+
+}
Added: trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/parser/ELParserImpl.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/parser/ELParserImpl.java (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/parser/ELParserImpl.java 2008-09-23 15:37:49 UTC (rev 10413)
@@ -0,0 +1,275 @@
+/*******************************************************************************
+ * Copyright (c) 2007 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:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.common.el.internal.core.parser;
+
+import org.jboss.tools.common.el.core.parser.LexicalToken;
+import org.jboss.tools.common.el.internal.core.model.ELArgumentImpl;
+import org.jboss.tools.common.el.internal.core.model.ELArgumentExpressionImpl;
+import org.jboss.tools.common.el.internal.core.model.ELComplexExpressionImpl;
+import org.jboss.tools.common.el.internal.core.model.ELExpressionImpl;
+import org.jboss.tools.common.el.internal.core.model.ELInstanceImpl;
+import org.jboss.tools.common.el.internal.core.model.ELInvocationExpressionImpl;
+import org.jboss.tools.common.el.internal.core.model.ELMethodInvocationImpl;
+import org.jboss.tools.common.el.internal.core.model.ELModelImpl;
+import org.jboss.tools.common.el.internal.core.model.ELMultiExpressionImpl;
+import org.jboss.tools.common.el.internal.core.model.ELOperatorImpl;
+import org.jboss.tools.common.el.internal.core.model.ELParametersImpl;
+import org.jboss.tools.common.el.internal.core.model.ELPropertyInvocationImpl;
+import org.jboss.tools.common.el.internal.core.model.ELValueExpressionImpl;
+import org.jboss.tools.common.el.internal.core.parser.token.ArgEndTokenDescription;
+import org.jboss.tools.common.el.internal.core.parser.token.ArgStartTokenDescription;
+import org.jboss.tools.common.el.internal.core.parser.token.CommaTokenDescription;
+import org.jboss.tools.common.el.internal.core.parser.token.DotTokenDescription;
+import org.jboss.tools.common.el.internal.core.parser.token.EndELTokenDescription;
+import org.jboss.tools.common.el.internal.core.parser.token.ExprEndTokenDescription;
+import org.jboss.tools.common.el.internal.core.parser.token.ExprStartTokenDescription;
+import org.jboss.tools.common.el.internal.core.parser.token.JavaNameTokenDescription;
+import org.jboss.tools.common.el.internal.core.parser.token.OperationTokenDescription;
+import org.jboss.tools.common.el.internal.core.parser.token.ParamEndTokenDescription;
+import org.jboss.tools.common.el.internal.core.parser.token.ParamStartTokenDescription;
+import org.jboss.tools.common.el.internal.core.parser.token.PrimitiveValueTokenDescription;
+import org.jboss.tools.common.el.internal.core.parser.token.StartELTokenDescription;
+import org.jboss.tools.common.el.internal.core.parser.token.StringTokenDescription;
+import org.jboss.tools.common.el.internal.core.parser.token.UnaryTokenDescription;
+import org.jboss.tools.common.el.internal.core.parser.token.WhiteSpaceTokenDescription;
+
+/**
+ *
+ * @author V. Kabanovich
+ *
+ */
+public class ELParserImpl {
+ ELModelImpl model;
+
+ LexicalToken current;
+
+ public ELModelImpl parse(LexicalToken start) {
+ model = new ELModelImpl();
+ current = start;
+ while(current != null) {
+ if(current.getType() == StartELTokenDescription.START_EL) {
+ ELInstanceImpl instance = readELInstance();
+ if(instance != null) {
+ model.addInstance(instance);
+ }
+ } else if(!hasNextToken()) {
+ break;
+ } else {
+ setNextToken();
+ }
+ }
+ return model;
+ }
+
+ protected ELInstanceImpl readELInstance() {
+ if(current.getType() != StartELTokenDescription.START_EL) {
+ return null;
+ }
+ ELInstanceImpl instance = new ELInstanceImpl();
+ instance.setFirstToken(current);
+ setNextToken();
+ ELExpressionImpl expression = readExpression();
+ if(expression != null) {
+ instance.setExpression(expression);
+ instance.setLastToken(expression.getLastToken());
+ }
+ do {
+ if(current.getType() == StartELTokenDescription.START_EL) {
+ instance.setLastToken(current.getPreviousToken());
+ return instance;
+ } else if(current.getType() == EndELTokenDescription.END_EL) {
+ instance.setLastToken(current);
+ setNextToken();
+ return instance;
+ } else if(!hasNextToken()) {
+ instance.setLastToken(current);
+ return instance;
+ }
+ setNextToken();
+ } while(true);
+ }
+
+ protected ELExpressionImpl readExpression() {
+ ELExpressionImpl single = readSingleExpression();
+ if(single == null) return null;
+ if(current.getType() != OperationTokenDescription.OPERATION) {
+ return single;
+ }
+ ELMultiExpressionImpl multi = new ELMultiExpressionImpl();
+ multi.setFirstToken(single.getFirstToken());
+ multi.addExpression(single);
+ while(current.getType() == OperationTokenDescription.OPERATION && hasNextToken()) {
+ ELOperatorImpl operator = new ELOperatorImpl();
+ operator.setFirstToken(current);
+ operator.setLastToken(current);
+ multi.addOperator(operator);
+ multi.setLastToken(operator.getLastToken());
+ setNextToken();
+ single = readSingleExpression();
+ if(single != null) {
+ multi.addExpression(single);
+ multi.setLastToken(single.getLastToken());
+ }
+ }
+ return multi;
+ }
+
+ protected ELExpressionImpl readSingleExpression() {
+ switch(current.getType()) {
+ case ExprStartTokenDescription.EXPR_START:
+ case UnaryTokenDescription.UNARY:
+ return readComplexExpression();
+ case PrimitiveValueTokenDescription.PRIMITIVE_VALUE:
+ case StringTokenDescription.STRING:
+ ELExpressionImpl expr = new ELValueExpressionImpl();
+ expr.setFirstToken(current);
+ expr.setLastToken(current);
+ setNextToken();
+ return expr;
+ case JavaNameTokenDescription.JAVA_NAME:
+ return readInvocationExpression();
+ }
+ return null;
+ }
+
+ protected ELExpressionImpl readComplexExpression() {
+ ELComplexExpressionImpl expr = new ELComplexExpressionImpl();
+ expr.setFirstToken(current);
+ if(!hasNextToken()) {
+ expr.setLastToken(current);
+ return expr;
+ }
+ setNextToken();
+ ELExpressionImpl child = readExpression();
+ if(child != null) {
+ expr.setExpression(child);
+ expr.setLastToken(child.getLastToken());
+ }
+ if(current.getType() == ExprEndTokenDescription.EXPR_END) {
+ expr.setLastToken(current);
+ setNextToken();
+ }
+ return expr;
+ }
+
+ protected ELInvocationExpressionImpl readInvocationExpression() {
+ if(current.getType() != JavaNameTokenDescription.JAVA_NAME) {
+ return null;
+ }
+ ELPropertyInvocationImpl name = new ELPropertyInvocationImpl();
+ name.setName(current);
+ ELInvocationExpressionImpl result = name;
+ setNextToken();
+ switch (current.getType()) {
+ case ArgStartTokenDescription.ARG_START:
+ while(current.getType() == ArgStartTokenDescription.ARG_START) {
+ ELArgumentImpl arg = readArgument();
+ ELArgumentExpressionImpl call = new ELArgumentExpressionImpl();
+ call.setArgument(arg);
+ call.setLeft(result);
+ result = call;
+ }
+ break;
+ case ParamStartTokenDescription.PARAM_START:
+ ELParametersImpl params = readParameters();
+ ELMethodInvocationImpl method = new ELMethodInvocationImpl();
+ method.setParameters(params);
+ method.setName(name.getName());
+ result = method;
+ }
+ if(current.getType() == DotTokenDescription.DOT) {
+ LexicalToken dot = current;
+ setNextToken();
+ ELInvocationExpressionImpl right = readInvocationExpression();
+ if(right != null) {
+ ELInvocationExpressionImpl r = right;
+ while(r.getLeft() != null) r = r.getLeft();
+ if(r instanceof ELPropertyInvocationImpl) {
+ ((ELPropertyInvocationImpl)r).setSeparator(dot);
+ } else {
+ //is it possible?
+ }
+ r.setLeft(result);
+ result = right;
+ }
+ }
+ return result;
+ }
+
+ protected ELParametersImpl readParameters() {
+ ELParametersImpl parameters = new ELParametersImpl();
+ parameters.setFirstToken(current);
+ if(!hasNextToken()) {
+ parameters.setLastToken(current);
+ return parameters;
+ }
+ setNextToken();
+ ELExpressionImpl expression = readExpression();
+ if(expression != null) {
+ parameters.addParameter(expression);
+ parameters.setLastToken(expression.getLastToken());
+ }
+ while(current.getType() == CommaTokenDescription.COMMA) {
+ if(!hasNextToken()) {
+ parameters.setLastToken(current);
+ return parameters;
+ }
+ setNextToken();
+ expression = readExpression();
+ if(expression != null) {
+ parameters.addParameter(expression);
+ parameters.setLastToken(expression.getLastToken());
+ }
+ }
+ if(current.getType() == ParamEndTokenDescription.PARAM_END) {
+ parameters.setLastToken(current);
+ setNextToken();
+ }
+
+ return parameters;
+ }
+
+ protected ELArgumentImpl readArgument() {
+ ELArgumentImpl arg = new ELArgumentImpl();
+ arg.setFirstToken(current);
+ arg.setLastToken(current);
+ if(!hasNextToken()) return arg;
+ setNextToken();
+ ELExpressionImpl expr = readExpression();
+ if(expr != null) {
+ arg.setArgument(expr);
+ arg.setLastToken(expr.getLastToken());
+ }
+ if(current.getType() == ArgEndTokenDescription.ARG_END) {
+ arg.setLastToken(current);
+ setNextToken();
+ }
+ return arg;
+ }
+
+ private boolean hasNextToken() {
+ return lookUpNextToken(current) != null;
+ }
+
+ private LexicalToken lookUpNextToken(LexicalToken token) {
+ LexicalToken c = token;
+ while(c != null && (c == token || c.getType() == WhiteSpaceTokenDescription.WHITESPACE)) {
+ c = c.getNextToken();
+ }
+ return c;
+ }
+
+ private void setNextToken() {
+ LexicalToken t = lookUpNextToken(current);
+ if(t != null) current = t;
+ }
+
+}
Added: trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/parser/rule/ArgRule.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/parser/rule/ArgRule.java (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/parser/rule/ArgRule.java 2008-09-23 15:37:49 UTC (rev 10413)
@@ -0,0 +1,66 @@
+/*******************************************************************************
+ * Copyright (c) 2007 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:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.common.el.internal.core.parser.rule;
+
+import org.jboss.tools.common.el.core.parser.IRule;
+import org.jboss.tools.common.el.internal.core.parser.token.ArgEndTokenDescription;
+import org.jboss.tools.common.el.internal.core.parser.token.PrimitiveValueTokenDescription;
+import org.jboss.tools.common.el.internal.core.parser.token.StringTokenDescription;
+import org.jboss.tools.common.el.internal.core.parser.token.WhiteSpaceTokenDescription;
+
+/**
+ *
+ * @author V. Kabanovich
+ *
+ */
+public class ArgRule implements IRule, BasicStates {
+
+ public static ArgRule INSTANCE = new ArgRule();
+
+ public int[] getStartStates() {
+ return new int[] {
+ STATE_EXPECTING_ARG,
+ STATE_EXPECTING_ARG_CLOSE,
+ };
+ }
+
+ public int getFinalState(int state, int token) {
+ switch (token) {
+ case WhiteSpaceTokenDescription.WHITESPACE:
+ return state;
+ case PrimitiveValueTokenDescription.PRIMITIVE_VALUE:
+ case StringTokenDescription.STRING:
+ return STATE_EXPECTING_ARG_CLOSE;
+ case ArgEndTokenDescription.ARG_END:
+ return STATE_EXPECTING_CALL_AFTER_METHOD;
+ }
+
+ return 0;
+ }
+
+ public int[] getTokenTypes(int state) {
+ switch(state) {
+ case STATE_EXPECTING_ARG:
+ return new int[] {
+ WhiteSpaceTokenDescription.WHITESPACE,
+ PrimitiveValueTokenDescription.PRIMITIVE_VALUE,
+ StringTokenDescription.STRING,
+ };
+ case STATE_EXPECTING_ARG_CLOSE:
+ return new int[] {
+ WhiteSpaceTokenDescription.WHITESPACE,
+ ArgEndTokenDescription.ARG_END,
+ };
+ }
+ return new int[0];
+ }
+
+}
Added: trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/parser/rule/BasicStates.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/parser/rule/BasicStates.java (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/parser/rule/BasicStates.java 2008-09-23 15:37:49 UTC (rev 10413)
@@ -0,0 +1,64 @@
+/*******************************************************************************
+ * Copyright (c) 2007 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:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.common.el.internal.core.parser.rule;
+
+/**
+ *
+ * @author V. Kabanovich
+ *
+ */
+public interface BasicStates {
+ public int STATE_EXPECTING_EL = 0;
+ // 1) "#{" --> EXPRESSION
+ public int STATE_ERROR = -1;
+
+
+ public int STATE_EXPECTING_EXPRESSION = 101;
+ // 1) "}" --> EL
+ // 2) NAME --> call
+ // 3) Primitive, String --> operation
+ // 4) unary, expr --> operand
+ public int STATE_EXPECTING_NAME = 102;
+ // 1) NAME --> call
+ public int STATE_EXPECTING_PARAM = 103;
+ // 1) ")" --> call after method
+ // 2) Primitive, String --> operation
+ // 3) NAME --> call
+ // 4) unary, expr --> operand
+ public int STATE_EXPECTING_OPERAND = 104;
+ // 1) Primitive, String --> operation
+ // 2) NAME --> call
+ // 4) unary, expr --> operand
+
+ public int STATE_EXPECTING_OPERATION = 400;
+ // 1) "," --> operand
+ // 2) ")" --> param: call after method
+ // expr: operation
+ // 3) Operation --> operand
+ // 4) not in param "}" --> EL
+
+ //For all calls: 1) not in params "}" --> EL
+ // 2) "." --> name
+ // 3) in params "," --> operand
+ // 4) in params OPERATION --> operand
+ // 5) in params ")" --> call after method
+ // in expr ")" --> operation
+ public int STATE_EXPECTING_CALL = 201;
+ // 5) "(" --> param
+ // 6) "[" --> arg
+ public int STATE_EXPECTING_CALL_AFTER_METHOD = 202; //same after arg
+
+ public int STATE_EXPECTING_ARG = 301;
+ // 1) Primitive, String --> arg close
+ public int STATE_EXPECTING_ARG_CLOSE = 302;
+ // 1) "]" --> call after method
+
+}
Added: trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/parser/rule/CallRule.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/parser/rule/CallRule.java (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/parser/rule/CallRule.java 2008-09-23 15:37:49 UTC (rev 10413)
@@ -0,0 +1,92 @@
+/*******************************************************************************
+ * Copyright (c) 2007 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:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.common.el.internal.core.parser.rule;
+
+import org.jboss.tools.common.el.core.parser.IRule;
+import org.jboss.tools.common.el.internal.core.parser.token.ArgStartTokenDescription;
+import org.jboss.tools.common.el.internal.core.parser.token.CommaTokenDescription;
+import org.jboss.tools.common.el.internal.core.parser.token.DotTokenDescription;
+import org.jboss.tools.common.el.internal.core.parser.token.EndELTokenDescription;
+import org.jboss.tools.common.el.internal.core.parser.token.ExprEndTokenDescription;
+import org.jboss.tools.common.el.internal.core.parser.token.OperationTokenDescription;
+import org.jboss.tools.common.el.internal.core.parser.token.ParamEndTokenDescription;
+import org.jboss.tools.common.el.internal.core.parser.token.ParamStartTokenDescription;
+import org.jboss.tools.common.el.internal.core.parser.token.WhiteSpaceTokenDescription;
+
+/**
+ *
+ * @author V. Kabanovich
+ *
+ */
+public class CallRule implements IRule, BasicStates {
+
+ public static CallRule INSTANCE = new CallRule();
+
+ public int[] getStartStates() {
+ return new int[] {
+ STATE_EXPECTING_CALL,
+ STATE_EXPECTING_CALL_AFTER_METHOD,
+ };
+ }
+
+ public int getFinalState(int state, int token) {
+ switch (token) {
+ case WhiteSpaceTokenDescription.WHITESPACE:
+ return state;
+ case EndELTokenDescription.END_EL:
+ return STATE_EXPECTING_EL;
+ case DotTokenDescription.DOT:
+ return STATE_EXPECTING_NAME;
+ case CommaTokenDescription.COMMA:
+ case OperationTokenDescription.OPERATION:
+ return STATE_EXPECTING_OPERAND;
+ case ParamEndTokenDescription.PARAM_END:
+ return STATE_EXPECTING_CALL_AFTER_METHOD;
+ case ParamStartTokenDescription.PARAM_START:
+ return STATE_EXPECTING_PARAM;
+ case ArgStartTokenDescription.ARG_START:
+ return STATE_EXPECTING_ARG;
+ case ExprEndTokenDescription.EXPR_END:
+ return STATE_EXPECTING_OPERATION;
+ }
+
+ return 0;
+ }
+
+ public int[] getTokenTypes(int state) {
+ switch(state) {
+ case STATE_EXPECTING_CALL:
+ return new int[] {
+ WhiteSpaceTokenDescription.WHITESPACE,
+ EndELTokenDescription.END_EL,
+ DotTokenDescription.DOT,
+ CommaTokenDescription.COMMA,
+ OperationTokenDescription.OPERATION,
+ ParamEndTokenDescription.PARAM_END,
+ ExprEndTokenDescription.EXPR_END,
+ ParamStartTokenDescription.PARAM_START,
+ ArgStartTokenDescription.ARG_START,
+ };
+ case STATE_EXPECTING_CALL_AFTER_METHOD:
+ return new int[] {
+ WhiteSpaceTokenDescription.WHITESPACE,
+ EndELTokenDescription.END_EL,
+ DotTokenDescription.DOT,
+ CommaTokenDescription.COMMA,
+ OperationTokenDescription.OPERATION,
+ ParamEndTokenDescription.PARAM_END,
+ ExprEndTokenDescription.EXPR_END,
+ };
+ }
+ return new int[0];
+ }
+
+}
Added: trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/parser/rule/ErrorRecoveryRule.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/parser/rule/ErrorRecoveryRule.java (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/parser/rule/ErrorRecoveryRule.java 2008-09-23 15:37:49 UTC (rev 10413)
@@ -0,0 +1,59 @@
+/*******************************************************************************
+ * Copyright (c) 2007 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:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.common.el.internal.core.parser.rule;
+
+import org.jboss.tools.common.el.core.parser.IRule;
+import org.jboss.tools.common.el.internal.core.parser.token.ArgEndTokenDescription;
+import org.jboss.tools.common.el.internal.core.parser.token.EndELTokenDescription;
+import org.jboss.tools.common.el.internal.core.parser.token.ExprEndTokenDescription;
+import org.jboss.tools.common.el.internal.core.parser.token.ParamEndTokenDescription;
+import org.jboss.tools.common.el.internal.core.parser.token.StartELTokenDescription;
+
+/**
+ *
+ * @author V. Kabanovich
+ *
+ */
+public class ErrorRecoveryRule implements IRule {
+
+ public static ErrorRecoveryRule INSTANCE = new ErrorRecoveryRule();
+
+ public int getFinalState(int state, int token) {
+ switch (token) {
+ case EndELTokenDescription.END_EL:
+ return BasicStates.STATE_EXPECTING_EL;
+ case StartELTokenDescription.START_EL:
+ return BasicStates.STATE_EXPECTING_EXPRESSION;
+ case ArgEndTokenDescription.ARG_END:
+ return BasicStates.STATE_EXPECTING_CALL_AFTER_METHOD;
+ case ParamEndTokenDescription.PARAM_END:
+ return BasicStates.STATE_EXPECTING_CALL_AFTER_METHOD;
+ case ExprEndTokenDescription.EXPR_END:
+ return BasicStates.STATE_EXPECTING_OPERATION;
+ }
+ return 0;
+ }
+
+ public int[] getStartStates() {
+ return new int[]{BasicStates.STATE_ERROR};
+ }
+
+ public int[] getTokenTypes(int state) {
+ return new int[]{
+ ArgEndTokenDescription.ARG_END,
+ ParamEndTokenDescription.PARAM_END,
+ ExprEndTokenDescription.EXPR_END,
+ EndELTokenDescription.END_EL,
+ StartELTokenDescription.START_EL
+ };
+ }
+
+}
Added: trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/parser/rule/ExpressionRule.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/parser/rule/ExpressionRule.java (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/parser/rule/ExpressionRule.java 2008-09-23 15:37:49 UTC (rev 10413)
@@ -0,0 +1,114 @@
+/*******************************************************************************
+ * Copyright (c) 2007 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:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.common.el.internal.core.parser.rule;
+
+import org.jboss.tools.common.el.core.parser.IRule;
+import org.jboss.tools.common.el.internal.core.parser.token.EndELTokenDescription;
+import org.jboss.tools.common.el.internal.core.parser.token.ExprStartTokenDescription;
+import org.jboss.tools.common.el.internal.core.parser.token.JavaNameTokenDescription;
+import org.jboss.tools.common.el.internal.core.parser.token.ParamEndTokenDescription;
+import org.jboss.tools.common.el.internal.core.parser.token.PrimitiveValueTokenDescription;
+import org.jboss.tools.common.el.internal.core.parser.token.StartELTokenDescription;
+import org.jboss.tools.common.el.internal.core.parser.token.StringTokenDescription;
+import org.jboss.tools.common.el.internal.core.parser.token.UnaryTokenDescription;
+import org.jboss.tools.common.el.internal.core.parser.token.WhiteSpaceTokenDescription;
+
+/**
+ *
+ * @author V. Kabanovich
+ *
+ */
+public class ExpressionRule implements IRule, BasicStates {
+
+ public static ExpressionRule INSTANCE = new ExpressionRule();
+
+ public int[] getStartStates() {
+ return new int[] {
+ STATE_EXPECTING_EL,
+
+ STATE_EXPECTING_EXPRESSION,
+ STATE_EXPECTING_NAME,
+ STATE_EXPECTING_PARAM,
+ STATE_EXPECTING_OPERAND
+ };
+ }
+
+ public int getFinalState(int state, int token) {
+ switch (token) {
+ case StartELTokenDescription.START_EL:
+ return STATE_EXPECTING_EXPRESSION;
+
+ case WhiteSpaceTokenDescription.WHITESPACE:
+ return state;
+ case EndELTokenDescription.END_EL:
+ return STATE_EXPECTING_EL;
+ case JavaNameTokenDescription.JAVA_NAME:
+ return STATE_EXPECTING_CALL;
+ case StringTokenDescription.STRING:
+ case PrimitiveValueTokenDescription.PRIMITIVE_VALUE:
+ return STATE_EXPECTING_OPERATION;
+ case ParamEndTokenDescription.PARAM_END:
+ return STATE_EXPECTING_CALL_AFTER_METHOD;
+ case ExprStartTokenDescription.EXPR_START:
+ case UnaryTokenDescription.UNARY:
+ return STATE_EXPECTING_OPERAND;
+ }
+
+ return 0;
+ }
+
+ public int[] getTokenTypes(int state) {
+ switch(state) {
+ case STATE_EXPECTING_EL:
+ return new int[]{
+ StartELTokenDescription.START_EL
+ };
+
+ case STATE_EXPECTING_EXPRESSION:
+ return new int[] {
+ WhiteSpaceTokenDescription.WHITESPACE,
+ EndELTokenDescription.END_EL,
+ PrimitiveValueTokenDescription.PRIMITIVE_VALUE,
+ JavaNameTokenDescription.JAVA_NAME,
+ StringTokenDescription.STRING,
+ ExprStartTokenDescription.EXPR_START,
+ UnaryTokenDescription.UNARY,
+ };
+ case STATE_EXPECTING_NAME:
+ return new int[] {
+ WhiteSpaceTokenDescription.WHITESPACE,
+ JavaNameTokenDescription.JAVA_NAME,
+ };
+ case STATE_EXPECTING_PARAM:
+ return new int[] {
+ WhiteSpaceTokenDescription.WHITESPACE,
+ PrimitiveValueTokenDescription.PRIMITIVE_VALUE,
+ JavaNameTokenDescription.JAVA_NAME,
+ StringTokenDescription.STRING,
+ ExprStartTokenDescription.EXPR_START,
+ UnaryTokenDescription.UNARY,
+ ParamEndTokenDescription.PARAM_END
+ };
+ case STATE_EXPECTING_OPERAND:
+ return new int[] {
+ WhiteSpaceTokenDescription.WHITESPACE,
+ PrimitiveValueTokenDescription.PRIMITIVE_VALUE,
+ StringTokenDescription.STRING,
+ ExprStartTokenDescription.EXPR_START,
+ UnaryTokenDescription.UNARY,
+ JavaNameTokenDescription.JAVA_NAME,
+ };
+
+ }
+ return new int[0];
+ }
+
+}
Added: trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/parser/rule/OperationRule.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/parser/rule/OperationRule.java (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/parser/rule/OperationRule.java 2008-09-23 15:37:49 UTC (rev 10413)
@@ -0,0 +1,68 @@
+/*******************************************************************************
+ * Copyright (c) 2007 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:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.common.el.internal.core.parser.rule;
+
+import org.jboss.tools.common.el.core.parser.IRule;
+import org.jboss.tools.common.el.internal.core.parser.token.CommaTokenDescription;
+import org.jboss.tools.common.el.internal.core.parser.token.EndELTokenDescription;
+import org.jboss.tools.common.el.internal.core.parser.token.ExprEndTokenDescription;
+import org.jboss.tools.common.el.internal.core.parser.token.OperationTokenDescription;
+import org.jboss.tools.common.el.internal.core.parser.token.ParamEndTokenDescription;
+import org.jboss.tools.common.el.internal.core.parser.token.WhiteSpaceTokenDescription;
+
+/**
+ *
+ * @author V. Kabanovich
+ *
+ */
+public class OperationRule implements IRule, BasicStates {
+
+ public static OperationRule INSTANCE = new OperationRule();
+
+ public int[] getStartStates() {
+ return new int[] {
+ STATE_EXPECTING_OPERATION,
+ };
+ }
+
+ public int getFinalState(int state, int token) {
+ switch (token) {
+ case WhiteSpaceTokenDescription.WHITESPACE:
+ return state;
+ case EndELTokenDescription.END_EL:
+ return STATE_EXPECTING_EL;
+ case CommaTokenDescription.COMMA:
+ case OperationTokenDescription.OPERATION:
+ return STATE_EXPECTING_OPERAND;
+ case ParamEndTokenDescription.PARAM_END:
+ return STATE_EXPECTING_CALL_AFTER_METHOD;
+ case ExprEndTokenDescription.EXPR_END:
+ return STATE_EXPECTING_OPERATION;
+ }
+
+ return 0;
+ }
+
+ public int[] getTokenTypes(int state) {
+ if(state == STATE_EXPECTING_OPERATION) {
+ return new int[] {
+ WhiteSpaceTokenDescription.WHITESPACE,
+ ParamEndTokenDescription.PARAM_END,
+ ExprEndTokenDescription.EXPR_END,
+ CommaTokenDescription.COMMA,
+ OperationTokenDescription.OPERATION,
+ EndELTokenDescription.END_EL,
+ };
+ }
+ return new int[0];
+ }
+
+}
Added: trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/parser/token/ArgEndTokenDescription.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/parser/token/ArgEndTokenDescription.java (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/parser/token/ArgEndTokenDescription.java 2008-09-23 15:37:49 UTC (rev 10413)
@@ -0,0 +1,46 @@
+/*******************************************************************************
+ * Copyright (c) 2007 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:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.common.el.internal.core.parser.token;
+
+import org.jboss.tools.common.el.core.parser.Tokenizer;
+
+/**
+ *
+ * @author V. Kabanovich
+ *
+ */
+public class ArgEndTokenDescription extends ConstantTokenDescription {
+ public static final int ARG_END = 11;
+ public static final String CLOSE = "]";
+
+ public static ArgEndTokenDescription INSTANCE = new ArgEndTokenDescription();
+
+ public ArgEndTokenDescription () {
+ super(CLOSE, ARG_END);
+ }
+
+ public boolean isStart(Tokenizer tokenizer, int offset) {
+ return isInArg(tokenizer) && super.isStart(tokenizer, offset);
+ }
+
+ public boolean read(Tokenizer tokenizer, int offset) {
+ boolean b = super.read(tokenizer, offset);
+ if(b) {
+ tokenizer.getContext().remove("arg");
+ }
+ return b;
+ }
+
+ private boolean isInArg(Tokenizer tokenizer) {
+ return tokenizer.getContext().get("arg") != null;
+ }
+
+}
Added: trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/parser/token/ArgStartTokenDescription.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/parser/token/ArgStartTokenDescription.java (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/parser/token/ArgStartTokenDescription.java 2008-09-23 15:37:49 UTC (rev 10413)
@@ -0,0 +1,38 @@
+/*******************************************************************************
+ * Copyright (c) 2007 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:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.common.el.internal.core.parser.token;
+
+import org.jboss.tools.common.el.core.parser.Tokenizer;
+
+/**
+ *
+ * @author V. Kabanovich
+ *
+ */
+public class ArgStartTokenDescription extends ConstantTokenDescription {
+ public static final int ARG_START = 10;
+ public static final String OPEN = "[";
+
+ public static ArgStartTokenDescription INSTANCE = new ArgStartTokenDescription();
+
+ public ArgStartTokenDescription () {
+ super(OPEN, ARG_START);
+ }
+
+ public boolean read(Tokenizer tokenizer, int offset) {
+ boolean b = super.read(tokenizer, offset);
+ if(b) {
+ tokenizer.getContext().put("arg", OPEN);
+ }
+ return b;
+ }
+
+}
Added: trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/parser/token/CommaTokenDescription.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/parser/token/CommaTokenDescription.java (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/parser/token/CommaTokenDescription.java 2008-09-23 15:37:49 UTC (rev 10413)
@@ -0,0 +1,36 @@
+/*******************************************************************************
+ * Copyright (c) 2007 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:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.common.el.internal.core.parser.token;
+
+import org.jboss.tools.common.el.core.parser.Tokenizer;
+
+/**
+ *
+ * @author V. Kabanovich
+ *
+ */
+public class CommaTokenDescription extends ConstantTokenDescription {
+ public static final int COMMA = 8;
+
+ public static CommaTokenDescription INSTANCE = new CommaTokenDescription();
+
+ public CommaTokenDescription () {
+ super(",", COMMA);
+ }
+
+ public boolean isStart(Tokenizer tokenizer, int offset) {
+ if(!super.isStart(tokenizer, offset)) {
+ return false;
+ }
+ return ParamUtil.isMethodParamContext(tokenizer.getContext());
+ }
+
+}
Added: trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/parser/token/ConstantTokenDescription.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/parser/token/ConstantTokenDescription.java (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/parser/token/ConstantTokenDescription.java 2008-09-23 15:37:49 UTC (rev 10413)
@@ -0,0 +1,64 @@
+/*******************************************************************************
+ * Copyright (c) 2007 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:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.common.el.internal.core.parser.token;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.jboss.tools.common.el.core.parser.ITokenDescription;
+import org.jboss.tools.common.el.core.parser.Tokenizer;
+
+/**
+ *
+ * @author V. Kabanovich
+ *
+ */
+public class ConstantTokenDescription implements ITokenDescription {
+ List<String> content = new ArrayList<String>();
+ int type;
+
+ public ConstantTokenDescription(String content, int type) {
+ this.content.add(content);
+ this.type = type;
+ }
+
+ protected void addContent(String content) {
+ this.content.add(content);
+ }
+
+ public String getName() {
+ return content.get(0);
+ }
+
+ public int getType() {
+ return type;
+ }
+
+ public boolean isStart(Tokenizer tokenizer, int offset) {
+ for (String s: content) {
+ if(tokenizer.startsWith(s)) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ public boolean read(Tokenizer tokenizer, int offset) {
+ for (String s: content) {
+ if(tokenizer.startsWith(s)) {
+ tokenizer.addToken(type, offset, offset + s.length());
+ return true;
+ }
+ }
+ return true;
+ }
+
+}
Added: trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/parser/token/DotTokenDescription.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/parser/token/DotTokenDescription.java (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/parser/token/DotTokenDescription.java 2008-09-23 15:37:49 UTC (rev 10413)
@@ -0,0 +1,27 @@
+/*******************************************************************************
+ * Copyright (c) 2007 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:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.common.el.internal.core.parser.token;
+
+/**
+ *
+ * @author V. Kabanovich
+ *
+ */
+public class DotTokenDescription extends ConstantTokenDescription {
+ public static final int DOT = 4;
+
+ public static DotTokenDescription INSTANCE = new DotTokenDescription();
+
+ public DotTokenDescription () {
+ super(".", DOT);
+ }
+
+}
Added: trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/parser/token/EndELTokenDescription.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/parser/token/EndELTokenDescription.java (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/parser/token/EndELTokenDescription.java 2008-09-23 15:37:49 UTC (rev 10413)
@@ -0,0 +1,48 @@
+/*******************************************************************************
+ * Copyright (c) 2007 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:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.common.el.internal.core.parser.token;
+
+import org.jboss.tools.common.el.core.parser.Tokenizer;
+import org.jboss.tools.common.el.internal.core.parser.rule.BasicStates;
+
+/**
+ *
+ * @author V. Kabanovich
+ *
+ */
+public class EndELTokenDescription extends ConstantTokenDescription {
+ public static final int END_EL = 2;
+
+ public static EndELTokenDescription INSTANCE = new EndELTokenDescription();
+
+ public EndELTokenDescription () {
+ super("}", END_EL);
+ }
+
+ public boolean isStart(Tokenizer tokenizer, int offset) {
+ if(!super.isStart(tokenizer, offset)) {
+ return false;
+ }
+ if(tokenizer.getState() == BasicStates.STATE_ERROR) {
+ return true;
+ }
+ return ParamUtil.isParamHistoryEmpty(tokenizer.getContext());
+ }
+
+ public boolean read(Tokenizer tokenizer, int offset) {
+ boolean b = super.read(tokenizer, offset);
+ if(b) {
+ ParamUtil.cleanParamHistory(tokenizer.getContext());
+ }
+ return b;
+ }
+
+}
Added: trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/parser/token/ExprEndTokenDescription.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/parser/token/ExprEndTokenDescription.java (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/parser/token/ExprEndTokenDescription.java 2008-09-23 15:37:49 UTC (rev 10413)
@@ -0,0 +1,44 @@
+/*******************************************************************************
+ * Copyright (c) 2007 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:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.common.el.internal.core.parser.token;
+
+import org.jboss.tools.common.el.core.parser.Tokenizer;
+
+/**
+ *
+ * @author V. Kabanovich
+ *
+ */
+public class ExprEndTokenDescription extends ConstantTokenDescription {
+ public static final int EXPR_END = 14;
+
+ public static ExprEndTokenDescription INSTANCE = new ExprEndTokenDescription();
+
+ public ExprEndTokenDescription () {
+ super(")", EXPR_END);
+ }
+
+ public boolean isStart(Tokenizer tokenizer, int offset) {
+ if(!super.isStart(tokenizer, offset)) {
+ return false;
+ }
+ return ParamUtil.isComplexExpressionContext(tokenizer.getContext());
+ }
+
+ public boolean read(Tokenizer tokenizer, int offset) {
+ boolean b = super.read(tokenizer, offset);
+ if(b) {
+ ParamUtil.closeCurrentParamContext(tokenizer.getContext());
+ }
+ return b;
+ }
+
+}
Added: trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/parser/token/ExprStartTokenDescription.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/parser/token/ExprStartTokenDescription.java (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/parser/token/ExprStartTokenDescription.java 2008-09-23 15:37:49 UTC (rev 10413)
@@ -0,0 +1,37 @@
+/*******************************************************************************
+ * Copyright (c) 2007 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:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.common.el.internal.core.parser.token;
+
+import org.jboss.tools.common.el.core.parser.Tokenizer;
+
+/**
+ *
+ * @author V. Kabanovich
+ *
+ */
+public class ExprStartTokenDescription extends ConstantTokenDescription {
+ public static final int EXPR_START = 13;
+
+ public static ExprStartTokenDescription INSTANCE = new ExprStartTokenDescription();
+
+ public ExprStartTokenDescription () {
+ super("(", EXPR_START);
+ }
+
+ public boolean read(Tokenizer tokenizer, int offset) {
+ boolean b = super.read(tokenizer, offset);
+ if(b) {
+ ParamUtil.openComplexExpressionContext(tokenizer.getContext());
+ }
+ return b;
+ }
+
+}
Added: trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/parser/token/JavaNameTokenDescription.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/parser/token/JavaNameTokenDescription.java (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/parser/token/JavaNameTokenDescription.java 2008-09-23 15:37:49 UTC (rev 10413)
@@ -0,0 +1,52 @@
+/*******************************************************************************
+ * Copyright (c) 2007 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:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.common.el.internal.core.parser.token;
+
+import org.jboss.tools.common.el.core.parser.ITokenDescription;
+import org.jboss.tools.common.el.core.parser.Tokenizer;
+
+/**
+ *
+ * @author V. Kabanovich
+ *
+ */
+public class JavaNameTokenDescription implements ITokenDescription {
+ public static final int JAVA_NAME = 3;
+
+ public static JavaNameTokenDescription INSTANCE = new JavaNameTokenDescription();
+
+ public String getName() {
+ return "NAME";
+ }
+
+ public int getType() {
+ return JAVA_NAME;
+ }
+
+ public boolean isStart(Tokenizer tokenizer, int offset) {
+ char ch = tokenizer.lookUpChar(offset);
+ return Character.isJavaIdentifierStart(ch);
+ }
+
+ public boolean read(Tokenizer tokenizer, int offset) {
+ int i = offset;
+ char ch = '\0';
+ while(Character.isJavaIdentifierPart(ch = tokenizer.readNextChar())) {
+ i++;
+ }
+ if(ch != '\0') {
+ tokenizer.releaseChar();
+ }
+ tokenizer.addToken(getType(), offset, i);
+ return false;
+ }
+
+}
Added: trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/parser/token/OperationTokenDescription.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/parser/token/OperationTokenDescription.java (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/parser/token/OperationTokenDescription.java 2008-09-23 15:37:49 UTC (rev 10413)
@@ -0,0 +1,85 @@
+/*******************************************************************************
+ * Copyright (c) 2007 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:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.common.el.internal.core.parser.token;
+
+import org.jboss.tools.common.el.core.parser.ITokenDescription;
+import org.jboss.tools.common.el.core.parser.Tokenizer;
+
+/**
+ *
+ * @author V. Kabanovich
+ *
+ */
+public class OperationTokenDescription implements ITokenDescription {
+ public static final int OPERATION = 12;
+
+ static String[] OPS = {
+ "&&", "||", "==", "!=", "<=", ">=",
+ "+", "-", "*", "/", "&", "%", "|", "?" , ":", "^", "<", ">",
+ };
+ private static final String[] OPS_2 = {
+ "div", "and", "or", "not", "mod",
+ };
+
+ public static OperationTokenDescription INSTANCE = new OperationTokenDescription();
+
+ public String getName() {
+ return "Operator";
+ }
+
+ public int getType() {
+ return OPERATION;
+ }
+
+ public boolean isStart(Tokenizer tokenizer, int offset) {
+ int end = -1;
+ boolean canBeFollowedByOperand = true;
+ for (int i = 0; end < 0 && i < OPS.length; i++) {
+ if(tokenizer.startsWith(OPS[i])) {
+ end = offset + OPS[i].length();
+ }
+ }
+ for (int i = 0; end < 0 && i < OPS_2.length; i++) {
+ if(tokenizer.startsWith(OPS_2[i])) {
+ end = offset + OPS_2[i].length();
+ canBeFollowedByOperand = false;
+ }
+ }
+ if(end < 0) return false;
+ char ch = tokenizer.lookUpChar(end);
+ if(Character.isWhitespace(ch) || ch == '\0' || ch == '('
+ || (canBeFollowedByOperand && Character.isJavaIdentifierPart(ch))) {
+ return true;
+ }
+
+ return false;
+ }
+
+ public boolean read(Tokenizer tokenizer, int offset) {
+ if(!isStart(tokenizer, offset)) {
+ return false;
+ }
+ int end = -1;
+ for (int i = 0; end < 0 && i < OPS.length; i++) {
+ if(tokenizer.startsWith(OPS[i])) {
+ end = offset + OPS[i].length();
+ }
+ }
+ for (int i = 0; end < 0 && i < OPS_2.length; i++) {
+ if(tokenizer.startsWith(OPS_2[i])) {
+ end = offset + OPS_2[i].length();
+ }
+ }
+ tokenizer.addToken(OPERATION, offset, end);
+ return true;
+ }
+
+}
Added: trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/parser/token/ParamEndTokenDescription.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/parser/token/ParamEndTokenDescription.java (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/parser/token/ParamEndTokenDescription.java 2008-09-23 15:37:49 UTC (rev 10413)
@@ -0,0 +1,44 @@
+/*******************************************************************************
+ * Copyright (c) 2007 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:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.common.el.internal.core.parser.token;
+
+import org.jboss.tools.common.el.core.parser.Tokenizer;
+
+/**
+ *
+ * @author V. Kabanovich
+ *
+ */
+public class ParamEndTokenDescription extends ConstantTokenDescription {
+ public static final int PARAM_END = 9;
+
+ public static ParamEndTokenDescription INSTANCE = new ParamEndTokenDescription();
+
+ public ParamEndTokenDescription () {
+ super(")", PARAM_END);
+ }
+
+ public boolean isStart(Tokenizer tokenizer, int offset) {
+ if(!super.isStart(tokenizer, offset)) {
+ return false;
+ }
+ return ParamUtil.isMethodParamContext(tokenizer.getContext());
+ }
+
+ public boolean read(Tokenizer tokenizer, int offset) {
+ boolean b = super.read(tokenizer, offset);
+ if(b) {
+ ParamUtil.closeCurrentParamContext(tokenizer.getContext());
+ }
+ return b;
+ }
+
+}
Added: trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/parser/token/ParamStartTokenDescription.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/parser/token/ParamStartTokenDescription.java (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/parser/token/ParamStartTokenDescription.java 2008-09-23 15:37:49 UTC (rev 10413)
@@ -0,0 +1,37 @@
+/*******************************************************************************
+ * Copyright (c) 2007 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:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.common.el.internal.core.parser.token;
+
+import org.jboss.tools.common.el.core.parser.Tokenizer;
+
+/**
+ *
+ * @author V. Kabanovich
+ *
+ */
+public class ParamStartTokenDescription extends ConstantTokenDescription {
+ public static final int PARAM_START = 7;
+
+ public static ParamStartTokenDescription INSTANCE = new ParamStartTokenDescription();
+
+ public ParamStartTokenDescription () {
+ super("(", PARAM_START);
+ }
+
+ public boolean read(Tokenizer tokenizer, int offset) {
+ boolean b = super.read(tokenizer, offset);
+ if(b) {
+ ParamUtil.openMethodParamContext(tokenizer.getContext());
+ }
+ return b;
+ }
+
+}
Added: trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/parser/token/ParamUtil.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/parser/token/ParamUtil.java (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/parser/token/ParamUtil.java 2008-09-23 15:37:49 UTC (rev 10413)
@@ -0,0 +1,68 @@
+/*******************************************************************************
+ * Copyright (c) 2007 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:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.common.el.internal.core.parser.token;
+
+import java.util.ArrayList;
+import java.util.Properties;
+
+/**
+ *
+ * @author V. Kabanovich
+ *
+ */
+public class ParamUtil {
+ static String PARAM_HISTORY = "(_level";
+
+ static class ParamHistory extends ArrayList<String>{
+ private static final long serialVersionUID = 1L;
+ }
+
+ public static boolean isParamHistoryEmpty(Properties context) {
+ ParamHistory i = (ParamHistory)(context.get(PARAM_HISTORY));
+ return i == null || i.size() == 0;
+ }
+
+ public static void cleanParamHistory(Properties context) {
+ context.remove(PARAM_HISTORY);
+ }
+
+ public static void createParamHistory(Properties context) {
+ context.put(PARAM_HISTORY, new ParamHistory());
+ }
+
+ public static boolean isMethodParamContext(Properties context) {
+ ParamHistory i = (ParamHistory)(context.get(PARAM_HISTORY));
+ return i != null && i.size() > 0 && "params".equals(i.get(i.size() - 1));
+ }
+
+ public static boolean isComplexExpressionContext(Properties context) {
+ ParamHistory i = (ParamHistory)(context.get("(_level"));
+ return i != null && i.size() > 0 && "expr".equals(i.get(i.size() - 1));
+ }
+
+ public static void closeCurrentParamContext(Properties context) {
+ ParamHistory i = (ParamHistory)(context.get(PARAM_HISTORY));
+ if(i != null && i.size() > 0) {
+ i.remove(i.size() - 1);
+ }
+ }
+
+ public static void openMethodParamContext(Properties context) {
+ ParamHistory i = (ParamHistory)(context.get("(_level"));
+ i.add("params");
+ }
+
+ public static void openComplexExpressionContext(Properties context) {
+ ParamHistory i = (ParamHistory)(context.get("(_level"));
+ i.add("expr");
+ }
+
+}
Added: trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/parser/token/PrimitiveValueTokenDescription.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/parser/token/PrimitiveValueTokenDescription.java (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/parser/token/PrimitiveValueTokenDescription.java 2008-09-23 15:37:49 UTC (rev 10413)
@@ -0,0 +1,105 @@
+/*******************************************************************************
+ * Copyright (c) 2007 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:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.common.el.internal.core.parser.token;
+
+import org.jboss.tools.common.el.core.parser.ITokenDescription;
+import org.jboss.tools.common.el.core.parser.Tokenizer;
+
+/**
+ *
+ * @author V. Kabanovich
+ *
+ */
+public class PrimitiveValueTokenDescription implements ITokenDescription {
+ public static final int PRIMITIVE_VALUE = 6;
+
+ public static PrimitiveValueTokenDescription INSTANCE = new PrimitiveValueTokenDescription();
+
+ private static final String[] OPS_2 = {
+ "null", "true", "false",
+ };
+ public String getName() {
+ return "Primitive";
+ }
+
+ public int getType() {
+ return PRIMITIVE_VALUE;
+ }
+
+ public boolean isStart(Tokenizer tokenizer, int offset) {
+ if(isNumber(tokenizer, offset)) {
+ return true;
+ }
+ int end = -1;
+ boolean canBeFollowedByOperand = true;
+ for (int i = 0; end < 0 && i < OPS_2.length; i++) {
+ if(tokenizer.startsWith(OPS_2[i])) {
+ end = offset + OPS_2[i].length();
+ canBeFollowedByOperand = false;
+ }
+ }
+ if(end < 0) return false;
+ char ch = tokenizer.lookUpChar(end);
+ if(Character.isWhitespace(ch) || ch == '\0' || !Character.isJavaIdentifierPart(ch)
+ || (canBeFollowedByOperand && Character.isJavaIdentifierPart(ch))) {
+ return true;
+ }
+ return false;
+ }
+
+ private boolean isNumber(Tokenizer tokenizer, int offset) {
+ //TODO improve
+ char ch = tokenizer.lookUpChar(offset);
+ return Character.isDigit(ch);
+ }
+
+ public boolean read(Tokenizer tokenizer, int offset) {
+ if(isNumber(tokenizer, offset)) {
+ return readNumber(tokenizer, offset);
+ }
+ int end = -1;
+ for (int i = 0; end < 0 && i < OPS_2.length; i++) {
+ if(tokenizer.startsWith(OPS_2[i])) {
+ end = offset + OPS_2[i].length();
+ }
+ }
+ tokenizer.addToken(getType(), offset, end);
+ return true;
+ }
+
+ private boolean readNumber(Tokenizer tokenizer, int offset) {
+ int i = offset;
+ char ch = '\0';
+ boolean lastCharIsWrong = false;
+ int dotCount = 0;
+ while((ch = tokenizer.readNextChar()) != '\0') {
+ if(ch == '.') {
+ dotCount++;
+ if(dotCount > 1) {
+ lastCharIsWrong = true;
+ break;
+ }
+ } else if(!Character.isDigit(ch)) {
+ //TODO improve: 0x1, 1d, .f, etc
+ lastCharIsWrong = true;
+ break;
+ }
+ i++;
+
+ }
+ if(lastCharIsWrong) {
+ tokenizer.releaseChar();
+ }
+ tokenizer.addToken(getType(), offset, i);
+ return true;
+ }
+
+}
Added: trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/parser/token/StartELTokenDescription.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/parser/token/StartELTokenDescription.java (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/parser/token/StartELTokenDescription.java 2008-09-23 15:37:49 UTC (rev 10413)
@@ -0,0 +1,38 @@
+/*******************************************************************************
+ * Copyright (c) 2007 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:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.common.el.internal.core.parser.token;
+
+import org.jboss.tools.common.el.core.parser.Tokenizer;
+
+/**
+ *
+ * @author V. Kabanovich
+ *
+ */
+public class StartELTokenDescription extends ConstantTokenDescription {
+ public static final int START_EL = 1;
+
+ public static StartELTokenDescription INSTANCE = new StartELTokenDescription();
+
+ public StartELTokenDescription () {
+ super("#{", START_EL);
+ addContent("${");
+ }
+
+ public boolean read(Tokenizer tokenizer, int offset) {
+ boolean b = super.read(tokenizer, offset);
+ if(b) {
+ ParamUtil.createParamHistory(tokenizer.getContext());
+ }
+ return b;
+ }
+
+}
Added: trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/parser/token/StringTokenDescription.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/parser/token/StringTokenDescription.java (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/parser/token/StringTokenDescription.java 2008-09-23 15:37:49 UTC (rev 10413)
@@ -0,0 +1,58 @@
+/*******************************************************************************
+ * Copyright (c) 2007 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:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.common.el.internal.core.parser.token;
+
+import org.jboss.tools.common.el.core.parser.ITokenDescription;
+import org.jboss.tools.common.el.core.parser.Tokenizer;
+
+/**
+ *
+ * @author V. Kabanovich
+ *
+ */
+public class StringTokenDescription implements ITokenDescription {
+ public static final int STRING = 5;
+
+ public static StringTokenDescription INSTANCE = new StringTokenDescription();
+
+ public String getName() {
+ return "String";
+ }
+
+ public int getType() {
+ return STRING;
+ }
+
+ public boolean isStart(Tokenizer tokenizer, int offset) {
+ char ch = tokenizer.lookUpChar(offset);
+ return ch == '"' || ch == '\'';
+ }
+
+ public boolean read(Tokenizer tokenizer, int offset) {
+ char ch = tokenizer.readNextChar();
+ char chE = ch;
+ int i = offset;
+ while(ch != '\0') {
+ i++;
+ ch = tokenizer.readNextChar();
+ if(ch == '\\') {
+ i++;
+ ch = tokenizer.readNextChar();
+ } else if(ch == chE) {
+ i++;
+ break;
+ }
+ }
+ tokenizer.addToken(getType(), offset, i);
+ return i > offset;
+ }
+
+}
Added: trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/parser/token/UnaryTokenDescription.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/parser/token/UnaryTokenDescription.java (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/parser/token/UnaryTokenDescription.java 2008-09-23 15:37:49 UTC (rev 10413)
@@ -0,0 +1,31 @@
+/*******************************************************************************
+ * Copyright (c) 2007 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:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.common.el.internal.core.parser.token;
+
+/**
+ *
+ * @author V. Kabanovich
+ *
+ */
+public class UnaryTokenDescription extends ConstantTokenDescription {
+ public static final int UNARY = 15;
+
+ public static UnaryTokenDescription INSTANCE = new UnaryTokenDescription();
+
+ public UnaryTokenDescription() {
+ super("!", UNARY);
+ addContent("--");
+ addContent("++");
+ addContent("+");
+ addContent("-");
+ }
+
+}
Added: trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/parser/token/WhiteSpaceTokenDescription.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/parser/token/WhiteSpaceTokenDescription.java (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/parser/token/WhiteSpaceTokenDescription.java 2008-09-23 15:37:49 UTC (rev 10413)
@@ -0,0 +1,52 @@
+/*******************************************************************************
+ * Copyright (c) 2007 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:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.common.el.internal.core.parser.token;
+
+import org.jboss.tools.common.el.core.parser.ITokenDescription;
+import org.jboss.tools.common.el.core.parser.Tokenizer;
+
+/**
+ *
+ * @author V. Kabanovich
+ *
+ */
+public class WhiteSpaceTokenDescription implements ITokenDescription {
+ public static final int WHITESPACE = 0;
+
+ public static WhiteSpaceTokenDescription INSTANCE = new WhiteSpaceTokenDescription();
+
+ public String getName() {
+ return "Whitespace";
+ }
+
+ public int getType() {
+ return WHITESPACE;
+ }
+
+ public boolean isStart(Tokenizer tokenizer, int offset) {
+ char i = tokenizer.lookUpChar(offset);
+ return Character.isWhitespace(i);
+ }
+
+ public boolean read(Tokenizer tokenizer, int offset) {
+ int i = offset;
+ char ch = '\0';
+ while(Character.isWhitespace(ch = tokenizer.readNextChar())) {
+ i++;
+ }
+ if(ch != '\0') {
+ tokenizer.releaseChar();
+ }
+ tokenizer.addToken(getType(), offset, i);
+ return false;
+ }
+
+}
15 years, 9 months
JBoss Tools SVN: r10412 - in documentation/trunk/movies: wink_resources and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: smukhina
Date: 2008-09-23 11:37:42 -0400 (Tue, 23 Sep 2008)
New Revision: 10412
Added:
documentation/trunk/movies/wink_resources/
documentation/trunk/movies/wink_resources/custom_box.svg
documentation/trunk/movies/wink_resources/custom_left.svg
documentation/trunk/movies/wink_resources/custom_left_bottom.svg
documentation/trunk/movies/wink_resources/custom_left_top.svg
documentation/trunk/movies/wink_resources/custom_right.svg
documentation/trunk/movies/wink_resources/custom_right_bottom.svg
documentation/trunk/movies/wink_resources/custom_right_top.svg
documentation/trunk/movies/wink_resources/custom_top_left.svg
documentation/trunk/movies/wink_resources/custom_top_right.svg
documentation/trunk/movies/wink_resources/palette_for_demo_movies_(256_colors).pal
Log:
https://jira.jboss.org/jira/browse/JBDS-426
the folder contains standard style elements for movies creation
Added: documentation/trunk/movies/wink_resources/custom_box.svg
===================================================================
--- documentation/trunk/movies/wink_resources/custom_box.svg (rev 0)
+++ documentation/trunk/movies/wink_resources/custom_box.svg 2008-09-23 15:37:42 UTC (rev 10412)
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN"
+ "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
+<svg width="117px" height="75px">
+<polygon points="10 10, 10 64, 106 64, 106 10"
+ style="stroke-width:0;fill:rgb(215,229,244);fill-opacity:0.949;" />
+<polyline points="18 18, 98 18, 98 55, 18 55, 18 18"
+ style="stroke:rgb(0,0,0);fill:none;" />
+<g id="appdata_0_255_255_255_1" />
+</svg>
Added: documentation/trunk/movies/wink_resources/custom_left.svg
===================================================================
--- documentation/trunk/movies/wink_resources/custom_left.svg (rev 0)
+++ documentation/trunk/movies/wink_resources/custom_left.svg 2008-09-23 15:37:42 UTC (rev 10412)
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN"
+ "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
+<svg width="126px" height="114px">
+<path d="M13.848 68.816 C13.848,76.336 21.568,80.583 28.145,80.583 C34.336,80.583 38.05,79.842 40.758,80.170 C43.081,83.454 54.858,96.718 57.567,100.966 C57.567,93.805 57.002,84.923 57.002,81.001 C62.416,81.001 93.957,80.583 99.757,80.583 C105.560,80.583 115.130,74.077 114.754,68.197 C114.754,59.043 115.005,37.625 115.005,26.833 C115.005,18.669 111.302,12.5 103.175,12.5 C95.827,12.5 32.829,12.5 26.633,12.5 C19.079,12.832 13.830,18.625 13.830,25.169 C13.830,30.4 13.848,62.283 13.848,68.816 Z"
+ style="stroke-width:0;fill:rgb(215,229,244);fill-opacity:0.949;" />
+<path d="M10 66.675 C10,74.420 17.973,78.788 24.764,78.788 C31.145,78.788 36.346,78.452 39.133,78.788 C41.525,82.15 53.904,98.641 56.698,103.001 C56.698,95.600 56.698,82.822 56.698,78.788 C62.283,78.788 92.683,78.788 98.670,78.788 C104.649,78.788 114.067,72.725 113.670,66.675 C113.670,57.264 112,33.545 112,22.441 C112,14.043 106.037,10.336 97.670,10.336 C90.084,10.336 28.394,10 22,10 C14.425,9.663 10.336,16.725 10.336,23.454 C10.336,28.833 10,59.949 10,66.675 Z"
+ style="stroke-width:0;fill:rgb(215,229,244);fill-opacity:0.85;" />
+<polyline points="103.408 66.334, 103.408 21.169, 22.4 21.169, 22.4 66.334, 103.408 66.334"
+ style="stroke:rgb(0,0,0);fill:none;" />
+<g id="appdata_0_0_0_0_1" />
+</svg>
Added: documentation/trunk/movies/wink_resources/custom_left_bottom.svg
===================================================================
--- documentation/trunk/movies/wink_resources/custom_left_bottom.svg (rev 0)
+++ documentation/trunk/movies/wink_resources/custom_left_bottom.svg 2008-09-23 15:37:42 UTC (rev 10412)
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN"
+ "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
+<svg width="170px" height="124px">
+<path d="M48.75 111.466 C41.233,111.466 36.983,104.007 36.983,97.663 C36.983,91.697 37.312,86.841 36.983,84.232 C33.703,81.990 17.703,70.416 13.466,67.804 C20.625,67.804 33.069,67.804 36.983,67.804 C36.983,62.574 36.983,34.163 36.983,28.568 C36.983,22.966 42.859,14.163 48.75,14.532 C57.9,14.532 137.3,14.532 148.082,14.532 C156.257,14.532 159.533,20.107 159.533,27.949 C159.533,35.031 159.533,92.066 159.533,98.037 C158.283,105.466 154.283,109.708 147.433,111.466 C142.202,111.466 55.288,111.466 48.75,111.466 Z"
+ style="stroke-width:0;fill:rgb(215,229,244);fill-opacity:0.6;" />
+<path d="M46 113.666 C38.331,113.666 34,105.692 34,98.9 C34,92.516 34.331,87.324 34,84.531 C30.663,82.137 14.330,69.766 10,66.966 C17.329,66.966 30,66.966 34,66.966 C34,61.382 34,30.983 34,25 C34,19.014 40,9.591 46,10 C55.331,10 136.332,10 147.332,10 C155.666,10 159,15.955 159,24.334 C159,31.913 159,92.916 159,99.308 C159.332,106.882 153.332,113.666 146.666,113.666 C141.332,113.666 52.666,113.666 46,113.666 Z"
+ style="stroke-width:0;fill:rgb(215,229,244);fill-opacity:0.85;" />
+<polyline points="46.331 21.163, 147.332 21.163, 147.332 100.166, 46.331 100.166, 46.331 21.163"
+ style="stroke:rgb(0,0,0);fill:none;" />
+<g id="appdata_0_0_0_0_1" />
+</svg>
Added: documentation/trunk/movies/wink_resources/custom_left_top.svg
===================================================================
--- documentation/trunk/movies/wink_resources/custom_left_top.svg (rev 0)
+++ documentation/trunk/movies/wink_resources/custom_left_top.svg 2008-09-23 15:37:42 UTC (rev 10412)
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN"
+ "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
+<svg width="170px" height="124px">
+<path d="M47.733 11.531 C40.218,11.531 35.966,19.362 35.966,26.037 C35.966,32.316 36.291,37.420 35.966,40.172 C32.687,42.529 16.675,54.692 12.437,57.441 C19.597,57.441 32.045,57.441 35.966,57.441 C35.966,62.937 35.966,92.824 35.966,98.708 C35.966,104.594 41.848,113.850 47.733,113.469 C56.889,113.469 136.327,113.469 147.115,113.469 C155.288,113.469 158.562,107.608 158.562,99.358 C158.562,91.908 158.562,31.929 158.562,25.644 C158.875,18.197 153,11.531 146.461,11.531 C141.225,11.531 54.276,11.531 47.733,11.531 Z"
+ style="stroke-width:0;fill:rgb(215,229,244);fill-opacity:0.6;" />
+<path d="M46 10 C38.331,10 34,17.973 34,24.764 C34,31.149 34.331,36.341 34,39.134 C30.663,41.529 14.330,53.899 10,56.697 C17.329,56.697 30,56.697 34,56.697 C34,62.283 34,92.678 34,98.666 C34,104.649 40,114.062 46,113.666 C55.331,113.666 136.332,113.666 147.332,113.666 C155.666,113.666 159,107.702 159,99.332 C159,91.749 159,30.75 159,24.358 C159.332,16.783 153.332,10 146.666,10 C141.332,10 52.666,10 46,10 Z"
+ style="stroke-width:0;fill:rgb(215,229,244);fill-opacity:0.85;" />
+<polyline points="46.331 24.5, 147.332 24.5, 147.332 103.5, 46.331 103.5, 46.331 24.5"
+ style="stroke:rgb(0,0,0);fill:none;" />
+<g id="appdata_0_0_0_0_1" />
+</svg>
Added: documentation/trunk/movies/wink_resources/custom_right.svg
===================================================================
--- documentation/trunk/movies/wink_resources/custom_right.svg (rev 0)
+++ documentation/trunk/movies/wink_resources/custom_right.svg 2008-09-23 15:37:42 UTC (rev 10412)
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN"
+ "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
+<svg width="125px" height="124px">
+<path d="M114.408 68.348 C112.5,75.898 106.3,79.362 99.3,80.362 C93.021,80.362 87.045,79.975 84.3,80.3 C81.949,83.576 84,83 108,109 C81,80 68.3,83.891 68.3,79.966 C62.804,79.966 33.179,80.362 27.3,80.362 C21.407,80.362 12.086,74.233 12.466,68.348 C12.466,59.19 11.764,37.15 11.764,26.358 C11.764,18.187 15.519,12.026 23.764,12.026 C31.216,12.026 95.149,12.026 101.433,12.026 C109.098,12.358 114.433,18.158 114.433,24.699 C114.433,29.931 114.408,61.810 114.408,68.348 Z"
+ style="stroke-width:0;fill:rgb(215,229,244);fill-opacity:0.6;" />
+<path d="M113.668 66.675 C113.668,74.416 105.695,78.788 98.904,78.788 C92.519,78.788 87.324,78.452 84.537,78.788 C82.139,82.15 81,78 109,113 C78,81 66.966,82.824 66.966,78.788 C61.383,78.788 30.983,78.788 25,78.788 C19.014,78.788 9.591,72.725 10,66.675 C10,57.264 11.668,33.545 11.668,22.441 C11.668,14.037 17.625,10.336 26,10.336 C33.574,10.336 95.274,10 101.668,10 C109.239,9.663 113.332,16.722 113.332,23.454 C113.332,28.833 113.668,59.949 113.668,66.675 Z"
+ style="stroke-width:0;fill:rgb(215,229,244);fill-opacity:0.85;" />
+<polyline points="20.262 66.334, 20.262 21.169, 101.262 21.169, 101.262 66.334, 20.262 66.334"
+ style="stroke:rgb(0,0,0);fill:none;" />
+<g id="appdata_0_0_0_0_1" />
+</svg>
Added: documentation/trunk/movies/wink_resources/custom_right_bottom.svg
===================================================================
--- documentation/trunk/movies/wink_resources/custom_right_bottom.svg (rev 0)
+++ documentation/trunk/movies/wink_resources/custom_right_bottom.svg 2008-09-23 15:37:42 UTC (rev 10412)
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN"
+ "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
+<svg width="170px" height="124px">
+<path d="M122.214 112.465 C129.725,112.465 133.975,105.007 133.975,98.661 C133.975,92.697 133.653,87.843 133.975,85.231 C137.258,82.984 153.262,71.416 157.499,68.805 C150.340,68.805 137.894,68.805 133.975,68.805 C133.975,63.578 133.975,35.163 133.975,29.568 C133.975,23.966 128.098,15.163 122.214,15.532 C113.066,15.532 33.658,15.532 22.876,15.532 C14.706,15.532 11.436,21.103 11.436,28.949 C11.436,36.031 11.436,93.065 11.436,99.037 C12.686,106.465 16.686,110.710 23.531,112.465 C28.764,112.465 115.675,112.465 122.214,112.465 Z"
+ style="stroke-width:0;fill:rgb(215,229,244);fill-opacity:0.6;" />
+<path d="M122.999 113.666 C130.664,113.666 135,105.692 135,98.899 C135,92.516 134.664,87.324 135,84.531 C138.332,82.137 154.664,69.766 159,66.966 C151.669,66.966 139,66.966 135,66.966 C135,61.382 135,30.983 135,25 C135,19.014 129,9.593 122.999,10 C113.665,10 32.663,10 21.663,10 C13.330,10 10,15.955 10,24.334 C10,31.913 10,92.916 10,99.308 C9.663,106.882 15.663,113.666 22.333,113.666 C27.663,113.666 116.327,113.666 122.999,113.666 Z"
+ style="stroke-width:0;fill:rgb(215,229,244);fill-opacity:0.85;" />
+<polyline points="21.75 21.163, 123.749 21.163, 123.749 100.166, 21.75 100.166, 21.75 21.163"
+ style="stroke:rgb(0,0,0);fill:none;" />
+<g id="appdata_0_0_0_0_1" />
+</svg>
Added: documentation/trunk/movies/wink_resources/custom_right_top.svg
===================================================================
--- documentation/trunk/movies/wink_resources/custom_right_top.svg (rev 0)
+++ documentation/trunk/movies/wink_resources/custom_right_top.svg 2008-09-23 15:37:42 UTC (rev 10412)
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN"
+ "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
+<svg width="170px" height="125px">
+<path d="M124.202 12.062 C131.716,12.062 135.966,19.896 135.966,26.568 C135.966,32.848 135.640,37.953 135.966,40.703 C139.25,43.06 155.258,55.222 159.5,57.967 C152.332,57.967 139.890,57.967 135.966,57.967 C135.966,63.470 135.966,93.351 135.966,99.239 C135.966,105.130 130.081,114.382 124.202,114 C115.045,114 35.608,114 24.816,114 C16.645,114 13.375,108.139 13.375,99.891 C13.375,92.441 13.375,32.460 13.375,26.175 C13.056,18.724 18.936,12.062 25.473,12.062 C30.708,12.062 117.661,12.062 124.202,12.062 Z"
+ style="stroke-width:0;fill:rgb(215,229,244);fill-opacity:0.6;" />
+<path d="M123 10 C130.666,10 135,17.973 135,24.764 C135,31.145 134.666,36.341 135,39.134 C138.332,41.529 154.666,53.896 159,56.698 C151.671,56.698 139,56.698 135,56.698 C135,62.283 135,92.675 135,98.666 C135,104.65 129,114.062 123,113.666 C113.666,113.666 32.663,113.666 21.663,113.666 C13.330,113.666 10,107.702 10,99.332 C10,91.745 10,30.75 10,24.358 C9.663,16.783 15.663,10 22.333,10 C27.663,10 116.332,10 123,10 Z"
+ style="stroke-width:0;fill:rgb(215,229,244);fill-opacity:0.85;" />
+<polyline points="122.666 24.495, 21.663 24.495, 21.663 103.5, 122.666 103.5, 122.666 24.495"
+ style="stroke:rgb(0,0,0);fill:none;" />
+<g id="appdata_0_0_0_0_1" />
+</svg>
Added: documentation/trunk/movies/wink_resources/custom_top_left.svg
===================================================================
--- documentation/trunk/movies/wink_resources/custom_top_left.svg (rev 0)
+++ documentation/trunk/movies/wink_resources/custom_top_left.svg 2008-09-23 15:37:42 UTC (rev 10412)
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN"
+ "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
+<svg width="125px" height="116px">
+<path d="M12.932 49.429 C12.932,41.913 20.649,37.663 27.226,37.663 C33.420,37.663 37.135,38.404 39.842,38.079 C42.164,34.795 54.127,18.490 56.835,14.25 C56.835,21.413 56.086,33.324 56.086,37.25 C61.501,37.25 93.045,37.663 98.841,37.663 C104.644,37.663 114.210,44.170 113.833,50.05 C113.833,59.206 114.086,80.625 114.086,91.413 C114.086,99.580 110.389,105.75 102.260,105.75 C94.908,105.75 31.908,105.75 25.717,105.75 C18.164,105.413 12.908,99.620 12.908,93.081 C12.908,87.843 12.932,55.966 12.932,49.429 Z"
+ style="stroke-width:0;fill:rgb(215,229,244);fill-opacity:0.6;" />
+<path d="M10 46.322 C10,38.574 17.973,34.210 24.764,34.210 C31.145,34.210 36.346,34.548 39.133,34.210 C41.525,30.848 53.904,14.358 56.698,10 C56.698,17.394 56.698,30.175 56.698,34.210 C62.283,34.210 92.683,34.210 98.670,34.210 C104.649,34.210 114.067,40.268 113.670,46.322 C113.670,55.733 112,79.454 112,90.553 C112,98.957 106.037,102.661 97.670,102.661 C90.084,102.661 28.394,103 22,103 C14.425,103.334 10.336,96.269 10.336,89.543 C10.336,84.163 10,53.05 10,46.322 Z"
+ style="stroke-width:0;fill:rgb(215,229,244);fill-opacity:0.85;" />
+<polyline points="103.408 46.666, 103.408 91.832, 22.4 91.832, 22.4 46.666, 103.408 46.666"
+ style="stroke:rgb(0,0,0);fill:none;" />
+<g id="appdata_0_0_0_0_1" />
+</svg>
Added: documentation/trunk/movies/wink_resources/custom_top_right.svg
===================================================================
--- documentation/trunk/movies/wink_resources/custom_top_right.svg (rev 0)
+++ documentation/trunk/movies/wink_resources/custom_top_right.svg 2008-09-23 15:37:42 UTC (rev 10412)
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN"
+ "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
+<svg width="125px" height="121px">
+<path d="M114.733 53.807 C114.733,46.288 106.904,42.041 100.228,42.041 C93.949,42.041 90.177,42.781 87.428,42.456 C85.077,39.175 97.875,25.75 102.875,12.25 C94.074,19.25 76.8,31.525 68.828,42.041 C63.333,42.041 33.444,42.041 27.562,42.041 C21.670,42.041 12.413,47.923 12.8,53.807 C12.8,62.964 12.09,85.005 12.09,95.791 C12.09,103.965 15.848,110.125 24.095,110.125 C31.548,110.125 95.478,110.125 101.762,110.125 C109.428,109.791 114.762,103.999 114.762,97.457 C114.762,92.220 114.733,60.345 114.733,53.807 Z"
+ style="stroke-width:0;fill:rgb(215,229,244);fill-opacity:0.6;" />
+<path d="M113.668 51.444 C113.668,43.708 105.695,39.335 98.904,39.335 C92.519,39.335 91.661,39.086 88.875,38.75 C85.101,36.574 106.173,14.358 103.375,10 C98.875,16.25 72.125,34.711 72.125,38.75 C66.541,38.75 30.983,39.335 25,39.335 C19.014,39.335 9.593,45.393 10,51.444 C10,60.858 11.669,84.576 11.669,95.678 C11.669,104.082 17.625,107.786 26,107.786 C33.583,107.786 95.274,108.125 101.668,108.125 C109.239,108.458 113.332,101.394 113.332,94.668 C113.332,89.288 113.668,58.175 113.668,51.444 Z"
+ style="stroke-width:0;fill:rgb(215,229,244);fill-opacity:0.85;" />
+<polyline points="20.262 51.791, 20.262 96.957, 101.262 96.957, 101.262 51.791, 20.262 51.791"
+ style="stroke:rgb(0,0,0);fill:none;" />
+<g id="appdata_0_0_0_0_1" />
+</svg>
Added: documentation/trunk/movies/wink_resources/palette_for_demo_movies_(256_colors).pal
===================================================================
--- documentation/trunk/movies/wink_resources/palette_for_demo_movies_(256_colors).pal (rev 0)
+++ documentation/trunk/movies/wink_resources/palette_for_demo_movies_(256_colors).pal 2008-09-23 15:37:42 UTC (rev 10412)
@@ -0,0 +1,257 @@
+JASC-PAL
+0100
+254
+15 15 15
+25 29 34
+28 36 31
+30 36 42
+30 39 49
+32 30 30
+32 32 30
+56 54 52
+29 8 89
+28 50 71
+30 59 96
+47 59 71
+13 78 15
+6 103 11
+26 111 49
+37 92 35
+48 111 51
+24 64 65
+19 87 126
+51 70 87
+51 80 108
+47 123 65
+48 106 117
+64 62 61
+120 22 24
+118 41 50
+64 63 78
+127 0 85
+123 58 70
+122 50 97
+66 64 61
+67 109 62
+121 82 45
+109 109 63
+80 80 79
+77 90 103
+82 104 83
+87 101 112
+98 92 91
+125 84 104
+102 100 90
+112 111 110
+33 4 147
+38 2 210
+56 17 254
+53 93 132
+57 102 144
+59 120 176
+65 28 254
+78 44 254
+91 79 153
+93 75 161
+80 112 144
+72 120 169
+100 89 158
+104 91 162
+100 116 132
+101 123 173
+94 67 254
+111 84 254
+124 99 254
+35 135 31
+49 141 50
+18 134 80
+54 136 72
+59 153 99
+67 169 54
+124 136 63
+126 190 63
+75 147 83
+85 152 101
+85 171 82
+87 163 101
+106 151 85
+110 145 112
+112 175 81
+111 173 113
+121 196 54
+116 194 80
+120 203 105
+58 139 151
+61 129 190
+63 191 159
+62 130 193
+85 141 141
+75 133 186
+84 165 136
+80 166 177
+108 130 136
+105 130 154
+99 144 153
+122 131 137
+119 134 151
+126 157 129
+121 148 158
+113 141 176
+117 175 133
+103 170 182
+74 143 207
+92 162 218
+106 154 202
+115 167 214
+114 174 230
+82 200 144
+125 201 137
+97 205 202
+141 23 20
+146 33 30
+144 46 45
+168 27 16
+173 42 30
+170 49 40
+130 7 90
+139 26 102
+149 46 116
+186 56 79
+144 93 50
+150 108 59
+178 92 20
+182 65 51
+181 113 21
+169 113 47
+144 83 79
+137 85 106
+142 113 80
+132 123 111
+180 86 82
+172 117 75
+184 112 107
+203 57 41
+204 26 65
+211 58 91
+232 60 66
+205 69 53
+194 120 19
+228 73 53
+208 86 71
+207 76 103
+201 103 86
+209 111 105
+241 77 83
+255 92 98
+228 99 82
+237 115 112
+154 62 128
+156 67 131
+130 127 149
+131 119 176
+166 80 139
+176 102 154
+183 118 165
+141 126 193
+136 113 254
+221 104 129
+251 124 128
+142 157 63
+150 182 63
+189 132 28
+180 141 48
+187 164 63
+150 136 78
+142 135 120
+148 175 75
+140 175 115
+179 144 78
+172 151 109
+182 162 86
+180 169 120
+148 213 61
+166 206 63
+186 249 63
+140 199 86
+147 200 103
+165 203 91
+166 203 113
+170 235 79
+197 135 26
+198 143 56
+207 175 56
+227 157 22
+200 148 76
+207 143 109
+206 165 84
+207 174 112
+233 134 123
+239 176 77
+229 186 108
+243 220 63
+219 207 81
+214 192 121
+251 192 95
+240 202 119
+245 242 111
+153 147 136
+141 153 170
+143 176 142
+151 165 176
+162 154 140
+182 141 177
+179 169 154
+182 177 169
+140 154 193
+152 136 254
+147 175 204
+136 182 227
+165 154 205
+168 152 254
+172 184 202
+179 171 249
+144 199 144
+155 197 168
+173 203 148
+178 202 178
+190 224 170
+155 198 209
+155 193 230
+157 227 203
+181 196 210
+173 202 230
+214 150 140
+199 145 181
+206 183 144
+195 187 175
+240 143 139
+242 158 161
+232 165 157
+241 174 171
+194 155 193
+209 177 202
+195 184 254
+249 189 192
+213 196 149
+205 197 185
+207 233 177
+241 212 142
+231 212 177
+251 227 147
+246 232 179
+214 209 201
+201 216 237
+215 228 210
+212 227 242
+225 220 213
+230 217 241
+232 227 219
+39 35 29
+229 235 246
+235 243 234
+232 242 253
+240 237 233
+243 235 245
+243 241 237
+14 14 14
+255 255 255
15 years, 9 months
JBoss Tools SVN: r10411 - trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/preferences.
by jbosstools-commits@lists.jboss.org
Author: sdzmitrovich
Date: 2008-09-23 11:27:32 -0400 (Tue, 23 Sep 2008)
New Revision: 10411
Modified:
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/preferences/VpePreference.java
Log:
code adjustment
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/preferences/VpePreference.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/preferences/VpePreference.java 2008-09-23 14:58:22 UTC (rev 10410)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/preferences/VpePreference.java 2008-09-23 15:27:32 UTC (rev 10411)
@@ -24,7 +24,7 @@
public static String ATT_SOURCE_VISUAL_EDITORS_WEIGHTS = "Size of Visual Editor pane 0-100%";
public static String ATT_SHOW_SELECTION_TAG_BAR = "show selection tag bar";
public static String ATT_ALWAYS_HIDE_SELECTION_BAR_WITHOUT_PROMT="always hide selection bar without prompt";
- public static String ATT_SHOW_INVISIBLE_TAGS="show invisible tags";
+ public static String ATT_SHOW_INVISIBLE_TAGS="show non-visual tags";
public static String SHOW_COMMENTS_VALUE;
public static String VPE_EDITOR_PATH = "%Options%/Struts Studio/Editors/Visual Page Editor"; //$NON-NLS-1$
public static final Preference SHOW_COMMENTS = new VpePreference(VPE_EDITOR_PATH, ATT_SHOW_COMMENTS);
15 years, 9 months
JBoss Tools SVN: r10410 - in trunk: jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components and 3 other directories.
by jbosstools-commits@lists.jboss.org
Author: sdzmitrovich
Date: 2008-09-23 10:58:22 -0400 (Tue, 23 Sep 2008)
New Revision: 10410
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/facet.jsp.xml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/selectItem.jsp.xml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/selectItems.jsp.xml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/selectOneRadio.jsp.xml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/subview.jsp.xml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/verbatim.jsp.xml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/view.jsp.xml
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/templates/vpe-templates-jsf.xml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/actionListener.jsp
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/attribute.jsp
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/convertDateTime.jsp
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/convertNumber.jsp
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/converter.jsp
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/facet.jsp
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/inputHidden.jsp
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/loadBundle.jsp
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/param.jsp
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/phaseListener.jsp
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/selectItem.jsp
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/selectItems.jsp
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/selectOneRadio.jsp
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/setPropertyActionListener.jsp
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/subview.jsp
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/validateDoubleRange.jsp
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/validateLength.jsp
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/validateLongRange.jsp
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/validator.jsp
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/valueChangeListener.jsp
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/verbatim.jsp
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/view.jsp
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/JsfComponentContentTest.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java
trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/ComponentContentTest.java
trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/TestDomUtil.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-2797
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/templates/vpe-templates-jsf.xml
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/templates/vpe-templates-jsf.xml 2008-09-23 14:01:49 UTC (rev 10409)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/templates/vpe-templates-jsf.xml 2008-09-23 14:58:22 UTC (rev 10410)
@@ -732,6 +732,10 @@
<vpe:tag name="f:setPropertyActionListener">
<vpe:template children="no" modify="no" />
</vpe:tag>
+
+ <vpe:tag name="f:actionListener">
+ <vpe:template children="no" modify="no" />
+ </vpe:tag>
<vpe:tag name="f:valueChangeListener">
<vpe:template children="no" modify="no" />
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/actionListener.jsp
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/actionListener.jsp 2008-09-23 14:01:49 UTC (rev 10409)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/actionListener.jsp 2008-09-23 14:58:22 UTC (rev 10410)
@@ -10,7 +10,7 @@
<h1><h:outputText value="actionListener" /></h1>
<h:form id="form">
<h:commandButton value="button">
- <f:actionListener type="someType" />
+ <f:actionListener type="someType" id="actionListener" />
</h:commandButton>
</h:form>
</f:view>
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/attribute.jsp
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/attribute.jsp 2008-09-23 14:01:49 UTC (rev 10409)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/attribute.jsp 2008-09-23 14:58:22 UTC (rev 10410)
@@ -10,7 +10,7 @@
<h1><h:outputText value="attribute" /></h1>
<h:form id="form">
<h:commandButton value="button">
- <f:attribute name="attributeName" value="attributeValue" />
+ <f:attribute name="attributeName" value="attributeValue" id="attribute"/>
</h:commandButton>
</h:form>
</f:view>
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/convertDateTime.jsp
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/convertDateTime.jsp 2008-09-23 14:01:49 UTC (rev 10409)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/convertDateTime.jsp 2008-09-23 14:58:22 UTC (rev 10410)
@@ -9,7 +9,7 @@
<f:view>
<h1><h:outputText value="convertDateTime" /></h1>
<h:inputText value="value">
- <f:convertDateTime pattern="MM/yyyy" />
+ <f:convertDateTime pattern="MM/yyyy" id="convertDateTime" />
</h:inputText>
</f:view>
</body>
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/convertNumber.jsp
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/convertNumber.jsp 2008-09-23 14:01:49 UTC (rev 10409)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/convertNumber.jsp 2008-09-23 14:58:22 UTC (rev 10410)
@@ -9,7 +9,7 @@
<f:view>
<h1><h:outputText value="convertNumber" /></h1>
<h:inputText value="value">
- <f:convertNumber minFractionDigits="2"/>
+ <f:convertNumber minFractionDigits="2" id="convertNumber" />
</h:inputText>
</f:view>
</body>
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/converter.jsp
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/converter.jsp 2008-09-23 14:01:49 UTC (rev 10409)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/converter.jsp 2008-09-23 14:58:22 UTC (rev 10410)
@@ -9,7 +9,7 @@
<f:view>
<h1><h:outputText value="converter" /></h1>
<h:inputText value="value">
- <f:converter converterId="someConverterId" />
+ <f:converter converterId="someConverterId" id="converter" />
</h:inputText>
</f:view>
</body>
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/facet.jsp
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/facet.jsp 2008-09-23 14:01:49 UTC (rev 10409)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/facet.jsp 2008-09-23 14:58:22 UTC (rev 10410)
@@ -11,8 +11,9 @@
<h:dataTable value="data">
<h:column>
- <f:facet name="header">
+ <f:facet name="header" id="facet">
<h:outputText value="Last Name" />
+ <h:outputText value="Cut Text" />
</f:facet>
Added: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/facet.jsp.xml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/facet.jsp.xml (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/facet.jsp.xml 2008-09-23 14:58:22 UTC (rev 10410)
@@ -0,0 +1,7 @@
+<tests>
+ <test id="facet">
+ <DIV>
+ <SPAN> Last Name</SPAN>
+ </DIV>
+ </test>
+</tests>
\ No newline at end of file
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/inputHidden.jsp
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/inputHidden.jsp 2008-09-23 14:01:49 UTC (rev 10409)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/inputHidden.jsp 2008-09-23 14:58:22 UTC (rev 10410)
@@ -9,7 +9,7 @@
<f:view>
<h1><h:outputText value="inputHidden" /></h1>
- <h:inputHidden value="inputHidden"/>
+ <h:inputHidden value="inputHidden" id="inputHidden"/>
</f:view>
</body>
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/loadBundle.jsp
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/loadBundle.jsp 2008-09-23 14:01:49 UTC (rev 10409)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/loadBundle.jsp 2008-09-23 14:58:22 UTC (rev 10410)
@@ -8,7 +8,7 @@
<f:view>
<h1><h:outputText value="loadBundle" /></h1>
- <f:loadBundle var="var" basename="someBaseName" />
+ <f:loadBundle var="var" basename="someBaseName" id="loadBundle" />
</f:view>
</body>
</html>
\ No newline at end of file
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/param.jsp
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/param.jsp 2008-09-23 14:01:49 UTC (rev 10409)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/param.jsp 2008-09-23 14:58:22 UTC (rev 10410)
@@ -15,7 +15,7 @@
<h:outputText value="param" />
- <f:param id="paramId" name="param" value="someParamValue" />
+ <f:param id="param" name="param" value="someParamValue" />
</h:commandLink>
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/phaseListener.jsp
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/phaseListener.jsp 2008-09-23 14:01:49 UTC (rev 10409)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/phaseListener.jsp 2008-09-23 14:58:22 UTC (rev 10410)
@@ -9,7 +9,7 @@
<f:view>
<h1><h:outputText value="phaseListener" /></h1>
- <f:phaseListener type="phaseListenerId"/>
+ <f:phaseListener type="phaseListenerId" id="phaseListener"/>
</f:view>
</body>
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/selectItem.jsp
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/selectItem.jsp 2008-09-23 14:01:49 UTC (rev 10409)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/selectItem.jsp 2008-09-23 14:58:22 UTC (rev 10410)
@@ -12,11 +12,19 @@
<h:outputText value="selectitem:" />
<h:selectManyCheckbox value="someValue">
- <f:selectItem itemLabel="check1" />
- <f:selectItem itemLabel="check2" />
- <f:selectItem itemLabel="check3" />
+ <f:selectItem itemLabel="check1" id="selectItem1" />
</h:selectManyCheckbox>
+ <h:selectManyListbox value="someValue">
+ <f:selectItem itemLabel="value1" itemValue="value1" id="selectItem2" />
+ </h:selectManyListbox>
+
+ <h:selectOneRadio>
+
+ <f:selectItem itemLabel="value1" id="selectItem3" />
+
+ </h:selectOneRadio>
+
</f:view>
</body>
</html>
\ No newline at end of file
Added: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/selectItem.jsp.xml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/selectItem.jsp.xml (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/selectItem.jsp.xml 2008-09-23 14:58:22 UTC (rev 10410)
@@ -0,0 +1,19 @@
+<tests>
+ <test id="selectItem1">
+ <SPAN>
+ <INPUT TYPE="checkbox" />
+ <LABEL>
+ <SPAN> check1</SPAN>
+ </LABEL>
+ </SPAN>
+ </test>
+ <test id="selectItem2">
+ <OPTION> value1</OPTION>
+ </test>
+ <test id="selectItem3">
+ <TABLE>
+ <INPUT TYPE="radio" NAME="radio_name_507" />
+ <LABEL> value1</LABEL>
+ </TABLE>
+ </test>
+</tests>
\ No newline at end of file
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/selectItems.jsp
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/selectItems.jsp 2008-09-23 14:01:49 UTC (rev 10409)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/selectItems.jsp 2008-09-23 14:58:22 UTC (rev 10410)
@@ -11,10 +11,18 @@
<h:outputText value="selectitems:" />
- <h:selectManyCheckbox value="someValue">
- <f:selectItems value="someValue" />
+ <h:selectManyCheckbox>
+ <f:selectItems value="someValue" id="selectItems1" />
</h:selectManyCheckbox>
+ <h:selectManyListbox>
+ <f:selectItems value="someValue" id="selectItems2" />
+ </h:selectManyListbox>
+
+ <h:selectOneRadio>
+ <f:selectItems value="someValue" id="selectItems3" />
+ </h:selectOneRadio>
+
</f:view>
</body>
</html>
\ No newline at end of file
Added: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/selectItems.jsp.xml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/selectItems.jsp.xml (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/selectItems.jsp.xml 2008-09-23 14:58:22 UTC (rev 10410)
@@ -0,0 +1,15 @@
+<tests>
+ <test id="selectItems1">
+ <SPAN>
+ <INPUT TYPE="checkbox" />
+ </SPAN>
+ </test>
+ <test id="selectItems2">
+ <OPTION>someValue</OPTION>
+ </test>
+ <test id="selectItems3">
+ <SPAN>
+ <INPUT TYPE="radio" />
+ </SPAN>
+ </test>
+</tests>
\ No newline at end of file
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/selectOneRadio.jsp
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/selectOneRadio.jsp 2008-09-23 14:01:49 UTC (rev 10409)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/selectOneRadio.jsp 2008-09-23 14:58:22 UTC (rev 10410)
@@ -11,15 +11,25 @@
<h:outputText value="selectOneRadio:" />
- <h:selectOneRadio>
-
+ <h:selectOneRadio layout="pageDirection" border="1"
+ id="selectOneRadio1">
+
<f:selectItem itemLabel="value1" />
<f:selectItem itemLabel="value2" />
<f:selectItem itemLabel="value3" />
<f:selectItem itemLabel="value4" />
-
+
</h:selectOneRadio>
+ <h:selectOneRadio dir="ltr" id="selectOneRadio2">
+
+ <f:selectItem itemLabel="value1" />
+ <f:selectItem itemLabel="value2" />
+ <f:selectItem itemLabel="value3" />
+ <f:selectItem itemLabel="value4" />
+
+ </h:selectOneRadio>
+
</f:view>
</body>
</html>
\ No newline at end of file
Added: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/selectOneRadio.jsp.xml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/selectOneRadio.jsp.xml (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/selectOneRadio.jsp.xml 2008-09-23 14:58:22 UTC (rev 10410)
@@ -0,0 +1,68 @@
+<tests>
+ <test id="selectOneRadio1">
+ <TABLE BORDER="1">
+ <TR>
+ <TD>
+ <TABLE>
+ <INPUT TYPE="radio" NAME="radio_name_253" DIR="" SIZE="" />
+ <LABEL> value1</LABEL>
+ </TABLE>
+ </TD>
+ </TR>
+ <TR>
+ <TD>
+ <TABLE>
+ <INPUT TYPE="radio" NAME="radio_name_253" DIR="" SIZE="" />
+ <LABEL> value2</LABEL>
+ </TABLE>
+ </TD>
+ </TR>
+ <TR>
+ <TD>
+ <TABLE>
+ <INPUT TYPE="radio" NAME="radio_name_253" DIR="" SIZE="" />
+ <LABEL> value3</LABEL>
+ </TABLE>
+ </TD>
+ </TR>
+ <TR>
+ <TD>
+ <TABLE>
+ <INPUT TYPE="radio" NAME="radio_name_253" DIR="" SIZE="" />
+ <LABEL> value4</LABEL>
+ </TABLE>
+ </TD>
+ </TR>
+ </TABLE>
+ </test>
+ <test id="selectOneRadio2">
+ <TABLE>
+ <TR>
+ <TD>
+ <TABLE>
+ <INPUT TYPE="radio" NAME="radio_name_506" DIR="ltr" />
+ <LABEL> value1</LABEL>
+ </TABLE>
+ </TD>
+ <TD>
+ <TABLE>
+ <INPUT TYPE="radio" NAME="radio_name_506" DIR="ltr" />
+ <LABEL> value2</LABEL>
+ </TABLE>
+ </TD>
+ <TD>
+ <TABLE>
+ <INPUT TYPE="radio" NAME="radio_name_506" DIR="ltr" />
+ <LABEL> value3</LABEL>
+ </TABLE>
+ </TD>
+ <TD>
+ <TABLE>
+ <INPUT TYPE="radio" NAME="radio_name_506" DIR="ltr" />
+ <LABEL> value4</LABEL>
+ </TABLE>
+ </TD>
+ </TR>
+ </TABLE>
+ </test>
+</tests>
\ No newline at end of file
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/setPropertyActionListener.jsp
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/setPropertyActionListener.jsp 2008-09-23 14:01:49 UTC (rev 10409)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/setPropertyActionListener.jsp 2008-09-23 14:58:22 UTC (rev 10410)
@@ -10,7 +10,7 @@
<h1><h:outputText value="setPropertyActionListener" /></h1>
<h:form>
<h:commandButton value="click">
- <f:setPropertyActionListener target="#{myBean.currentPage}" value="1" />
+ <f:setPropertyActionListener target="#{myBean.currentPage}" value="1" id="setPropertyActionListener" />
</h:commandButton>
</h:form>
</f:view>
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/subview.jsp
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/subview.jsp 2008-09-23 14:01:49 UTC (rev 10409)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/subview.jsp 2008-09-23 14:58:22 UTC (rev 10410)
@@ -8,9 +8,11 @@
<f:view>
<h1><h:outputText value="subview" /></h1>
- <f:subview id="subviewId">
- <h:outputText value="subview content" />
+ <f:subview id="subview1">
</f:subview>
+ <f:subview id="subview2">
+ subview content
+ </f:subview>
</f:view>
</body>
</html>
\ No newline at end of file
Added: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/subview.jsp.xml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/subview.jsp.xml (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/subview.jsp.xml 2008-09-23 14:58:22 UTC (rev 10410)
@@ -0,0 +1,25 @@
+<tests>
+ <test id="subview1">
+ <TABLE
+ STYLE="border: 1px dotted rgb(255, 102, 0); padding: 5px; width: 100%;">
+ <TR>
+ <TD>
+ <DIV></DIV>
+ <BR />
+ </TD>
+ </TR>
+ </TABLE>
+ </test>
+ <test id="subview2">
+ <TABLE
+ STYLE="border: 1px dotted rgb(255, 102, 0); padding: 5px; width: 100%;">
+ <TR>
+ <TD>
+ <DIV>
+ <SPAN> subview content</SPAN>
+ </DIV>
+ </TD>
+ </TR>
+ </TABLE>
+ </test>
+</tests>
\ No newline at end of file
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/validateDoubleRange.jsp
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/validateDoubleRange.jsp 2008-09-23 14:01:49 UTC (rev 10409)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/validateDoubleRange.jsp 2008-09-23 14:58:22 UTC (rev 10410)
@@ -10,7 +10,7 @@
<h1><h:outputText value="validateDoubleRange" /></h1>
<h:form>
<h:inputText value="value">
- <f:validateDoubleRange minimum="0" maximum="100" />
+ <f:validateDoubleRange minimum="0" maximum="100" id="validateDoubleRange"/>
</h:inputText>
</h:form>
</f:view>
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/validateLength.jsp
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/validateLength.jsp 2008-09-23 14:01:49 UTC (rev 10409)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/validateLength.jsp 2008-09-23 14:58:22 UTC (rev 10410)
@@ -10,7 +10,7 @@
<h1><h:outputText value="validateLength" /></h1>
<h:form>
<h:inputText value="value">
- <f:validateLength minimum="10" maximum="100" />
+ <f:validateLength minimum="10" maximum="100" id="validateLength" />
</h:inputText>
</h:form>
</f:view>
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/validateLongRange.jsp
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/validateLongRange.jsp 2008-09-23 14:01:49 UTC (rev 10409)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/validateLongRange.jsp 2008-09-23 14:58:22 UTC (rev 10410)
@@ -10,7 +10,7 @@
<h1><h:outputText value="validateLongRange" /></h1>
<h:form>
<h:inputText value="value">
- <f:validateLongRange minimum="10" maximum="100" />
+ <f:validateLongRange minimum="10" maximum="100" id="validateLongRange" />
</h:inputText>
</h:form>
</f:view>
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/validator.jsp
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/validator.jsp 2008-09-23 14:01:49 UTC (rev 10409)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/validator.jsp 2008-09-23 14:58:22 UTC (rev 10410)
@@ -10,7 +10,7 @@
<h1><h:outputText value="validator" /></h1>
<h:form>
<h:inputText value="value">
- <f:validator validatorId="validatorId"/>
+ <f:validator validatorId="validatorId" id="validator" />
</h:inputText>
</h:form>
</f:view>
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/valueChangeListener.jsp
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/valueChangeListener.jsp 2008-09-23 14:01:49 UTC (rev 10409)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/valueChangeListener.jsp 2008-09-23 14:58:22 UTC (rev 10410)
@@ -10,7 +10,7 @@
<h1><h:outputText value="valueChangeListener" /></h1>
<h:form>
<h:inputText value="value">
- <f:valueChangeListener type="listener" />
+ <f:valueChangeListener type="listener" id="valueChangeListener" />
</h:inputText>
</h:form>
</f:view>
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/verbatim.jsp
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/verbatim.jsp 2008-09-23 14:01:49 UTC (rev 10409)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/verbatim.jsp 2008-09-23 14:58:22 UTC (rev 10410)
@@ -8,18 +8,12 @@
<f:view>
<h1><h:outputText value="verbatim" /></h1>
- <f:verbatim>
- <table width="50%">
- <tr>
- <td>1</td>
- <td>2</td>
- </tr>
- <tr>
- <td>3</td>
- <td>4</td>
- </tr>
- </table>
+ <f:verbatim id="verbatim1">
+ <input type="button" value="button" />
</f:verbatim>
+ <f:verbatim escape="true" id="verbatim2">
+ <input type="button" value="button" />
+ </f:verbatim>
</f:view>
</body>
</html>
\ No newline at end of file
Added: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/verbatim.jsp.xml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/verbatim.jsp.xml (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/verbatim.jsp.xml 2008-09-23 14:58:22 UTC (rev 10410)
@@ -0,0 +1,15 @@
+<tests>
+ <test id="verbatim1">
+ <SPAN>
+ <INPUT TYPE="button" VALUE="button" />
+ </SPAN>
+ </test>
+ <test id="verbatim2">
+ <SPAN>
+ <SPAN></SPAN>
+ <SPAN></SPAN>
+ <input type="button" value="button" />
+ <SPAN></SPAN>
+ </SPAN>
+ </test>
+</tests>
\ No newline at end of file
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/view.jsp
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/view.jsp 2008-09-23 14:01:49 UTC (rev 10409)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/view.jsp 2008-09-23 14:58:22 UTC (rev 10410)
@@ -6,8 +6,8 @@
</head>
<body>
-<f:view>
- <h1><h:outputText value="view" /></h1>
+<f:view id="view">
+ view
</f:view>
</body>
</html>
\ No newline at end of file
Added: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/view.jsp.xml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/view.jsp.xml (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/view.jsp.xml 2008-09-23 14:58:22 UTC (rev 10410)
@@ -0,0 +1,14 @@
+<tests>
+ <test id="view">
+ <TABLE
+ STYLE="border: 1px dotted rgb(255, 102, 0); padding: 5px; width: 100%;">
+ <TR>
+ <TD>
+ <DIV>
+ <SPAN> view</SPAN>
+ </DIV>
+ </TD>
+ </TR>
+ </TABLE>
+ </test>
+</tests>
\ No newline at end of file
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/JsfComponentContentTest.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/JsfComponentContentTest.java 2008-09-23 14:01:49 UTC (rev 10409)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/JsfComponentContentTest.java 2008-09-23 14:58:22 UTC (rev 10410)
@@ -46,7 +46,8 @@
}
public void testInputHidden() throws Throwable {
- assertTrue("it is necessery to add body of the test", false); //$NON-NLS-1$
+ performInvisibleTagTest(
+ "components/inputHidden.jsp", "inputHidden"); //$NON-NLS-1$ //$NON-NLS-2$
}
public void testInputSecret() throws Throwable {
@@ -127,23 +128,25 @@
*/
public void testActionListener() throws Throwable {
- assertTrue("it is necessery to add body of the test", false); //$NON-NLS-1$
+ performInvisibleTagTest(
+ "components/actionListener.jsp", "actionListener"); //$NON-NLS-1$ //$NON-NLS-2$
}
public void testAttribute() throws Throwable {
- assertTrue("it is necessery to add body of the test", false); //$NON-NLS-1$
+ performInvisibleTagTest("components/attribute.jsp", "attribute"); //$NON-NLS-1$ //$NON-NLS-2$
}
public void testConvertDateTime() throws Throwable {
- assertTrue("it is necessery to add body of the test", false); //$NON-NLS-1$
+ performInvisibleTagTest(
+ "components/convertDateTime.jsp", "convertDateTime"); //$NON-NLS-1$ //$NON-NLS-2$
}
public void testConvertNumber() throws Throwable {
- assertTrue("it is necessery to add body of the test", false); //$NON-NLS-1$
+ performInvisibleTagTest("components/convertNumber.jsp", "convertNumber"); //$NON-NLS-1$ //$NON-NLS-2$
}
public void testConverter() throws Throwable {
- assertTrue("it is necessery to add body of the test", false); //$NON-NLS-1$
+ performInvisibleTagTest("components/converter.jsp", "converter"); //$NON-NLS-1$ //$NON-NLS-2$
}
public void testFacet() throws Throwable {
@@ -151,15 +154,15 @@
}
public void testLoadBundle() throws Throwable {
- assertTrue("it is necessery to add body of the test", false); //$NON-NLS-1$
+ performInvisibleTagTest("components/loadBundle.jsp", "loadBundle"); //$NON-NLS-1$ //$NON-NLS-2$
}
public void testParam() throws Throwable {
- assertTrue("it is necessery to add body of the test", false); //$NON-NLS-1$
+ performInvisibleTagTest("components/param.jsp", "param"); //$NON-NLS-1$ //$NON-NLS-2$
}
public void testPhaseListener() throws Throwable {
- assertTrue("it is necessery to add body of the test", false); //$NON-NLS-1$
+ performInvisibleTagTest("components/phaseListener.jsp", "phaseListener"); //$NON-NLS-1$ //$NON-NLS-2$
}
public void testSelectItem() throws Throwable {
@@ -171,7 +174,8 @@
}
public void testSetPropertyActionListener() throws Throwable {
- assertTrue("it is necessery to add body of the test", false); //$NON-NLS-1$
+ performInvisibleTagTest(
+ "components/setPropertyActionListener.jsp", "setPropertyActionListener"); //$NON-NLS-1$ //$NON-NLS-2$
}
public void testSubview() throws Throwable {
@@ -180,23 +184,27 @@
}
public void testValidateDoubleRange() throws Throwable {
- assertTrue("it is necessery to add body of the test", false); //$NON-NLS-1$
+ performInvisibleTagTest(
+ "components/validateDoubleRange.jsp", "validateDoubleRange"); //$NON-NLS-1$ //$NON-NLS-2$
}
public void testValidateLength() throws Throwable {
- assertTrue("it is necessery to add body of the test", false); //$NON-NLS-1$
+ performInvisibleTagTest(
+ "components/validateLength.jsp", "validateLength"); //$NON-NLS-1$ //$NON-NLS-2$
}
public void testValidateLongRange() throws Throwable {
- assertTrue("it is necessery to add body of the test", false); //$NON-NLS-1$
+ performInvisibleTagTest(
+ "components/validateLongRange.jsp", "validateLongRange"); //$NON-NLS-1$ //$NON-NLS-2$
}
public void testValidator() throws Throwable {
- assertTrue("it is necessery to add body of the test", false); //$NON-NLS-1$
+ performInvisibleTagTest("components/validator.jsp", "validator"); //$NON-NLS-1$ //$NON-NLS-2$
}
public void testValueChangeListener() throws Throwable {
- assertTrue("it is necessery to add body of the test", false); //$NON-NLS-1$
+ performInvisibleTagTest(
+ "components/valueChangeListener.jsp", "valueChangeListener"); //$NON-NLS-1$ //$NON-NLS-2$
}
public void testVerbatim() throws Throwable {
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java 2008-09-23 14:01:49 UTC (rev 10409)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java 2008-09-23 14:58:22 UTC (rev 10410)
@@ -2459,7 +2459,7 @@
nsIDOMElement span = visualDocument.createElement(HTML.TAG_SPAN);
span.setAttribute(HTML.TAG_STYLE,
- "border: dashed 1px GREY;color:GREY;font-size:12px;"); //$NON-NLS-1$
+ "border: 1px dashed GREY; color: GREY; font-size: 12px;"); //$NON-NLS-1$
nsIDOMText text = visualDocument.createTextNode(sourceNode
.getNodeName());
Modified: trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/ComponentContentTest.java
===================================================================
--- trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/ComponentContentTest.java 2008-09-23 14:01:49 UTC (rev 10409)
+++ trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/ComponentContentTest.java 2008-09-23 14:58:22 UTC (rev 10410)
@@ -20,7 +20,7 @@
import org.eclipse.ui.part.FileEditorInput;
import org.jboss.tools.jst.jsp.jspeditor.JSPMultiPageEditor;
import org.jboss.tools.vpe.editor.VpeController;
-import org.jboss.tools.vpe.editor.mapping.VpeElementMapping;
+import org.jboss.tools.vpe.editor.mapping.VpeNodeMapping;
import org.mozilla.interfaces.nsIDOMElement;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
@@ -99,6 +99,14 @@
}
+ /**
+ *
+ * @param controller
+ * @param xmlTestDocument
+ * @param elementId
+ * @param xmlTestId
+ * @return
+ */
protected boolean compareElements(VpeController controller,
Document xmlTestDocument, String elementId, String xmlTestId) {
@@ -119,6 +127,80 @@
}
/**
+ *
+ * @param elementPagePath
+ * - path to test page
+ * @throws Throwable
+ */
+ protected void performInvisibleTagTest(String elementPagePath,
+ String elementId) throws Throwable {
+ setException(null);
+
+ IFile elementPageFile = (IFile) TestUtil.getComponentPath(
+ elementPagePath, getTestProjectName());
+
+ IEditorInput input = new FileEditorInput(elementPageFile);
+
+ TestUtil.waitForJobs();
+
+ IEditorPart editor = PlatformUI.getWorkbench()
+ .getActiveWorkbenchWindow().getActivePage().openEditor(input,
+ EDITOR_ID, true);
+
+ assertNotNull(editor);
+
+ TestUtil.waitForJobs();
+
+ VpeController controller = getVpeController((JSPMultiPageEditor) editor);
+
+ // find source element and check if it is not null
+ Element sourceELement = findSourceElementById(controller, elementId);
+ assertNotNull(sourceELement);
+
+ // find visual element and check if it is null
+ nsIDOMElement visualElement = findElementById(controller, elementId);
+ assertNull(visualElement);
+
+ // set show invisible tag's flag to true
+ controller.getVisualBuilder().setShowInvisibleTags(true);
+ controller.visualRefresh();
+
+ TestUtil.waitForIdle();
+
+ // find visual element and check if it is not null
+ visualElement = findElementById(controller, elementId);
+ assertNotNull(visualElement);
+
+ // generate text for invisible tag
+ String modelInvisibleTagText = generateInvisibleTagText(sourceELement
+ .getNodeName());
+
+ // generate dom document and get root element
+ Element modelElement = TestDomUtil.getDocument(modelInvisibleTagText)
+ .getDocumentElement();
+ assertNotNull(modelElement);
+
+ // compare elements
+ assertEquals(true, TestDomUtil
+ .compareNodes(visualElement, modelElement));
+
+ if (getException() != null) {
+ throw getException();
+ }
+
+ }
+
+ /**
+ *
+ * @param tagName
+ * @return
+ */
+ private String generateInvisibleTagText(String tagName) {
+ return "<span style=\"border: 1px dashed GREY; color: GREY; font-size: 12px;\" >" //$NON-NLS-1$
+ + tagName + "</span>"; //$NON-NLS-1$
+ }
+
+ /**
* find visual element by "id" entered in source part of vpe
*
* @param controller
@@ -128,19 +210,34 @@
protected nsIDOMElement findElementById(VpeController controller,
String elementId) {
- Element sourceElement = getSourceDocument(controller).getElementById(
- elementId);
+ Element sourceElement = findSourceElementById(controller, elementId);
- VpeElementMapping elementMapping = controller.getDomMapping()
- .getNearElementMapping(sourceElement);
+ VpeNodeMapping nodeMapping = controller.getDomMapping().getNodeMapping(
+ sourceElement);
- return elementMapping.getVisualElement();
+ if (nodeMapping == null)
+ return null;
+
+ return (nsIDOMElement) nodeMapping.getVisualNode();
}
/**
+ * find source element by "id"
*
+ * @param controller
+ * @param elementId
* @return
*/
+ protected Element findSourceElementById(VpeController controller,
+ String elementId) {
+
+ return getSourceDocument(controller).getElementById(elementId);
+ }
+
+ /**
+ *
+ * @return
+ */
abstract protected String getTestProjectName();
}
Modified: trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/TestDomUtil.java
===================================================================
--- trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/TestDomUtil.java 2008-09-23 14:01:49 UTC (rev 10409)
+++ trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/TestDomUtil.java 2008-09-23 14:58:22 UTC (rev 10410)
@@ -124,10 +124,11 @@
if (attributes != null) {
for (int i = 0; i < attributes.getLength(); i++) {
Attr attr = (Attr) attributes.item(i);
+
if ((!vpeElement.hasAttribute(attr.getName()))
- || (!attr.getNodeValue().equals(
+ || (!attr.getNodeValue().trim().equals(
vpeElement.getAttributeNode(attr.getName())
- .getNodeValue())))
+ .getNodeValue().trim())))
return false;
}
}
@@ -167,7 +168,8 @@
}
/**
- * get ids of tests
+ * get ids of tests
+ *
* @param testDocument
* @return
*/
15 years, 9 months