[jbosstools-commits] JBoss Tools SVN: r9155 - in trunk/jst/plugins/org.jboss.tools.jst.jsp: images/cssdialog and 12 other directories.

jbosstools-commits at lists.jboss.org jbosstools-commits at lists.jboss.org
Wed Jul 16 11:19:39 EDT 2008


Author: dsakovich
Date: 2008-07-16 11:19:39 -0400 (Wed, 16 Jul 2008)
New Revision: 9155

Added:
   trunk/jst/plugins/org.jboss.tools.jst.jsp/images/cssdialog/
   trunk/jst/plugins/org.jboss.tools.jst.jsp/images/cssdialog/color.gif
   trunk/jst/plugins/org.jboss.tools.jst.jsp/images/cssdialog/color_large.gif
   trunk/jst/plugins/org.jboss.tools.jst.jsp/images/cssdialog/folder.gif
   trunk/jst/plugins/org.jboss.tools.jst.jsp/images/cssdialog/folder_large.gif
   trunk/jst/plugins/org.jboss.tools.jst.jsp/images/cssdialog/font.gif
   trunk/jst/plugins/org.jboss.tools.jst.jsp/images/cssdialog/font_large.gif
   trunk/jst/plugins/org.jboss.tools.jst.jsp/images/cssdialog/left.gif
   trunk/jst/plugins/org.jboss.tools.jst.jsp/images/cssdialog/right.gif
   trunk/jst/plugins/org.jboss.tools.jst.jsp/images/cssdialog/sample.gif
   trunk/jst/plugins/org.jboss.tools.jst.jsp/resources/org/jboss/tools/jst/
   trunk/jst/plugins/org.jboss.tools.jst.jsp/resources/org/jboss/tools/jst/jsp/
   trunk/jst/plugins/org.jboss.tools.jst.jsp/resources/org/jboss/tools/jst/jsp/outline/
   trunk/jst/plugins/org.jboss.tools.jst.jsp/resources/org/jboss/tools/jst/jsp/outline/cssdialog/
   trunk/jst/plugins/org.jboss.tools.jst.jsp/resources/org/jboss/tools/jst/jsp/outline/cssdialog/colors.xml
   trunk/jst/plugins/org.jboss.tools.jst.jsp/resources/org/jboss/tools/jst/jsp/outline/cssdialog/cssElements.xml
   trunk/jst/plugins/org.jboss.tools.jst.jsp/resources/org/jboss/tools/jst/jsp/outline/cssdialog/cssElementsWithCombo.xml
   trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/
   trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/CSSDialog.java
   trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/FontFamilyDialog.java
   trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/ImageSelectionDialog.java
   trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/common/
   trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/common/CSSConstants.java
   trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/common/Constants.java
   trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/common/ImageCombo.java
   trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/common/MessageUtil.java
   trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/common/Util.java
   trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/common/messages.properties
   trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/events/
   trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/events/TabPropertySheetMouseAdapter.java
   trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/parsers/
   trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/parsers/BaseListener.java
   trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/parsers/CSSElementsParser.java
   trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/parsers/ColorParser.java
   trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/parsers/ColorParserListener.java
   trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/parsers/ComboParser.java
   trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/parsers/IListener.java
   trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/parsers/Parser.java
   trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/parsers/ParserListener.java
   trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/tabs/
   trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/tabs/TabBackgroundControl.java
   trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/tabs/TabBoxesControl.java
   trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/tabs/TabPropertySheetControl.java
   trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/tabs/TabQuickEditControl.java
   trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/tabs/TabTextControl.java
Modified:
   trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/JspEditorPlugin.java
   trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/JSPDialogCellEditor.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-2499

Added: trunk/jst/plugins/org.jboss.tools.jst.jsp/images/cssdialog/color.gif
===================================================================
(Binary files differ)


Property changes on: trunk/jst/plugins/org.jboss.tools.jst.jsp/images/cssdialog/color.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/jst/plugins/org.jboss.tools.jst.jsp/images/cssdialog/color_large.gif
===================================================================
(Binary files differ)


Property changes on: trunk/jst/plugins/org.jboss.tools.jst.jsp/images/cssdialog/color_large.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/jst/plugins/org.jboss.tools.jst.jsp/images/cssdialog/folder.gif
===================================================================
(Binary files differ)


Property changes on: trunk/jst/plugins/org.jboss.tools.jst.jsp/images/cssdialog/folder.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/jst/plugins/org.jboss.tools.jst.jsp/images/cssdialog/folder_large.gif
===================================================================
(Binary files differ)


Property changes on: trunk/jst/plugins/org.jboss.tools.jst.jsp/images/cssdialog/folder_large.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/jst/plugins/org.jboss.tools.jst.jsp/images/cssdialog/font.gif
===================================================================
(Binary files differ)


Property changes on: trunk/jst/plugins/org.jboss.tools.jst.jsp/images/cssdialog/font.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/jst/plugins/org.jboss.tools.jst.jsp/images/cssdialog/font_large.gif
===================================================================
(Binary files differ)


Property changes on: trunk/jst/plugins/org.jboss.tools.jst.jsp/images/cssdialog/font_large.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/jst/plugins/org.jboss.tools.jst.jsp/images/cssdialog/left.gif
===================================================================
(Binary files differ)


Property changes on: trunk/jst/plugins/org.jboss.tools.jst.jsp/images/cssdialog/left.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/jst/plugins/org.jboss.tools.jst.jsp/images/cssdialog/right.gif
===================================================================
(Binary files differ)


Property changes on: trunk/jst/plugins/org.jboss.tools.jst.jsp/images/cssdialog/right.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/jst/plugins/org.jboss.tools.jst.jsp/images/cssdialog/sample.gif
===================================================================
(Binary files differ)


Property changes on: trunk/jst/plugins/org.jboss.tools.jst.jsp/images/cssdialog/sample.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/jst/plugins/org.jboss.tools.jst.jsp/resources/org/jboss/tools/jst/jsp/outline/cssdialog/colors.xml
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/resources/org/jboss/tools/jst/jsp/outline/cssdialog/colors.xml	                        (rev 0)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/resources/org/jboss/tools/jst/jsp/outline/cssdialog/colors.xml	2008-07-16 15:19:39 UTC (rev 9155)
@@ -0,0 +1,147 @@
+<colors>
+	<color value="AliceBlue" name="#F0F8FF" />
+	<color value="AntiqueWhite" name="#FAEBD7" />
+	<color value="Aqua" name="#00FFFF" />
+	<color value="Aquamarine" name="#7FFFD4" />
+	<color value="Azure" name="#F0FFFF" />
+	<color value="Beige" name="#F5F5DC" />
+	<color value="Bisque" name="#FFE4C4" />
+	<color value="Black" name="#000000" />
+	<color value="BlanchedAlmond" name="#FFEBCD" />
+	<color value="Blue" name="#0000FF" />
+	<color value="BlueViolet" name="#8A2BE2" />
+	<color value="Brown" name="#A52A2A" />
+	<color value="BurlyWood" name="#DEB887" />
+	<color value="CadetBlue" name="#5F9EA0" />
+	<color value="Chartreuse" name="#7FFF00" />
+	<color value="Chocolate" name="#D2691E" />
+	<color value="Coral" name="#FF7F50" />
+	<color value="CornflowerBlue" name="#6495ED" />
+	<color value="Cornsilk" name="#FFF8DC" />
+	<color value="Crimson" name="#DC143C" />
+	<color value="Cyan" name="#00FFFF" />
+	<color value="DarkBlue" name="#00008B" />
+	<color value="DarkCyan" name="#008B8B" />
+	<color value="DarkGoldenRod" name="#B8860B" />
+	<color value="DarkGray" name="#A9A9A9" />
+	<color value="DarkGreen" name="#006400" />
+	<color value="DarkKhaki" name="#BDB76B" />
+	<color value="DarkMagenta" name="#8B008B" />
+	<color value="DarkOliveGreen" name="#556B2F" />
+	<color value="Darkorange" name="#FF8C00" />
+	<color value="DarkOrchid" name="#9932CC" />
+	<color value="DarkRed" name="#8B0000" />
+	<color value="DarkSalmon" name="#E9967A" />
+	<color value="DarkSeaGreen" name="#8FBC8F" />
+	<color value="DarkSlateBlue" name="#483D8B" />
+	<color value="DarkSlateGray" name="#2F4F4F" />
+	<color value="DarkTurquoise" name="#00CED1" />
+	<color value="DarkViolet" name="#9400D3" />
+	<color value="DeepPink" name="#FF1493" />
+	<color value="DeepSkyBlue" name="#00BFFF" />
+	<color value="DimGray" name="#696969" />
+	<color value="DimGrey" name="#696969" />
+	<color value="DodgerBlue" name="#1E90FF" />
+	<color value="FireBrick" name="#B22222" />
+	<color value="FloralWhite" name="#FFFAF0" />
+	<color value="ForestGreen" name="#228B22" />
+	<color value="Fuchsia" name="#FF00FF" />
+	<color value="Gainsboro" name="#DCDCDC" />
+	<color value="GhostWhite" name="#F8F8FF" />
+	<color value="Gold" name="#FFD700" />
+	<color value="GoldenRod" name="#DAA520" />
+	<color value="Gray" name="#808080" />
+	<color value="Grey" name="#808080" />
+	<color value="Green" name="#008000" />
+	<color value="GreenYellow" name="#ADFF2F" />
+	<color value="HoneyDew" name="#F0FFF0" />
+	<color value="HotPink" name="#FF69B4" />
+	<color value="IndianRed" name="#CD5C5C" />
+	<color value="Indigo" name="#4B0082" />
+	<color value="Ivory" name="#FFFFF0" />
+	<color value="Khaki" name="#F0E68C" />
+	<color value="Lavender" name="#E6E6FA" />
+	<color value="LavenderBlush" name="#FFF0F5" />
+	<color value="LawnGreen" name="#7CFC00" />
+	<color value="LemonChiffon" name="#FFFACD" />
+	<color value="LightBlue" name="#ADD8E6" />
+	<color value="LightCoral" name="#F08080" />
+	<color value="LightCyan" name="#E0FFFF" />
+	<color value="LightGoldenRodYellow" name="#FAFAD2" />
+	<color value="LightGray" name="#D3D3D3" />
+	<color value="LightGrey" name="#D3D3D3" />
+	<color value="LightGreen" name="#90EE90" />
+	<color value="LightPink" name="#FFB6C1" />
+	<color value="LightSalmon" name="#FFA07A" />
+	<color value="LightSeaGreen" name="#20B2AA" />
+	<color value="LightSkyBlue" name="#87CEFA" />
+	<color value="LightSlateGray" name="#778899" />
+	<color value="LightSlateGrey" name="#778899" />
+	<color value="LightSteelBlue" name="#B0C4DE" />
+	<color value="LightYellow" name="#FFFFE0" />
+	<color value="Lime" name="#00FF00" />
+	<color value="LimeGreen" name="#32CD32" />
+	<color value="Linen" name="#FAF0E6" />
+	<color value="Magenta" name="#FF00FF" />
+	<color value="Maroon" name="#800000" />
+	<color value="MediumAquaMarine" name="#66CDAA" />
+	<color value="MediumBlue" name="#0000CD" />
+	<color value="MediumOrchid" name="#BA55D3" />
+	<color value="MediumPurple" name="#9370D8" />
+	<color value="MediumSeaGreen" name="#3CB371" />
+	<color value="MediumSlateBlue" name="#7B68EE" />
+	<color value="MediumSpringGreen" name="#00FA9A" />
+	<color value="MediumTurquoise" name="#48D1CC" />
+	<color value="MediumVioletRed" name="#C71585" />
+	<color value="MidnightBlue" name="#191970" />
+	<color value="MintCream" name="#F5FFFA" />
+	<color value="MistyRose" name="#FFE4E1" />
+	<color value="Moccasin" name="#FFE4B5" />
+	<color value="NavajoWhite" name="#FFDEAD" />
+	<color value="Navy" name="#000080" />
+	<color value="OldLace" name="#FDF5E6" />
+	<color value="Olive" name="#808000" />
+	<color value="OliveDrab" name="#6B8E23" />
+	<color value="Orange" name="#FFA500" />
+	<color value="OrangeRed" name="#FF4500" />
+	<color value="Orchid" name="#DA70D6" />
+	<color value="PaleGoldenRod" name="#EEE8AA" />
+	<color value="PaleGreen" name="#98FB98" />
+	<color value="PaleTurquoise" name="#AFEEEE" />
+	<color value="PaleVioletRed" name="#D87093" />
+	<color value="PapayaWhip" name="#FFEFD5" />
+	<color value="PeachPuff" name="#FFDAB9" />
+	<color value="Peru" name="#CD853F" />
+	<color value="Pink" name="#FFC0CB" />
+	<color value="Plum" name="#DDA0DD" />
+	<color value="PowderBlue" name="#B0E0E6" />
+	<color value="Purple" name="#800080" />
+	<color value="Red" name="#FF0000" />
+	<color value="RosyBrown" name="#BC8F8F" />
+	<color value="RoyalBlue" name="#4169E1" />
+	<color value="SaddleBrown" name="#8B4513" />
+	<color value="Salmon" name="#FA8072" />
+	<color value="SandyBrown" name="#F4A460" />
+	<color value="SeaGreen" name="#2E8B57" />
+	<color value="SeaShell" name="#FFF5EE" />
+	<color value="Sienna" name="#A0522D" />
+	<color value="Silver" name="#C0C0C0" />
+	<color value="SkyBlue" name="#87CEEB" />
+	<color value="SlateBlue" name="#6A5ACD" />
+	<color value="SlateGray" name="#708090" />
+	<color value="SlateGrey" name="#708090" />
+	<color value="Snow" name="#FFFAFA" />
+	<color value="SpringGreen" name="#00FF7F" />
+	<color value="SteelBlue" name="#4682B4" />
+	<color value="Tan" name="#D2B48C" />
+	<color value="Teal" name="#008080" />
+	<color value="Thistle" name="#D8BFD8" />
+	<color value="Tomato" name="#FF6347" />
+	<color value="Turquoise" name="#40E0D0" />
+	<color value="Violet" name="#EE82EE" />
+	<color value="Wheat" name="#F5DEB3" />
+	<color value="White" name="#FFFFFF" />
+	<color value="WhiteSmoke" name="#F5F5F5" />
+	<color value="Yellow" name="#FFFF00" />
+	<color value="YellowGreen" name="#9ACD32" />
+</colors>
\ No newline at end of file

Added: trunk/jst/plugins/org.jboss.tools.jst.jsp/resources/org/jboss/tools/jst/jsp/outline/cssdialog/cssElements.xml
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/resources/org/jboss/tools/jst/jsp/outline/cssdialog/cssElements.xml	                        (rev 0)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/resources/org/jboss/tools/jst/jsp/outline/cssdialog/cssElements.xml	2008-07-16 15:19:39 UTC (rev 9155)
@@ -0,0 +1,167 @@
+<elements>
+
+	<!-- ################### Block elements #################### -->
+	<Aural>
+		<element name="azimuth"/>
+		<element name="cue"/>
+		<element name="cue-after"/>
+		<element name="cue-before"/>
+		<element name="elevation"/>
+		<element name="pause"/>
+		<element name="pause-after"/>
+		<element name="pause-before"/>
+		<element name="pitch"/>
+		<element name="pitch-range"/>
+		<element name="play-during"/>
+		<element name="richness"/>
+		<element name="speak"/>
+		<element name="speak-numeral"/>
+		<element name="speak-punctuation"/>
+		<element name="speech-rate"/>
+		<element name="stress"/>
+		<element name="voice-family"/>
+		<element name="volumn"/> 
+	</Aural>
+	
+	<Background>
+		<element name="background"/>
+		<element name="background-attachment"/>
+		<element name="background-color"/>
+		<element name="background-image"/>
+		<element name="background-position"/>
+		<element name="background-repeat"/>
+	</Background>
+	
+	<Boxes>
+		<element name="border"/>
+		<element name="border-bottom"/>
+		<element name="border-bottom-color"/>
+		<element name="border-bottom-style"/>
+		<element name="border-bottom-width"/>
+		<element name="border-color"/>
+		<element name="border-left"/>
+		<element name="border-left-color"/>
+		<element name="border-left-style"/>
+		<element name="border-left-width"/>
+		<element name="border-right"/>
+		<element name="border-right-color"/>
+		<element name="border-right-style"/>
+		<element name="border-right-width"/>
+		<element name="border-style"/>
+		<element name="border-top"/>
+		<element name="border-top-color"/>
+		<element name="border-top-style"/>
+		<element name="border-top-width"/>
+		<element name="border-width"/>
+		<element name="margin"/>
+		<element name="margin-bottom"/>
+		<element name="margin-left"/>
+		<element name="margin-right"/>
+		<element name="margin-top"/>
+		<element name="padding"/>
+		<element name="padding-bottom"/>
+		<element name="padding-left"/>
+		<element name="padding-right"/>
+		<element name="padding-top"/>
+	</Boxes>
+	
+	<Dimension>
+		<element name="height"/>
+		<element name="line-height"/>
+		<element name="max-height"/>
+		<element name="max-width"/>
+		<element name="min-height"/>
+		<element name="min-width"/>
+		<element name="vertical-align"/>
+		<element name="width"/>
+	</Dimension>
+	
+	<Font>
+		<element name="font"/>
+		<element name="font-family"/>
+		<element name="font-size"/>
+		<element name="font-size-adjust"/>
+		<element name="font-stretch"/>
+		<element name="font-style"/>
+		<element name="font-variant"/>
+		<element name="font-weight"/>
+	</Font>
+	
+	<Interface>
+		<element name="cursor"/>
+		<element name="outline"/>
+		<element name="outline-color"/>
+		<element name="outline-style"/>
+		<element name="outline-width"/>
+	</Interface>
+	
+	<List>
+		<element name="list-style"/>
+		<element name="list-style-image"/>
+		<element name="list-style-position"/>
+		<element name="list-style-type"/>
+		<element name="marker-offset"/>
+	</List>
+	
+	<Miscellaneous>
+		<element name="content"/>
+		<element name="counter-increment"/>
+		<element name="counter-reset"/>
+		<element name="quotes"/>
+		<element name="counter-increment"/>
+		<element name="counter-reset"/>
+		<element name="quotes"/>
+	</Miscellaneous>
+	
+	
+	<Paging>
+		<element name="marks"/>
+		<element name="orphans"/>
+		<element name="page"/>
+		<element name="page-break-after"/>
+		<element name="page-break-before"/>
+		<element name="page-break-inside"/>
+		<element name="size"/>
+		<element name="widows"/>
+	</Paging>
+	
+	<Positioning>
+		<element name="bottom"/>
+		<element name="clear"/>
+		<element name="clip"/>
+		<element name="direction"/>
+		<element name="display"/>
+		<element name="float"/>
+		<element name="left"/>
+		<element name="overflow"/>
+		<element name="position"/>
+		<element name="right"/>
+		<element name="top"/>
+		<element name="unicode-bidi"/>
+		<element name="visibility"/>
+		<element name="z-index"/>
+	</Positioning>
+	
+	<Tables>
+		<element name="border-collapse"/>
+		<element name="border-spacing"/>
+		<element name="caption-side"/>
+		<element name="empty-cells"/>
+		<element name="speak-header"/>
+		<element name="table-layout"/>
+	</Tables>
+	
+	<Text>
+		<element name="color"/>
+		<element name="letter-spacing"/>
+		<element name="text-align"/>
+		<element name="text-decoration"/>
+		<element name="text-indent"/>
+		<element name="text-shadow"/>
+		<element name="text-transform"/>
+		<element name="white-space"/>
+		<element name="word-spacing"/>
+	</Text>
+	<!-- ############################################################ -->
+	
+</elements>
\ No newline at end of file

Added: trunk/jst/plugins/org.jboss.tools.jst.jsp/resources/org/jboss/tools/jst/jsp/outline/cssdialog/cssElementsWithCombo.xml
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/resources/org/jboss/tools/jst/jsp/outline/cssdialog/cssElementsWithCombo.xml	                        (rev 0)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/resources/org/jboss/tools/jst/jsp/outline/cssdialog/cssElementsWithCombo.xml	2008-07-16 15:19:39 UTC (rev 9155)
@@ -0,0 +1,572 @@
+<elements>
+
+	<color>
+		<value name="none"/>
+	</color>
+	
+	<background-color>
+		<value name="none"/>
+	</background-color>
+	
+	<border-bottom-color>
+		<value name="none"/>
+	</border-bottom-color>
+	
+	<border-color>
+		<value name="none"/>
+	</border-color>
+	
+	<border-left-color>
+		<value name="none"/>
+	</border-left-color>
+	
+	<border-right-color>
+		<value name="none"/>
+	</border-right-color>
+	
+	<border-top-color>
+		<value name="none"/>
+	</border-top-color>
+	
+	<outline-color>
+		<value name="none"/>
+	</outline-color>
+	
+	<letter-spacing>
+		<value name="normal"/>
+	</letter-spacing>
+	
+	<text-align>
+		<value name="left"/>
+		<value name="right"/>
+		<value name="center"/>
+		<value name="justify"/>
+	</text-align>
+	
+	<text-decoration>
+		<value name="none"/>
+		<value name="underline"/>
+		<value name="overline"/>
+		<value name="line-through"/>
+		<value name="blink"/>
+	</text-decoration>
+	
+	<text-transform>
+		<value name="none"/>
+		<value name="capitalize"/>
+		<value name="uppercase"/>
+		<value name="lowercase"/>
+	</text-transform>
+	
+	<white-space>
+		<value name="normal"/>
+		<value name="pre"/>
+		<value name="nowrap"/>
+	</white-space>
+	
+	<word-spacing>
+		<value name="normal"/>
+	</word-spacing>
+	
+	<font-size>
+		<value name="xx-small"/>
+		<value name="x-small"/>
+		<value name="small"/>
+		<value name="medium"/>
+		<value name="large"/>
+		<value name="x-large"/>
+		<value name="xx-large"/>
+		<value name="smaller"/>
+		<value name="larger"/>
+	</font-size>
+	
+	<font-size-adjust>
+		<value name="none"/>
+	</font-size-adjust>
+	
+	<font-stretch>
+		<value name="normal"/>
+		<value name="wider"/>
+		<value name="narrower"/>
+		<value name="ultra-condensed"/>
+		<value name="extra-condensed"/>
+		<value name="condensed"/>
+		<value name="semi-condensed"/>
+		<value name="semi-expanded"/>
+		<value name="expanded"/>
+		<value name="extra-expanded"/>
+		<value name="ultra-expanded"/>
+	</font-stretch>
+	
+	<font-style>
+		<value name="normal"/>
+		<value name="italic"/>
+		<value name="oblique"/>		
+	</font-style>
+	
+	<font-variant>
+		<value name="normal"/>
+		<value name="small-caps"/>
+	</font-variant>
+	
+	<font-weight>
+		<value name="normal"/>
+		<value name="bold"/>
+		<value name="bolder"/>
+		<value name="lighter"/>
+	</font-weight>
+	
+	<background-attachment>
+		<value name="scroll"/>
+		<value name="fixed"/>
+	</background-attachment>
+	
+	<background-image>
+		<value name="none"/>
+	</background-image>
+	
+	<background-repeat>
+		<value name="repeat"/>
+		<value name="repeat-x"/>
+		<value name="repeat-y"/>
+		<value name="no-repeat"/>
+	</background-repeat>
+	
+	<border-bottom-style>
+		<value name="solid"/>
+		<value name="none"/>
+		<value name="hidden"/>
+		<value name="dotted"/>
+		<value name="dashed"/>
+		<value name="double"/>
+		<value name="groove"/>
+		<value name="ridge"/>
+		<value name="inset"/>
+		<value name="outset"/>
+	</border-bottom-style>
+	
+	<border-bottom-width>
+		<value name="medium"/>
+		<value name="thin"/>
+		<value name="thick"/>
+	</border-bottom-width>
+	
+	<border-left-style>
+		<value name="solid"/>
+		<value name="none"/>
+		<value name="hidden"/>
+		<value name="dotted"/>
+		<value name="dashed"/>
+		<value name="double"/>
+		<value name="groove"/>
+		<value name="ridge"/>
+		<value name="inset"/>
+		<value name="outset"/>
+	</border-left-style>
+	
+	<border-left-width>
+		<value name="medium"/>
+		<value name="thin"/>
+		<value name="thick"/>
+	</border-left-width>
+	
+	<border-right-style>
+		<value name="solid"/>
+		<value name="none"/>
+		<value name="hidden"/>
+		<value name="dotted"/>
+		<value name="dashed"/>
+		<value name="double"/>
+		<value name="groove"/>
+		<value name="ridge"/>
+		<value name="inset"/>
+		<value name="outset"/>
+	</border-right-style>
+	
+	<border-right-width>
+		<value name="medium"/>
+		<value name="thin"/>
+		<value name="thick"/>
+	</border-right-width>
+	
+	<border-style>
+		<value name="solid"/>
+		<value name="none"/>
+		<value name="hidden"/>
+		<value name="dotted"/>
+		<value name="dashed"/>
+		<value name="double"/>
+		<value name="groove"/>
+		<value name="ridge"/>
+		<value name="inset"/>
+		<value name="outset"/>
+	</border-style>
+	
+	<border-top-style>
+		<value name="solid"/>
+		<value name="none"/>
+		<value name="hidden"/>
+		<value name="dotted"/>
+		<value name="dashed"/>
+		<value name="double"/>
+		<value name="groove"/>
+		<value name="ridge"/>
+		<value name="inset"/>
+		<value name="outset"/>
+	</border-top-style>
+	
+	<border-top-width>
+		<value name="medium"/>
+		<value name="thin"/>
+		<value name="thick"/>
+	</border-top-width>
+	
+	<border-width>
+		<value name="medium"/>
+		<value name="thin"/>
+		<value name="thick"/>
+	</border-width>
+	
+	<margin-bottom>
+		<value name="auto"/>
+	</margin-bottom>
+	
+	<margin-left>
+		<value name="auto"/>
+	</margin-left>
+	
+	<margin-right>
+		<value name="auto"/>
+	</margin-right>
+	
+	<margin-top>
+		<value name="auto"/>
+	</margin-top>
+	
+	<list-style-image>
+		<value name="none"/>
+	</list-style-image>
+	
+	<list-style-position>
+		<value name="inside"/>
+		<value name="outside"/>
+	</list-style-position>
+	
+	<list-style-type>
+		<value name="disk"/>
+		<value name="circle"/>
+		<value name="square"/>
+		<value name="decimal"/>
+		<value name="decimal-leading-zero"/>
+		<value name="lower-roman"/>
+		<value name="upper-roman"/>
+		<value name="lower-alpha"/>
+		<value name="upper-alpha"/>
+		<value name="lower-greek"/>
+		<value name="lower-latin"/>
+		<value name="upper-latin"/>
+		<value name="hebrew"/>
+		<value name="armenian"/>
+		<value name="georgian"/>
+		<value name="cjk-ideographic"/>
+		<value name="hiragana"/>
+		<value name="katakana"/>
+		<value name="hiragana-iroha"/>
+		<value name="katakana-iroha"/>
+		<value name="none"/>
+	</list-style-type>
+	
+	<marker-offset>
+		<value name="auto"/>
+	</marker-offset>
+	
+	<line-height>
+		<value name="normal"/>
+	</line-height>
+	
+	<max-height>
+		<value name="none"/>
+	</max-height>
+	
+	<max-width>
+		<value name="none"/>
+	</max-width>
+	
+	<vertical-align>
+		<value name="baseline"/>
+		<value name="sub"/>
+		<value name="super"/>
+		<value name="top"/>
+		<value name="text-top"/>
+		<value name="middle"/>
+		<value name="bottom"/>
+		<value name="text-bottom"/>
+	</vertical-align>
+	
+	<bottom>
+		<value name="auto"/>
+	</bottom>
+	
+	<clear>
+		<value name="none"/>
+		<value name="left"/>
+		<value name="right"/>
+		<value name="both"/>
+	</clear>
+	
+	<clip>
+		<value name="auto"/>
+	</clip>
+	
+	<direction>
+		<value name="ltr"/>
+		<value name="rtl"/>
+	</direction>
+	
+	<display>
+		<value name="none"/>
+		<value name="inline"/>
+		<value name="block"/>
+		<value name="list-item"/>
+		<value name="run-in"/>
+		<value name="compact"/>
+		<value name="marker"/>
+		<value name="table"/>
+		<value name="inline-table"/>
+		<value name="table-row-group"/>
+		<value name="table-header-group"/>
+		<value name="table-footer-group"/>
+		<value name="table-row"/>
+		<value name="table-column-group"/>
+		<value name="table-column"/>
+		<value name="table-cell"/>
+		<value name="table-caption"/>
+	</display>
+	
+	<float>
+		<value name="left"/>
+		<value name="right"/>
+		<value name="none"/>
+	</float>
+	
+	<left>
+		<value name="auto"/>
+	</left>
+	
+	<overflow>
+		<value name="visible"/>
+		<value name="hidden"/>
+		<value name="scroll"/>
+		<value name="auto"/>
+	</overflow>
+	
+	<position>
+		<value name="static"/>
+		<value name="relative"/>
+		<value name="absolute"/>
+		<value name="fixed"/>
+	</position>
+	
+	<right>
+		<value name="auto"/>
+	</right>
+	
+	<top>
+		<value name="auto"/>
+	</top>
+	
+	<unicode-bidi>
+		<value name="normal"/>
+		<value name="embed"/>
+		<value name="bidi-override"/>
+	</unicode-bidi>
+	
+	<visibility>
+		<value name="visible"/>
+		<value name="hidden"/>
+		<value name="collapse"/>
+	</visibility>
+	
+	<z-index>
+		<value name="auto"/>
+	</z-index>
+	
+	<marks>
+		<value name="crop"/>
+		<value name="cross"/>
+		<value name="none"/>
+	</marks>
+	
+	<page-break-after>
+		<value name="auto"/>
+		<value name="always"/>
+		<value name="avoid"/>
+		<value name="left"/>
+		<value name="right"/>
+	</page-break-after>
+	
+	<page-break-before>
+		<value name="auto"/>
+		<value name="always"/>
+		<value name="avoid"/>
+		<value name="left"/>
+		<value name="right"/>
+	</page-break-before>
+	
+	<page-break-inside>
+		<value name="avoid"/>
+		<value name="auto"/>
+	</page-break-inside>
+	
+	<size>
+		<value name="auto"/>
+		<value name="portrait"/>
+		<value name="landscape"/>
+	</size>
+	
+	<border-collapse>
+		<value name="collapse"/>
+		<value name="separate"/>
+	</border-collapse>
+	
+	<caption-side>
+		<value name="top"/>
+		<value name="bottom"/>
+		<value name="left"/>
+		<value name="right"/>
+	</caption-side>
+	
+	<empty-cells>
+		<value name="show"/>
+		<value name="hide"/>
+	</empty-cells>
+	
+	<speak-header>
+		<value name="once"/>
+		<value name="always"/>
+	</speak-header>
+	
+	<table-layout>
+		<value name="auto"/>
+		<value name="fixed"/>
+	</table-layout>
+	
+	<cursor>
+		<value name="auto"/>
+		<value name="crosshair"/>
+		<value name="default"/>
+		<value name="pointer"/>
+		<value name="move"/>
+		<value name="e-resize"/>
+		<value name="ne-resize"/>
+		<value name="nw-resize"/>
+		<value name="n-resize"/>
+		<value name="se-resize"/>
+		<value name="sw-resize"/>
+		<value name="s-resize"/>
+		<value name="w-resize"/>
+		<value name="text"/>
+		<value name="wait"/>
+		<value name="help"/>
+	</cursor>
+	
+	<outline-style>
+		<value name="solid"/>
+		<value name="none"/>
+		<value name="hidden"/>
+		<value name="dotted"/>
+		<value name="dashed"/>
+		<value name="double"/>
+		<value name="groove"/>
+		<value name="ridge"/>
+		<value name="inset"/>
+		<value name="outset"/>
+	</outline-style>
+	
+	<outline-width>
+		<value name="medium"/>
+		<value name="thin"/>
+		<value name="thick"/>
+	</outline-width>
+	
+	<azimuth>
+		<value name="left-side"/>
+		<value name="far-left"/>
+		<value name="left"/>
+		<value name="center-left"/>
+		<value name="center"/>
+		<value name="center-right"/>
+		<value name="right"/>
+		<value name="far-right"/>
+		<value name="rigth-side"/>
+		<value name="behind"/>
+		<value name="leftwards"/>
+		<value name="rightwards"/>
+	</azimuth>
+	
+	<cue-after>
+		<value name="none"/>
+	</cue-after>
+	
+	<cue-before>
+		<value name="none"/>
+	</cue-before>
+	
+	<elevation>
+		<value name="below"/>
+		<value name="level"/>
+		<value name="above"/>
+		<value name="higher"/>
+		<value name="lower"/>
+	</elevation>
+	
+	<pitch>
+		<value name="x-low"/>
+		<value name="low"/>
+		<value name="medium"/>
+		<value name="high"/>
+		<value name="x-high"/>
+	</pitch>
+	
+	<play-during>
+		<value name="mix"/>
+		<value name="repeat"/>
+		<value name="auto"/>
+		<value name="none"/>
+	</play-during>
+	
+	<speak>
+		<value name="normal"/>
+		<value name="none"/>
+		<value name="spell-out"/>
+	</speak>
+	
+	<speak-numeral>
+		<value name="digits"/>
+		<value name="continuous"/>
+	</speak-numeral>
+	
+	<speak-punctuation>
+		<value name="code"/>
+		<value name="none"/>
+	</speak-punctuation>
+	
+	<speech-rate>
+		<value name="x-slow"/>
+		<value name="slow"/>
+		<value name="medium"/>
+		<value name="fast"/>
+		<value name="x-fast"/>
+		<value name="faster"/>
+		<value name="slower"/>
+	</speech-rate>
+	
+	<volumn>
+		<value name="silent"/>
+		<value name="x-soft"/>
+		<value name="soft"/>
+		<value name="medium"/>
+		<value name="loud"/>
+		<value name="x-loud"/>
+	</volumn>
+</elements>
\ No newline at end of file

Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/JspEditorPlugin.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/JspEditorPlugin.java	2008-07-16 13:59:16 UTC (rev 9154)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/JspEditorPlugin.java	2008-07-16 15:19:39 UTC (rev 9155)
@@ -11,9 +11,8 @@
 package org.jboss.tools.jst.jsp;
 
 import java.io.File;
+import java.io.IOException;
 import java.net.URL;
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
 
 import org.eclipse.core.resources.IWorkspace;
 import org.eclipse.core.resources.ResourcesPlugin;
@@ -23,6 +22,7 @@
 import org.eclipse.core.runtime.Platform;
 import org.eclipse.jdt.ui.text.JavaTextTools;
 import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jface.resource.ImageDescriptor;
 import org.eclipse.jst.jsp.ui.internal.JSPUIPlugin;
 import org.eclipse.swt.widgets.Shell;
 import org.eclipse.ui.IWorkbench;
@@ -31,6 +31,7 @@
 import org.jboss.tools.common.log.IPluginLog;
 import org.jboss.tools.common.text.xml.XmlEditorPlugin;
 import org.jboss.tools.jst.jsp.preferences.JSPOccurrencePreferenceConstants;
+import org.osgi.framework.Bundle;
 
 /**
  * The main plugin class to be used in the desktop.
@@ -41,6 +42,7 @@
 	
 	public static final String PLUGIN_ID = "org.jboss.tools.jst.jsp"; 
 
+	public static final String PLUGIN_CSSDIALOG_RESOURCES = "/resources/org/jboss/tools/jst/jsp/outline/cssdialog";
 
 	/**
 	 * The constructor.
@@ -133,4 +135,34 @@
 	public static IPluginLog getPluginLog() {
 		return getDefault();
 	}
+	
+	/**
+	     * Returns an image descriptor for the image file at the given plug-in
+	     * relative path
+	     * 
+	     * @param path
+	     *                the path
+	     * @return the image descriptor
+	     */
+	    public static ImageDescriptor getImageDescriptor(String path) {
+		return imageDescriptorFromPlugin(PLUGIN_ID, path);
+	    }
+
+	    /**
+	     * Get plug-in resource path
+	     * 
+	     * @return path
+	     */
+	    public static String getPluginCSSDialogResourcePath() {
+		Bundle bundle = Platform.getBundle(PLUGIN_ID);
+		URL url = null;
+		try {
+		    url = bundle == null ? null : FileLocator.resolve(bundle
+			    .getEntry(PLUGIN_CSSDIALOG_RESOURCES));
+
+		} catch (IOException e) {
+		    url = bundle.getEntry(PLUGIN_CSSDIALOG_RESOURCES);
+		}
+		return (url == null) ? null : url.getPath();
+	    }
 }

Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/JSPDialogCellEditor.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/JSPDialogCellEditor.java	2008-07-16 13:59:16 UTC (rev 9154)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/JSPDialogCellEditor.java	2008-07-16 15:19:39 UTC (rev 9155)
@@ -7,121 +7,141 @@
  *
  * Contributors:
  *     Exadel, Inc. and Red Hat, Inc. - initial API and implementation
- ******************************************************************************/ 
+ ******************************************************************************/
 package org.jboss.tools.jst.jsp.outline;
 
 import java.util.Properties;
 
-import org.jboss.tools.common.kb.wtp.WtpKbConnector;
-import org.jboss.tools.common.model.ui.attribute.editor.DialogCellEditorEx;
-import org.jboss.tools.common.model.ui.objecteditor.AttributeWrapper;
-import org.jboss.tools.common.model.ui.objecteditor.ExtendedCellEditorProvider;
-import org.eclipse.jdt.internal.ui.refactoring.contentassist.*;
+import org.eclipse.jdt.internal.ui.refactoring.contentassist.ControlContentAssistHelper;
+import org.eclipse.jface.window.Window;
 import org.eclipse.swt.widgets.Button;
 import org.eclipse.swt.widgets.Composite;
 import org.eclipse.swt.widgets.Control;
 import org.eclipse.swt.widgets.Text;
 import org.eclipse.ui.contentassist.ContentAssistHandler;
 import org.jboss.tools.common.meta.key.WizardKeys;
+import org.jboss.tools.common.model.ui.attribute.editor.DialogCellEditorEx;
+import org.jboss.tools.common.model.ui.objecteditor.AttributeWrapper;
+import org.jboss.tools.common.model.ui.objecteditor.ExtendedCellEditorProvider;
+import org.jboss.tools.jst.jsp.contentassist.FaceletsHtmlContentAssistProcessor;
 import org.jboss.tools.jst.jsp.contentassist.JSPDialogCellEditorContentAssistProcessor;
-import org.jboss.tools.jst.jsp.contentassist.FaceletsHtmlContentAssistProcessor;
 import org.jboss.tools.jst.jsp.drop.treeviewer.model.RootElement;
+import org.jboss.tools.jst.jsp.outline.cssdialog.CSSDialog;
 
 /**
- * @author Kabanovich
- * Cell Editor for JSP attributes, of which values can be 
- * provided by prompting knoledgebase.
+ * @author Kabanovich Cell Editor for JSP attributes, of which values can be
+ *         provided by prompting knoledgebase.
  */
 
-public class JSPDialogCellEditor extends DialogCellEditorEx implements ExtendedCellEditorProvider.StoppableCellEditor {
-	Properties context;
-	//ValueHelper valueHelper;
-	JSPDialogCellEditorContentAssistProcessor contentAssistentProcessor;
-	ContentAssistHandler handler = null;
-	
-	boolean hasProposals = false;
-	
-	public JSPDialogCellEditor(Composite parent, Properties context) {
-		super(parent);
-		this.context = context;
-		ValueHelper valueHelper = (ValueHelper)context.get("valueHelper");
+public class JSPDialogCellEditor extends DialogCellEditorEx implements
+	ExtendedCellEditorProvider.StoppableCellEditor {
+    Properties context;
+    // ValueHelper valueHelper;
+    JSPDialogCellEditorContentAssistProcessor contentAssistentProcessor;
+    ContentAssistHandler handler = null;
 
-		contentAssistentProcessor = new JSPDialogCellEditorContentAssistProcessor();
-		if(valueHelper != null) contentAssistentProcessor.setContext(context);
-		handler = ContentAssistHandler.createHandlerForText(getTextField(), ControlContentAssistHelper.createJavaContentAssistant(contentAssistentProcessor));
-	}
-	
+    boolean hasProposals = false;
+
+    public JSPDialogCellEditor(Composite parent, Properties context) {
+	super(parent);
+	this.context = context;
+	ValueHelper valueHelper = (ValueHelper) context.get("valueHelper");
+
+	contentAssistentProcessor = new JSPDialogCellEditorContentAssistProcessor();
+	if (valueHelper != null)
+	    contentAssistentProcessor.setContext(context);
+	handler = ContentAssistHandler.createHandlerForText(getTextField(),
+		ControlContentAssistHelper
+			.createJavaContentAssistant(contentAssistentProcessor));
+    }
+
     public void activate() {
-    	checkHasProposals();
-    	checkButtonEnablement();
-    	super.activate();
+	checkHasProposals();
+	checkButtonEnablement();
+	super.activate();
+    }
+
+    void checkHasProposals() {
+	hasProposals = false;
+	if (context == null)
+	    return;
+	// valueHelper = (ValueHelper)context.get("valueHelper");
+	// if(valueHelper == null) return;
+	ValueHelper valueHelper = new ValueHelper();
+	String attributeName = "" + context.getProperty("attributeName");
+	String nodeName = "" + context.getProperty("nodeName");
+	String query = "/";
+	if (valueHelper.isFacetets() && nodeName.indexOf(':') < 0) {
+	    query += FaceletsHtmlContentAssistProcessor.faceletHtmlPrefixStart;
 	}
-    
-    void checkHasProposals() {
-    	hasProposals = false;
-		if(context == null) return;
-		//valueHelper = (ValueHelper)context.get("valueHelper");
-		//if(valueHelper == null) return;
-		ValueHelper valueHelper = new ValueHelper();
-		String attributeName = "" + context.getProperty("attributeName");
-		String nodeName = "" + context.getProperty("nodeName");
-		String query = "/";
-		if(valueHelper.isFacetets() && nodeName.indexOf(':') < 0) {
-			query += FaceletsHtmlContentAssistProcessor.faceletHtmlPrefixStart;
-		}
-		query += nodeName + "@" + attributeName;
-		RootElement root = (RootElement)valueHelper.getInitalInput(query);
-		hasProposals = root != null && root.getChildren().length > 0;
+	query += nodeName + "@" + attributeName;
+	RootElement root = (RootElement) valueHelper.getInitalInput(query);
+	hasProposals = root != null && root.getChildren().length > 0;
     }
-    
+
     private void checkButtonEnablement() {
-		if(context == null) return;
-		//valueHelper = (ValueHelper)context.get("valueHelper");
-		//if(valueHelper == null) return;
-		ValueHelper valueHelper = new ValueHelper();
-		Button button = getButtonControl();
-		if(button == null || button.isDisposed()) return;
-		button.setVisible(hasProposals);
-		handler.setEnabled(hasProposals);
+	if (context == null)
+	    return;
+	// valueHelper = (ValueHelper)context.get("valueHelper");
+	// if(valueHelper == null) return;
+	ValueHelper valueHelper = new ValueHelper();
+	Button button = getButtonControl();
+	if (button == null || button.isDisposed())
+	    return;
+	button.setVisible(hasProposals);
+	handler.setEnabled(hasProposals);
     }
 
-	protected Object openDialogBox(Control cellEditorWindow) {
-		externalEditing = true;
-		String attributeName = "" + context.getProperty("attributeName");
-		String nodeName = "" + context.getProperty("nodeName");
-		String query = "/";
-		ValueHelper valueHelper = new ValueHelper();
-		if(valueHelper != null && valueHelper.isFacetets() && nodeName.indexOf(":") < 0) {
-			query += FaceletsHtmlContentAssistProcessor.faceletHtmlPrefixStart;
-		}
-		query += nodeName + "@" + attributeName;
-		context.setProperty("query", query);
-		context.setProperty("help", query);
-		context.setProperty("title", "Edit " + WizardKeys.toDisplayName(attributeName));
-		context.setProperty("subtitle", "<" + context.getProperty("nodeName") + ">");
+    protected Object openDialogBox(Control cellEditorWindow) {
+	externalEditing = true;
+	String attributeName = "" + context.getProperty("attributeName");
+	String nodeName = "" + context.getProperty("nodeName");
+	String query = "/";
+	ValueHelper valueHelper = new ValueHelper();
+	if (valueHelper != null && valueHelper.isFacetets()
+		&& nodeName.indexOf(":") < 0) {
+	    query += FaceletsHtmlContentAssistProcessor.faceletHtmlPrefixStart;
+	}
+	query += nodeName + "@" + attributeName;
+	context.setProperty("query", query);
+	context.setProperty("help", query);
+	context.setProperty("title", "Edit "
+		+ WizardKeys.toDisplayName(attributeName));
+	context.setProperty("subtitle", "<" + context.getProperty("nodeName")
+		+ ">");
 
-		String value = (getValue() instanceof String) 
-			? getValue().toString() 
-			: getValue() instanceof AttributeWrapper ? ((AttributeWrapper)getValue()).value 
+	String value = (getValue() instanceof String) ? getValue().toString()
+		: getValue() instanceof AttributeWrapper ? ((AttributeWrapper) getValue()).value
 			: "";
-		
-		context.put("value", value);
-		JSPTreeDialog dialog = new JSPTreeDialog();
-		dialog.setObject(context);
-		if(dialog.execute() != 0) {
-			externalEditing = false;
-			return null;
+
+	context.put("value", value);
+	if (attributeName.equals("style")) {
+	    CSSDialog dialog = new CSSDialog(cellEditorWindow.getShell(), (value == null ? ""
+			: value));
+		if (dialog.open() == Window.OK) {
+		    externalEditing = false;
+		    return dialog.getNewStyle();
+		    
 		}
+	} else {
+
+	    JSPTreeDialog dialog = new JSPTreeDialog();
+	    dialog.setObject(context);
+	    if (dialog.execute() != 0) {
 		externalEditing = false;
-		value = context.getProperty("value");
-		return value;
+		return null;
+	    }
 	}
-	
-	public void stopEditing() {
-		super.fireApplyEditorValue();
-	}
-	
-	protected Text getTextField() {
-		return text;
-	}
+	externalEditing = false;
+	value = context.getProperty("value");
+	return value;
+    }
+
+    public void stopEditing() {
+	super.fireApplyEditorValue();
+    }
+
+    protected Text getTextField() {
+	return text;
+    }
 }

Added: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/CSSDialog.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/CSSDialog.java	                        (rev 0)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/CSSDialog.java	2008-07-16 15:19:39 UTC (rev 9155)
@@ -0,0 +1,426 @@
+/*******************************************************************************
+ * 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.jst.jsp.outline.cssdialog;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Set;
+import java.util.Map.Entry;
+
+import org.eclipse.jface.dialogs.Dialog;
+import org.eclipse.jface.dialogs.IDialogSettings;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.browser.Browser;
+import org.eclipse.swt.custom.ScrolledComposite;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.TabFolder;
+import org.eclipse.swt.widgets.TabItem;
+import org.jboss.tools.jst.jsp.JspEditorPlugin;
+import org.jboss.tools.jst.jsp.outline.cssdialog.common.Constants;
+import org.jboss.tools.jst.jsp.outline.cssdialog.common.MessageUtil;
+import org.jboss.tools.jst.jsp.outline.cssdialog.parsers.BaseListener;
+import org.jboss.tools.jst.jsp.outline.cssdialog.parsers.CSSElementsParser;
+import org.jboss.tools.jst.jsp.outline.cssdialog.parsers.ColorParser;
+import org.jboss.tools.jst.jsp.outline.cssdialog.parsers.ColorParserListener;
+import org.jboss.tools.jst.jsp.outline.cssdialog.parsers.ComboParser;
+import org.jboss.tools.jst.jsp.outline.cssdialog.parsers.Parser;
+import org.jboss.tools.jst.jsp.outline.cssdialog.parsers.ParserListener;
+import org.jboss.tools.jst.jsp.outline.cssdialog.tabs.TabBackgroundControl;
+import org.jboss.tools.jst.jsp.outline.cssdialog.tabs.TabBoxesControl;
+import org.jboss.tools.jst.jsp.outline.cssdialog.tabs.TabPropertySheetControl;
+import org.jboss.tools.jst.jsp.outline.cssdialog.tabs.TabQuickEditControl;
+import org.jboss.tools.jst.jsp.outline.cssdialog.tabs.TabTextControl;
+import org.xml.sax.Attributes;
+
+/**
+ * Class for CSS editor dialog
+ * 
+ * @author Dzmitry Sakovich (dsakovich at exadel.com)
+ */
+public class CSSDialog extends Dialog {
+    
+    private static int MIN_HEIGHT_FOR_BROWSER = 60;
+
+    private static int TAB_TEXT_FONT_NUMBER = 0;
+    private static int TAB_QUICK_EDIT_NUMBER = 4;
+
+    private static int SIZE_NULL = 0;
+
+    private static int FIRST_SELECTION = 0;
+
+    private static String NODE_NAME_ELEMENTS = "elements";
+    private static String NODE_NAME_VALUE = "value";
+    private static String NODE_NAME_ELEMENT = "element";
+    private static String NODE_ATTRIBUTE_NAME = "name";
+
+    private Browser browser = null;
+
+    private String oldStyle;
+    private String newStyle;
+
+    private TabItem lastSelectedTab = null;
+
+    private TabTextControl tabTextControl;
+    private TabBackgroundControl tabBackgroundControl;
+    private TabBoxesControl tabBoxesControl;
+    private TabPropertySheetControl tabPropertySheetControl;
+    private TabQuickEditControl tabQuickEditControl;
+
+    private TabItem tabTextFont;
+    private TabItem tabBackground;
+    private TabItem tabBoxes;
+    private TabItem tabPropertySheet;
+    private TabItem tabQuickEdit;
+
+    private HashMap<String, ArrayList<String>> comboMap = new HashMap<String, ArrayList<String>>();
+    private HashMap<String, ArrayList<String>> elementsMap = new HashMap<String, ArrayList<String>>();
+    private HashMap<String, String> attributesMap = new HashMap<String, String>();
+
+    public CSSDialog(final Shell parentShell, String oldStyle) {
+	super(parentShell);
+	setShellStyle(getShellStyle() | SWT.RESIZE | SWT.MAX
+		| SWT.APPLICATION_MODAL);
+	this.oldStyle = oldStyle;
+
+	ComboParser comboParser = new ComboParser();
+	comboParser.setListener(new BaseListener(comboMap) {
+
+	    private ArrayList<String> list = null;
+
+	    public void startElement(String uri, String localName,
+		    String nodeName, Attributes attrs) {
+
+		if (nodeName.trim().equalsIgnoreCase(NODE_NAME_ELEMENTS))
+		    return;
+
+		if (!nodeName.trim().equalsIgnoreCase(NODE_NAME_VALUE)) {
+		    String name = nodeName;
+		    list = new ArrayList<String>();
+		    map.put(name, list);
+		} else {
+		    list.add(attrs.getValue(NODE_ATTRIBUTE_NAME));
+		}
+	    }
+
+	});
+	comboParser.parse();
+
+	CSSElementsParser cssParser = new CSSElementsParser();
+	cssParser.setListener(new BaseListener(elementsMap) {
+
+	    private ArrayList<String> list = null;
+
+	    public void startElement(String uri, String localName,
+		    String nodeName, Attributes attrs) {
+
+		if (nodeName.trim().equalsIgnoreCase(NODE_NAME_ELEMENTS))
+		    return;
+
+		if (!nodeName.trim().equalsIgnoreCase(NODE_NAME_ELEMENT)) {
+		    String name = nodeName;
+		    list = new ArrayList<String>();
+		    map.put(name, list);
+		} else {
+		    list.add(attrs.getValue(NODE_ATTRIBUTE_NAME));
+		}
+	    }
+
+	});
+	cssParser.parse();
+
+	ColorParserListener colorListener = new ColorParserListener();
+	ColorParser colorParser = new ColorParser();
+	colorParser.setListener(colorListener);
+	colorParser.parse();
+
+    }
+
+    /**
+     * Getter for newStyle attribute
+     * 
+     * @return
+     */
+    public String getNewStyle() {
+	return newStyle;
+    }
+
+    /**
+     * Setter for newStyle attribute
+     * 
+     * @param newStyle
+     */
+    public void setNewStyle(String newStyle) {
+	this.newStyle = newStyle;
+    }
+
+    /**
+     * Method for creating dialog area
+     * 
+     * @param parent
+     */
+    protected Control createDialogArea(final Composite parent) {
+		
+	ParserListener listener = new ParserListener(attributesMap);
+	Parser parser = new Parser(elementsMap);
+	parser.addListener(listener);
+	parser.parse(oldStyle);
+
+	final Composite composite = (Composite) super.createDialogArea(parent);
+
+	final GridData gridData = new GridData(GridData.FILL, GridData.FILL,
+		true, true);
+
+	composite.setLayoutData(gridData);
+	GridData gd = new GridData(GridData.FILL_BOTH
+		| GridData.GRAB_HORIZONTAL | GridData.GRAB_VERTICAL);
+
+	final TabFolder tabFolder = new TabFolder(composite, SWT.NONE);
+	tabFolder.setLayoutData(gd);
+
+	// ------------------------Browser-----------------------------------
+
+	browser = new Browser(composite, SWT.BORDER);
+	GridData gridBrowser = new GridData(GridData.FILL_BOTH);
+	gridBrowser.minimumHeight = MIN_HEIGHT_FOR_BROWSER;
+	browser.setLayoutData(gridBrowser);
+	//browser.se
+	setStyleForPreview();
+	// ------------------------------------------------------------------
+
+	// Create each tab and set its text, tool tip text,
+	tabTextFont = new TabItem(tabFolder, SWT.NONE);
+	tabTextFont.setText(MessageUtil.getString("TEXT_FONT_TAB_NAME"));
+	tabTextFont.setToolTipText(MessageUtil.getString("TEXT_FONT_TAB_NAME"));
+	tabTextFont.setControl(createTabTextControl(tabFolder));
+	lastSelectedTab = tabTextFont;
+
+	tabBackground = new TabItem(tabFolder, SWT.NONE);
+	tabBackground.setText(MessageUtil.getString("BACKGROUND_TAB_NAME"));
+	tabBackground.setToolTipText(MessageUtil
+		.getString("BACKGROUND_TAB_NAME"));
+	tabBackground.setControl(createTabBackgroundControl(tabFolder));
+
+	tabBoxes = new TabItem(tabFolder, SWT.NONE);
+	tabBoxes.setText(MessageUtil.getString("BOXES_TAB_NAME"));
+	tabBoxes.setToolTipText(MessageUtil.getString("BOXES_TAB_NAME"));
+	tabBoxes.setControl(createTabBoxesControl(tabFolder));
+
+	tabPropertySheet = new TabItem(tabFolder, SWT.NONE);
+	tabPropertySheet.setText(MessageUtil
+		.getString("PROPERTY_SHEET_TAB_NAME"));
+	tabPropertySheet.setToolTipText(MessageUtil
+		.getString("PROPERTY_SHEET_TAB_NAME"));
+	tabPropertySheet.setControl(createTabPropertySheetControl(tabFolder));
+
+	tabFolder.setSelection(TAB_TEXT_FONT_NUMBER);
+	if (attributesMap.size() > SIZE_NULL) {
+	    tabQuickEdit = new TabItem(tabFolder, SWT.NONE);
+	    tabQuickEdit.setText(MessageUtil.getString("QUICK_EDIT_TAB-NAME"));
+	    tabQuickEdit.setToolTipText(MessageUtil
+		    .getString("QUICK_EDIT_TAB-NAME"));
+	    tabQuickEdit.setControl(createTabQuickEditContol(tabFolder));
+	    tabFolder.setSelection(TAB_QUICK_EDIT_NUMBER);
+	    lastSelectedTab = tabQuickEdit;
+	}
+	tabFolder.addSelectionListener(new SelectionAdapter() {
+
+	    public void widgetSelected(SelectionEvent se) {
+
+		
+		if (tabFolder.getSelection()[FIRST_SELECTION] == tabQuickEdit) {
+		    tabQuickEditControl.dispose();
+		    tabQuickEdit
+			    .setControl(createTabQuickEditContol(tabFolder));
+		    lastSelectedTab = tabQuickEdit;
+		} else if (tabFolder.getSelection()[FIRST_SELECTION] == tabTextFont) {
+		    tabTextControl.updateData(false);
+		    lastSelectedTab = tabTextFont;
+		} else if (tabFolder.getSelection()[FIRST_SELECTION] == tabBackground) {
+		    tabBackgroundControl.updateData(false);
+		    lastSelectedTab = tabBackground;
+		} else if (tabFolder.getSelection()[FIRST_SELECTION] == tabBoxes) {
+		    tabBoxesControl.updateData(false);
+		    lastSelectedTab = tabBoxes;
+		} else if (tabFolder.getSelection()[FIRST_SELECTION] == tabPropertySheet) {
+		    tabPropertySheetControl.updateData(false);
+		    lastSelectedTab = tabPropertySheet;
+		}
+	    }
+	});
+
+	return composite;
+    }
+
+    /**
+     * Method for setting title for dialog
+     * 
+     * @param newShell
+     */
+    protected void configureShell(Shell newShell) {
+	super.configureShell(newShell);
+	newShell.setText(MessageUtil.getString("CSS_DIALOG_TITLE"));
+    }
+
+    protected void okPressed() {
+
+	if (lastSelectedTab == tabTextFont) {
+	    tabTextControl.updateData(true);
+	} else if (lastSelectedTab == tabBackground) {
+	    tabBackgroundControl.updateData(true);
+	} else if (lastSelectedTab == tabBoxes) {
+	    tabBoxesControl.updateData(true);
+	} else if (lastSelectedTab == tabPropertySheet) {
+	    tabPropertySheetControl.updateData(true);
+	}
+	StringBuffer buf = new StringBuffer();
+	Set<Entry<String, String>> set = attributesMap.entrySet();
+	for (Map.Entry<String, String> me : set) {
+	    buf.append(me.getKey() + Constants.COLON_STRING + me.getValue()
+		    + Constants.SEMICOLON_STRING);
+	}
+	setNewStyle(buf.toString());
+	super.okPressed();
+    }
+
+    /**
+     * Method for creating text tab
+     * 
+     * @param tabFolder
+     * @return composite
+     */
+    private Control createTabTextControl(TabFolder tabFolder) {
+
+	ScrolledComposite sc = new ScrolledComposite(tabFolder, SWT.H_SCROLL
+		| SWT.V_SCROLL);
+
+	sc.setExpandHorizontal(true);
+	sc.setExpandVertical(true);
+
+	tabTextControl = new TabTextControl(sc, comboMap, attributesMap, this);
+	sc.setContent(tabTextControl);
+
+	sc.setMinSize(tabTextControl.computeSize(SWT.DEFAULT, SWT.DEFAULT));
+
+	return sc;
+    }
+
+    /**
+     * Method for creating background tab
+     * 
+     * @param tabFolder
+     * @return composite
+     */
+    private Control createTabBackgroundControl(TabFolder tabFolder) {
+	ScrolledComposite sc = new ScrolledComposite(tabFolder, SWT.H_SCROLL
+		| SWT.V_SCROLL);
+
+	sc.setExpandHorizontal(true);
+	sc.setExpandVertical(true);
+
+	tabBackgroundControl = new TabBackgroundControl(sc, comboMap,
+		attributesMap, this);
+	sc.setContent(tabBackgroundControl);
+	sc.setMinSize(tabBackgroundControl
+		.computeSize(SWT.DEFAULT, SWT.DEFAULT));
+
+	return sc;
+    }
+
+    /**
+     * Method for creating boxes tab
+     * 
+     * @param tabFolder
+     * @return composite
+     */
+    private Control createTabBoxesControl(TabFolder tabFolder) {
+
+	ScrolledComposite sc = new ScrolledComposite(tabFolder, SWT.H_SCROLL
+		| SWT.V_SCROLL);
+
+	sc.setExpandHorizontal(true);
+	sc.setExpandVertical(true);
+
+	tabBoxesControl = new TabBoxesControl(sc, comboMap, attributesMap, this);
+	sc.setContent(tabBoxesControl);
+	sc.setMinSize(tabBoxesControl.computeSize(SWT.DEFAULT, SWT.DEFAULT));
+
+	return sc;
+    }
+
+    /**
+     * 
+     * Method for creating property sheet tab
+     * 
+     * @param tabFolder
+     * @return
+     */
+    private Control createTabPropertySheetControl(TabFolder tabFolder) {
+	tabPropertySheetControl = new TabPropertySheetControl(tabFolder,
+		elementsMap, comboMap, attributesMap, this);
+	return tabPropertySheetControl;
+    }
+
+    /**
+     * 
+     * Method for creating quick edit tab
+     * 
+     * @param tabFolder
+     * @return
+     */
+    private Control createTabQuickEditContol(TabFolder tabFolder) {
+
+	ScrolledComposite sc = new ScrolledComposite(tabFolder, SWT.H_SCROLL
+		| SWT.V_SCROLL);
+
+	sc.setExpandHorizontal(true);
+	sc.setExpandVertical(true);
+
+	tabQuickEditControl = new TabQuickEditControl(sc, comboMap,
+		attributesMap, this);
+	sc.setContent(tabQuickEditControl);
+
+	sc
+		.setMinSize(tabQuickEditControl.computeSize(SWT.DEFAULT,
+			SWT.DEFAULT));
+	return sc;
+    }
+
+    @Override
+    protected IDialogSettings getDialogBoundsSettings() {
+	return JspEditorPlugin.getDefault().getDialogSettings();
+    }
+
+    /**
+     * 
+     * Set style for preview
+     */
+    public void setStyleForPreview() {
+
+	String styleForSpan = "";
+	String html = "";
+
+	Set<String> keySet = attributesMap.keySet();
+
+	for (String key : keySet)
+	    styleForSpan += key + Constants.COLON_STRING
+		    + attributesMap.get(key) + Constants.SEMICOLON_STRING;
+
+	html = Constants.OPEN_SPAN_TAG + styleForSpan
+		+ Constants.TEXT_FOR_PREVIEW + Constants.CLOSE_SPAN_TAG;
+	browser.setText(html);
+    }
+}
\ No newline at end of file

Added: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/FontFamilyDialog.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/FontFamilyDialog.java	                        (rev 0)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/FontFamilyDialog.java	2008-07-16 15:19:39 UTC (rev 9155)
@@ -0,0 +1,496 @@
+/*******************************************************************************
+ * 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.jst.jsp.outline.cssdialog;
+
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.Set;
+
+import org.eclipse.jface.dialogs.Dialog;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.dnd.DND;
+import org.eclipse.swt.dnd.DragSource;
+import org.eclipse.swt.dnd.DragSourceEvent;
+import org.eclipse.swt.dnd.DragSourceListener;
+import org.eclipse.swt.dnd.DropTarget;
+import org.eclipse.swt.dnd.DropTargetAdapter;
+import org.eclipse.swt.dnd.DropTargetEvent;
+import org.eclipse.swt.dnd.TextTransfer;
+import org.eclipse.swt.dnd.Transfer;
+import org.eclipse.swt.events.DisposeEvent;
+import org.eclipse.swt.events.DisposeListener;
+import org.eclipse.swt.events.MouseEvent;
+import org.eclipse.swt.events.MouseListener;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.graphics.FontData;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.layout.FormAttachment;
+import org.eclipse.swt.layout.FormData;
+import org.eclipse.swt.layout.FormLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.List;
+import org.eclipse.swt.widgets.Shell;
+
+import org.jboss.tools.jst.jsp.JspEditorPlugin;
+import org.jboss.tools.jst.jsp.outline.cssdialog.common.Constants;
+import org.jboss.tools.jst.jsp.outline.cssdialog.common.MessageUtil;
+
+/**
+ * Class for choosing CCS font-family attribute
+ * 
+ * @author dsakovich at exadel.com
+ */
+public class FontFamilyDialog extends Dialog implements SelectionListener {
+
+    /** Font family string */
+    private String fontFamily;
+
+    /** Existing font family */
+    private String existFontFamily;
+
+    private List fontFamilyList;
+    private List allFontFamilyList;
+
+    private Button rightButton;
+    private Button leftButton;
+
+    private static final String COMMA = ",";
+
+    private static final int HEIGHT = 300;
+
+    private static final int BUTTON_TOP_OFFSET = 20;
+    private static final int BUTTON_LEFT_OFFSET = 20;
+    private static final int BUTTON_RIGHT_OFFSET = -20;
+    private static final int BUTTON_RIGHT = 60;
+    private static final int RIGHT_BUTTON_TOP = 30;
+    private static final int LEFT_BUTTON_TOP = 40;
+
+    private static final int LIST_TOP_OFFSET = 10;
+    private static final int LIST_RIGHT_OFFSET = -10;
+    private static final int LIST_LEFT_OFFSET = 10;
+    private static final int LIST_BOTTOM_OFFSET = -10;
+    private static final int LIST_TOP = 5;
+    private static final int LIST_BOTTOM = 100;
+
+    private static final int ALL_FONTS_LIST_LEFT = 0;
+    private static final int ALL_FONTS_LIST_RIGHT = 40;
+    private static final int SELECTED_FONT_LIST_LEFT = 60;
+    private static final int SELECTED_FONT_LIST_RIGHT = 100;
+
+    /**
+     * Constructor
+     * 
+     * @param parentShell
+     *                parent shell
+     * @param existingFontFamily
+     *                existing font family
+     */
+    public FontFamilyDialog(Shell parentShell, String existingFontFamily) {
+	super(parentShell);
+	this.existFontFamily = existingFontFamily;
+    }
+
+    /**
+     * Create Dialog area
+     * 
+     * @param Composite
+     */
+    protected Control createDialogArea(Composite parent) {
+	final Composite composite = (Composite) super.createDialogArea(parent);
+
+	composite.setLayout(new FormLayout());
+
+	allFontFamilyList = new List(composite, SWT.MULTI | SWT.BORDER
+		| SWT.V_SCROLL);
+	FormData fd = new FormData();
+	fd.top = new FormAttachment(LIST_TOP, LIST_TOP_OFFSET);
+	fd.left = new FormAttachment(ALL_FONTS_LIST_LEFT, LIST_LEFT_OFFSET);
+	fd.bottom = new FormAttachment(LIST_BOTTOM, LIST_BOTTOM_OFFSET);
+	fd.right = new FormAttachment(ALL_FONTS_LIST_RIGHT, LIST_RIGHT_OFFSET);
+	fd.height = HEIGHT;
+	allFontFamilyList.setLayoutData(fd);
+
+	Set<String> s = new HashSet<String>();
+	FontData[] fds = composite.getDisplay().getFontList(null, false);
+	for (int i = 0; i < fds.length; ++i)
+	    s.add(fds[i].getName());
+	fds = composite.getDisplay().getFontList(null, true);
+	for (int i = 0; i < fds.length; ++i)
+	    s.add(fds[i].getName());
+	String[] existFonts = fontFamilyParser();
+	Arrays.sort(existFonts);
+
+	String[] answer = new String[s.size()];
+	s.toArray(answer);
+	Arrays.sort(answer);
+
+	for (int i = 0; i < answer.length; i++) {
+	    allFontFamilyList.add(answer[i]);
+	}
+
+	rightButton = new Button(composite, SWT.PUSH);
+	fd = new FormData();
+	fd.top = new FormAttachment(RIGHT_BUTTON_TOP, BUTTON_TOP_OFFSET);
+	fd.left = new FormAttachment(allFontFamilyList, BUTTON_LEFT_OFFSET);
+	fd.right = new FormAttachment(BUTTON_RIGHT, BUTTON_RIGHT_OFFSET);
+	rightButton.setLayoutData(fd);
+	rightButton
+		.setToolTipText(MessageUtil.getString("ADD_FONT_FAMILY_TIP"));
+	ImageDescriptor rightDesc = JspEditorPlugin
+		.getImageDescriptor(Constants.IMAGE_RIGHT_FILE_LOCATION);
+	Image rightImage = rightDesc.createImage();
+	rightButton.setImage(rightImage);
+	rightButton.setEnabled(false);
+	rightButton.addDisposeListener(new DisposeListener() {
+	    public void widgetDisposed(DisposeEvent e) {
+		Button button = (Button) e.getSource();
+		button.getImage().dispose();
+	    }
+	});
+	leftButton = new Button(composite, SWT.PUSH);
+	fd = new FormData();
+	fd.top = new FormAttachment(LEFT_BUTTON_TOP, BUTTON_TOP_OFFSET);
+	fd.left = new FormAttachment(allFontFamilyList, BUTTON_LEFT_OFFSET);
+	fd.right = new FormAttachment(BUTTON_RIGHT, BUTTON_RIGHT_OFFSET);
+	leftButton.setLayoutData(fd);
+	leftButton.setToolTipText(MessageUtil
+		.getString("REMOVE_FONT_FAMILY_TIP"));
+	ImageDescriptor leftDesc = JspEditorPlugin
+		.getImageDescriptor(Constants.IMAGE_LEFT_FILE_LOCATION);
+	Image leftImage = leftDesc.createImage();
+	leftButton.setImage(leftImage);
+	leftButton.setEnabled(false);
+	leftButton.addDisposeListener(new DisposeListener() {
+	    public void widgetDisposed(DisposeEvent e) {
+		Button button = (Button) e.getSource();
+		button.getImage().dispose();
+	    }
+	});
+
+	fontFamilyList = new List(composite, SWT.SINGLE | SWT.BORDER
+		| SWT.V_SCROLL);
+	fd = new FormData();
+	fd.top = new FormAttachment(LIST_TOP, LIST_TOP_OFFSET);
+	fd.left = new FormAttachment(SELECTED_FONT_LIST_LEFT, LIST_LEFT_OFFSET);
+	fd.bottom = new FormAttachment(LIST_BOTTOM, LIST_BOTTOM_OFFSET);
+	fd.right = new FormAttachment(SELECTED_FONT_LIST_RIGHT,
+		LIST_RIGHT_OFFSET);
+	fd.height = HEIGHT;
+	fontFamilyList.setLayoutData(fd);
+	if (existFontFamily != null
+		&& !existFontFamily.equals(Constants.EMPTY_STRING)) {
+	    for (int i = 0; i < existFonts.length; i++) {
+		fontFamilyList.add(existFonts[i]);
+	    }
+	}
+
+	/** Control listeners */
+	allFontFamilyList.addMouseListener(new MouseListener() {
+
+	    public void mouseDoubleClick(MouseEvent e) {
+		int selectedItem = allFontFamilyList.getSelectionIndex();
+		addFont(fontFamilyList, allFontFamilyList.getItem(selectedItem));
+		allFontFamilyList.remove(selectedItem);
+		rightButton.setEnabled(false);
+	    }
+
+	    public void mouseDown(MouseEvent e) {
+		if (allFontFamilyList.getSelectionCount() > 0) {
+		    fontFamilyList.deselectAll();
+		    leftButton.setEnabled(false);
+		    rightButton.setEnabled(true);
+		}
+	    }
+
+	    public void mouseUp(MouseEvent e) {
+	    }
+	});
+
+	fontFamilyList.addMouseListener(new MouseListener() {
+
+	    public void mouseDoubleClick(MouseEvent e) {
+		leftButton.setEnabled(false);
+		int selectedItem = fontFamilyList.getSelectionIndex();
+		fontFamilyList.deselectAll();
+		addFont(allFontFamilyList, fontFamilyList.getItem(selectedItem));
+		fontFamilyList.remove(selectedItem);
+	    }
+
+	    public void mouseDown(MouseEvent e) {
+		if (fontFamilyList.getSelectionCount() > 0) {
+		    allFontFamilyList.deselectAll();
+		    rightButton.setEnabled(false);
+		    leftButton.setEnabled(true);
+		}
+	    }
+
+	    public void mouseUp(MouseEvent e) {
+	    }
+
+	});
+
+	rightButton.addSelectionListener(this);
+
+	leftButton.addSelectionListener(this);
+
+	/** Add drag and drop */
+	Transfer[] types = new Transfer[] { TextTransfer.getInstance() };
+
+	final DragSource source = new DragSource(allFontFamilyList,
+		DND.DROP_MOVE);
+	source.setTransfer(types);
+	source.addDragListener(new DragSourceListener() {
+
+	    public void dragFinished(DragSourceEvent event) {
+		if (event.detail == DND.DROP_MOVE) {
+		    int selectedItem = allFontFamilyList.getSelectionIndex();
+		    allFontFamilyList.remove(selectedItem);
+		}
+	    }
+
+	    public void dragSetData(DragSourceEvent event) {
+		int selectedItem = allFontFamilyList.getSelectionIndex();
+		event.data = allFontFamilyList.getItem(selectedItem);
+	    }
+
+	    public void dragStart(DragSourceEvent event) {
+		event.doit = (allFontFamilyList.getSelectionCount() != 0);
+	    }
+
+	});
+
+	DropTarget target = new DropTarget(fontFamilyList, DND.DROP_MOVE);
+	target.setTransfer(types);
+	target.addDropListener(new DropTargetAdapter() {
+	    public void drop(DropTargetEvent event) {
+		if (event.data == null) {
+		    event.detail = DND.DROP_NONE;
+		    return;
+		}
+		addFont(fontFamilyList, ((String) event.data));
+		rightButton.setEnabled(false);
+	    }
+	});
+
+	final DragSource sourceBack = new DragSource(fontFamilyList,
+		DND.DROP_MOVE);
+	sourceBack.setTransfer(types);
+	sourceBack.addDragListener(new DragSourceListener() {
+
+	    public void dragFinished(DragSourceEvent event) {
+		if (event.detail == DND.DROP_MOVE) {
+		    int selectedItem = fontFamilyList.getSelectionIndex();
+		    fontFamilyList.remove(selectedItem);
+		}
+	    }
+
+	    public void dragSetData(DragSourceEvent event) {
+		int selectedItem = fontFamilyList.getSelectionIndex();
+		event.data = fontFamilyList.getItem(selectedItem);
+	    }
+
+	    public void dragStart(DragSourceEvent event) {
+		event.doit = (fontFamilyList.getSelectionCount() != 0);
+	    }
+
+	});
+
+	DropTarget targetBack = new DropTarget(allFontFamilyList, DND.DROP_MOVE);
+	targetBack.setTransfer(types);
+	targetBack.addDropListener(new DropTargetAdapter() {
+	    public void drop(DropTargetEvent event) {
+		if (event.data == null) {
+		    event.detail = DND.DROP_NONE;
+		    return;
+		}
+		addFont(allFontFamilyList, ((String) event.data));
+		leftButton.setEnabled(false);
+	    }
+	});
+
+	return composite;
+
+    }
+
+    /**
+     * Set title for dialog
+     */
+    protected void configureShell(Shell newShell) {
+	super.configureShell(newShell);
+	newShell.setText(MessageUtil.getString("FONT_FAMILY_DIALOG_TITLE"));
+    }
+
+    protected void okPressed() {
+	String[] items = fontFamilyList.getItems();
+	StringBuffer buf = new StringBuffer();
+	for (int i = 0; i < items.length; i++) {
+	    buf.append((i == 0 ? Constants.EMPTY_STRING : COMMA) + items[i]);
+	}
+	fontFamily = buf.toString();
+	super.okPressed();
+    }
+
+    /**
+     * Method for add to font to sorted list
+     * 
+     * @param list
+     * @param font
+     */
+    private void addFont(List list, String font) {
+	Set<String> s = new HashSet<String>();
+	String[] items = list.getItems();
+	list.removeAll();
+	for (int i = 0; i < items.length; i++) {
+	    s.add(items[i]);
+	}
+	s.add(font);
+	String[] answer = new String[s.size()];
+	s.toArray(answer);
+	Arrays.sort(answer);
+	for (int i = 0; i < answer.length; i++) {
+	    list.add(answer[i]);
+	}
+    }
+
+    /**
+     * Getter for fontFamily attribute
+     * 
+     * @return fontFamily
+     */
+    public String getFontFamily() {
+	return fontFamily;
+    }
+
+    /**
+     * Setter for fontFamily attribute
+     * 
+     * @param fontFamily
+     */
+    public void setFontFamily(String fontFamily) {
+	this.fontFamily = fontFamily;
+    }
+
+    /**
+     * Method for parse font family string
+     * 
+     * @param font
+     *                family string
+     * @return list font family
+     */
+    private String[] fontFamilyParser() {
+	existFontFamily = existFontFamily.trim();
+	return existFontFamily.split(COMMA);
+    }
+
+    /**
+     * Selection listener
+     */
+    public void widgetDefaultSelected(SelectionEvent e) {
+	Object ob = e.getSource();
+	if (ob.equals(leftButton)) {
+	    int[] selectedItems = fontFamilyList.getSelectionIndices();
+	    String[] items = allFontFamilyList.getItems();
+	    Set<String> s = new HashSet<String>();
+	    for (int i = 0; i < items.length; i++) {
+		s.add(items[i]);
+	    }
+	    for (int i = 0; i < selectedItems.length; i++) {
+		s.add(fontFamilyList.getItem(selectedItems[i]));
+	    }
+	    allFontFamilyList.removeAll();
+	    String[] answer = new String[s.size()];
+	    s.toArray(answer);
+	    Arrays.sort(answer);
+	    for (int i = 0; i < answer.length; i++) {
+		allFontFamilyList.add(answer[i]);
+	    }
+	    fontFamilyList.remove(selectedItems);
+	    leftButton.setEnabled(false);
+	} else if (ob.equals(rightButton)) {
+	    int[] selectedItems = allFontFamilyList.getSelectionIndices();
+	    String[] items = fontFamilyList.getItems();
+	    Set<String> s = new HashSet<String>();
+	    for (int i = 0; i < items.length; i++) {
+		s.add(items[i]);
+	    }
+	    for (int i = 0; i < selectedItems.length; i++) {
+		s.add(allFontFamilyList.getItem(selectedItems[i]));
+	    }
+	    fontFamilyList.removeAll();
+	    String[] answer = new String[s.size()];
+	    s.toArray(answer);
+	    Arrays.sort(answer);
+	    for (int i = 0; i < answer.length; i++) {
+		fontFamilyList.add(answer[i]);
+	    }
+	    allFontFamilyList.remove(selectedItems);
+	    rightButton.setEnabled(false);
+	} else if (ob.equals(allFontFamilyList)) {
+	    fontFamilyList.deselectAll();
+	    leftButton.setEnabled(false);
+	    rightButton.setEnabled(true);
+	} else if (ob.equals(fontFamilyList)) {
+	    allFontFamilyList.deselectAll();
+	    rightButton.setEnabled(false);
+	    leftButton.setEnabled(true);
+	}
+    }
+
+    /**
+     * Selection listener
+     */
+    public void widgetSelected(SelectionEvent e) {
+	Object ob = e.getSource();
+	if (ob.equals(leftButton)) {
+	    int[] selectedItems = fontFamilyList.getSelectionIndices();
+	    String[] items = allFontFamilyList.getItems();
+	    Set<String> s = new HashSet<String>();
+	    for (int i = 0; i < items.length; i++) {
+		s.add(items[i]);
+	    }
+	    for (int i = 0; i < selectedItems.length; i++) {
+		s.add(fontFamilyList.getItem(selectedItems[i]));
+	    }
+	    allFontFamilyList.removeAll();
+	    String[] answer = new String[s.size()];
+	    s.toArray(answer);
+	    Arrays.sort(answer);
+	    for (int i = 0; i < answer.length; i++) {
+		allFontFamilyList.add(answer[i]);
+	    }
+	    fontFamilyList.remove(selectedItems);
+	    leftButton.setEnabled(false);
+	} else if (ob.equals(rightButton)) {
+	    int[] selectedItems = allFontFamilyList.getSelectionIndices();
+	    String[] items = fontFamilyList.getItems();
+	    Set<String> s = new HashSet<String>();
+	    for (int i = 0; i < items.length; i++) {
+		s.add(items[i]);
+	    }
+	    for (int i = 0; i < selectedItems.length; i++) {
+		s.add(allFontFamilyList.getItem(selectedItems[i]));
+	    }
+	    fontFamilyList.removeAll();
+	    String[] answer = new String[s.size()];
+	    s.toArray(answer);
+	    Arrays.sort(answer);
+	    for (int i = 0; i < answer.length; i++) {
+		fontFamilyList.add(answer[i]);
+	    }
+	    allFontFamilyList.remove(selectedItems);
+	    rightButton.setEnabled(false);
+	}
+    }
+}

Added: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/ImageSelectionDialog.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/ImageSelectionDialog.java	                        (rev 0)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/ImageSelectionDialog.java	2008-07-16 15:19:39 UTC (rev 9155)
@@ -0,0 +1,719 @@
+/*******************************************************************************
+ * 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.jst.jsp.outline.cssdialog;
+
+import java.io.FileInputStream;
+import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import org.eclipse.core.resources.IContainer;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IFolder;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.jface.dialogs.IDialogConstants;
+import org.eclipse.jface.viewers.DoubleClickEvent;
+import org.eclipse.jface.viewers.IDoubleClickListener;
+import org.eclipse.jface.viewers.ILabelProvider;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.ITreeContentProvider;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.jface.viewers.ViewerComparator;
+import org.eclipse.jface.viewers.ViewerFilter;
+import org.eclipse.jface.viewers.ViewerSorter;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.BusyIndicator;
+import org.eclipse.swt.events.PaintEvent;
+import org.eclipse.swt.events.PaintListener;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.Cursor;
+import org.eclipse.swt.graphics.GC;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.ImageData;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Canvas;
+import org.eclipse.swt.widgets.Combo;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.swt.widgets.Tree;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.dialogs.ElementTreeSelectionDialog;
+import org.eclipse.ui.dialogs.ISelectionStatusValidator;
+import org.eclipse.ui.dialogs.SelectionStatusDialog;
+import org.eclipse.ui.internal.WorkbenchMessages;
+import org.jboss.tools.jst.jsp.outline.cssdialog.common.MessageUtil;
+
+/**
+ * Class for creating images selection dialog
+ * 
+ * @author dsakovich at exadel.com
+ */
+ at SuppressWarnings("restriction")
+public class ImageSelectionDialog extends SelectionStatusDialog {
+
+    private Combo filterCombo;
+
+    private Canvas canvas;
+
+    private IFile file;
+
+    private Text resolution;
+
+    private Color emptyColor;
+
+    private TreeViewer fViewer;
+
+    private ILabelProvider fLabelProvider;
+
+    private ITreeContentProvider fContentProvider;
+
+    private ISelectionStatusValidator fValidator = null;
+
+    private ViewerComparator fComparator;
+
+    private boolean fAllowMultiple = true;
+
+    private boolean fDoubleClickSelects = true;
+
+    private String fEmptyListMessage = WorkbenchMessages.ElementTreeSelectionDialog_nothing_available;
+
+    private IStatus fCurrStatus = new Status(IStatus.OK, PlatformUI.PLUGIN_ID,
+	    IStatus.OK, "", null);
+
+    private List<ViewerFilter> fFilters;
+
+    private Object fInput;
+
+    private boolean fIsEmpty;
+
+    private int fWidth = 60;
+
+    private int fHeight = 18;
+
+    final static String[][] fileExtensions = {
+	    { "jpeg", "jpg", "jpe", "jfif" }, { "gif" }, { "bmp" },
+	    { "tif", "tiff" }, { "png" }, { "ico" } };
+
+    /**
+     * Constructs an instance of <code>ImageSelectionDialog</code>.
+     * 
+     * @param parent
+     *                The parent shell for the dialog
+     * @param labelProvider
+     *                the label provider to render the entries
+     * @param contentProvider
+     *                the content provider to evaluate the tree structure
+     */
+    public ImageSelectionDialog(Shell parent, ILabelProvider labelProvider,
+	    ITreeContentProvider contentProvider) {
+	super(parent);
+
+	fLabelProvider = labelProvider;
+	fContentProvider = contentProvider;
+
+	setResult(new ArrayList<Object>(0));
+	setStatusLineAboveButtons(true);
+
+	int shellStyle = getShellStyle();
+	setShellStyle(shellStyle | SWT.MAX | SWT.RESIZE);
+    }
+
+    /**
+     * Sets the initial selection. Convenience method.
+     * 
+     * @param selection
+     *                the initial selection.
+     */
+    public void setInitialSelection(Object selection) {
+	setInitialSelections(new Object[] { selection });
+    }
+
+    /**
+     * Sets the message to be displayed if the list is empty.
+     * 
+     * @param message
+     *                the message to be displayed.
+     */
+    public void setEmptyListMessage(String message) {
+	fEmptyListMessage = message;
+    }
+
+    /**
+     * Specifies if multiple selection is allowed.
+     * 
+     * @param allowMultiple
+     */
+    public void setAllowMultiple(boolean allowMultiple) {
+	fAllowMultiple = allowMultiple;
+    }
+
+    /**
+     * Specifies if default selected events (double click) are created.
+     * 
+     * @param doubleClickSelects
+     */
+    public void setDoubleClickSelects(boolean doubleClickSelects) {
+	fDoubleClickSelects = doubleClickSelects;
+    }
+
+    /**
+     * Sets the sorter used by the tree viewer.
+     * 
+     * @param sorter
+     * @deprecated as of 3.3, use
+     *             {@link ElementTreeSelectionDialog#setComparator(ViewerComparator)}
+     *             instead
+     */
+    public void setSorter(ViewerSorter sorter) {
+	fComparator = sorter;
+    }
+
+    /**
+     * Sets the comparator used by the tree viewer.
+     * 
+     * @param comparator
+     * @since 3.3
+     */
+    public void setComparator(ViewerComparator comparator) {
+	fComparator = comparator;
+    }
+
+    /**
+     * Adds a filter to the tree viewer.
+     * 
+     * @param filter
+     *                a filter.
+     */
+    public void addFilter(String[] extention) {
+	if (fFilters == null) {
+	    fFilters = new ArrayList<ViewerFilter>(4);
+	}
+
+	fFilters.add(new FileExtensionFilter(extention));
+    }
+
+    /**
+     * Sets an optional validator to check if the selection is valid. The
+     * validator is invoked whenever the selection changes.
+     * 
+     * @param validator
+     *                the validator to validate the selection.
+     */
+    public void setValidator(ISelectionStatusValidator validator) {
+	fValidator = validator;
+    }
+
+    /**
+     * Sets the tree input.
+     * 
+     * @param input
+     *                the tree input.
+     */
+    public void setInput(Object input) {
+	fInput = input;
+    }
+
+    /**
+     * Sets the size of the tree in unit of characters.
+     * 
+     * @param width
+     *                the width of the tree.
+     * @param height
+     *                the height of the tree.
+     */
+    public void setSize(int width, int height) {
+	fWidth = width;
+	fHeight = height;
+    }
+
+    /**
+     * Validate the receiver and update the ok status.
+     * 
+     */
+    protected void updateOKStatus() {
+	if (!fIsEmpty) {
+	    if (fValidator != null) {
+		fCurrStatus = fValidator.validate(getResult());
+		updateStatus(fCurrStatus);
+	    } else {
+		fCurrStatus = new Status(IStatus.OK, PlatformUI.PLUGIN_ID,
+			IStatus.OK, "", null);
+	    }
+	} else {
+	    fCurrStatus = new Status(IStatus.ERROR, PlatformUI.PLUGIN_ID,
+		    IStatus.ERROR, fEmptyListMessage, null);
+	}
+	updateStatus(fCurrStatus);
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see org.eclipse.jface.window.Window#open()
+     */
+    public int open() {
+	fIsEmpty = evaluateIfTreeEmpty(fInput);
+	super.open();
+	return getReturnCode();
+    }
+
+    /**
+     * Handles cancel button pressed event.
+     */
+    protected void cancelPressed() {
+	setResult(null);
+	super.cancelPressed();
+    }
+
+    /*
+     * @see SelectionStatusDialog#computeResult()
+     */
+    protected void computeResult() {
+	setResult(((IStructuredSelection) fViewer.getSelection()).toList());
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see org.eclipse.jface.window.Window#create()
+     */
+    public void create() {
+	BusyIndicator.showWhile(null, new Runnable() {
+	    public void run() {
+		access$superCreate();
+		fViewer.setSelection(new StructuredSelection(
+			getInitialElementSelections()), true);
+		updateOKStatus();
+	    }
+	});
+    }
+
+    /*
+     * @see Dialog#createDialogArea(Composite)
+     */
+    protected Control createDialogArea(Composite parent) {
+
+	final Composite composite = new Composite(parent, SWT.NONE);
+	GridLayout layout = new GridLayout();
+	layout.numColumns = 2;
+	layout.marginHeight = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN);
+	layout.marginWidth = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_MARGIN);
+	layout.verticalSpacing = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_SPACING);
+	layout.horizontalSpacing = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING);
+	composite.setLayout(layout);
+	composite.setLayoutData(new GridData(GridData.FILL_BOTH));
+	super.applyDialogFont(composite);
+
+	Label messageLabel = createMessageArea(composite);
+	new Label(composite, SWT.NONE);
+	TreeViewer treeViewer = createTreeViewer(composite);
+
+	Composite comp = createPreview(composite);
+
+	GridData browserData = new GridData(GridData.FILL_BOTH);
+	browserData.widthHint = convertWidthInCharsToPixels(fWidth / 2);
+	browserData.heightHint = convertHeightInCharsToPixels(fHeight);
+	browserData.minimumWidth = convertWidthInCharsToPixels(fWidth / 2);
+	browserData.minimumHeight = convertHeightInCharsToPixels(fHeight);
+	comp.setLayoutData(browserData);
+
+	GridData data = new GridData(GridData.FILL_BOTH);
+	data.widthHint = convertWidthInCharsToPixels(fWidth);
+	data.heightHint = convertHeightInCharsToPixels(fHeight);
+
+	Tree treeWidget = treeViewer.getTree();
+	treeWidget.setLayoutData(data);
+	treeWidget.setFont(parent.getFont());
+
+	filterCombo = new Combo(composite, SWT.READ_ONLY | SWT.BORDER);
+	filterCombo.setLayoutData(new GridData(GridData.FILL, GridData.CENTER,
+		false, false));
+
+	filterCombo.add(MessageUtil.getString("ALL_FILES"));
+	filterCombo.add(MessageUtil.getString("ALL_IMAGE_FILES"));
+	for (int i = 0; i < fileExtensions.length; i++) {
+	    String[] str = fileExtensions[i];
+	    StringBuffer buf = new StringBuffer();
+	    for (int j = 0; j < str.length; j++) {
+		buf.append("*." + str[j].toUpperCase() + "; ");
+	    }
+	    filterCombo.add(buf.toString());
+	}
+	filterCombo.select(0);
+	filterCombo.addSelectionListener(new SelectionListener() {
+
+	    public void widgetDefaultSelected(SelectionEvent e) {
+	    }
+
+	    public void widgetSelected(SelectionEvent e) {
+		if (fViewer != null) {
+		    ViewerFilter[] filters = fViewer.getFilters();
+		    if (filters != null) {
+			for (int i = 0; i < filters.length; i++) {
+			    fViewer.removeFilter(filters[i]);
+			}
+		    }
+		    if (filterCombo.getSelectionIndex() != 0)
+			if (filterCombo.getSelectionIndex() == 1) {
+			    Set<String> s = new HashSet<String>();
+			    for (int i = 0; i < fileExtensions.length; i++) {
+				String[] tmp = fileExtensions[i];
+				for (int j = 0; j < tmp.length; j++)
+				    s.add(tmp[j]);
+			    }
+			    String[] allExtensions = new String[s.size()];
+			    s.toArray(allExtensions);
+			    fViewer.addFilter(new FileExtensionFilter(
+				    allExtensions));
+
+			} else {
+			    fViewer.addFilter(new FileExtensionFilter(
+				    fileExtensions[filterCombo
+					    .getSelectionIndex() - 2]));
+			}
+		    fViewer.refresh();
+		    if (fViewer.getTree().getItemCount() <= 0) {
+			fIsEmpty = true;
+		    } else {
+			fIsEmpty = false;
+		    }
+		    if (fViewer.getTree().getSelectionCount() <= 0) {
+			file = null;
+			canvas.redraw();
+		    }
+		    updateOKStatus();
+
+		}
+	    }
+	});
+
+	if (fIsEmpty) {
+	    messageLabel.setEnabled(false);
+	    treeWidget.setEnabled(false);
+	}
+	return composite;
+    }
+
+    /**
+     * Creates the tree viewer.
+     * 
+     * @param parent
+     *                the parent composite
+     * @return the tree viewer
+     */
+    protected TreeViewer createTreeViewer(Composite parent) {
+	int style = SWT.BORDER | (fAllowMultiple ? SWT.MULTI : SWT.SINGLE);
+
+	fViewer = new TreeViewer(new Tree(parent, style));
+	fViewer.setContentProvider(fContentProvider);
+	fViewer.setLabelProvider(fLabelProvider);
+	fViewer.addSelectionChangedListener(new ISelectionChangedListener() {
+	    @SuppressWarnings("unchecked")
+	    public void selectionChanged(SelectionChangedEvent event) {
+
+		access$setResult(((IStructuredSelection) event.getSelection())
+			.toList());
+		updateOKStatus();
+
+	    }
+	});
+
+	fViewer.getTree().addSelectionListener(new SelectionListener() {
+
+	    public void widgetDefaultSelected(SelectionEvent e) {
+
+	    }
+
+	    public void widgetSelected(SelectionEvent e) {
+		Object obj = getFirstResult();
+		if (obj instanceof IFile) {
+		    file = (IFile) getFirstResult();
+		} else if (obj instanceof IFolder) {
+		    file = null;
+		}
+		canvas.redraw();
+
+	    }
+
+	});
+
+	fViewer.setComparator(fComparator);
+	if (fFilters != null) {
+	    for (int i = 0; i != fFilters.size(); i++) {
+		fViewer.addFilter(fFilters.get(i));
+	    }
+	}
+
+	if (fDoubleClickSelects) {
+	    Tree tree = fViewer.getTree();
+	    tree.addSelectionListener(new SelectionAdapter() {
+		public void widgetDefaultSelected(SelectionEvent e) {
+		    updateOKStatus();
+		    if (fCurrStatus.isOK()) {
+			access$superButtonPressed(IDialogConstants.OK_ID);
+		    }
+		}
+	    });
+	}
+	fViewer.addDoubleClickListener(new IDoubleClickListener() {
+	    public void doubleClick(DoubleClickEvent event) {
+		updateOKStatus();
+
+		// If it is not OK or if double click does not
+		// select then expand
+		if (!(fDoubleClickSelects && fCurrStatus.isOK())) {
+		    ISelection selection = event.getSelection();
+		    if (selection instanceof IStructuredSelection) {
+			Object item = ((IStructuredSelection) selection)
+				.getFirstElement();
+			if (fViewer.getExpandedState(item)) {
+			    fViewer.collapseToLevel(item, 1);
+			} else {
+			    fViewer.expandToLevel(item, 1);
+			}
+		    }
+		}
+	    }
+	});
+
+	fViewer.setInput(fInput);
+
+	return fViewer;
+    }
+
+    /**
+     * Returns the tree viewer.
+     * 
+     * @return the tree viewer
+     */
+    protected TreeViewer getTreeViewer() {
+	return fViewer;
+    }
+
+    /**
+     * Set the result using the super class implementation of buttonPressed.
+     * 
+     * @param id
+     * @see org.eclipse.jface.dialogs.Dialog#buttonPressed(int)
+     */
+    protected void access$superButtonPressed(int id) {
+	super.buttonPressed(id);
+    }
+
+    /**
+     * Set the result using the super class implementation of setResult.
+     * 
+     * @param result
+     * @see SelectionStatusDialog#setResult(int, Object)
+     */
+    protected void access$setResult(List<Object> result) {
+	super.setResult(result);
+    }
+
+    /**
+     * @see org.eclipse.jface.window.Window#handleShellCloseEvent()
+     */
+    protected void handleShellCloseEvent() {
+	super.handleShellCloseEvent();
+
+	// Handle the closing of the shell by selecting the close icon
+	if (getReturnCode() == CANCEL) {
+	    setResult(null);
+	}
+    }
+
+    private void access$superCreate() {
+	super.create();
+    }
+
+    /**
+     * Create image preview control
+     * 
+     * @param parent
+     * @return composite
+     */
+    private Composite createPreview(Composite parent) {
+	Composite composite = new Composite(parent, SWT.NONE);
+	GridLayout layout = new GridLayout();
+	layout.numColumns = 1;
+	composite.setLayout(layout);
+	composite.setLayoutData(new GridData(GridData.FILL_BOTH));
+
+	Label label = new Label(composite, SWT.NONE);
+	label.setLayoutData(new GridData(GridData.CENTER, GridData.CENTER,
+		false, false));
+	label.setText(MessageUtil.getString("IMAGE_PREVIEW"));
+	canvas = new Canvas(composite, SWT.BORDER);
+
+	GridData browserData = new GridData(GridData.FILL_BOTH);
+	browserData.widthHint = convertWidthInCharsToPixels((fWidth) / 2);
+	browserData.heightHint = convertHeightInCharsToPixels(fHeight);
+	canvas.setLayoutData(browserData);
+
+	resolution = new Text(composite, SWT.READ_ONLY | SWT.CENTER);
+	resolution.setLayoutData(new GridData(GridData.FILL, GridData.CENTER,
+		false, false));
+	resolution.setVisible(false);
+
+	emptyColor = canvas.getForeground();
+
+	canvas.addPaintListener(new PaintListener() {
+	    public void paintControl(PaintEvent e) {
+		GC gc = new GC(canvas);
+		gc.setForeground(emptyColor);
+		gc.fillRectangle(1, 1, canvas.getSize().x - 2,
+			canvas.getSize().y - 2);
+		// resolution.setText("");
+		resolution.setVisible(false);
+		if (file != null) {
+		    Cursor parentCursor = getShell().getCursor();
+		    final Cursor waitCursor = new Cursor(getShell()
+			    .getDisplay(), SWT.CURSOR_WAIT);
+		    Point previewPoint = new Point(0, 0);
+		    Point labelPoint = canvas.getSize();
+		    InputStream stream;
+		    try {
+			getShell().setCursor(waitCursor);
+			stream = new FileInputStream(file.getLocation()
+				.toOSString());
+			ImageData imageData = new ImageData(stream);
+			stream.close();
+			if (imageData != null) {
+			    Image image = new Image(getShell().getDisplay(),
+				    imageData);
+
+			    // set image in center
+			    Point imagePoint = new Point(
+				    image.getBounds().width,
+				    image.getBounds().height);
+
+			    String imageInfo = imagePoint.x + " x "
+				    + imagePoint.y + " px";
+			    // change resolution if image anymore image label
+			    if ((imagePoint.x > labelPoint.x)
+				    || (imagePoint.y > labelPoint.y)) {
+				float ratioImage = (float) imagePoint.x
+					/ (float) imagePoint.y;
+				if (((imagePoint.y > labelPoint.y) && (labelPoint.y
+					* ratioImage > labelPoint.x))
+					|| ((imagePoint.x > labelPoint.x) && (labelPoint.x
+						/ ratioImage < labelPoint.y))) {
+				    imageData = imageData.scaledTo(
+					    labelPoint.x - 10,
+					    (int) (labelPoint.x / ratioImage));
+				} else {
+				    imageData = imageData
+					    .scaledTo(
+						    (int) (labelPoint.y * ratioImage) - 10,
+						    labelPoint.y);
+				}
+				image.dispose();
+				image = new Image(getShell().getDisplay(),
+					imageData);
+				imagePoint.x = image.getBounds().width;
+				imagePoint.y = image.getBounds().height;
+
+			    }
+
+			    previewPoint.x = labelPoint.x / 2 - imagePoint.x
+				    / 2;
+			    previewPoint.y = labelPoint.y / 2 - imagePoint.y
+				    / 2;
+			    gc.drawImage(image, previewPoint.x, previewPoint.y);
+			    resolution.setVisible(true);
+			    resolution.setText(imageInfo);
+			    image.dispose();
+			    gc.dispose();
+			}
+		    } catch (Exception ev) {
+
+		    } finally {
+			getShell().setCursor(parentCursor);
+		    }
+		}
+	    }
+	});
+	return composite;
+    }
+
+    private boolean evaluateIfTreeEmpty(Object input) {
+	Object[] elements = fContentProvider.getElements(input);
+	if (elements.length > 0) {
+	    if (fFilters != null) {
+		for (int i = 0; i < fFilters.size(); i++) {
+		    ViewerFilter curr = fFilters.get(i);
+		    elements = curr.filter(fViewer, input, elements);
+		}
+	    }
+	}
+	return elements.length == 0;
+    }
+
+    /**
+     * Class for creates filter by file extensions
+     * 
+     * @author dsakovich
+     */
+    private class FileExtensionFilter extends ViewerFilter {
+
+	private String[] fTargetExtension;
+
+	public FileExtensionFilter(String[] targetExtension) {
+	    fTargetExtension = targetExtension;
+	}
+
+	public boolean select(Viewer viewer, Object parent, Object element) {
+	    if (element instanceof IFile) {
+		for (int i = 0; i < fTargetExtension.length; i++) {
+		    if (((IFile) element).getName().toLowerCase().endsWith(
+			    "." + fTargetExtension[i])) {
+			return true;
+		    }
+		}
+		return false;
+	    }
+	    if (element instanceof IProject && ((IProject) element).isOpen())
+		return true;
+	    if (element instanceof IContainer) { // i.e. IProject, IFolder
+		try {
+		    IResource[] resources = ((IContainer) element).members();
+		    for (int i = 0; i < resources.length; i++) {
+			if (select(viewer, parent, resources[i]))
+			    return true;
+		    }
+		} catch (CoreException e) {
+		    // TODO Sakovich exception
+		}
+	    }
+	    return false;
+	}
+    }
+
+}

Added: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/common/CSSConstants.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/common/CSSConstants.java	                        (rev 0)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/common/CSSConstants.java	2008-07-16 15:19:39 UTC (rev 9155)
@@ -0,0 +1,39 @@
+/*******************************************************************************
+ * 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.jst.jsp.outline.cssdialog.common;
+
+/**
+ * This class contains CSS constants
+ * 
+ * @author dsakovich at exadel.com
+ * 
+ */
+public class CSSConstants {
+
+    public static final String BACKGROUND_REPEAT = "background-repeat";
+    public static final String BACKGROUND_COLOR = "background-color";
+    public static final String BACKGROUND_IMAGE = "background-image";
+    public static final String BORDER_STYLE = "border-style";
+    public static final String BORDER_WIDTH = "border-width";
+    public static final String WIDTH = "width";
+    public static final String HEIGHT = "height";
+    public static final String BORDER_COLOR = "border-color";
+    public static final String MARGIN = "margin";
+    public static final String PADDING = "padding";
+    public static final String FONT_SIZE = "font-size";
+    public static final String FONT_STYLE = "font-style";
+    public static final String FONT_WEIGHT = "font-weight";
+    public static final String TEXT_DECORATION = "text-decoration";
+    public static final String TEXT_ALIGN = "text-align";
+    public static final String FONT_FAMILY = "font-family";
+    public static final String COLOR = "color";
+
+}

Added: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/common/Constants.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/common/Constants.java	                        (rev 0)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/common/Constants.java	2008-07-16 15:19:39 UTC (rev 9155)
@@ -0,0 +1,70 @@
+/*******************************************************************************
+ * 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.jst.jsp.outline.cssdialog.common;
+
+import org.eclipse.swt.graphics.RGB;
+
+/**
+ * 
+ * Class for constants
+ * 
+ * @author Evgeny Zheleznyakov
+ * 
+ */
+public class Constants {
+
+    public static final String extSizes[] = new String[] { "", "em", "ex",
+	    "px", "in", "cm", "mm", "pt", "pc" };
+
+    public static final String elemFolder[] = new String[] {
+	    "background-image", "list-style-image", "cursor", "cue-after",
+	    "cue-before" };
+
+    public static final String extElem[] = new String[] {
+	    "border-bottom-width", "border-left-width", "borer-right-width",
+	    "border-top-width", "border-width", "bottom", "font-size",
+	    "height", "left", "letter-spacing", "line-height", "margin",
+	    "margin-bottom", "margin-left", "margin-right", "margin-top",
+	    "margin-offset", "margin-bottom", "max-height", "max-width",
+	    "min-height", "min-width", "outline-width", "padding",
+	    "padding-bottom", "padding-left", "padding-right", "padding-top",
+	    "right", "size", "text-indent", "top", "vertical-align", "width",
+	    "word-spacing" };
+
+    public static final String NONE = "none";
+
+    public static final String IMAGE_COLOR_FILE_LOCATION = "images/cssdialog/color.gif";
+    public static final String IMAGE_FOLDER_FILE_LOCATION = "images/cssdialog/folder.gif";
+    public static final String IMAGE_FONT_FILE_LOCATION = "images/cssdialog/font.gif";
+    public static final String IMAGE_COLORLARGE_FILE_LOCATION = "images/cssdialog/color_large.gif";
+    public static final String IMAGE_FOLDERLARGE_FILE_LOCATION = "images/cssdialog/folder_large.gif";
+    public static final String IMAGE_FONTLARGE_FILE_LOCATION = "images/cssdialog/font_large.gif";
+    public static final String IMAGE_LEFT_FILE_LOCATION = "images/cssdialog/left.gif";
+    public static final String IMAGE_RIGHT_FILE_LOCATION = "images/cssdialog/right.gif";
+    public static final String IMAGE_SAMPLE_FILE_LOCATION = "images/cssdialog/sample.gif";
+    
+    public static final int FIRST_COLUMN = 0;
+    public static final int SECOND_COLUMN = 1;
+
+    public static final String EMPTY_STRING = "";
+    
+    public static final RGB RGB_BLACK = new RGB(0,0,0);
+    public static final RGB RGB_WHITE = new RGB(0xFF, 0xFF, 0xFF);
+
+    public static final int DONT_CONTAIN = -1;
+    
+    public static String OPEN_SPAN_TAG = "<span style=\"width: 100%;";
+    public static String CLOSE_SPAN_TAG = "</span>";
+    public static String TEXT_FOR_PREVIEW = "\">Text for preview";
+    
+    public static String COLON_STRING = ":";
+    public static String SEMICOLON_STRING = ";";
+}
\ No newline at end of file

Added: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/common/ImageCombo.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/common/ImageCombo.java	                        (rev 0)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/common/ImageCombo.java	2008-07-16 15:19:39 UTC (rev 9155)
@@ -0,0 +1,1093 @@
+/*******************************************************************************
+ * 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.jst.jsp.outline.cssdialog.common;
+
+import java.util.Arrays;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.SWTException;
+import org.eclipse.swt.events.DisposeEvent;
+import org.eclipse.swt.events.DisposeListener;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.GC;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.ImageData;
+import org.eclipse.swt.graphics.PaletteData;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.RGB;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Listener;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Table;
+import org.eclipse.swt.widgets.TableItem;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.swt.widgets.TypedListener;
+import org.eclipse.swt.widgets.Widget;
+
+/**
+ * The ImageCombo Combo-Widget class with images represents a selectable user
+ * interface object that combines a text field and a list and issues
+ * notification when an item is selected from the list.
+ * 
+ * @author dsakovich at exadel.com
+ * 
+ */
+public final class ImageCombo extends Composite {
+
+    private static final boolean gtk = "gtk".equals(SWT.getPlatform());
+    private boolean dontDrop = false;
+    private int visibleItemCount = 10;
+
+    private Text text;
+    private Table table;
+    private Shell popup;
+    private Button arrowButton;
+
+    private boolean hasFocus;
+
+    private Listener listener, filter;
+  
+    private static final int X = 0;
+    private static final int Y = 0;
+    private static final int WIDTH = 20;
+    private static final int HEIGHT = 15;
+    private static final int DEPTH = 1;
+    private static final String SPACE = " ";
+    private static final int DEFAULT_SELECTION = -1;
+
+    /**
+     * Constructs a new instance of this class given its parent and a style
+     * value describing its behavior and appearance.
+     * <p>
+     * The style value is either one of the style constants defined in class
+     * <code>SWT</code> which is applicable to instances of this class, or
+     * must be built by <em>bitwise OR</em>'ing together (that is, using the
+     * <code>int</code> "|" operator) two or more of those <code>SWT</code>
+     * style constants. The class description lists the style constants that are
+     * applicable to the class. Style bits are also inherited from superclasses.
+     * </p>
+     * 
+     * @param parent
+     *                a widget which will be the parent of the new instance
+     *                (cannot be null)
+     * @param style
+     *                the style of widget to construct
+     * 
+     * @exception IllegalArgumentException
+     *                    <ul>
+     *                    <li>ERROR_NULL_ARGUMENT - if the parent is null</li>
+     *                    </ul>
+     * @exception SWTException
+     *                    <ul>
+     *                    <li>ERROR_THREAD_INVALID_ACCESS - if not called from
+     *                    the thread that created the parent</li>
+     *                    </ul>
+     * 
+     * @see SWT#BORDER
+     * @see SWT#READ_ONLY
+     * @see SWT#FLAT
+     * @see Widget#getStyle()
+     */
+    public ImageCombo(Composite parent, int style) {
+	super(parent, style = checkStyle(style));
+	int textStyle = SWT.SINGLE;
+	if (gtk)
+	    textStyle |= SWT.BORDER;
+	if ((style & SWT.READ_ONLY) != 0)
+	    textStyle |= SWT.READ_ONLY;
+	if ((style & SWT.FLAT) != 0)
+	    textStyle |= SWT.FLAT;
+	text = new Text(this, textStyle);
+	int arrowStyle = SWT.ARROW | SWT.DOWN;
+	if ((style & SWT.FLAT) != 0)
+	    arrowStyle |= SWT.FLAT;
+	arrowButton = new Button(this, arrowStyle);
+	listener = new Listener() {
+	    public void handleEvent(Event event) {
+		if (popup == event.widget) {
+		    popupEvent(event);
+		    return;
+		}
+		if (text == event.widget) {
+		    textEvent(event);
+		    return;
+		}
+		if (table == event.widget) {
+		    listEvent(event);
+		    return;
+		}
+		if (arrowButton == event.widget) {
+		    arrowEvent(event);
+		    return;
+		}
+		if (ImageCombo.this == event.widget) {
+		    comboEvent(event);
+		    return;
+		}
+		if (getShell() == event.widget) {
+		    handleFocus(SWT.FocusOut);
+		}
+	    }
+	};
+	filter = new Listener() {
+	    public void handleEvent(Event event) {
+		Shell shell = ((Control) event.widget).getShell();
+		if (shell == ImageCombo.this.getShell()) {
+		    handleFocus(SWT.FocusOut);
+		}
+	    }
+	};
+
+	int[] comboEvents = { SWT.Dispose, SWT.Move, SWT.Resize };
+	for (int i = 0; i < comboEvents.length; i++)
+	    this.addListener(comboEvents[i], listener);
+
+	int[] textEvents = { SWT.KeyDown, SWT.KeyUp, SWT.Modify, SWT.MouseDown,
+		SWT.MouseUp, SWT.Traverse, SWT.FocusIn };
+	for (int i = 0; i < textEvents.length; i++)
+	    text.addListener(textEvents[i], listener);
+
+	int[] arrowEvents = { SWT.Selection, SWT.FocusIn };
+	for (int i = 0; i < arrowEvents.length; i++)
+	    arrowButton.addListener(arrowEvents[i], listener);
+	createPopup(DEFAULT_SELECTION);
+   }
+
+    /**
+     * 
+     * @param style
+     * @return
+     */
+    static int checkStyle(int style) {
+	int mask = gtk ? SWT.READ_ONLY | SWT.FLAT | SWT.LEFT_TO_RIGHT
+		| SWT.RIGHT_TO_LEFT : SWT.BORDER | SWT.READ_ONLY | SWT.FLAT
+		| SWT.LEFT_TO_RIGHT | SWT.RIGHT_TO_LEFT;
+	return style & mask;
+    }
+
+    /**
+     * Adds the argument to the end of the receiver's list.
+     * 
+     * @param string
+     *                the new item
+     * 
+     * @param image
+     *                image for the item
+     * 
+     * @exception IllegalArgumentException
+     *                    <ul>
+     *                    <li>ERROR_NULL_ARGUMENT - if the string is null</li>
+     *                    </ul>
+     * @exception SWTException
+     *                    <ul>
+     *                    <li>ERROR_WIDGET_DISPOSED - if the receiver has been
+     *                    disposed</li>
+     *                    <li>ERROR_THREAD_INVALID_ACCESS - if not called from
+     *                    the thread that created the receiver</li>
+     *                    </ul>
+     * 
+     * @see #add(String,int)
+     */
+    public void add(String string, Image image) {
+	checkWidget();
+	if (string == null)
+	    SWT.error(SWT.ERROR_NULL_ARGUMENT);
+	TableItem newItem = new TableItem(this.table, SWT.NONE);
+
+	newItem.setText(string);
+	if (image != null)
+	    newItem.setImage(image);
+	newItem.addDisposeListener(new DisposeListener() {
+	    public void widgetDisposed(DisposeEvent e) {
+		TableItem item = (TableItem) e.getSource();
+		item.getImage().dispose();
+	    }
+	});
+    }
+
+    /**
+     * Adds the argument to the receiver's list at the given zero-relative
+     * index.
+     * <p>
+     * Note: To add an item at the end of the list, use the result of calling
+     * <code>getItemCount()</code> as the index or use
+     * <code>add(String)</code>.
+     * </p>
+     * 
+     * @param string
+     *                the new item
+     * 
+     * @param image
+     *                image for the item
+     * 
+     * @param index
+     *                the index for the item
+     * 
+     * @exception IllegalArgumentException
+     *                    <ul>
+     *                    <li>ERROR_NULL_ARGUMENT - if the string is null</li>
+     *                    <li>ERROR_INVALID_RANGE - if the index is not between
+     *                    0 and the number of elements in the list (inclusive)</li>
+     *                    </ul>
+     * @exception SWTException
+     *                    <ul>
+     *                    <li>ERROR_WIDGET_DISPOSED - if the receiver has been
+     *                    disposed</li>
+     *                    <li>ERROR_THREAD_INVALID_ACCESS - if not called from
+     *                    the thread that created the receiver</li>
+     *                    </ul>
+     * 
+     * @see #add(String)
+     */
+    public void add(String string, Image image, int index) {
+	checkWidget();
+	if (string == null)
+	    SWT.error(SWT.ERROR_NULL_ARGUMENT);
+	TableItem newItem = new TableItem(this.table, SWT.NONE, index);
+	if (image != null) {
+	    newItem.setImage(image);
+	    newItem.addDisposeListener(new DisposeListener() {
+		public void widgetDisposed(DisposeEvent e) {
+		    TableItem item = (TableItem) e.getSource();
+		    item.getImage().dispose();
+		}
+	    });
+	}
+
+    }
+
+    /**
+     * Adds the argument to the end of the receiver's list.
+     * 
+     * @param string
+     *                the new item
+     * @param rgb
+     *                RGB color image for the item
+     * 
+     * 
+     * @exception IllegalArgumentException
+     *                    <ul>
+     *                    <li>ERROR_NULL_ARGUMENT - if the string is null</li>
+     *                    </ul>
+     * @exception SWTException
+     *                    <ul>
+     *                    <li>ERROR_WIDGET_DISPOSED - if the receiver has been
+     *                    disposed</li>
+     *                    <li>ERROR_THREAD_INVALID_ACCESS - if not called from
+     *                    the thread that created the receiver</li>
+     *                    </ul>
+     * 
+     * @see #add(String,int)
+     */
+    public void add(String string, RGB rgb) {
+	Color white = new Color(getDisplay(), Constants.RGB_WHITE);
+	Color black = new Color(getDisplay(), Constants.RGB_BLACK);
+	Color color = new Color(getDisplay(), rgb);
+
+	Image image = new Image(getDisplay(), WIDTH, HEIGHT);
+	GC gc = new GC(image);
+	gc.setBackground(color);
+	gc.fillRectangle(X, Y, WIDTH, HEIGHT);
+	gc.setBackground(black);
+	gc.drawRectangle(X, Y, WIDTH, HEIGHT);
+	gc.dispose();
+	ImageData imageData = image.getImageData();
+	image.dispose();
+	color.dispose();
+
+	PaletteData palette = new PaletteData(new RGB[] { Constants.RGB_BLACK,
+		Constants.RGB_WHITE, });
+	ImageData maskData = new ImageData(WIDTH, HEIGHT, DEPTH, palette);
+	Image mask = new Image(getDisplay(), maskData);
+	gc = new GC(mask);
+	gc.setBackground(black);
+	gc.fillRectangle(X, Y, WIDTH, HEIGHT);
+	gc.setBackground(white);
+	gc.fillRectangle(X, Y, WIDTH, HEIGHT);
+	gc.dispose();
+	maskData = mask.getImageData();
+	mask.dispose();
+
+	Image icon = new Image(getDisplay(), imageData, maskData);
+	color.dispose();
+	black.dispose();
+	white.dispose();
+	add(string, icon);
+    }
+
+    /**
+     * Adds the listener to the collection of listeners who will be notified
+     * when the receiver's text is modified, by sending it one of the messages
+     * defined in the <code>ModifyListener</code> interface.
+     * 
+     * @param listener
+     *                the listener which should be notified
+     * 
+     * @exception IllegalArgumentException
+     *                    <ul>
+     *                    <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+     *                    </ul>
+     * @exception SWTException
+     *                    <ul>
+     *                    <li>ERROR_WIDGET_DISPOSED - if the receiver has been
+     *                    disposed</li>
+     *                    <li>ERROR_THREAD_INVALID_ACCESS - if not called from
+     *                    the thread that created the receiver</li>
+     *                    </ul>
+     * 
+     * @see ModifyListener
+     * @see #removeModifyListener
+     */
+    public void addModifyListener(ModifyListener listener) {
+	checkWidget();
+	if (listener == null)
+	    SWT.error(SWT.ERROR_NULL_ARGUMENT);
+	TypedListener typedListener = new TypedListener(listener);
+	addListener(SWT.Modify, typedListener);
+    }
+
+    /**
+     * Adds the listener to the collection of listeners who will be notified
+     * when the receiver's selection changes, by sending it one of the messages
+     * defined in the <code>SelectionListener</code> interface.
+     * <p>
+     * <code>widgetSelected</code> is called when the combo's list selection
+     * changes. <code>widgetDefaultSelected</code> is typically called when
+     * ENTER is pressed the combo's text area.
+     * </p>
+     * 
+     * @param listener
+     *                the listener which should be notified
+     * 
+     * @exception IllegalArgumentException
+     *                    <ul>
+     *                    <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+     *                    </ul>
+     * @exception SWTException
+     *                    <ul>
+     *                    <li>ERROR_WIDGET_DISPOSED - if the receiver has been
+     *                    disposed</li>
+     *                    <li>ERROR_THREAD_INVALID_ACCESS - if not called from
+     *                    the thread that created the receiver</li>
+     *                    </ul>
+     * 
+     * @see SelectionListener
+     * @see #removeSelectionListener
+     * @see SelectionEvent
+     */
+    public void addSelectionListener(SelectionListener listener) {
+	checkWidget();
+	if (listener == null)
+	    SWT.error(SWT.ERROR_NULL_ARGUMENT);
+	TypedListener typedListener = new TypedListener(listener);
+	addListener(SWT.Selection, typedListener);
+	addListener(SWT.DefaultSelection, typedListener);
+    }
+
+    /**
+     * 
+     * @param event
+     */
+    void arrowEvent(Event event) {
+	switch (event.type) {
+	case SWT.FocusIn: {
+	    if (gtk) {
+		setFocus();
+		return;
+	    }
+	    handleFocus(SWT.FocusIn);
+	    break;
+	}
+	case SWT.Selection: {
+	    if (gtk) {
+		if (!dontDrop) {
+		    dropDown(!isDropped());
+		}
+		dontDrop = false;
+	    } else {
+		dropDown(!isDropped());
+	    }
+	    break;
+	}
+	}
+    }
+
+    /**
+     * 
+     * @param event
+     */
+    void comboEvent(Event event) {
+	switch (event.type) {
+	case SWT.Dispose:
+	    if (popup != null && !popup.isDisposed()) {
+		table.removeListener(SWT.Dispose, listener);
+		popup.dispose();
+	    }
+	    Shell shell = getShell();
+	    shell.removeListener(SWT.Deactivate, listener);
+	    Display display = getDisplay();
+	    display.removeFilter(SWT.FocusIn, filter);
+	    popup = null;
+	    text = null;
+	    table = null;
+	    arrowButton = null;
+	    break;
+	case SWT.Move:
+	    dropDown(false);
+	    break;
+	case SWT.Resize:
+	    internalLayout(false);
+	    break;
+	}
+    }
+
+    /**
+     * Method for computing size for widget
+     * 
+     * @param wHint
+     *                width
+     * @param hHint
+     *                height
+     * @return Point
+     */
+    public Point computeSize(int wHint, int hHint, boolean changed) {
+	checkWidget();
+	int width = 0, height = 0;
+	String[] items = getStringsFromTable();
+	int textWidth = 0;
+	GC gc = new GC(text);
+	int spacer = gc.stringExtent(SPACE).x;
+	for (int i = 0; i < items.length; i++) {
+	    textWidth = Math.max(gc.stringExtent(items[i]).x, textWidth);
+	}
+	gc.dispose();
+	Point textSize = text.computeSize(SWT.DEFAULT, SWT.DEFAULT, changed);
+	Point arrowSize = arrowButton.computeSize(SWT.DEFAULT, SWT.DEFAULT,
+		changed);
+	Point listSize = table.computeSize(wHint, SWT.DEFAULT, changed);
+	int borderWidth = getBorderWidth();
+
+	height = Math.max(hHint, Math.max(textSize.y, arrowSize.y) + 2
+		* borderWidth);
+	width = Math.max(wHint, Math.max(textWidth + 2 * spacer + arrowSize.x
+		+ 2 * borderWidth, listSize.x));
+	return new Point(width, height);
+    }
+
+    /**
+     * Method for creating popup table
+     * 
+     * @param selectionIndex
+     */
+    void createPopup(int selectionIndex) {
+	// create shell and list
+	popup = new Shell(getShell(), SWT.NO_TRIM | SWT.ON_TOP);
+	int style = getStyle();
+	int listStyle = SWT.SINGLE | SWT.V_SCROLL;
+	if ((style & SWT.FLAT) != 0)
+	    listStyle |= SWT.FLAT;
+	if ((style & SWT.RIGHT_TO_LEFT) != 0)
+	    listStyle |= SWT.RIGHT_TO_LEFT;
+	if ((style & SWT.LEFT_TO_RIGHT) != 0)
+	    listStyle |= SWT.LEFT_TO_RIGHT;
+	// create a table instead of a list.
+	table = new Table(popup, listStyle);
+	table.setToolTipText(MessageUtil
+		.getString("IMAGE_COMBO_TABLE_TOOL_TIP"));
+
+	int[] popupEvents = { SWT.Close, SWT.Paint, SWT.Deactivate };
+	for (int i = 0; i < popupEvents.length; i++)
+	    popup.addListener(popupEvents[i], listener);
+	int[] listEvents = { SWT.Traverse, SWT.MouseDoubleClick, SWT.KeyDown,
+		SWT.KeyUp, SWT.FocusIn, SWT.Dispose };
+	for (int i = 0; i < listEvents.length; i++)
+	    table.addListener(listEvents[i], listener);
+
+	if (selectionIndex != -1)
+	    table.setSelection(selectionIndex);
+    }
+
+    /**
+     * 
+     * @param drop
+     */
+    void dropDown(boolean drop) {
+	if (drop == isDropped())
+	    return;
+	if (!drop) {
+	    popup.setVisible(false);
+	    if (!isDisposed() && arrowButton.isFocusControl()) {
+		text.setFocus();
+	    }
+	    return;
+	}
+
+	if (getShell() != popup.getParent()) {
+	    int selectionIndex = table.getSelectionIndex();
+	    table.removeListener(SWT.Dispose, listener);
+	    popup.dispose();
+	    popup = null;
+	    table = null;
+	    createPopup(selectionIndex);
+	}
+
+	Point size = getSize();
+	int itemCount = table.getItemCount();
+	itemCount = (itemCount == 0) ? visibleItemCount : Math.min(
+		visibleItemCount, itemCount);
+	int itemHeight = table.getItemHeight() * itemCount;
+	Point listSize = table.computeSize(SWT.DEFAULT, itemHeight, false);
+	table.setBounds(1, 1, Math.max(size.x - 2, listSize.x), listSize.y);
+
+	int index = table.getSelectionIndex();
+	if (index != -1)
+	    table.setTopIndex(index);
+	Display display = getDisplay();
+	Rectangle listRect = table.getBounds();
+	Rectangle parentRect = display.map(getParent(), null, getBounds());
+	Point comboSize = getSize();
+	Rectangle displayRect = getMonitor().getClientArea();
+	int width = Math.max(comboSize.x, listRect.width + 2);
+	int height = listRect.height + 2;
+	int x = parentRect.x;
+	int y = parentRect.y + comboSize.y;
+	if (y + height > displayRect.y + displayRect.height)
+	    y = parentRect.y - height;
+	popup.setBounds(x, y, width, height);
+	popup.setVisible(true);
+	table.setFocus();
+    }
+
+    /**
+     * Returns the number of items contained in the receiver's list.
+     * 
+     * @return the number of items
+     * 
+     * @exception SWTException
+     *                    <ul>
+     *                    <li>ERROR_WIDGET_DISPOSED - if the receiver has been
+     *                    disposed</li>
+     *                    <li>ERROR_THREAD_INVALID_ACCESS - if not called from
+     *                    the thread that created the receiver</li>
+     *                    </ul>
+     */
+    public int getItemCount() {
+	checkWidget();
+	return table.getItemCount();
+    }
+
+    String[] getStringsFromTable() {
+	String[] items = new String[this.table.getItems().length];
+	for (int i = 0, n = items.length; i < n; i++) {
+	    items[i] = this.table.getItem(i).getText();
+	}
+	return items;
+    }
+
+    /**
+     * Returns the zero-relative index of the item which is currently selected
+     * in the receiver's list, or -1 if no item is selected.
+     * 
+     * @return the index of the selected item
+     * 
+     * @exception SWTException
+     *                    <ul>
+     *                    <li>ERROR_WIDGET_DISPOSED - if the receiver has been
+     *                    disposed</li>
+     *                    <li>ERROR_THREAD_INVALID_ACCESS - if not called from
+     *                    the thread that created the receiver</li>
+     *                    </ul>
+     */
+    public int getSelectionIndex() {
+	checkWidget();
+	return table.getSelectionIndex();
+    }
+
+    /**
+     * Method for getting widget style
+     */
+    public int getStyle() {
+	int style = super.getStyle();
+	style &= ~SWT.READ_ONLY;
+	if (!text.getEditable())
+	    style |= SWT.READ_ONLY;
+	return style;
+    }
+
+    /**
+     * Returns a string containing a copy of the contents of the receiver's text
+     * field.
+     * 
+     * @return the receiver's text
+     * 
+     * @exception SWTException
+     *                    <ul>
+     *                    <li>ERROR_WIDGET_DISPOSED - if the receiver has been
+     *                    disposed</li>
+     *                    <li>ERROR_THREAD_INVALID_ACCESS - if not called from
+     *                    the thread that created the receiver</li>
+     *                    </ul>
+     */
+    public String getText() {
+	checkWidget();
+	return text.getText();
+    }
+
+    /**
+     * 
+     * @param type
+     */
+    void handleFocus(int type) {
+	if (isDisposed())
+	    return;
+	switch (type) {
+	case SWT.FocusIn: {
+	    if (hasFocus)
+		return;
+	    hasFocus = true;
+	    Shell shell = getShell();
+	    shell.removeListener(SWT.Deactivate, listener);
+	    shell.addListener(SWT.Deactivate, listener);
+	    Display display = getDisplay();
+	    display.removeFilter(SWT.FocusIn, filter);
+	    display.addFilter(SWT.FocusIn, filter);
+	    Event e = new Event();
+	    notifyListeners(SWT.FocusIn, e);
+	    break;
+	}
+	case SWT.FocusOut: {
+	    if (!hasFocus)
+		return;
+	    Control focusControl = getDisplay().getFocusControl();
+	    if (focusControl == arrowButton || focusControl == table
+		    || focusControl == text)
+		return;
+	    hasFocus = false;
+	    Shell shell = getShell();
+	    shell.removeListener(SWT.Deactivate, listener);
+	    Display display = getDisplay();
+	    display.removeFilter(SWT.FocusIn, filter);
+	    Event e = new Event();
+	    notifyListeners(SWT.FocusOut, e);
+	    break;
+	}
+	}
+    }
+
+    /**
+     * Searches the receiver's list starting at the first item (index 0) until
+     * an item is found that is equal to the argument, and returns the index of
+     * that item. If no item is found, returns -1.
+     * 
+     * @param string
+     *                the search item
+     * @return the index of the item
+     * 
+     * @exception IllegalArgumentException
+     *                    <ul>
+     *                    <li>ERROR_NULL_ARGUMENT - if the string is null</li>
+     *                    </ul>
+     * @exception SWTException
+     *                    <ul>
+     *                    <li>ERROR_WIDGET_DISPOSED - if the receiver has been
+     *                    disposed</li>
+     *                    <li>ERROR_THREAD_INVALID_ACCESS - if not called from
+     *                    the thread that created the receiver</li>
+     *                    </ul>
+     */
+    public int indexOf(String string) {
+	checkWidget();
+	if (string == null)
+	    SWT.error(SWT.ERROR_NULL_ARGUMENT);
+	return Arrays.asList(getStringsFromTable()).indexOf(string);
+    }
+
+    /**
+     * 
+     * @return
+     */
+    boolean isDropped() {
+	return popup.getVisible();
+    }
+
+    /**
+     * 
+     * @param changed
+     */
+    void internalLayout(boolean changed) {
+	if (isDropped())
+	    dropDown(false);
+	Rectangle rect = getClientArea();
+	int width = rect.width;
+	int height = rect.height;
+	Point arrowSize = arrowButton.computeSize(SWT.DEFAULT, height, changed);
+	text.setBounds(0, 0, width - arrowSize.x, height);
+	arrowButton.setBounds(width - arrowSize.x, 0, arrowSize.x, arrowSize.y);
+    }
+
+    /**
+     * 
+     * @param event
+     */
+    void listEvent(Event event) {
+	switch (event.type) {
+	case SWT.Dispose:
+	    if (getShell() != popup.getParent()) {
+		int selectionIndex = table.getSelectionIndex();
+		popup = null;
+		table = null;
+		createPopup(selectionIndex);
+	    }
+	    break;
+	case SWT.FocusIn: {
+	    handleFocus(SWT.FocusIn);
+	    break;
+	}
+	case SWT.MouseDoubleClick: {
+	    int index = table.getSelectionIndex();
+	    if (index == -1)
+		return;
+	    text.setText(table.getItem(index).getText());
+	    table.setSelection(index);
+	    Event e = new Event();
+	    e.time = event.time;
+	    e.stateMask = event.stateMask;
+	    e.doit = event.doit;
+	    notifyListeners(SWT.Selection, e);
+	    event.doit = e.doit;
+	    dropDown(false);
+	    break;
+	}
+	case SWT.Traverse: {
+	    switch (event.detail) {
+	    case SWT.TRAVERSE_RETURN:
+	    case SWT.TRAVERSE_ESCAPE:
+	    case SWT.TRAVERSE_ARROW_PREVIOUS:
+	    case SWT.TRAVERSE_ARROW_NEXT:
+		event.doit = false;
+		break;
+	    }
+	    Event e = new Event();
+	    e.time = event.time;
+	    e.detail = event.detail;
+	    e.doit = event.doit;
+	    e.character = event.character;
+	    e.keyCode = event.keyCode;
+	    notifyListeners(SWT.Traverse, e);
+	    event.doit = e.doit;
+	    event.detail = e.detail;
+	    break;
+	}
+	case SWT.KeyUp: {
+	    Event e = new Event();
+	    e.time = event.time;
+	    e.character = event.character;
+	    e.keyCode = event.keyCode;
+	    e.stateMask = event.stateMask;
+	    notifyListeners(SWT.KeyUp, e);
+	    break;
+	}
+	case SWT.KeyDown: {
+	    if (event.character == SWT.ESC) {
+		// Escape key cancels popup list
+		dropDown(false);
+	    }
+	    if ((event.stateMask & SWT.ALT) != 0
+		    && (event.keyCode == SWT.ARROW_UP || event.keyCode == SWT.ARROW_DOWN)) {
+		dropDown(false);
+	    }
+	    if (event.character == SWT.CR) {
+		// Enter causes default selection
+		dropDown(false);
+		Event e = new Event();
+		e.time = event.time;
+		e.stateMask = event.stateMask;
+		notifyListeners(SWT.DefaultSelection, e);
+	    }
+	    if (isDisposed())
+		break;
+	    Event e = new Event();
+	    e.time = event.time;
+	    e.character = event.character;
+	    e.keyCode = event.keyCode;
+	    e.stateMask = event.stateMask;
+	    notifyListeners(SWT.KeyDown, e);
+	    int index = table.getSelectionIndex();
+	    if (index == -1)
+		return;
+	    text.setText(table.getItem(index).getText());
+	    table.setSelection(index);
+	    break;
+	}
+	}
+    }
+
+    /**
+     * 
+     * @param event
+     */
+    void popupEvent(Event event) {
+	switch (event.type) {
+	case SWT.Paint:
+	    // draw black rectangle around list
+	    Rectangle listRect = table.getBounds();
+	    Color black = getDisplay().getSystemColor(SWT.COLOR_BLACK);
+	    event.gc.setForeground(black);
+	    event.gc.drawRectangle(X, Y, listRect.width + 1,
+		    listRect.height + 1);
+	    break;
+	case SWT.Close:
+	    event.doit = false;
+	    dropDown(false);
+	    break;
+	case SWT.Deactivate:
+	    // when the popup shell is deactivated by clicking the button,
+	    // we receive two Deactivate events on Win32, whereas on GTK
+	    // we first receive one Deactivation event from the shell and
+	    // then a Selection event from the button.
+	    // as a work-around, set a flag (dontDrop) if running GTK
+	    if (gtk) {
+		Point loc = arrowButton.toControl(getDisplay()
+			.getCursorLocation());
+		Point size = arrowButton.getSize();
+		if ((loc.x >= 0) && (loc.y >= 0) && (loc.x < size.x)
+			&& (loc.y < size.y)) {
+		    dontDrop = true;
+		}
+	    }
+	    dropDown(false);
+	    break;
+	}
+    }
+
+    /**
+     * Method for redrawing widget
+     */
+    public void redraw() {
+	super.redraw();
+	text.redraw();
+	arrowButton.redraw();
+	if (popup.isVisible())
+	    table.redraw();
+    }
+
+    /**
+     * Selects the item at the given zero-relative index in the receiver's list.
+     * If the item at the index was already selected, it remains selected.
+     * Indices that are out of range are ignored.
+     * 
+     * @param index
+     *                the index of the item to select
+     * 
+     * @exception SWTException
+     *                    <ul>
+     *                    <li>ERROR_WIDGET_DISPOSED - if the receiver has been
+     *                    disposed</li>
+     *                    <li>ERROR_THREAD_INVALID_ACCESS - if not called from
+     *                    the thread that created the receiver</li>
+     *                    </ul>
+     */
+    public void select(int index) {
+	checkWidget();
+	if (index == -1) {
+	    table.deselectAll();
+	    text.setText(Constants.EMPTY_STRING);
+	    return;
+	}
+	if (0 <= index && index < table.getItemCount()) {
+	    if (index != getSelectionIndex()) {
+		text.setText(table.getItem(index).getText());
+		text.selectAll();
+		table.select(index);
+		table.showSelection();
+	    }
+	}
+    }
+
+    /**
+     * Method for setting focus in text widget
+     */
+    public boolean setFocus() {
+	checkWidget();
+	return text.setFocus();
+    }
+
+    /**
+     * Sets the contents of the receiver's text field to the given string.
+     * <p>
+     * Note: The text field in a <code>Combo</code> is typically only capable
+     * of displaying a single line of text. Thus, setting the text to a string
+     * containing line breaks or other special characters will probably cause it
+     * to display incorrectly.
+     * </p>
+     * 
+     * @param string
+     *                the new text
+     * 
+     * @exception IllegalArgumentException
+     *                    <ul>
+     *                    <li>ERROR_NULL_ARGUMENT - if the string is null</li>
+     *                    </ul>
+     * @exception SWTException
+     *                    <ul>
+     *                    <li>ERROR_WIDGET_DISPOSED - if the receiver has been
+     *                    disposed</li>
+     *                    <li>ERROR_THREAD_INVALID_ACCESS - if not called from
+     *                    the thread that created the receiver</li>
+     *                    </ul>
+     */
+    public void setText(String string) {
+	checkWidget();
+	if (string == null)
+	    SWT.error(SWT.ERROR_NULL_ARGUMENT);
+	int index = -1;
+	for (int i = 0, n = table.getItemCount(); i < n; i++) {
+	    if (table.getItem(i).getText().equals(string)) {
+		index = i;
+		break;
+	    }
+	}
+	if (index == -1) {
+	    table.deselectAll();
+	    text.setText(string);
+	    return;
+	}
+	text.setText(string);
+	text.selectAll();
+	table.setSelection(index);
+	table.showSelection();
+    }
+
+    /**
+     * 
+     * @param event
+     */
+    void textEvent(Event event) {
+	switch (event.type) {
+	case SWT.FocusIn: {
+	    handleFocus(SWT.FocusIn);
+	    break;
+	}
+	case SWT.KeyDown: {
+	    if (event.character == SWT.CR) {
+		dropDown(false);
+		Event e = new Event();
+		e.time = event.time;
+		e.stateMask = event.stateMask;
+		notifyListeners(SWT.DefaultSelection, e);
+	    }
+	    if (isDisposed())
+		break;
+
+	    if (event.keyCode == SWT.ARROW_UP
+		    || event.keyCode == SWT.ARROW_DOWN) {
+		event.doit = false;
+		if ((event.stateMask & SWT.ALT) != 0) {
+		    boolean dropped = isDropped();
+		    text.selectAll();
+		    if (!dropped)
+			setFocus();
+		    dropDown(!dropped);
+		    break;
+		}
+
+		int oldIndex = getSelectionIndex();
+		if (event.keyCode == SWT.ARROW_UP) {
+		    select(Math.max(oldIndex - 1, 0));
+		} else {
+		    select(Math.min(oldIndex + 1, getItemCount() - 1));
+		}
+		if (oldIndex != getSelectionIndex()) {
+		    Event e = new Event();
+		    e.time = event.time;
+		    e.stateMask = event.stateMask;
+		    notifyListeners(SWT.Selection, e);
+		}
+		if (isDisposed())
+		    break;
+	    }
+
+	    Event e = new Event();
+	    e.time = event.time;
+	    e.character = event.character;
+	    e.keyCode = event.keyCode;
+	    e.stateMask = event.stateMask;
+	    notifyListeners(SWT.KeyDown, e);
+	    break;
+	}
+	case SWT.KeyUp: {
+	    Event e = new Event();
+	    e.time = event.time;
+	    e.character = event.character;
+	    e.keyCode = event.keyCode;
+	    e.stateMask = event.stateMask;
+	    notifyListeners(SWT.KeyUp, e);
+	    break;
+	}
+	case SWT.Modify: {
+	    table.deselectAll();
+	    Event e = new Event();
+	    e.time = event.time;
+	    notifyListeners(SWT.Modify, e);
+	    break;
+	}
+	case SWT.MouseDown: {
+	    if (event.button != 1)
+		return;
+	    if (text.getEditable())
+		return;
+	    boolean dropped = isDropped();
+	    text.selectAll();
+	    if (!dropped)
+		setFocus();
+	    dropDown(!dropped);
+	    break;
+	}
+	case SWT.MouseUp: {
+	    if (event.button != 1)
+		return;
+	    if (text.getEditable())
+		return;
+	    text.selectAll();
+	    break;
+	}
+	case SWT.Traverse: {
+	    switch (event.detail) {
+	    case SWT.TRAVERSE_RETURN:
+	    case SWT.TRAVERSE_ARROW_PREVIOUS:
+	    case SWT.TRAVERSE_ARROW_NEXT:
+		event.doit = false;
+		break;
+	    }
+
+	    Event e = new Event();
+	    e.time = event.time;
+	    e.detail = event.detail;
+	    e.doit = event.doit;
+	    e.character = event.character;
+	    e.keyCode = event.keyCode;
+	    notifyListeners(SWT.Traverse, e);
+	    event.doit = e.doit;
+	    event.detail = e.detail;
+	    break;
+	}
+	}
+    }
+ 
+}

Added: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/common/MessageUtil.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/common/MessageUtil.java	                        (rev 0)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/common/MessageUtil.java	2008-07-16 15:19:39 UTC (rev 9155)
@@ -0,0 +1,60 @@
+/*******************************************************************************
+ * 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.jst.jsp.outline.cssdialog.common;
+
+import java.text.MessageFormat;
+import java.util.MissingResourceException;
+import java.util.ResourceBundle;
+
+/**
+ * Utility class which helps with managing messages.
+ * 
+ * @author dsakovich at exadel.com
+ */
+public class MessageUtil {
+
+    private static final String RESOURCE_BUNDLE = "org.jboss.tools.jst.jsp.outline.cssdialog.common.messages";//$NON-NLS-1$
+
+    private static ResourceBundle fgResourceBundle = ResourceBundle
+	    .getBundle(RESOURCE_BUNDLE);
+
+    private MessageUtil() {
+    }
+
+    /**
+     * Returns the formatted message for the given key in
+     * 
+     * @param key
+     *                the resource name
+     * @param args
+     *                the message arguments
+     * @return the string
+     */
+    public static String format(String key, Object[] args) {
+	return MessageFormat.format(getString(key), args);
+    }
+
+    /**
+     * Returns the resource object with the given key
+     * 
+     * @param key
+     *                the resource name
+     * @return the string
+     */
+    public static String getString(String key) {
+	try {
+	    return fgResourceBundle.getString(key);
+	} catch (MissingResourceException e) {
+	    // TODO Sakovich
+	    return key;
+	}
+    }
+}

Added: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/common/Util.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/common/Util.java	                        (rev 0)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/common/Util.java	2008-07-16 15:19:39 UTC (rev 9155)
@@ -0,0 +1,326 @@
+/*******************************************************************************
+ * 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.jst.jsp.outline.cssdialog.common;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Set;
+import java.util.StringTokenizer;
+
+import org.eclipse.swt.graphics.RGB;
+import org.jboss.tools.jst.jsp.outline.cssdialog.parsers.ColorParserListener;
+
+/**
+ * 
+ * Utility class
+ * 
+ * @author Evgeny Zheleznyakov
+ * 
+ */
+public class Util {
+
+    private static String RGB = "rgb";
+
+    private static String NONE = "none";
+
+    private static String THIN = "thin";
+
+    private static String COMMA = ",";
+
+    private static int START_INDEX_RED = 1;
+    private static int END_INDEX_RED = 3;
+    private static int START_INDEX_GRENN = 3;
+    private static int END_INDEX_GREEN = 5;
+    private static int START_INDEX_BLUE = 5;
+    private static int END_INDEX_BLUE = 7;
+
+    private static int MAX_VALUE_RGB = 255;
+    private static int MIN_VALUE_RGB = 0;
+
+    private static int COUNT_COLORS = 3;
+
+    private static int RADIX = 16;
+
+    private static int COLOR_LENGTH = 7;
+
+    private static int START_COLOR_INDEX = 0;
+
+    private static char OPEN_BRACKET = '{';
+    private static char CLOSE_BRACKET = '}';
+
+    private static char SHARP = '#';
+    private static String SHARP_STRING = "#";
+
+    private static String ZERO_STR = "0";
+    private static int NORMAL_MIN_VALUE = 10;
+
+    /**
+     * Method for checking contain or not css attribute folder
+     * 
+     * @param name
+     *                Name css attribute
+     * @return true - contain, or else - dont contain
+     */
+    public static boolean containFolder(String name) {
+
+	for (int i = 0; i < Constants.elemFolder.length; i++)
+	    if (Constants.elemFolder[i].equals(name))
+		return true;
+	return false;
+    }
+
+    /**
+     * Method for search css attribute in block elements (Aural, Boxes,....)
+     * 
+     * @param name
+     *                Name css attribute
+     * @param set
+     *                Set of block elemnts
+     * @return true - find, or else - dont find
+     */
+    public static boolean searchOnBlock(String name, Set<String> set) {
+
+	for (String str1 : set)
+	    if (str1.equals(name))
+		return true;
+
+	return false;
+    }
+
+    /**
+     * Method for search css attribute in combo elements (text-decoration,
+     * font-weight,....)
+     * 
+     * @param name
+     *                Name css attribute
+     * @param set
+     *                Set of combo elemnts
+     * @return true - find, or else - dont find
+     */
+    public static boolean searchInCombo(String name, Set<String> set) {
+
+	for (String str1 : set)
+	    if (str1.equals(name))
+		return true;
+
+	return false;
+    }
+
+    /**
+     * Method for search string into css attributes
+     * 
+     * @param name
+     *                Name
+     * @param elementMap
+     *                Map of css attributes
+     * @return true - find, or else - dont find
+     */
+    public static boolean searchInElement(String name,
+	    HashMap<String, ArrayList<String>> elementMap) {
+
+	Set<String> set = elementMap.keySet();
+
+	for (String str : set) {
+
+	    ArrayList<String> list = elementMap.get(str);
+	    for (String str1 : list)
+		if (str1.equals(name))
+		    return true;
+	}
+
+	return false;
+    }
+
+    /**
+     * Method for get RGB from string
+     * 
+     * @param color
+     *                Color string
+     * @return RGB color, or null, if color invalid
+     */
+    public static RGB getColor(String color) {
+
+	if (color.equals(Constants.EMPTY_STRING) || color.equals(NONE))
+	    return null;
+
+	if (color.charAt(START_COLOR_INDEX) == SHARP
+		&& color.length() == COLOR_LENGTH) {
+
+	    String strR = color.substring(START_INDEX_RED, END_INDEX_RED);
+	    String strG = color.substring(START_INDEX_GRENN, END_INDEX_GREEN);
+	    String strB = color.substring(START_INDEX_BLUE, END_INDEX_BLUE);
+
+	    try {
+		Integer.parseInt(strR, RADIX);
+		Integer.parseInt(strG, RADIX);
+		Integer.parseInt(strB, RADIX);
+	    } catch (RuntimeException e) {
+		return null;
+	    }
+	    return convertColorHEX(color);
+	} else if (color.toLowerCase().indexOf(RGB) != Constants.DONT_CONTAIN) {
+
+	    int start = color.indexOf(OPEN_BRACKET);
+	    int end = color.indexOf(CLOSE_BRACKET);
+	    String str = color.substring(start + 1, end);
+
+	    StringTokenizer st = new StringTokenizer(str, COMMA);
+
+	    int j = 0;
+	    while (st.hasMoreTokens()) {
+		try {
+		    int i = Integer.parseInt(st.nextToken().trim());
+		    if (i < MIN_VALUE_RGB || i > MAX_VALUE_RGB)
+			return null;
+
+		} catch (NumberFormatException e) {
+		    return null;
+		}
+		j++;
+	    }
+
+	    if (j == COUNT_COLORS)
+		return convertColorRGB(color);
+	} else {
+	    HashMap<String, String> colorMap = ColorParserListener.getMap();
+
+	    for (String key : colorMap.keySet())
+		if (colorMap.get(key).equalsIgnoreCase(color))
+		    return convertColorHEX(key);
+	}
+
+	return null;
+    }
+
+    /**
+     * Method for convert string(123px) into two string (123 and px)
+     * 
+     * @param str
+     *                String for convert
+     * @return Array two strings, or null, if str uncorrect
+     */
+    public static String[] convertExtString(String str) {
+
+	if (str.equalsIgnoreCase(THIN))
+	    return new String[] { THIN, Constants.EMPTY_STRING };
+
+	if (str == null)
+	    return null;
+
+	if (str.trim().equals(Constants.EMPTY_STRING))
+	    return new String[] { Constants.EMPTY_STRING,
+		    Constants.EMPTY_STRING };
+
+	String newStr = str.toLowerCase().trim();
+
+	int index = -1;
+	for (int i = 1; i < Constants.extSizes.length; i++) {
+
+	    index = newStr.indexOf(Constants.extSizes[i]);
+	    if (index != -1)
+		break;
+	}
+
+	if (index == -1)
+	    return new String[] { newStr, Constants.EMPTY_STRING };
+
+	String number = newStr.substring(0, index);
+	String ext = newStr.substring(index, index + 2);
+
+	return new String[] { number, ext };
+    }
+
+    /**
+     * Method for search css attribute into extElements
+     * 
+     * @param name
+     *                Name of css attribute
+     * @return true - find, or else - dont find
+     */
+    public static boolean searchInExtElement(String name) {
+
+	for (int i = 0; i < Constants.extElem.length; i++)
+	    if (Constants.extElem[i].equals(name))
+		return true;
+	return false;
+    }
+
+    /**
+     * Method for getting RGB color from string color
+     * 
+     * @param color
+     *                String color
+     * @return RGB color
+     */
+    public static RGB convertColorRGB(String color) {
+
+	String newStr = color.trim().toLowerCase();
+
+	int rgb[] = new int[COUNT_COLORS];
+
+	int start = newStr.indexOf(OPEN_BRACKET);
+	int end = newStr.indexOf(CLOSE_BRACKET);
+	String str = newStr.substring(start + 1, end);
+
+	StringTokenizer st = new StringTokenizer(str, COMMA);
+	int i = 0;
+	while (st.hasMoreTokens())
+	    rgb[i++] = Integer.parseInt(st.nextToken().trim());
+	return new RGB(rgb[0], rgb[1], rgb[2]);
+    }
+
+    /**
+     * Method for getting RGB color from hex string
+     * 
+     * @param color
+     *                String color
+     * @return RGB color
+     */
+    public static RGB convertColorHEX(String color) {
+
+	String newStr = color.trim().toLowerCase();
+
+	String strR = newStr.substring(START_INDEX_RED, END_INDEX_RED);
+	String strG = newStr.substring(START_INDEX_GRENN, END_INDEX_GREEN);
+	String strB = newStr.substring(START_INDEX_BLUE, END_INDEX_BLUE);
+
+	int red = Integer.parseInt(strR, RADIX);
+	int green = Integer.parseInt(strG, RADIX);
+	int blue = Integer.parseInt(strB, RADIX);
+
+	return new RGB(red, green, blue);
+    }
+
+    /**
+     * Method for convert RGB to String
+     * 
+     * @param rgb
+     *                RGB color
+     * @return String color
+     */
+    public static String createColorString(RGB rgb) {
+	String colorStr = SHARP_STRING
+		+ (rgb.red < NORMAL_MIN_VALUE ? ZERO_STR
+			: Constants.EMPTY_STRING)
+		+ Integer.toHexString(rgb.red)
+		+ (rgb.green < NORMAL_MIN_VALUE ? ZERO_STR
+			: Constants.EMPTY_STRING)
+		+ Integer.toHexString(rgb.green)
+		+ Constants.EMPTY_STRING
+		+ (rgb.blue < NORMAL_MIN_VALUE ? ZERO_STR
+			: Constants.EMPTY_STRING)
+		+ Integer.toHexString(rgb.blue);
+	colorStr = colorStr.toUpperCase();
+	if (ColorParserListener.getMap().get(colorStr) != null)
+	    return ColorParserListener.getMap().get(colorStr);
+	return colorStr;
+    }
+}
\ No newline at end of file

Added: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/common/messages.properties
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/common/messages.properties	                        (rev 0)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/common/messages.properties	2008-07-16 15:19:39 UTC (rev 9155)
@@ -0,0 +1,42 @@
+CSS_DIALOG_TITLE=CSS Editor
+TEXT_FONT_TAB_NAME=Text/Font 
+BOXES_TAB_NAME=Boxes
+BACKGROUND_TAB_NAME=Background
+PROPERTY_SHEET_TAB_NAME=Property Sheet
+QUICK_EDIT_TAB-NAME=Quick Edit
+BACKGROUND_COLOR=Background Color:
+BACKGROUND_COLOR_TIP=Choose background color
+COLOR_DIALOG_TITLE=Choose a Color 
+BACKGROUND_IMAGE=Background Image:
+BACKGROUND_IMAGE_TIP=Choose background image
+IMAGE_DIALOG_TITLE=File Selection
+IMAGE_DIALOG_MESSAGE=Select image
+IMAGE_DIALOG_EMPTY_MESSAGE=Not find images in current Project
+BACKGROUND_REPEAT=Background Repeat:
+DIMENSION_TITLE=Dimension
+WIDTH=Width:
+HEIGHT=Height:
+BORDER_TITLE=Border
+BORDER_STYLE=Border Style:
+BORDER_COLOR=Border Color:
+BORDER_COLOR_TIP=Choose border color
+BORDER_WIDTH=Border Width:
+MARGIN_PADDING_TITLE=Margin/Padding
+MARGIN=Margin:
+PADDING=Padding:
+FONT_FAMILY=Font Family:
+FONT_FAMILY_TIP=Choose font family
+COLOR=Color:
+COLOR_TIP=Choose text color
+FONT_SIZE=Font Size:
+FONT_STYLE=Font Style:
+FONT_WEIGHT=Font Weight:
+TEXT_DECORATION=Text Decoration:
+TEXT_ALIGN=Text Align:
+ALL_FILES=All files
+ALL_IMAGE_FILES=All image files
+ADD_FONT_FAMILY_TIP=Add font family
+REMOVE_FONT_FAMILY_TIP=Remove font family
+FONT_FAMILY_DIALOG_TITLE=Choose font family
+IMAGE_PREVIEW=Image preview
+IMAGE_COMBO_TABLE_TOOL_TIP=Double click to select color
\ No newline at end of file

Added: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/events/TabPropertySheetMouseAdapter.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/events/TabPropertySheetMouseAdapter.java	                        (rev 0)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/events/TabPropertySheetMouseAdapter.java	2008-07-16 15:19:39 UTC (rev 9155)
@@ -0,0 +1,467 @@
+/*******************************************************************************
+ * 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.jst.jsp.outline.cssdialog.events;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.window.Window;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.TreeEditor;
+import org.eclipse.swt.events.DisposeEvent;
+import org.eclipse.swt.events.DisposeListener;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.events.MouseAdapter;
+import org.eclipse.swt.events.MouseEvent;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.RGB;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.ColorDialog;
+import org.eclipse.swt.widgets.Combo;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.swt.widgets.Tree;
+import org.eclipse.swt.widgets.TreeItem;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IFileEditorInput;
+import org.eclipse.ui.model.WorkbenchContentProvider;
+import org.eclipse.ui.model.WorkbenchLabelProvider;
+
+import org.jboss.tools.jst.jsp.JspEditorPlugin;
+import org.jboss.tools.jst.jsp.outline.cssdialog.CSSDialog;
+import org.jboss.tools.jst.jsp.outline.cssdialog.FontFamilyDialog;
+import org.jboss.tools.jst.jsp.outline.cssdialog.ImageSelectionDialog;
+import org.jboss.tools.jst.jsp.outline.cssdialog.common.CSSConstants;
+import org.jboss.tools.jst.jsp.outline.cssdialog.common.Constants;
+import org.jboss.tools.jst.jsp.outline.cssdialog.common.ImageCombo;
+import org.jboss.tools.jst.jsp.outline.cssdialog.common.MessageUtil;
+import org.jboss.tools.jst.jsp.outline.cssdialog.common.Util;
+import org.jboss.tools.jst.jsp.outline.cssdialog.parsers.ColorParserListener;
+import org.jboss.tools.jst.jsp.outline.cssdialog.tabs.TabPropertySheetControl;
+
+/**
+ * 
+ * Listener for tree in tab property sheet
+ * 
+ * @author Evgeny Zheleznyakov
+ * 
+ */
+public class TabPropertySheetMouseAdapter extends MouseAdapter {
+
+    private Tree tree;
+
+    private TreeEditor editor;
+
+    private Combo combo = null;
+    private ImageCombo colorCombo = null;
+
+    private HashMap<String, ArrayList<String>> comboMap;
+    private HashMap<String, ArrayList<String>> elementsMap;
+
+    private static int GRID_NUM_COLUMNS = 2;
+    private static int GRID_MARGIN_HEIGHT = 0;
+    private static int GRID_MARGIN_WIDTH = 0;
+    private static int GRID_HORIZONTAL_SPASING = 0;
+    
+    private CSSDialog cssDialog;
+    
+    private TabPropertySheetControl tabPropertySheetControl;
+
+    public TabPropertySheetMouseAdapter(Tree tree,
+	    HashMap<String, ArrayList<String>> elementsMap,
+	    HashMap<String, ArrayList<String>> comboMap,
+	    TabPropertySheetControl tabPropertySheetControl,
+	    CSSDialog dialog) {
+	
+	this.tabPropertySheetControl = tabPropertySheetControl;
+	this.cssDialog = dialog;
+	this.tree = tree;
+	this.comboMap = comboMap;
+	this.elementsMap = elementsMap;
+
+	editor = new TreeEditor(tree);
+	editor.horizontalAlignment = SWT.LEFT;
+	editor.grabHorizontal = true;
+    }
+
+    /**
+     * Invoke then mouse pressed
+     */
+    public void mouseDown(MouseEvent event) {
+
+	for (int i = 0; i < tree.getColumnCount(); i++)
+	    tree.getColumn(i).pack();
+
+	Control old = editor.getEditor();
+	if (old != null)
+	    old.dispose();
+
+	Point pt = new Point(event.x, event.y);
+
+	final TreeItem item = tree.getItem(pt);
+
+	if (item != null) {
+
+	    if (Util.searchOnBlock(item.getText(Constants.FIRST_COLUMN).trim(),
+		    elementsMap.keySet()))
+		return;
+
+	    if (Util.searchInCombo(item.getText(Constants.FIRST_COLUMN).trim(),
+		    comboMap.keySet()))
+		createCombo(item, Constants.SECOND_COLUMN);
+	    else
+		createText(item, Constants.SECOND_COLUMN);
+	}
+    }
+
+    /**
+     * Method for create combo editor
+     * 
+     * @param item
+     *                Tree item for editing
+     * @param column
+     *                Number of column for editing
+     */
+    private void createCombo(final TreeItem item, int column) {
+
+	final Composite panel = new Composite(tree, SWT.NONE);
+	GridLayout grid = new GridLayout();
+	grid.numColumns = GRID_NUM_COLUMNS;
+	grid.marginHeight = GRID_MARGIN_HEIGHT;
+	grid.marginWidth = GRID_MARGIN_WIDTH;
+	grid.horizontalSpacing = GRID_HORIZONTAL_SPASING;
+	panel.setLayout(grid);
+
+	Button btn = null;
+
+	boolean color = false;
+
+	// color element
+	if (item.getText(Constants.FIRST_COLUMN).trim().indexOf(
+		CSSConstants.COLOR) != Constants.DONT_CONTAIN) {
+	    color = true;
+
+	    // create combo for color
+	    colorCombo = new ImageCombo(panel, SWT.BORDER);
+
+	    HashMap<String, String> colorMap = ColorParserListener.getMap();
+
+	    for (String key : colorMap.keySet()) {
+		RGB rgb = Util.getColor(key);
+		colorCombo.add(colorMap.get(key), rgb);
+	    }
+
+	    if (colorCombo.indexOf(item.getText(Constants.SECOND_COLUMN).trim()
+		    .toLowerCase()) != Constants.DONT_CONTAIN)
+		colorCombo.select(colorCombo.indexOf(item.getText(
+			Constants.SECOND_COLUMN).trim().toLowerCase()));
+	    else
+		colorCombo
+			.setText(item.getText(Constants.SECOND_COLUMN).trim());
+
+	    colorCombo.addSelectionListener(new SelectionAdapter() {
+
+		public void widgetSelected(SelectionEvent event) {
+		    item.setText(Constants.SECOND_COLUMN, colorCombo.getText());
+		    panel.dispose();
+		    tabPropertySheetControl.updateData(true);
+		    cssDialog.setStyleForPreview();
+		}
+	    });
+
+	    colorCombo.addModifyListener(new ModifyListener() {
+		public void modifyText(ModifyEvent event) {
+		    item.setText(Constants.SECOND_COLUMN, colorCombo.getText());
+		    tabPropertySheetControl.updateData(true);
+		    cssDialog.setStyleForPreview();
+		}
+	    });
+
+	    // create color button
+	    btn = new Button(panel, SWT.NONE);
+	    ImageDescriptor imageDes = JspEditorPlugin
+		    .getImageDescriptor(Constants.IMAGE_COLOR_FILE_LOCATION);
+	    Image colorImage = imageDes.createImage();
+	    btn.setImage(colorImage);
+	    btn.addDisposeListener(new DisposeListener() {
+		public void widgetDisposed(DisposeEvent e) {
+		    Button button = (Button) e.getSource();
+		    button.getImage().dispose();
+		}
+	    });
+	    btn.setToolTipText(MessageUtil.getString("COLOR_DIALOG_TITLE"));
+
+	    btn.addSelectionListener(new SelectionAdapter() {
+
+		public void widgetSelected(SelectionEvent event) {
+
+		    RGB startRgb = Util.getColor(item.getText(
+			    Constants.SECOND_COLUMN).toLowerCase().trim());
+
+		    if (startRgb == null)
+			startRgb = Constants.RGB_BLACK;
+
+		    ColorDialog colorDialog = new ColorDialog(tree.getShell());
+		    colorDialog.setRGB(startRgb);
+		    colorDialog.setText(MessageUtil
+			    .getString("COLOR_DIALOG_TITLE"));
+		    RGB rgb = colorDialog.open();
+		    if (rgb != null) {
+
+			String str = Util.createColorString(rgb);
+
+			if (ColorParserListener.getMap().get(str) != null)
+			    item.setText(Constants.SECOND_COLUMN,
+				    ColorParserListener.getMap().get(str));
+			else
+			    item.setText(Constants.SECOND_COLUMN, str);
+			
+			tabPropertySheetControl.updateData(true);
+			cssDialog.setStyleForPreview();
+		    }
+		    panel.dispose();
+		}
+	    });
+	} else if (Util.containFolder(item.getText(Constants.FIRST_COLUMN)
+		.trim())) {
+
+	    combo = new Combo(panel, SWT.NONE);
+
+	    // create chooser button
+	    btn = new Button(panel, SWT.NONE);
+	    ImageDescriptor imageDes = JspEditorPlugin
+		    .getImageDescriptor(Constants.IMAGE_FOLDER_FILE_LOCATION);
+	    Image chooserImage = imageDes.createImage();
+	    btn.setImage(chooserImage);
+	    btn.addDisposeListener(new DisposeListener() {
+		public void widgetDisposed(DisposeEvent e) {
+		    Button button = (Button) e.getSource();
+		    button.getImage().dispose();
+		}
+	    });
+	    btn.setToolTipText(MessageUtil.getString("IMAGE_DIALOG_MESSAGE"));
+
+	    btn.addSelectionListener(new SelectionAdapter() {
+		public void widgetSelected(SelectionEvent event) {
+		    IProject project = getCurrentProject();
+
+		    ImageSelectionDialog dialog = new ImageSelectionDialog(tree
+			    .getShell(), new WorkbenchLabelProvider(),
+			    new WorkbenchContentProvider());
+		    dialog
+			    .setTitle(MessageUtil
+				    .getString("IMAGE_DIALOG_TITLE"));
+		    dialog.setMessage(MessageUtil
+			    .getString("IMAGE_DIALOG_MESSAGE"));
+		    dialog.setEmptyListMessage(MessageUtil
+			    .getString("IMAGE_DIALOG_EMPTY_MESSAGE"));
+		    dialog.setAllowMultiple(false);
+		    dialog.setInput(project);
+		    if (dialog.open() == ImageSelectionDialog.OK) {
+			IFile file = (IFile) dialog.getFirstResult();
+			String value = file.getFullPath().toString();
+			item.setText(Constants.SECOND_COLUMN, value);
+			panel.dispose();
+			tabPropertySheetControl.updateData(true);
+			cssDialog.setStyleForPreview();
+		    }
+		}
+	    });
+
+	} else {
+	    combo = new Combo(panel, SWT.NONE);
+	}
+
+	// add items
+	if (!color) {
+	    ArrayList<String> list = comboMap.get(item.getText(
+		    Constants.FIRST_COLUMN).trim());
+
+	    for (String str : list)
+		combo.add(str);
+
+	    if (btn != null)
+		btn.setLayoutData(new GridData(GridData.END, GridData.CENTER,
+			false, false));
+
+	    combo.setLayoutData(new GridData(GridData.FILL, GridData.CENTER,
+		    true, false));
+
+	    combo.setFocus();
+	    if (combo.indexOf(item.getText(column)) == Constants.DONT_CONTAIN
+		    && !item.getText(column).equals(Constants.EMPTY_STRING))
+		combo.setText(item.getText(column));
+	    else
+		combo.select(combo.indexOf(item.getText(column)));
+
+	    // Add a listener to set the selected item back into the
+	    // cell
+	    final int col = column;
+	    combo.addSelectionListener(new SelectionAdapter() {
+		public void widgetSelected(SelectionEvent event) {
+		    item.setText(col, combo.getText());
+		    panel.dispose();
+		    tabPropertySheetControl.updateData(true);
+		    cssDialog.setStyleForPreview();
+		}
+	    });
+
+	    combo.addModifyListener(new ModifyListener() {
+		public void modifyText(ModifyEvent event) {
+		    item.setText(col, combo.getText());
+		    tabPropertySheetControl.updateData(true);
+		    cssDialog.setStyleForPreview();
+		}
+	    });
+	} else {
+	    colorCombo.setLayoutData(new GridData(GridData.FILL,
+		    GridData.CENTER, true, false));
+
+	    btn.setLayoutData(new GridData(GridData.END, GridData.CENTER,
+		    false, false));
+
+	    colorCombo.setFocus();
+	}
+
+	// Compute the width for the editor
+	// Also, compute the column width, so that the dropdown
+	// fits
+	editor.minimumWidth = panel.computeSize(SWT.DEFAULT, SWT.DEFAULT).x;
+	editor.minimumHeight = panel.computeSize(SWT.DEFAULT, SWT.DEFAULT).y;
+
+	tree.getColumn(column).setWidth(editor.minimumWidth);
+
+	// Set the focus on the dropdown and set into the editor
+	editor.setEditor(panel, item, column);
+    }
+
+    /**
+     * Method for create text editor
+     * 
+     * @param item
+     *                Tree item for editing
+     * @param column
+     *                Number of column for editing
+     */
+    private void createText(final TreeItem item, int column) {
+
+	final Composite panel = new Composite(tree, SWT.NONE);
+	GridLayout grid = new GridLayout();
+	grid.numColumns = GRID_NUM_COLUMNS;
+	grid.marginHeight = GRID_MARGIN_HEIGHT;
+	grid.marginWidth = GRID_MARGIN_WIDTH;
+	grid.horizontalSpacing = GRID_HORIZONTAL_SPASING;
+	panel.setLayout(grid);
+
+	Button btn = null;
+
+	final Text text = new Text(panel, SWT.BORDER);
+
+	if (item.getText(Constants.FIRST_COLUMN).trim().equalsIgnoreCase(
+		CSSConstants.FONT_FAMILY)) {
+
+	    btn = new Button(panel, SWT.NONE);
+	    ImageDescriptor imageDes = JspEditorPlugin
+		    .getImageDescriptor(Constants.IMAGE_FONT_FILE_LOCATION);
+	    Image fontImage = imageDes.createImage();
+	    btn.setImage(fontImage);
+	    btn.addDisposeListener(new DisposeListener() {
+		public void widgetDisposed(DisposeEvent e) {
+		    Button button = (Button) e.getSource();
+		    button.getImage().dispose();
+		}
+	    });
+	    btn.setToolTipText(MessageUtil.getString("FONT_FAMILY_TIP"));
+
+	    btn.addSelectionListener(new SelectionAdapter() {
+		public void widgetSelected(SelectionEvent event) {
+		    FontFamilyDialog dialog = new FontFamilyDialog(tree
+			    .getShell(), item.getText(Constants.SECOND_COLUMN));
+		    if (dialog.open() == Window.OK) {
+			item.setText(Constants.SECOND_COLUMN, dialog
+				.getFontFamily());
+			panel.dispose();
+			tabPropertySheetControl.updateData(true);
+			cssDialog.setStyleForPreview();
+		    }
+		}
+	    });
+	}
+
+	if (btn != null)
+	    btn.setLayoutData(new GridData(GridData.END, GridData.CENTER,
+		    false, false));
+
+	text.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true,
+		false));
+
+	// Compute the width for the editor
+	// Also, compute the column width, so that the dropdown
+	// fits
+	editor.minimumWidth = panel.computeSize(SWT.DEFAULT, SWT.DEFAULT).x;
+	editor.minimumHeight = panel.computeSize(SWT.DEFAULT, SWT.DEFAULT).y;
+
+	tree.getColumn(column).setWidth(editor.minimumWidth);
+
+	// Set the focus on the dropdown and set into the editor
+	editor.setEditor(panel, item, column);
+
+	// Transfer any text from the cell to the Text control,
+	// set the color to match this row, select the text,
+	// and set focus to the control
+	text.setText(item.getText(column));
+	text.setFocus();
+
+	// Add a handler to transfer the text back to the cell
+	// any time it's modified
+	final int col = column;
+	text.addModifyListener(new ModifyListener() {
+	    public void modifyText(ModifyEvent event) {
+		// Set the text of the editor's control back
+		// into the cell
+		item.setText(col, text.getText());
+		tabPropertySheetControl.updateData(true);
+		cssDialog.setStyleForPreview();
+	    }
+	});
+    }
+
+    /**
+     * Method for get current project
+     * 
+     * @return IProject
+     */
+    public static IProject getCurrentProject() {
+	IEditorPart editor = JspEditorPlugin.getDefault().getWorkbench()
+		.getActiveWorkbenchWindow().getActivePage().getActiveEditor();
+	IEditorInput input = editor.getEditorInput();
+	IFile file = null;
+	if (input instanceof IFileEditorInput) {
+	    file = ((IFileEditorInput) input).getFile();
+	}
+	if (file == null)
+	    return null;
+
+	IProject project = file.getProject();
+	return project;
+    }
+}
\ No newline at end of file

Added: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/parsers/BaseListener.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/parsers/BaseListener.java	                        (rev 0)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/parsers/BaseListener.java	2008-07-16 15:19:39 UTC (rev 9155)
@@ -0,0 +1,48 @@
+/*******************************************************************************
+ * 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.jst.jsp.outline.cssdialog.parsers;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+
+import org.xml.sax.helpers.DefaultHandler;
+
+/**
+ * Base listener
+ * 
+ * @author Evgeny Zheleznyakov
+ * 
+ */
+public class BaseListener extends DefaultHandler {
+
+    protected HashMap<String, ArrayList<String>> map;
+
+    /**
+     * 
+     * Constructor for listener
+     * 
+     * @param map
+     *                Map for writing
+     */
+    public BaseListener(HashMap<String, ArrayList<String>> map) {
+	this.map = map;
+    }
+
+    /**
+     * 
+     * Getter for map
+     * 
+     * @return Map
+     */
+    public HashMap<String, ArrayList<String>> getMap() {
+	return map;
+    }
+}
\ No newline at end of file

Added: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/parsers/CSSElementsParser.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/parsers/CSSElementsParser.java	                        (rev 0)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/parsers/CSSElementsParser.java	2008-07-16 15:19:39 UTC (rev 9155)
@@ -0,0 +1,74 @@
+/*******************************************************************************
+ * 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.jst.jsp.outline.cssdialog.parsers;
+
+import java.io.File;
+import java.io.IOException;
+
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.parsers.SAXParser;
+import javax.xml.parsers.SAXParserFactory;
+
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
+import org.jboss.tools.jst.jsp.JspEditorPlugin;
+import org.xml.sax.SAXException;
+
+public class CSSElementsParser {
+
+    private String FILE_NAME = "cssElements.xml";
+
+    private BaseListener listener;
+
+    private SAXParserFactory fact;
+
+    private SAXParser saxParser;
+
+    public CSSElementsParser() {
+
+	try {
+	    fact = SAXParserFactory.newInstance();
+	    saxParser = fact.newSAXParser();
+
+	} catch (ParserConfigurationException e) {
+	    // TODO Evgeny Zheleznyakov remove all printStackTrace
+	    e.printStackTrace();
+	} catch (SAXException e) {
+	    // TODO Evgeny Zheleznyakov remove all printStackTrace
+	    e.printStackTrace();
+	}
+    }
+
+    public void parse() {
+
+	String pluginPath = JspEditorPlugin.getPluginCSSDialogResourcePath();
+	IPath pluginFile = new Path(pluginPath);
+	String path = pluginFile.append(FILE_NAME).toFile().getAbsolutePath();
+	File file = new File(path);
+	if (!file.exists())
+	    throw new RuntimeException();
+
+	try {
+	    saxParser.parse(file, listener);
+	} catch (SAXException e) {
+	    // TODO Evgeny Zheleznyakov remove all printStackTrace
+	    e.printStackTrace();
+	} catch (IOException e) {
+	    // TODO Evgeny Zheleznyakov remove all printStackTrace
+	    e.printStackTrace();
+	}
+
+    }
+
+    public void setListener(BaseListener listener) {
+	this.listener = listener;
+    }
+}
\ No newline at end of file

Added: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/parsers/ColorParser.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/parsers/ColorParser.java	                        (rev 0)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/parsers/ColorParser.java	2008-07-16 15:19:39 UTC (rev 9155)
@@ -0,0 +1,94 @@
+/*******************************************************************************
+ * 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.jst.jsp.outline.cssdialog.parsers;
+
+import java.io.File;
+import java.io.IOException;
+
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.parsers.SAXParser;
+import javax.xml.parsers.SAXParserFactory;
+
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
+import org.jboss.tools.jst.jsp.JspEditorPlugin;
+
+import org.xml.sax.SAXException;
+
+/**
+ * 
+ * Parser for parse colors elements
+ * 
+ * @author Evgeny Zheleznyakov
+ * 
+ */
+public class ColorParser {
+
+    private String FILE_NAME = "colors.xml";
+
+    private ColorParserListener listener;
+
+    private SAXParserFactory fact;
+
+    private SAXParser saxParser;
+
+    /**
+     * Constructor for Color parser
+     */
+    public ColorParser() {
+
+	try {
+	    fact = SAXParserFactory.newInstance();
+	    saxParser = fact.newSAXParser();
+
+	} catch (ParserConfigurationException e) {
+	    // TODO Evgeny Zheleznyakov remove all printStackTrace
+	    e.printStackTrace();
+	} catch (SAXException e) {
+	    // TODO Evgeny Zheleznyakov remove all printStackTrace
+	    e.printStackTrace();
+	}
+    }
+
+    /**
+     * Parse the content of the file specified as XML using the specified
+     */
+    public void parse() {
+
+	String pluginPath = JspEditorPlugin.getPluginCSSDialogResourcePath();
+	IPath pluginFile = new Path(pluginPath);
+	String path = pluginFile.append(FILE_NAME).toFile().getAbsolutePath();
+	File file = new File(path);
+	if (!file.exists())
+	    throw new RuntimeException();
+
+	try {
+	    saxParser.parse(file, listener);
+	} catch (SAXException e) {
+	    // TODO Evgeny Zheleznyakov remove all printStackTrace
+	    e.printStackTrace();
+	} catch (IOException e) {
+	    // TODO Evgeny Zheleznyakov remove all printStackTrace
+	    e.printStackTrace();
+	}
+
+    }
+
+    /**
+     * Method for set listener
+     * 
+     * @param listener
+     *                ColorParseListener
+     */
+    public void setListener(ColorParserListener listener) {
+	this.listener = listener;
+    }
+}
\ No newline at end of file

Added: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/parsers/ColorParserListener.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/parsers/ColorParserListener.java	                        (rev 0)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/parsers/ColorParserListener.java	2008-07-16 15:19:39 UTC (rev 9155)
@@ -0,0 +1,50 @@
+/*******************************************************************************
+ * 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.jst.jsp.outline.cssdialog.parsers;
+
+import java.util.HashMap;
+
+import org.xml.sax.Attributes;
+import org.xml.sax.helpers.DefaultHandler;
+
+/**
+ * Color parser listener
+ * 
+ * @author ezheleznyakov
+ * 
+ */
+public class ColorParserListener extends DefaultHandler {
+
+    private static String NODE_NAME_COLOR = "color";
+
+    private static String NODE_ATTRIBUTE_NAME = "name";
+
+    private static String NODE_ATTRIBUTE_VALUE = "value";
+
+    private static HashMap<String, String> map;
+
+    public ColorParserListener() {
+	map = new HashMap<String, String>();
+    }
+
+    public void startElement(String uri, String localName, String nodeName,
+	    Attributes attrs) {
+
+	if (nodeName.trim().equalsIgnoreCase(NODE_NAME_COLOR)) {
+	    map.put(attrs.getValue(NODE_ATTRIBUTE_NAME).trim().toUpperCase(),
+		    attrs.getValue(NODE_ATTRIBUTE_VALUE).trim());
+	}
+    }
+
+    public static HashMap<String, String> getMap() {
+	return map;
+    }
+}
\ No newline at end of file

Added: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/parsers/ComboParser.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/parsers/ComboParser.java	                        (rev 0)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/parsers/ComboParser.java	2008-07-16 15:19:39 UTC (rev 9155)
@@ -0,0 +1,76 @@
+/*******************************************************************************
+ * 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.jst.jsp.outline.cssdialog.parsers;
+
+import java.io.File;
+import java.io.IOException;
+
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.parsers.SAXParser;
+import javax.xml.parsers.SAXParserFactory;
+
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
+import org.jboss.tools.jst.jsp.JspEditorPlugin;
+import org.xml.sax.SAXException;
+
+/**
+ * 
+ * @author ezheleznyakov
+ * 
+ */
+public class ComboParser {
+
+    private String FILE_NAME = "cssElementsWithCombo.xml";
+
+    private BaseListener listener;
+
+    private SAXParser saxParser;
+
+    public ComboParser() {
+
+	try {
+	    saxParser = SAXParserFactory.newInstance().newSAXParser();
+
+	} catch (ParserConfigurationException e) {
+	    // TODO Evgeny Zheleznyakov remove all printStackTrace
+	    e.printStackTrace();
+	} catch (SAXException e) {
+	    // TODO Evgeny Zheleznyakov remove all printStackTrace
+	    e.printStackTrace();
+	}
+    }
+
+    public void parse() {
+
+	String pluginPath = JspEditorPlugin.getPluginCSSDialogResourcePath();
+	IPath pluginFile = new Path(pluginPath);
+	String path = pluginFile.append(FILE_NAME).toFile().getAbsolutePath();
+	File file = new File(path);
+	if (!file.exists())
+	    throw new RuntimeException();
+
+	try {
+	    saxParser.parse(file, listener);
+	} catch (SAXException e) {
+	    // TODO Evgeny Zheleznyakov remove all printStackTrace
+	    e.printStackTrace();
+	} catch (IOException e) {
+	    // TODO Evgeny Zheleznyakov remove all printStackTrace
+	    e.printStackTrace();
+	}
+
+    }
+
+    public void setListener(BaseListener listener) {
+	this.listener = listener;
+    }
+}

Added: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/parsers/IListener.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/parsers/IListener.java	                        (rev 0)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/parsers/IListener.java	2008-07-16 15:19:39 UTC (rev 9155)
@@ -0,0 +1,32 @@
+/*******************************************************************************
+ * 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.jst.jsp.outline.cssdialog.parsers;
+
+/**
+ * 
+ * Interface for listenrs
+ * 
+ * @author Evgeny Zheleznyakov
+ * 
+ */
+public interface IListener {
+
+    /**
+     * 
+     * Invoke when getting new pair name, value
+     * 
+     * @param name
+     *                Name css attribute
+     * @param value
+     *                Value css attribute
+     */
+    public void nextElement(String name, String value);
+}
\ No newline at end of file

Added: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/parsers/Parser.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/parsers/Parser.java	                        (rev 0)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/parsers/Parser.java	2008-07-16 15:19:39 UTC (rev 9155)
@@ -0,0 +1,92 @@
+/*******************************************************************************
+ * 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.jst.jsp.outline.cssdialog.parsers;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.StringTokenizer;
+
+import org.jboss.tools.jst.jsp.outline.cssdialog.common.Constants;
+import org.jboss.tools.jst.jsp.outline.cssdialog.common.Util;
+
+/**
+ * 
+ * Parser for input style string
+ * 
+ * @author Evgeny Zheleznyakov
+ * 
+ */
+public class Parser {
+
+    private static String SEPARATE_SYMBOLS = ":;";
+
+    private ArrayList<IListener> list;
+
+    private HashMap<String, ArrayList<String>> elementsMap;
+
+    public Parser(HashMap<String, ArrayList<String>> elementsMap) {
+	this.elementsMap = elementsMap;
+	list = new ArrayList<IListener>();
+    }
+
+    public void parse(String str) {
+
+	if (str == null)
+	    return;
+	if (str.trim().equals(Constants.EMPTY_STRING))
+	    return;
+
+	StringTokenizer st = new StringTokenizer(str, SEPARATE_SYMBOLS);
+
+	while (st.hasMoreTokens()) {
+	    String name = null;
+	    String value = null;
+
+	    name = st.nextToken().trim().toLowerCase();
+	    if (!Util.searchInElement(name, elementsMap))
+		continue;
+	    if (st.hasMoreTokens())
+		value = st.nextToken().trim();
+	    else
+		continue;
+
+	    if (name.equals(Constants.EMPTY_STRING)
+		    || value.equals(Constants.EMPTY_STRING))
+		continue;
+
+	    for (IListener listener : list) {
+		listener.nextElement(name, value);
+	    }
+	}
+    }
+
+    /**
+     * 
+     * Add listener for parser
+     * 
+     * @param listener
+     *                Listener
+     */
+    public void addListener(IListener listener) {
+	list.add(listener);
+    }
+
+    /**
+     * 
+     * Remove listener from parser
+     * 
+     * @param listener
+     *                Listener
+     */
+    public void removeListener(IListener listener) {
+	list.remove(listener);
+    }
+}
\ No newline at end of file

Added: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/parsers/ParserListener.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/parsers/ParserListener.java	                        (rev 0)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/parsers/ParserListener.java	2008-07-16 15:19:39 UTC (rev 9155)
@@ -0,0 +1,37 @@
+/*******************************************************************************
+ * 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.jst.jsp.outline.cssdialog.parsers;
+
+import java.util.HashMap;
+
+/**
+ * 
+ * ParserListener for input style string
+ * 
+ * @author Evgeny Zheleznyakov
+ * 
+ */
+public class ParserListener implements IListener {
+
+    private HashMap<String, String> map;
+
+    public ParserListener(HashMap<String, String> map) {
+	this.map = map;
+    }
+
+    public void nextElement(String name, String value) {
+	map.put(name, value);
+    }
+
+    public HashMap<String, String> getMap() {
+	return map;
+    }
+}
\ No newline at end of file

Added: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/tabs/TabBackgroundControl.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/tabs/TabBackgroundControl.java	                        (rev 0)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/tabs/TabBackgroundControl.java	2008-07-16 15:19:39 UTC (rev 9155)
@@ -0,0 +1,305 @@
+/*******************************************************************************
+ * 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.jst.jsp.outline.cssdialog.tabs;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Set;
+import java.util.Map.Entry;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.DisposeEvent;
+import org.eclipse.swt.events.DisposeListener;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.RGB;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.ColorDialog;
+import org.eclipse.swt.widgets.Combo;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IFileEditorInput;
+import org.eclipse.ui.model.WorkbenchContentProvider;
+import org.eclipse.ui.model.WorkbenchLabelProvider;
+import org.jboss.tools.jst.jsp.JspEditorPlugin;
+import org.jboss.tools.jst.jsp.outline.cssdialog.CSSDialog;
+import org.jboss.tools.jst.jsp.outline.cssdialog.ImageSelectionDialog;
+import org.jboss.tools.jst.jsp.outline.cssdialog.common.CSSConstants;
+import org.jboss.tools.jst.jsp.outline.cssdialog.common.Constants;
+import org.jboss.tools.jst.jsp.outline.cssdialog.common.ImageCombo;
+import org.jboss.tools.jst.jsp.outline.cssdialog.common.MessageUtil;
+import org.jboss.tools.jst.jsp.outline.cssdialog.common.Util;
+import org.jboss.tools.jst.jsp.outline.cssdialog.parsers.ColorParserListener;
+
+/**
+ * Class for creating control in Background tab
+ * 
+ * @author dsakovich at exadel.com
+ * 
+ */
+public class TabBackgroundControl extends Composite {
+
+    private ImageCombo colorCombo;
+
+    private Combo backgroundImageCombo;
+    private Combo backgroundRepeatCombo;
+
+    private HashMap<String, String> attributesMap;
+
+    private static final int numColumns = 3;
+
+    private CSSDialog cssDialog;
+
+    public TabBackgroundControl(final Composite composite,
+	    HashMap<String, ArrayList<String>> comboMap,
+	    final HashMap<String, String> attributesMap, CSSDialog dialog) {
+	super(composite, SWT.NONE);
+	this.attributesMap = attributesMap;
+	this.cssDialog = dialog;
+
+	final GridLayout gridLayout = new GridLayout();
+	gridLayout.numColumns = numColumns;
+	setLayout(gridLayout);
+
+	Label label = new Label(this, SWT.LEFT);
+	label.setLayoutData(new GridData(GridData.END, GridData.CENTER, false,
+		false));
+	label.setText(MessageUtil.getString("BACKGROUND_COLOR"));
+
+	colorCombo = new ImageCombo(this, SWT.BORDER);
+	colorCombo.setLayoutData(new GridData(GridData.FILL, GridData.CENTER,
+		true, false));
+	// ////////////////////////////////////////////////////////////////////////
+	Set<Entry<String, String>> set = ColorParserListener.getMap()
+		.entrySet();
+
+	for (Map.Entry<String, String> me : set) {
+	    RGB rgb = Util.getColor(me.getKey());
+	    colorCombo.add(me.getValue(), rgb);
+	}
+
+	colorCombo.addModifyListener(new ModifyListener() {
+	    public void modifyText(ModifyEvent event) {
+		String tmp = colorCombo.getText();
+		if (tmp != null) {
+		    if (tmp.trim().length() > 0)
+			attributesMap.put(CSSConstants.BACKGROUND_COLOR, tmp);
+		    else
+			attributesMap.remove(CSSConstants.BACKGROUND_COLOR);
+		}
+		cssDialog.setStyleForPreview();
+	    }
+	});
+
+	Button button = new Button(this, SWT.PUSH);
+	button.setLayoutData(new GridData(GridData.END, GridData.CENTER, false,
+		false));
+	button.setToolTipText(MessageUtil.getString("BACKGROUND_COLOR_TIP"));
+	ImageDescriptor colorDesc = JspEditorPlugin
+		.getImageDescriptor(Constants.IMAGE_COLORLARGE_FILE_LOCATION);
+	Image im = colorDesc.createImage();
+	button.setImage(im);
+	button.addDisposeListener(new DisposeListener() {
+	    public void widgetDisposed(DisposeEvent e) {
+		Button button = (Button) e.getSource();
+		button.getImage().dispose();
+	    }
+	});
+	button.addSelectionListener(new SelectionAdapter() {
+	    public void widgetSelected(SelectionEvent event) {
+		ColorDialog dlg = new ColorDialog(getShell());
+
+		dlg
+			.setRGB(Util.getColor((colorCombo.getText().trim())) == null ? new RGB(
+				0, 0, 0)
+				: Util.getColor((colorCombo.getText().trim())));
+		dlg.setText(MessageUtil.getString("COLOR_DIALOG_TITLE"));
+		RGB rgb = dlg.open();
+		if (rgb != null) {
+		    String colorStr = Util.createColorString(rgb);
+		    colorCombo.setText(colorStr);
+		}
+	    }
+	});
+
+	label = new Label(this, SWT.LEFT);
+	label.setLayoutData(new GridData(GridData.END, GridData.CENTER, false,
+		false));
+	label.setText(MessageUtil.getString("BACKGROUND_IMAGE"));
+
+	backgroundImageCombo = new Combo(this, SWT.BORDER);
+	final GridData backgroundImageGridData = new GridData(GridData.FILL,
+		GridData.CENTER, true, false);
+	backgroundImageCombo.setLayoutData(backgroundImageGridData);
+	backgroundImageCombo.add(Constants.NONE);
+
+	backgroundImageCombo.addModifyListener(new ModifyListener() {
+	    public void modifyText(ModifyEvent event) {
+		String tmp = backgroundImageCombo.getText();
+		if (tmp != null) {
+		    if (tmp.trim().length() > 0)
+			attributesMap.put(CSSConstants.BACKGROUND_IMAGE, tmp);
+		    else
+			attributesMap.remove(CSSConstants.BACKGROUND_IMAGE);
+		}
+		cssDialog.setStyleForPreview();
+	    }
+	});
+
+	button = new Button(this, SWT.PUSH);
+	button.setLayoutData(new GridData(GridData.END, GridData.CENTER, false,
+		false));
+	button.setToolTipText(MessageUtil.getString("BACKGROUND_IMAGE"));
+	ImageDescriptor imageDesc = JspEditorPlugin
+		.getImageDescriptor(Constants.IMAGE_FOLDERLARGE_FILE_LOCATION);
+	Image image = imageDesc.createImage();
+	button.setImage(image);
+	button.addDisposeListener(new DisposeListener() {
+	    public void widgetDisposed(DisposeEvent e) {
+		Button button = (Button) e.getSource();
+		button.getImage().dispose();
+	    }
+	});
+	button.addSelectionListener(new SelectionAdapter() {
+	    public void widgetSelected(SelectionEvent event) {
+		IProject project = getCurrentProject();
+		ImageSelectionDialog dialog = new ImageSelectionDialog(
+			getShell(), new WorkbenchLabelProvider(),
+			new WorkbenchContentProvider());
+		dialog.setTitle(MessageUtil.getString("IMAGE_DIALOG_TITLE"));
+		dialog
+			.setMessage(MessageUtil
+				.getString("IMAGE_DIALOG_MESSAGE"));
+		dialog.setEmptyListMessage(MessageUtil
+			.getString("IMAGE_DIALOG_EMPTY_MESSAGE"));
+		dialog.setAllowMultiple(false);
+		dialog.setInput(project);
+		if (dialog.open() == ImageSelectionDialog.OK) {
+		    IFile file = (IFile) dialog.getFirstResult();
+		    String value = file.getFullPath().toString();
+		    backgroundImageCombo.add(value);
+		    backgroundImageCombo.setText(value);
+		}
+	    }
+	});
+
+	label = new Label(this, SWT.LEFT);
+	label.setLayoutData(new GridData(GridData.END, GridData.CENTER, false,
+		false));
+	label.setText(MessageUtil.getString("BACKGROUND_REPEAT"));
+
+	backgroundRepeatCombo = new Combo(this, SWT.BORDER);
+	backgroundRepeatCombo.setLayoutData(new GridData(GridData.FILL,
+		GridData.CENTER, false, false));
+
+	backgroundRepeatCombo.addModifyListener(new ModifyListener() {
+	    public void modifyText(ModifyEvent event) {
+		String tmp = backgroundRepeatCombo.getText();
+		if (tmp != null) {
+		    if (tmp.trim().length() > 0)
+			attributesMap.put(CSSConstants.BACKGROUND_REPEAT, tmp);
+		    else
+			attributesMap.remove(CSSConstants.BACKGROUND_REPEAT);
+		}
+		cssDialog.setStyleForPreview();
+	    }
+	});
+
+	ArrayList<String> list = comboMap.get(CSSConstants.BACKGROUND_REPEAT);
+	for (String str : list)
+	    backgroundRepeatCombo.add(str);
+
+	label = new Label(this, SWT.LEFT);
+	label.setLayoutData(new GridData(GridData.END, GridData.CENTER, false,
+		false));
+	label.setText(Constants.EMPTY_STRING);
+
+    }
+
+    /**
+     * Method for get current project
+     * 
+     * @return IProject
+     */
+    public static IProject getCurrentProject() {
+	IEditorPart editor = JspEditorPlugin.getDefault().getWorkbench()
+		.getActiveWorkbenchWindow().getActivePage().getActiveEditor();
+	IEditorInput input = editor.getEditorInput();
+	IFile file = null;
+	if (input instanceof IFileEditorInput) {
+	    file = ((IFileEditorInput) input).getFile();
+	}
+	if (file == null)
+	    return null;
+
+	IProject project = file.getProject();
+	return project;
+
+    }
+
+    /**
+     * Method for get data in controls (if param equal true ), or set data (if
+     * param equal false).
+     * 
+     * @param param
+     */
+    public void updateData(boolean param) {
+	String tmp;
+	
+	//TODO Evgeny Zheleznyakov remove block comment
+	/*if (param) {
+	    tmp = colorCombo.getText();
+	    if (tmp != null) {
+		if (tmp.trim().length() > 0)
+		    attributesMap.put(CSSConstants.BACKGROUND_COLOR, tmp);
+		else
+		    attributesMap.remove(CSSConstants.BACKGROUND_COLOR);
+	    }
+	    tmp = backgroundImageCombo.getText();
+	    if (tmp != null) {
+		if (tmp.trim().length() > 0)
+		    attributesMap.put(CSSConstants.BACKGROUND_IMAGE, tmp);
+		else
+		    attributesMap.remove(CSSConstants.BACKGROUND_IMAGE);
+	    }
+	    tmp = backgroundRepeatCombo.getText();
+	    if (tmp != null) {
+		if (tmp.trim().length() > 0)
+		    attributesMap.put(CSSConstants.BACKGROUND_REPEAT, tmp);
+		else
+		    attributesMap.remove(CSSConstants.BACKGROUND_REPEAT);
+	    }
+	} else {*/
+	    if ((tmp = attributesMap.get(CSSConstants.BACKGROUND_COLOR)) != null)
+		colorCombo.setText(tmp);
+	    else
+		colorCombo.setText(Constants.EMPTY_STRING);
+	    if ((tmp = attributesMap.get(CSSConstants.BACKGROUND_IMAGE)) != null)
+		backgroundImageCombo.setText(tmp);
+	    else
+		backgroundImageCombo.setText(Constants.EMPTY_STRING);
+	    if ((tmp = attributesMap.get(CSSConstants.BACKGROUND_REPEAT)) != null)
+		backgroundRepeatCombo.setText(tmp);
+	    else
+		backgroundRepeatCombo.setText(Constants.EMPTY_STRING);
+    }
+}
\ No newline at end of file

Added: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/tabs/TabBoxesControl.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/tabs/TabBoxesControl.java	                        (rev 0)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/tabs/TabBoxesControl.java	2008-07-16 15:19:39 UTC (rev 9155)
@@ -0,0 +1,680 @@
+/*******************************************************************************
+ * 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.jst.jsp.outline.cssdialog.tabs;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Set;
+import java.util.Map.Entry;
+
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.resource.JFaceResources;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.DisposeEvent;
+import org.eclipse.swt.events.DisposeListener;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.RGB;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.ColorDialog;
+import org.eclipse.swt.widgets.Combo;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Text;
+import org.jboss.tools.jst.jsp.JspEditorPlugin;
+import org.jboss.tools.jst.jsp.outline.cssdialog.CSSDialog;
+import org.jboss.tools.jst.jsp.outline.cssdialog.common.CSSConstants;
+import org.jboss.tools.jst.jsp.outline.cssdialog.common.Constants;
+import org.jboss.tools.jst.jsp.outline.cssdialog.common.ImageCombo;
+import org.jboss.tools.jst.jsp.outline.cssdialog.common.MessageUtil;
+import org.jboss.tools.jst.jsp.outline.cssdialog.common.Util;
+import org.jboss.tools.jst.jsp.outline.cssdialog.parsers.ColorParserListener;
+
+/**
+ * Class for creating control in Box tab
+ * 
+ * @author dsakovich at exadel.com
+ * 
+ */
+public class TabBoxesControl extends Composite {
+
+    private Combo extWidthCombo;
+    private Combo extHeightCombo;
+    private Combo borderWidthCombo;
+    private Combo extPaddingCombo;
+    private Combo extBorderWidthCombo;
+    private Combo borderStyleCombo;
+    private Combo extMarginCombo;
+    
+    private ImageCombo borderColorCombo;
+
+    private Text widthText;
+    private Text heightText;
+    private Text marginText;
+    private Text paddingText;  
+
+    private ArrayList<String> list;
+    private HashMap<String, String> attributesMap;
+
+    private static final int numColumns = 3;
+
+    private CSSDialog cssDialog;
+
+    /**
+     * Constructor for creating controls
+     * 
+     * @param composite
+     */
+    public TabBoxesControl(final Composite composite,
+	    final HashMap<String, ArrayList<String>> comboMap,
+	    final HashMap<String, String> attributesMap, CSSDialog dialog) {
+	super(composite, SWT.NONE);
+	this.attributesMap = attributesMap;
+	this.cssDialog = dialog;
+
+	final GridLayout gridLayout = new GridLayout();
+	gridLayout.numColumns = numColumns;
+	setLayout(gridLayout);
+
+	Label label = new Label(this, SWT.NONE);
+	label.setLayoutData(new GridData(GridData.BEGINNING, GridData.CENTER,
+		false, false, 3, 1));
+
+	label.setFont(JFaceResources.getFontRegistry().get(
+		JFaceResources.BANNER_FONT));
+	label.setText(MessageUtil.getString("DIMENSION_TITLE"));
+	label = new Label(this, SWT.LEFT);
+	label.setText(MessageUtil.getString("WIDTH"));
+	label.setLayoutData(new GridData(GridData.END, GridData.CENTER, false,
+		false));
+
+	widthText = new Text(this, SWT.BORDER | SWT.SINGLE);
+
+	widthText.addModifyListener(new ModifyListener() {
+	    public void modifyText(ModifyEvent event) {
+
+		String tmp = widthText.getText();
+
+		if (tmp != null) {
+		    if (tmp.trim().length() > 0) {
+			String extWidth = extWidthCombo.getText().trim();
+			if (extWidth != null)
+			    attributesMap.put(CSSConstants.WIDTH, tmp
+				    + extWidth);
+			else
+			    attributesMap.put(CSSConstants.WIDTH, tmp);
+		    } else
+			attributesMap.remove(CSSConstants.WIDTH);
+		} else
+		    attributesMap.remove(CSSConstants.WIDTH);
+		cssDialog.setStyleForPreview();
+	    }
+	});
+
+	widthText.setLayoutData(new GridData(GridData.FILL, GridData.CENTER,
+		true, false));
+
+	extWidthCombo = new Combo(this, SWT.BORDER | SWT.READ_ONLY);
+
+	extWidthCombo.addModifyListener(new ModifyListener() {
+	    public void modifyText(ModifyEvent event) {
+		String width = widthText.getText().trim();
+		if (width == null)
+		    return;
+		if (width.equals(Constants.EMPTY_STRING))
+		    return;
+
+		String tmp = extWidthCombo.getText();
+
+		if (tmp != null) {
+		    attributesMap.put(CSSConstants.WIDTH, width + tmp);
+		    cssDialog.setStyleForPreview();
+		}
+	    }
+	});
+
+	extWidthCombo.setLayoutData(new GridData(GridData.FILL,
+		GridData.CENTER, false, false));
+	for (int i = 0; i < Constants.extSizes.length; i++) {
+	    extWidthCombo.add(Constants.extSizes[i]);
+	}
+
+	label = new Label(this, SWT.LEFT);
+	label.setText(MessageUtil.getString("HEIGHT"));
+	label.setLayoutData(new GridData(GridData.END, GridData.CENTER, false,
+		false));
+
+	heightText = new Text(this, SWT.BORDER | SWT.SINGLE);
+
+	heightText.addModifyListener(new ModifyListener() {
+	    public void modifyText(ModifyEvent event) {
+		String tmp = heightText.getText();
+
+		if (tmp != null) {
+		    if (tmp.trim().length() > 0) {
+			String extHeight = extHeightCombo.getText().trim();
+			if (extHeight != null)
+			    attributesMap.put(CSSConstants.HEIGHT, tmp
+				    + extHeight);
+			else
+			    attributesMap.put(CSSConstants.HEIGHT, tmp);
+		    } else
+			attributesMap.remove(CSSConstants.HEIGHT);
+		} else
+		    attributesMap.remove(CSSConstants.HEIGHT);
+		cssDialog.setStyleForPreview();
+	    }
+	});
+
+	heightText.setLayoutData(new GridData(GridData.FILL, GridData.CENTER,
+		true, false));
+
+	extHeightCombo = new Combo(this, SWT.BORDER | SWT.READ_ONLY);
+
+	extHeightCombo.addModifyListener(new ModifyListener() {
+	    public void modifyText(ModifyEvent event) {
+		String height = heightText.getText().trim();
+		if (height == null)
+		    return;
+		if (height.equals(Constants.EMPTY_STRING))
+		    return;
+
+		String tmp = extHeightCombo.getText();
+
+		if (tmp != null) {
+		    attributesMap.put(CSSConstants.HEIGHT, height + tmp);
+		    cssDialog.setStyleForPreview();
+		}
+	    }
+	});
+
+	extHeightCombo.setLayoutData(new GridData(GridData.FILL,
+		GridData.CENTER, false, false));
+	for (int i = 0; i < Constants.extSizes.length; i++) {
+	    extHeightCombo.add(Constants.extSizes[i]);
+	}
+
+	label = new Label(this, SWT.NONE);
+	label.setLayoutData(new GridData(GridData.BEGINNING, GridData.CENTER,
+		false, false, 3, 1));
+	label.setFont(JFaceResources.getFontRegistry().get(
+		JFaceResources.BANNER_FONT));
+	label.setText(MessageUtil.getString("BORDER_TITLE"));
+
+	label = new Label(this, SWT.LEFT);
+	label.setLayoutData(new GridData(GridData.END, GridData.CENTER, false,
+		false));
+	label.setText(MessageUtil.getString("BORDER_STYLE"));
+
+	borderStyleCombo = new Combo(this, SWT.BORDER);
+	
+	borderStyleCombo.addModifyListener(new ModifyListener() {
+	    
+	    public void modifyText(ModifyEvent event) {
+		String tmp = borderStyleCombo.getText().trim();
+		if(tmp != null)
+		  if(!tmp.equals(Constants.EMPTY_STRING)) {
+		      attributesMap.put(CSSConstants.BORDER_STYLE, tmp);
+		      cssDialog.setStyleForPreview();
+		      return;
+		  }
+		  attributesMap.remove(CSSConstants.BORDER_STYLE);
+		  cssDialog.setStyleForPreview();
+	    }
+	});
+	
+	borderStyleCombo.setLayoutData(new GridData(GridData.FILL,
+		GridData.CENTER, false, false));
+	list = comboMap.get(CSSConstants.BORDER_STYLE);
+	for (String str : list) {
+	    borderStyleCombo.add(str);
+	}
+
+	label = new Label(this, SWT.LEFT);
+	label.setLayoutData(new GridData(GridData.END, GridData.CENTER, false,
+		false));
+	label.setText(Constants.EMPTY_STRING);
+
+	label = new Label(this, SWT.LEFT);
+	label.setLayoutData(new GridData(GridData.END, GridData.CENTER, false,
+		false));
+	label.setText(MessageUtil.getString("BORDER_COLOR"));
+
+	borderColorCombo = new ImageCombo(this, SWT.BORDER);
+	
+	borderColorCombo.addModifyListener(new ModifyListener() {
+	    
+	    public void modifyText(ModifyEvent event) {
+		String tmp = borderColorCombo.getText().trim();
+		if(tmp != null)
+		  if(!tmp.equals(Constants.EMPTY_STRING)) {
+		      attributesMap.put(CSSConstants.BORDER_COLOR, tmp);
+		      cssDialog.setStyleForPreview();
+		      return;
+		  }
+		  attributesMap.remove(CSSConstants.BORDER_COLOR);
+		  cssDialog.setStyleForPreview();
+	    }
+	});
+	
+	borderColorCombo.setLayoutData(new GridData(GridData.FILL,
+		GridData.CENTER, true, false));
+	Set<Entry<String, String>> set = ColorParserListener.getMap()
+		.entrySet();
+
+	for (Map.Entry<String, String> me : set) {
+	    RGB rgb = Util.getColor(me.getKey());
+	    borderColorCombo.add(me.getValue(), rgb);
+	}
+
+	final Button button = new Button(this, SWT.PUSH);
+	button.setLayoutData(new GridData(GridData.END, GridData.CENTER, false,
+		false));
+	button.setToolTipText(MessageUtil.getString("BORDER_COLOR_TIP"));
+	ImageDescriptor colorDesc = JspEditorPlugin
+		.getImageDescriptor(Constants.IMAGE_COLORLARGE_FILE_LOCATION);
+	Image im = colorDesc.createImage();
+	button.setImage(im);
+	button.addDisposeListener(new DisposeListener() {
+	    public void widgetDisposed(DisposeEvent e) {
+		Button button = (Button) e.getSource();
+		button.getImage().dispose();
+	    }
+	});
+	button.addSelectionListener(new SelectionAdapter() {
+	    public void widgetSelected(SelectionEvent event) {
+		ColorDialog dlg = new ColorDialog(getShell());
+
+		dlg
+			.setRGB(Util.getColor((borderColorCombo.getText()
+				.trim())) == null ? Constants.RGB_BLACK : Util
+				.getColor((borderColorCombo.getText().trim())));
+		dlg.setText(MessageUtil.getString("COLOR_DIALOG_TITLE"));
+		RGB rgb = dlg.open();
+		if (rgb != null) {
+		    String colorStr = Util.createColorString(rgb);
+		    borderColorCombo.setText(colorStr);
+		}
+	    }
+	});
+
+	label = new Label(this, SWT.LEFT);
+	label.setText(MessageUtil.getString("BORDER_WIDTH"));
+	label.setLayoutData(new GridData(GridData.END, GridData.CENTER, false,
+		false));
+
+	borderWidthCombo = new Combo(this, SWT.BORDER | SWT.SINGLE);
+
+	borderWidthCombo.addModifyListener(new ModifyListener() {
+
+	    public void modifyText(ModifyEvent e) {
+		String currentText = borderWidthCombo.getText();
+
+		list = comboMap.get(CSSConstants.BORDER_WIDTH);
+		for (String str : list) {
+		    if (currentText.equals(str)) {
+			extBorderWidthCombo.select(0);
+			extBorderWidthCombo.setEnabled(false);
+			attributesMap.put(CSSConstants.BORDER_WIDTH,
+				currentText);
+			cssDialog.setStyleForPreview();
+			return;
+		    }
+		}
+		extBorderWidthCombo.setEnabled(true);
+
+		String tmp = borderWidthCombo.getText();
+
+		if (tmp != null) {
+		    if (tmp.trim().length() > 0) {
+			String extBorderWidth = extBorderWidthCombo.getText()
+				.trim();
+			if (extBorderWidth != null)
+			    attributesMap.put(CSSConstants.BORDER_WIDTH, tmp
+				    + extBorderWidth);
+			else
+			    attributesMap.put(CSSConstants.BORDER_WIDTH, tmp);
+		    } else
+			attributesMap.remove(CSSConstants.BORDER_WIDTH);
+		} else
+		    attributesMap.remove(CSSConstants.BORDER_WIDTH);
+		cssDialog.setStyleForPreview();
+	    }
+	});
+
+	borderWidthCombo.setLayoutData(new GridData(GridData.FILL,
+		GridData.CENTER, true, false));
+
+	list = comboMap.get(CSSConstants.BORDER_WIDTH);
+	for (String str : list) {
+	    borderWidthCombo.add(str);
+	}
+
+	extBorderWidthCombo = new Combo(this, SWT.BORDER | SWT.READ_ONLY);
+	
+	extBorderWidthCombo.addModifyListener(new ModifyListener() {
+	    public void modifyText(ModifyEvent event) {
+		String borderWidth = borderWidthCombo.getText().trim();
+		if (borderWidth == null)
+		    return;
+		if (borderWidth.equals(Constants.EMPTY_STRING))
+		    return;
+
+		String tmp = extBorderWidthCombo.getText();
+
+		if (tmp != null) {
+		    attributesMap.put(CSSConstants.BORDER_WIDTH, borderWidth + tmp);
+		    cssDialog.setStyleForPreview();
+		}
+	    }
+	});
+	
+	extBorderWidthCombo.setLayoutData(new GridData(GridData.FILL,
+		GridData.CENTER, false, false));
+	for (int i = 0; i < Constants.extSizes.length; i++) {
+	    extBorderWidthCombo.add(Constants.extSizes[i]);
+	}
+
+	borderWidthCombo.addModifyListener(new ModifyListener() {
+
+	    public void modifyText(ModifyEvent e) {
+		String currentText = borderWidthCombo.getText();
+
+		list = comboMap.get(CSSConstants.BORDER_WIDTH);
+		for (String str : list) {
+		    if (currentText.equals(str)) {
+			extBorderWidthCombo.select(0);
+			extBorderWidthCombo.setEnabled(false);
+			return;
+		    }
+		    extBorderWidthCombo.setEnabled(true);
+		}
+	    }
+	});
+
+	label = new Label(this, SWT.NONE);
+	label.setLayoutData(new GridData(GridData.BEGINNING, GridData.CENTER,
+		false, false, 3, 1));
+	label.setFont(JFaceResources.getFontRegistry().get(
+		JFaceResources.BANNER_FONT));
+	label.setText(MessageUtil.getString("MARGIN_PADDING_TITLE"));
+
+	label = new Label(this, SWT.LEFT);
+	label.setText(MessageUtil.getString("MARGIN"));
+	label.setLayoutData(new GridData(GridData.END, GridData.CENTER, false,
+		false));
+
+	marginText = new Text(this, SWT.BORDER | SWT.SINGLE);
+
+	marginText.addModifyListener(new ModifyListener() {
+	    public void modifyText(ModifyEvent event) {
+
+		String tmp = marginText.getText();
+
+		if (tmp != null) {
+		    if (tmp.trim().length() > 0) {
+			String extMargin = extMarginCombo.getText().trim();
+			if (extMargin != null)
+			    attributesMap.put(CSSConstants.MARGIN, tmp
+				    + extMargin);
+			else
+			    attributesMap.put(CSSConstants.MARGIN, tmp);
+		    } else
+			attributesMap.remove(CSSConstants.MARGIN);
+		} else
+		    attributesMap.remove(CSSConstants.MARGIN);
+		cssDialog.setStyleForPreview();
+	    }
+	});
+
+	marginText.setLayoutData(new GridData(GridData.FILL, GridData.CENTER,
+		true, false));
+
+	extMarginCombo = new Combo(this, SWT.BORDER | SWT.READ_ONLY);
+
+	extMarginCombo.addModifyListener(new ModifyListener() {
+	    public void modifyText(ModifyEvent event) {
+		String margin = marginText.getText().trim();
+		if (margin == null)
+		    return;
+		if (margin.equals(Constants.EMPTY_STRING))
+		    return;
+
+		String tmp = extMarginCombo.getText();
+
+		if (tmp != null) {
+		    attributesMap.put(CSSConstants.MARGIN, margin + tmp);
+		    cssDialog.setStyleForPreview();
+		}
+	    }
+	});
+
+	extMarginCombo.setLayoutData(new GridData(GridData.FILL,
+		GridData.CENTER, false, false));
+	for (int i = 0; i < Constants.extSizes.length; i++) {
+	    extMarginCombo.add(Constants.extSizes[i]);
+	}
+
+	label = new Label(this, SWT.LEFT);
+	label.setText(MessageUtil.getString("PADDING"));
+	label.setLayoutData(new GridData(GridData.END, GridData.CENTER, false,
+		false));
+
+	paddingText = new Text(this, SWT.BORDER | SWT.SINGLE);
+
+	paddingText.addModifyListener(new ModifyListener() {
+	    public void modifyText(ModifyEvent event) {
+
+		String tmp = paddingText.getText();
+
+		if (tmp != null) {
+		    if (tmp.trim().length() > 0) {
+			String extPadding = extPaddingCombo.getText().trim();
+			if (extPadding != null)
+			    attributesMap.put(CSSConstants.PADDING, tmp
+				    + extPadding);
+			else
+			    attributesMap.put(CSSConstants.PADDING, tmp);
+		    } else
+			attributesMap.remove(CSSConstants.PADDING);
+		} else
+		    attributesMap.remove(CSSConstants.PADDING);
+		cssDialog.setStyleForPreview();
+	    }
+	});
+
+	paddingText.setLayoutData(new GridData(GridData.FILL, GridData.CENTER,
+		true, false));
+
+	extPaddingCombo = new Combo(this, SWT.BORDER | SWT.READ_ONLY);
+
+	extPaddingCombo.addModifyListener(new ModifyListener() {
+	    public void modifyText(ModifyEvent event) {
+		String padding = paddingText.getText().trim();
+		if (padding == null)
+		    return;
+		if (padding.equals(Constants.EMPTY_STRING))
+		    return;
+
+		String tmp = extPaddingCombo.getText();
+
+		if (tmp != null) {
+		    attributesMap.put(CSSConstants.PADDING, padding + tmp);
+		    cssDialog.setStyleForPreview();
+		}
+	    }
+	});
+
+	extPaddingCombo.setLayoutData(new GridData(GridData.FILL,
+		GridData.CENTER, false, false));
+	for (int i = 0; i < Constants.extSizes.length; i++) {
+	    extPaddingCombo.add(Constants.extSizes[i]);
+	}
+    }
+
+    /**
+     * Method for get data in controls (if param equal true ), or set data (if
+     * param equal false).
+     * 
+     * @param param
+     */
+    public void updateData(boolean param) {
+	String tmp;
+	
+	//TODO Evgeny Zheleznyakov remove block comment
+	/*if (param) {
+	    tmp = widthText.getText();
+	    if (tmp != null) {
+		if (tmp.trim().length() > 0)
+		    attributesMap
+			    .put(
+				    CSSConstants.WIDTH,
+				    tmp
+					    + (extWidthCombo.getText() == null ? Constants.EMPTY_STRING
+						    : extWidthCombo.getText()));
+		else
+		    attributesMap.remove(CSSConstants.WIDTH);
+	    }
+	    tmp = heightText.getText();
+	    if (tmp != null) {
+		if (tmp.trim().length() > 0)
+		    attributesMap
+			    .put(
+				    CSSConstants.HEIGHT,
+				    tmp
+					    + (extHeightCombo.getText() == null ? Constants.EMPTY_STRING
+						    : extHeightCombo.getText()));
+		else
+		    attributesMap.remove(CSSConstants.HEIGHT);
+	    }
+	    tmp = borderStyleCombo.getText();
+	    if (tmp != null && tmp.trim().length() > 0) {
+		attributesMap.put(CSSConstants.BORDER_STYLE, tmp);
+	    }
+	    tmp = borderColorCombo.getText();
+	    if (tmp != null && tmp.trim().length() > 0) {
+		attributesMap.put(CSSConstants.BORDER_COLOR, tmp);
+	    }
+	    tmp = borderWidthCombo.getText();
+	    if (tmp != null) {
+		if (tmp.trim().length() > 0)
+		    attributesMap
+			    .put(
+				    CSSConstants.BORDER_WIDTH,
+				    tmp
+					    + (extBorderWidthCombo.getText() == null ? Constants.EMPTY_STRING
+						    : extBorderWidthCombo
+							    .getText()));
+		else
+		    attributesMap.remove(CSSConstants.BORDER_WIDTH);
+	    }
+	    tmp = marginText.getText();
+	    if (tmp != null) {
+		if (tmp.trim().length() > 0)
+		    attributesMap
+			    .put(
+				    CSSConstants.MARGIN,
+				    tmp
+					    + (extMarginCombo.getText() == null ? Constants.EMPTY_STRING
+						    : extMarginCombo.getText()));
+		else
+		    attributesMap.remove(CSSConstants.MARGIN);
+	    }
+	    tmp = paddingText.getText();
+	    if (tmp != null) {
+		if (tmp.trim().length() > 0)
+		    attributesMap
+			    .put(
+				    CSSConstants.PADDING,
+				    tmp
+					    + (extPaddingCombo.getText() == null ? Constants.EMPTY_STRING
+						    : extPaddingCombo.getText()));
+		else
+		    attributesMap.remove(CSSConstants.PADDING);
+	    }
+	} else {*/
+	    if ((tmp = attributesMap.get(CSSConstants.WIDTH)) != null) {
+		String[] str = Util.convertExtString(tmp);
+		widthText.setText(str[0]);
+		if (extWidthCombo.indexOf(str[1]) != -1) {
+		    extWidthCombo.setText(str[1]);
+		    extWidthCombo.select(extWidthCombo.indexOf(str[1]));
+		} else
+		    extWidthCombo.select(0);
+	    } else {
+		widthText.setText(Constants.EMPTY_STRING);
+		extWidthCombo.select(0);
+	    }
+	    if ((tmp = attributesMap.get(CSSConstants.HEIGHT)) != null) {
+		String[] str = Util.convertExtString(tmp);
+		heightText.setText(str[0]);
+		if (extHeightCombo.indexOf(str[1]) != -1) {
+		    extHeightCombo.setText(str[1]);
+		    extHeightCombo.select(extHeightCombo.indexOf(str[1]));
+		} else
+		    extHeightCombo.select(0);
+	    } else {
+		heightText.setText(Constants.EMPTY_STRING);
+		extHeightCombo.select(0);
+	    }
+	    if ((tmp = attributesMap.get(CSSConstants.BORDER_STYLE)) != null)
+		borderStyleCombo.setText(tmp);
+	    else
+		borderStyleCombo.setText(Constants.EMPTY_STRING);
+	    if ((tmp = attributesMap.get(CSSConstants.BORDER_COLOR)) != null)
+		borderColorCombo.setText(tmp);
+	    else
+		borderColorCombo.setText(Constants.EMPTY_STRING);
+	    if ((tmp = attributesMap.get(CSSConstants.BORDER_WIDTH)) != null) {
+		String[] str = Util.convertExtString(tmp);
+		borderWidthCombo.setText(str[0]);
+		if (extBorderWidthCombo.indexOf(str[1]) != -1) {
+		    extBorderWidthCombo.setText(str[1]);
+		    extBorderWidthCombo.select(extBorderWidthCombo
+			    .indexOf(str[1]));
+		} else
+		    extBorderWidthCombo.select(0);
+	    } else {
+		borderWidthCombo.setText(Constants.EMPTY_STRING);
+		extBorderWidthCombo.select(0);
+	    }
+	    if ((tmp = attributesMap.get(CSSConstants.MARGIN)) != null) {
+		String[] str = Util.convertExtString(tmp);
+		marginText.setText(str[0]);
+		if (extMarginCombo.indexOf(str[1]) != -1) {
+		    extMarginCombo.setText(str[1]);
+		    extMarginCombo.select(extMarginCombo.indexOf(str[1]));
+		} else
+		    extMarginCombo.select(0);
+	    } else {
+		marginText.setText(Constants.EMPTY_STRING);
+		extMarginCombo.select(0);
+	    }
+	    if ((tmp = attributesMap.get(CSSConstants.PADDING)) != null) {
+		String[] str = Util.convertExtString(tmp);
+		paddingText.setText(str[0]);
+		if (extPaddingCombo.indexOf(str[1]) != -1) {
+		    extPaddingCombo.setText(str[1]);
+		    extPaddingCombo.select(extPaddingCombo.indexOf(str[1]));
+		} else
+		    extPaddingCombo.select(0);
+	    } else {
+		paddingText.setText(Constants.EMPTY_STRING);
+		extPaddingCombo.select(0);
+	    }
+    }
+}
\ No newline at end of file

Added: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/tabs/TabPropertySheetControl.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/tabs/TabPropertySheetControl.java	                        (rev 0)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/tabs/TabPropertySheetControl.java	2008-07-16 15:19:39 UTC (rev 9155)
@@ -0,0 +1,192 @@
+/*******************************************************************************
+ * 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.jst.jsp.outline.cssdialog.tabs;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Set;
+
+import org.eclipse.jface.resource.JFaceResources;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.FillLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.TabFolder;
+import org.eclipse.swt.widgets.Tree;
+import org.eclipse.swt.widgets.TreeColumn;
+import org.eclipse.swt.widgets.TreeItem;
+import org.jboss.tools.jst.jsp.outline.cssdialog.CSSDialog;
+import org.jboss.tools.jst.jsp.outline.cssdialog.common.Constants;
+import org.jboss.tools.jst.jsp.outline.cssdialog.events.TabPropertySheetMouseAdapter;
+
+/**
+ * 
+ * Class for creating Property sheet tab
+ * 
+ * @author Evgeny Zheleznyakov
+ * 
+ */
+public class TabPropertySheetControl extends Composite {
+
+    private String columns[] = new String[] { "Attribute", "Value" };
+
+    private Tree tree;
+
+    private HashMap<String, String> attributesMap;
+
+    /**
+     * Constructor for creating controls
+     * 
+     * @param composite
+     *                The parent composite for tab
+     */
+    public TabPropertySheetControl(TabFolder tabFolder,
+	    HashMap<String, ArrayList<String>> elementMap,
+	    HashMap<String, ArrayList<String>> comboMap,
+	    HashMap<String, String> attributesMap,
+	    CSSDialog dialog) {
+	super(tabFolder, SWT.NONE);
+
+	this.attributesMap = attributesMap;
+
+	setLayout(new FillLayout());
+
+	tree = new Tree(this, SWT.NONE);
+	tree.setHeaderVisible(true);
+	tree.setLinesVisible(true);
+
+	// Create NUM columns
+	for (int i = 0; i < columns.length; i++) {
+	    TreeColumn column = new TreeColumn(tree, SWT.LEFT | SWT.COLOR_BLACK);
+	    column.setText(columns[i]);
+	}
+
+	Set<String> set = elementMap.keySet();
+
+	for (String str : set) {
+
+	    TreeItem item = new TreeItem(tree, SWT.NONE);
+	    item.setText(str);
+	    item.setFont(Constants.FIRST_COLUMN, JFaceResources
+		    .getFontRegistry().get(JFaceResources.TEXT_FONT));
+	    ArrayList<String> list = elementMap.get(str);
+
+	    for (String strList : list) {
+
+		TreeItem subItem = new TreeItem(item, SWT.NONE);
+		subItem.setText(Constants.FIRST_COLUMN, strList);
+	    }
+	}
+	updateData(false);
+
+	tree.addMouseListener(new TabPropertySheetMouseAdapter(tree,
+		elementMap, comboMap, this, dialog));
+
+	for (int i = 0; i < tree.getColumnCount(); i++)
+	    tree.getColumn(i).pack();
+    }
+
+    /**
+     * Method for get data in controls (if param equal true ), or set data (if
+     * param equal false).
+     * 
+     * @param update
+     */
+    public void updateData(boolean update) {
+	if (update) {
+
+	    for (int i = 0; i < tree.getItemCount(); i++) {
+		for (int j = 0; j < tree.getItem(i).getItemCount(); j++) {
+		    if (tree.getItem(i).getItem(j).getText(
+			    Constants.SECOND_COLUMN) == null) {
+			attributesMap.remove(tree.getItem(i).getItem(j)
+				.getText(Constants.FIRST_COLUMN));
+		    } else if (tree.getItem(i).getItem(j).getText(
+			    Constants.SECOND_COLUMN).trim().equals(
+			    Constants.EMPTY_STRING)) {
+			attributesMap.remove(tree.getItem(i).getItem(j)
+				.getText(Constants.FIRST_COLUMN));
+		    } else {
+			attributesMap.put(tree.getItem(i).getItem(j).getText(
+				Constants.FIRST_COLUMN), tree.getItem(i)
+				.getItem(j).getText(Constants.SECOND_COLUMN));
+		    }
+		}
+	    }
+	} else {
+
+	    for (int i = 0; i < tree.getItemCount(); i++)
+		for (int j = 0; j < tree.getItem(i).getItemCount(); j++)
+		    tree.getItem(i).getItem(j).setText(Constants.SECOND_COLUMN,
+			    Constants.EMPTY_STRING);
+
+	    Set<String> set = attributesMap.keySet();
+	    for (String str : set) {
+
+		for (int i = 0; i < tree.getItemCount(); i++)
+		    for (int j = 0; j < tree.getItem(i).getItemCount(); j++)
+			if (tree.getItem(i).getItem(j).getText(
+				Constants.FIRST_COLUMN).equals(str))
+			    tree.getItem(i).getItem(j).setText(
+				    Constants.SECOND_COLUMN,
+				    attributesMap.get(str));
+	    }	   
+	    setExpanded();
+	}
+    }
+
+    /**
+     * 
+     * Set expanded item for not empty css attributes
+     */
+    private void setExpanded() {
+
+	TreeItem item = null;
+
+	for (int i = 0; i < tree.getItemCount(); i++)
+	    tree.getItem(i).setExpanded(false);
+
+	Set<String> set = attributesMap.keySet();
+
+	for (String attr : set)
+	    if ((item = find(attr)) != null) {
+		item.setExpanded(true);
+	    }
+
+	for (int i = 0; i < tree.getColumnCount(); i++)
+	    tree.getColumn(i).pack();
+    }
+
+    /**
+     * 
+     * Find tree item for expand
+     * 
+     * @param attr
+     *                Name of css attributes
+     * @return Tree item which will expand
+     */
+    private TreeItem find(String attr) {
+
+	TreeItem item = null;
+	TreeItem subItem = null;
+
+	for (int i = 0; i < tree.getItemCount(); i++) {
+
+	    item = tree.getItem(i);
+	    for (int j = 0; j < item.getItemCount(); j++) {
+
+		subItem = item.getItem(j);
+		if (subItem.getText().equals(attr))
+		    return item;
+	    }
+	}
+	return null;
+    }
+}
\ No newline at end of file

Added: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/tabs/TabQuickEditControl.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/tabs/TabQuickEditControl.java	                        (rev 0)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/tabs/TabQuickEditControl.java	2008-07-16 15:19:39 UTC (rev 9155)
@@ -0,0 +1,608 @@
+/*******************************************************************************
+ * 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.jst.jsp.outline.cssdialog.tabs;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.StringTokenizer;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.window.Window;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.DisposeEvent;
+import org.eclipse.swt.events.DisposeListener;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.RGB;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.ColorDialog;
+import org.eclipse.swt.widgets.Combo;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IFileEditorInput;
+import org.eclipse.ui.model.WorkbenchContentProvider;
+import org.eclipse.ui.model.WorkbenchLabelProvider;
+import org.jboss.tools.jst.jsp.JspEditorPlugin;
+import org.jboss.tools.jst.jsp.outline.cssdialog.CSSDialog;
+import org.jboss.tools.jst.jsp.outline.cssdialog.FontFamilyDialog;
+import org.jboss.tools.jst.jsp.outline.cssdialog.ImageSelectionDialog;
+import org.jboss.tools.jst.jsp.outline.cssdialog.common.CSSConstants;
+import org.jboss.tools.jst.jsp.outline.cssdialog.common.Constants;
+import org.jboss.tools.jst.jsp.outline.cssdialog.common.ImageCombo;
+import org.jboss.tools.jst.jsp.outline.cssdialog.common.MessageUtil;
+import org.jboss.tools.jst.jsp.outline.cssdialog.common.Util;
+import org.jboss.tools.jst.jsp.outline.cssdialog.parsers.ColorParserListener;
+
+/**
+ * 
+ * Class for creating control in Quick edit tab
+ * 
+ * @author Evgeny Zheleznyakov
+ * 
+ */
+public class TabQuickEditControl extends Composite {
+
+    private static String COLON_STRING = ":";
+    private static String SPACE_STRING = " ";
+
+    private static String DASH_STRING = "-";
+
+    private static int FIRST_INDEX = 0;
+    private static int SECOND_INDEX = 1;
+
+    private static int GRID_NUM_COLUMNS = 3;
+
+    private static int VALUE_NUMBER = 0;
+    private static int EXT_VALUE_NUMBER = 1;
+
+    private Label label = null;
+
+    private HashMap<String, ArrayList<String>> comboMap;
+    private HashMap<String, String> attributesMap;
+
+    private CSSDialog dialog;
+
+    /**
+     * Constructor for creating controls
+     * 
+     * @param composite
+     *                The parent composite for tab
+     */
+    public TabQuickEditControl(Composite sc,
+	    HashMap<String, ArrayList<String>> comboMap,
+	    HashMap<String, String> attributesMap, CSSDialog dialog) {
+	super(sc, SWT.NONE);
+
+	this.dialog = dialog;
+	this.attributesMap = attributesMap;
+	this.comboMap = comboMap;
+	GridLayout gridLayout = new GridLayout();
+	gridLayout.numColumns = GRID_NUM_COLUMNS;
+	setLayout(gridLayout);
+
+	ArrayList<String> listKeys = new ArrayList<String>();
+
+	for (String key : attributesMap.keySet())
+	    listKeys.add(key);
+
+	Collections.sort(listKeys);
+
+	for (String key : listKeys) {
+
+	    label = new Label(this, SWT.LEFT);
+	    label.setText(format(key));
+	    label.setLayoutData(new GridData(GridData.END, GridData.CENTER,
+		    false, false));
+	    if (Util.searchInCombo(key, comboMap.keySet()))
+		createCombo(this, key, attributesMap.get(key));
+	    else
+		createText(this, key, attributesMap.get(key));
+	}
+    }
+
+    /**
+     * Method for creating combo controls
+     * 
+     * @param composite
+     *                The parent composite for tab
+     * @param name
+     *                Name of css element
+     * @param value
+     *                Value of css element
+     */
+    private void createCombo(final Composite composite, final String name,
+	    final String value) {
+
+	Button btn = null;
+	//if css attribute with color combo
+	if (name.indexOf(CSSConstants.COLOR) != Constants.DONT_CONTAIN) {
+
+	    final ImageCombo colorCombo = new ImageCombo(composite, SWT.BORDER);
+	    colorCombo.setText(value);
+	    colorCombo.setLayoutData(new GridData(GridData.FILL,
+		    GridData.CENTER, true, false));
+
+	    btn = new Button(composite, SWT.NONE);
+	    btn.setLayoutData(new GridData(GridData.END, GridData.CENTER,
+		    false, false));
+	    ImageDescriptor imageDes = JspEditorPlugin
+		    .getImageDescriptor(Constants.IMAGE_COLOR_FILE_LOCATION);
+	    Image colorImage = imageDes.createImage();
+	    btn.setImage(colorImage);
+	    btn.setToolTipText(MessageUtil.getString("COLOR_DIALOG_TITLE"));
+	    btn.addDisposeListener(new DisposeListener() {
+		public void widgetDisposed(DisposeEvent e) {
+		    Button button = (Button) e.getSource();
+		    button.getImage().dispose();
+		}
+	    });
+	    btn.addSelectionListener(new SelectionAdapter() {
+
+		public void widgetSelected(SelectionEvent event) {
+
+		    RGB startRgb = Util.getColor((colorCombo.getText()
+			    .toLowerCase().trim()));
+
+		    if (startRgb == null)
+			startRgb = Constants.RGB_BLACK;
+
+		    ColorDialog colorDialog = new ColorDialog(composite
+			    .getShell());
+		    colorDialog.setRGB(startRgb);
+		    colorDialog.setText(MessageUtil
+			    .getString("COLOR_DIALOG_TITLE"));
+		    RGB rgb = colorDialog.open();
+		    if (rgb != null) {
+
+			String str = Util.createColorString(rgb);
+
+			if (ColorParserListener.getMap().get(str) != null)
+			    colorCombo.setText(ColorParserListener.getMap()
+				    .get(str));
+			else
+			    colorCombo.setText(str);
+		    }
+		}
+	    });
+
+	    colorCombo.addModifyListener(new ModifyListener() {
+
+		String key = name;
+
+		public void modifyText(ModifyEvent event) {
+
+		    if (!colorCombo.getText().trim().equals(
+			    Constants.EMPTY_STRING))
+			attributesMap.put(key, colorCombo.getText().trim());
+		    else
+			attributesMap.remove(key);
+
+		    dialog.setStyleForPreview();
+		}
+	    });
+
+	    HashMap<String, String> colorMap = ColorParserListener.getMap();
+
+	    for (String key : colorMap.keySet()) {
+		RGB rgb = Util.getColor(key);
+		colorCombo.add(colorMap.get(key), rgb);
+	    }
+
+	    if (btn == null) {
+		new Label(composite, SWT.NONE);
+	    }
+
+	    colorCombo.setText(value);
+
+	    //if css attribute contain choose_folder button
+	} else if (Util.containFolder(name)) {
+	    final Combo combo = new Combo(composite, SWT.NONE);
+	    combo.setLayoutData(new GridData(GridData.FILL, GridData.CENTER,
+		    true, false));
+	    btn = new Button(composite, SWT.NONE);
+	    btn.setLayoutData(new GridData(GridData.END, GridData.CENTER,
+		    false, false));
+	    ImageDescriptor imageDes = JspEditorPlugin
+		    .getImageDescriptor(Constants.IMAGE_FOLDER_FILE_LOCATION);
+	    Image chooserImage = imageDes.createImage();
+	    btn.setImage(chooserImage);
+	    btn.addDisposeListener(new DisposeListener() {
+		public void widgetDisposed(DisposeEvent e) {
+		    Button button = (Button) e.getSource();
+		    button.getImage().dispose();
+		}
+	    });
+	    btn.setToolTipText(MessageUtil.getString("COLOR_DIALOG_TITLE"));
+	    ArrayList<String> list = comboMap.get(name);
+	    for (String str : list)
+		combo.add(str);
+
+	    btn.addSelectionListener(new SelectionAdapter() {
+		public void widgetSelected(SelectionEvent event) {
+		    IProject project = getCurrentProject();
+		    ImageSelectionDialog dialog = new ImageSelectionDialog(
+			    composite.getShell(), new WorkbenchLabelProvider(),
+			    new WorkbenchContentProvider());
+		    dialog
+			    .setTitle(MessageUtil
+				    .getString("IMAGE_DIALOG_TITLE"));
+		    dialog.setMessage(MessageUtil
+			    .getString("IMAGE_DIALOG_MESSAGE"));
+		    dialog.setEmptyListMessage(MessageUtil
+			    .getString("IMAGE_DIALOG_EMPTY_MESSAGE"));
+		    dialog.setAllowMultiple(false);
+		    dialog.setInput(project);
+		    if (dialog.open() == ImageSelectionDialog.OK) {
+			IFile file = (IFile) dialog.getFirstResult();
+			String value = file.getFullPath().toString();
+			combo.setText(value);
+		    }
+		}
+	    });
+
+	    combo.setText(value);
+	    combo.addModifyListener(new ModifyListener() {
+
+		String key = name;
+
+		public void modifyText(ModifyEvent event) {
+		    if (!combo.getText().trim().equals(Constants.EMPTY_STRING))
+			attributesMap.put(key, combo.getText().trim());
+		    else
+			attributesMap.remove(key);
+
+		    dialog.setStyleForPreview();
+		}
+	    });
+
+	} else {
+	    final Combo combo = new Combo(composite, SWT.CENTER);
+	    combo.setLayoutData(new GridData(GridData.FILL, GridData.CENTER,
+		    true, false));
+
+	    ArrayList<String> list = comboMap.get(name);
+	    for (String str : list)
+		combo.add(str);
+
+	    final Combo extCombo;
+	    String values[] = null;
+	    boolean ext = false;
+	    if (Util.searchInExtElement(name)) {
+		ext = true;
+		values = Util.convertExtString(value);
+		extCombo = new Combo(composite, SWT.BORDER | SWT.READ_ONLY);
+		extCombo.setLayoutData(new GridData(GridData.END,
+			GridData.CENTER, false, false));
+		for (int i = 0; i < Constants.extSizes.length; i++)
+		    extCombo.add(Constants.extSizes[i]);
+		extCombo.select(extCombo.indexOf(values[EXT_VALUE_NUMBER]));
+
+		//TODO Evgeny Zheleznyakov remove block comment
+		/*extCombo.addSelectionListener(new SelectionAdapter() {
+
+		    String key = name;
+
+		    public void widgetSelected(SelectionEvent event) {
+
+			if (!attributesMap.get(key).trim().equals(
+				Constants.EMPTY_STRING)) {
+			    attributesMap.put(key, combo.getText()
+				    + extCombo.getText());
+			    dialog.setStyleForPreview();
+			}
+		    }
+		});*/
+
+		extCombo.addModifyListener(new ModifyListener() {
+
+		    String key = name;
+
+		    public void modifyText(ModifyEvent event) {
+			String tmpCombo = combo.getText().trim();
+			if (tmpCombo == null)
+			    return;
+			if (tmpCombo.equals(Constants.EMPTY_STRING))
+			    return;
+
+			String tmpExt = extCombo.getText();
+
+			if (tmpExt != null) {
+			    attributesMap.put(key, tmpCombo + tmpExt);
+			    dialog.setStyleForPreview();
+			}
+		    }
+		});
+
+		combo.addModifyListener(new ModifyListener() {
+
+		    String key = name;
+
+		    public void modifyText(ModifyEvent e) {
+
+			String currentText = combo.getText();
+
+			String[] items = combo.getItems();
+
+			for (int i = 0; i < items.length; i++) {
+			    if (currentText.equalsIgnoreCase(items[i])) {
+				extCombo.select(VALUE_NUMBER);
+				extCombo.setEnabled(false);
+				attributesMap.put(key, currentText);
+				dialog.setStyleForPreview();
+				return;
+			    }
+			}
+			extCombo.setEnabled(true);
+
+			String tmp = combo.getText().trim();
+			if (tmp != null) {
+			    if (!tmp.equals(Constants.EMPTY_STRING)) {
+				String extTmp = extCombo.getText().trim();
+				if (extTmp != null)
+				    attributesMap.put(key, tmp + extTmp);
+				else
+				    attributesMap.put(key, tmp);
+
+			    } else
+				attributesMap.remove(key);
+			} else
+			    attributesMap.remove(key);
+			dialog.setStyleForPreview();
+		    }
+		});
+
+	    } else {
+		new Label(composite, SWT.NONE).setLayoutData(new GridData(
+			GridData.END, GridData.CENTER, false, false));
+		combo.addModifyListener(new ModifyListener() {
+
+		    String key = name;
+
+		    public void modifyText(ModifyEvent event) {
+
+			if (!combo.getText().trim().equals(
+				Constants.EMPTY_STRING))
+			    attributesMap.put(key, combo.getText().trim());
+			else
+			    attributesMap.remove(key);
+
+			dialog.setStyleForPreview();
+		    }
+		});
+	    }
+
+	    if (ext)
+		combo.setText(values[VALUE_NUMBER]);
+	    else
+		combo.setText(value);
+	}
+    }
+
+    /**
+     * Method for creating text controls
+     * 
+     * @param composite
+     *                The parent composite for tab
+     * @param name
+     *                Name of css element
+     * @param value
+     *                Value of css element
+     */
+    private void createText(final Composite composite, final String name,
+	    final String value) {
+
+	Button btn = null;
+
+	final Text text = new Text(composite, SWT.BORDER);
+	text.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true,
+		false));
+
+	if (name.equalsIgnoreCase(CSSConstants.FONT_FAMILY)) {
+	    btn = new Button(composite, SWT.NONE);
+	    btn.setLayoutData(new GridData(GridData.END, GridData.CENTER,
+		    false, false));
+	    ImageDescriptor imageDes = JspEditorPlugin
+		    .getImageDescriptor(Constants.IMAGE_FONT_FILE_LOCATION);
+	    Image fontImage = imageDes.createImage();
+	    btn.setImage(fontImage);
+	    btn.setToolTipText(MessageUtil.getString("FONT_FAMILY_TIP"));
+	    btn.addDisposeListener(new DisposeListener() {
+		public void widgetDisposed(DisposeEvent e) {
+		    Button button = (Button) e.getSource();
+		    button.getImage().dispose();
+		}
+	    });
+	    btn.addSelectionListener(new SelectionAdapter() {
+		public void widgetSelected(SelectionEvent event) {
+		    FontFamilyDialog dialog = new FontFamilyDialog(composite
+			    .getShell(), text.getText());
+		    if (dialog.open() == Window.OK) {
+			text.setText(dialog.getFontFamily());
+		    }
+		}
+	    });
+
+	    text.addModifyListener(new ModifyListener() {
+
+		String key = name;
+
+		public void modifyText(ModifyEvent event) {
+
+		    if (!text.getText().trim().equals(Constants.EMPTY_STRING))
+			attributesMap.put(key, text.getText().trim());
+		    else
+			attributesMap.remove(key);
+
+		    dialog.setStyleForPreview();
+		}
+	    });
+	}
+
+	final Combo extCombo;
+	String values[] = null;
+	boolean ext = false;
+	if (btn == null) {
+	    if (Util.searchInExtElement(name)) {
+		values = Util.convertExtString(value);
+		ext = true;
+		extCombo = new Combo(composite, SWT.BORDER | SWT.READ_ONLY);
+		extCombo.setLayoutData(new GridData(GridData.END,
+			GridData.CENTER, false, false));
+		for (int i = 0; i < Constants.extSizes.length; i++)
+		    extCombo.add(Constants.extSizes[i]);
+		extCombo.select(extCombo.indexOf(values[EXT_VALUE_NUMBER]));
+
+		//TODO Evgeny Zheleznyakov remove block comment
+		/*extCombo.addSelectionListener(new SelectionAdapter() {
+
+		    String key = name;
+
+		    public void widgetSelected(SelectionEvent event) {
+
+			if (!attributesMap.get(key).trim().equals(
+				Constants.EMPTY_STRING)) {
+			    attributesMap.put(key, text.getText()
+				    + extCombo.getText());
+			    dialog.setStyleForPreview();
+			}
+		    }
+		});*/
+
+		extCombo.addModifyListener(new ModifyListener() {
+
+		    String key = name;
+
+		    public void modifyText(ModifyEvent event) {
+			String tmpCombo = text.getText().trim();
+			if (tmpCombo == null)
+			    return;
+			if (tmpCombo.equals(Constants.EMPTY_STRING))
+			    return;
+
+			String tmpExt = extCombo.getText();
+
+			if (tmpExt != null) {
+			    attributesMap.put(key, tmpCombo + tmpExt);
+			    dialog.setStyleForPreview();
+			}
+		    }
+		});
+
+		text.addModifyListener(new ModifyListener() {
+
+		    String key = name;
+
+		    public void modifyText(ModifyEvent e) {
+
+			String tmp = text.getText().trim();
+			if (tmp != null) {
+			    if (!tmp.equals(Constants.EMPTY_STRING)) {
+				String extTmp = extCombo.getText().trim();
+				if (extTmp != null)
+				    attributesMap.put(key, tmp + extTmp);
+				else
+				    attributesMap.put(key, tmp);
+
+			    } else
+				attributesMap.remove(key);
+			} else
+			    attributesMap.remove(key);
+			dialog.setStyleForPreview();
+		    }
+		});
+
+	    } else {
+		new Label(composite, SWT.NONE).setLayoutData(new GridData(
+			GridData.END, GridData.CENTER, false, false));
+
+		text.addModifyListener(new ModifyListener() {
+
+		    String key = name;
+
+		    public void modifyText(ModifyEvent event) {
+
+			if (!text.getText().trim().equals(
+				Constants.EMPTY_STRING))
+			    attributesMap.put(key, text.getText().trim());
+			else
+			    attributesMap.remove(key);
+
+			dialog.setStyleForPreview();
+		    }
+		});
+
+	    }
+	}
+
+	if (ext)
+	    text.setText(values[VALUE_NUMBER]);
+	else
+	    text.setText(value);
+    }
+
+    /**
+     * Method for get current project
+     * 
+     * @return IProject
+     */
+    public static IProject getCurrentProject() {
+	IEditorPart editor = JspEditorPlugin.getDefault().getWorkbench()
+		.getActiveWorkbenchWindow().getActivePage().getActiveEditor();
+	IEditorInput input = editor.getEditorInput();
+	IFile file = null;
+	if (input instanceof IFileEditorInput) {
+	    file = ((IFileEditorInput) input).getFile();
+	}
+	if (file == null)
+	    return null;
+
+	IProject project = file.getProject();
+	return project;
+
+    }
+
+    /**
+     * Method for format css names (text-decoration : Text Decoration)
+     * 
+     * @param str
+     *                CSS name
+     * @return Format ss name
+     */
+    private String format(String str) {
+
+	StringTokenizer st = new StringTokenizer(str, DASH_STRING);
+	String finalStr = Constants.EMPTY_STRING;
+
+	while (st.hasMoreTokens()) {
+	    StringBuffer sb = new StringBuffer(st.nextToken());
+	    String upper = sb.substring(FIRST_INDEX, SECOND_INDEX)
+		    .toUpperCase();
+	    sb.replace(FIRST_INDEX, SECOND_INDEX, upper);
+	    finalStr += sb;
+	    if (st.hasMoreTokens())
+		finalStr += SPACE_STRING;
+	    else
+		finalStr += COLON_STRING;
+	}
+	return finalStr;
+    }
+}
\ No newline at end of file

Added: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/tabs/TabTextControl.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/tabs/TabTextControl.java	                        (rev 0)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/tabs/TabTextControl.java	2008-07-16 15:19:39 UTC (rev 9155)
@@ -0,0 +1,510 @@
+/*******************************************************************************
+ * 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.jst.jsp.outline.cssdialog.tabs;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Set;
+import java.util.Map.Entry;
+
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.window.Window;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.DisposeEvent;
+import org.eclipse.swt.events.DisposeListener;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.RGB;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.ColorDialog;
+import org.eclipse.swt.widgets.Combo;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Text;
+import org.jboss.tools.jst.jsp.JspEditorPlugin;
+import org.jboss.tools.jst.jsp.outline.cssdialog.CSSDialog;
+import org.jboss.tools.jst.jsp.outline.cssdialog.FontFamilyDialog;
+import org.jboss.tools.jst.jsp.outline.cssdialog.common.CSSConstants;
+import org.jboss.tools.jst.jsp.outline.cssdialog.common.Constants;
+import org.jboss.tools.jst.jsp.outline.cssdialog.common.ImageCombo;
+import org.jboss.tools.jst.jsp.outline.cssdialog.common.MessageUtil;
+import org.jboss.tools.jst.jsp.outline.cssdialog.common.Util;
+import org.jboss.tools.jst.jsp.outline.cssdialog.parsers.ColorParserListener;
+
+/**
+ * Class for creating Text tab controls
+ * 
+ * @author dsakovich at exadel.com
+ * 
+ */
+public class TabTextControl extends Composite {
+
+    private Text fontFamilyText;
+
+    private ImageCombo colorCombo;
+    private Combo fontSizeCombo;
+    private Combo extFontSizeCombo;
+    private Combo fontStyleCombo;
+    private Combo fontWeigthCombo;
+    private Combo textDecorationCombo;
+    private Combo textAlignCombo;
+
+    private ArrayList<String> list;
+
+    private HashMap<String, String> attributesMap;
+
+    private static final int numColumns = 3;
+
+    private CSSDialog cssDialog;
+
+    /**
+     * Constructor for creating controls
+     * 
+     * @param composite
+     */
+    public TabTextControl(final Composite composite,
+	    final HashMap<String, ArrayList<String>> comboMap,
+	    final HashMap<String, String> attributesMap, CSSDialog dialog) {
+	super(composite, SWT.NONE);
+	this.attributesMap = attributesMap;
+	this.cssDialog = dialog;
+
+	final GridLayout gridLayout = new GridLayout();
+	gridLayout.numColumns = numColumns;
+	setLayout(gridLayout);
+
+	Label label = new Label(this, SWT.LEFT);
+	label.setText(MessageUtil.getString("FONT_FAMILY"));
+	label.setLayoutData(new GridData(GridData.END, GridData.CENTER, false,
+		false));
+
+	fontFamilyText = new Text(this, SWT.BORDER | SWT.SINGLE);
+	fontFamilyText.setLayoutData(new GridData(GridData.FILL,
+		GridData.CENTER, true, false));
+
+	fontFamilyText.addModifyListener(new ModifyListener() {
+	    public void modifyText(ModifyEvent event) {
+		String tmp = fontFamilyText.getText();
+		if (tmp != null) {
+		    if (tmp.trim().length() > 0)
+			attributesMap.put(CSSConstants.FONT_FAMILY, tmp);
+		    else
+			attributesMap.remove(CSSConstants.FONT_FAMILY);
+		}
+		cssDialog.setStyleForPreview();
+	    }
+	});
+
+	Button button = new Button(this, SWT.PUSH);
+	button.setLayoutData(new GridData(GridData.END, GridData.CENTER, false,
+		false));
+	button.setToolTipText(MessageUtil.getString("FONT_FAMILY_TIP"));
+	ImageDescriptor fontDesc = JspEditorPlugin
+		.getImageDescriptor(Constants.IMAGE_FONTLARGE_FILE_LOCATION);
+	Image fontImage = fontDesc.createImage();
+	button.setImage(fontImage);
+	button.addDisposeListener(new DisposeListener() {
+	    public void widgetDisposed(DisposeEvent e) {
+		Button button = (Button) e.getSource();
+		button.getImage().dispose();
+	    }
+	});
+	button.addSelectionListener(new SelectionAdapter() {
+	    public void widgetSelected(SelectionEvent event) {
+		FontFamilyDialog dialog = new FontFamilyDialog(getShell(),
+			fontFamilyText.getText());
+		if (dialog.open() == Window.OK) {
+		    fontFamilyText.setText(dialog.getFontFamily());
+		}
+	    }
+	});
+	label = new Label(this, SWT.LEFT);
+	label.setLayoutData(new GridData(GridData.END, GridData.CENTER, false,
+		false));
+	label.setText(MessageUtil.getString("COLOR"));
+
+	colorCombo = new ImageCombo(this, SWT.BORDER);
+	colorCombo.setLayoutData(new GridData(GridData.FILL, GridData.CENTER,
+		true, false));
+
+	colorCombo.addModifyListener(new ModifyListener() {
+	    public void modifyText(ModifyEvent event) {
+		String tmp = colorCombo.getText();
+		if (tmp != null) {
+		    if (tmp.trim().length() > 0)
+			attributesMap.put(CSSConstants.COLOR, tmp);
+		    else
+			attributesMap.remove(CSSConstants.COLOR);
+		}
+		cssDialog.setStyleForPreview();
+	    }
+	});
+
+	// ////////////////////////////////////////////////////////////////////////
+	Set<Entry<String, String>> set = ColorParserListener.getMap()
+		.entrySet();
+
+	for (Map.Entry<String, String> me : set) {
+	    RGB rgb = Util.getColor(me.getKey());
+	    colorCombo.add(me.getValue(), rgb);
+	}
+	// ///////////////////////////////////////////////////////////////////////
+
+	button = new Button(this, SWT.PUSH);
+	button.setLayoutData(new GridData(GridData.END, GridData.CENTER, false,
+		false));
+	button.setToolTipText(MessageUtil.getString("COLOR_TIP"));
+	ImageDescriptor colorDesc = JspEditorPlugin
+		.getImageDescriptor(Constants.IMAGE_COLORLARGE_FILE_LOCATION);
+	Image im = colorDesc.createImage();
+	button.setImage(im);
+	button.addDisposeListener(new DisposeListener() {
+	    public void widgetDisposed(DisposeEvent e) {
+		Button button = (Button) e.getSource();
+		button.getImage().dispose();
+	    }
+	});
+	button.addSelectionListener(new SelectionAdapter() {
+	    public void widgetSelected(SelectionEvent event) {
+		ColorDialog dlg = new ColorDialog(getShell());
+
+		dlg
+			.setRGB(Util.getColor((colorCombo.getText().trim())) == null ? Constants.RGB_BLACK
+				: Util.getColor((colorCombo.getText().trim())));
+		dlg.setText(MessageUtil.getString("COLOR_DIALOG_TITLE"));
+		RGB rgb = dlg.open();
+		if (rgb != null) {
+		    String colorStr = Util.createColorString(rgb);
+		    colorCombo.setText(colorStr);
+		}
+	    }
+	});
+
+	label = new Label(this, SWT.LEFT);
+	label.setLayoutData(new GridData(GridData.END, GridData.CENTER, false,
+		false));
+	label.setText(MessageUtil.getString("FONT_SIZE"));
+
+	fontSizeCombo = new Combo(this, SWT.BORDER | SWT.SINGLE);
+
+	final GridData fontSizeGridData = new GridData(GridData.FILL,
+		GridData.CENTER, true, false);
+	fontSizeCombo.setLayoutData(fontSizeGridData);
+
+	list = comboMap.get(CSSConstants.FONT_SIZE);
+	for (String str : list) {
+	    fontSizeCombo.add(str);
+	}
+
+	extFontSizeCombo = new Combo(this, SWT.BORDER | SWT.READ_ONLY);
+
+	extFontSizeCombo.addModifyListener(new ModifyListener() {
+	    public void modifyText(ModifyEvent event) {
+		String fontSize = fontSizeCombo.getText().trim();
+		if (fontSize == null)
+		    return;
+		if (fontSize.equals(Constants.EMPTY_STRING))
+		    return;
+
+		String tmp = extFontSizeCombo.getText();
+
+		if (tmp != null) {
+		    attributesMap.put(CSSConstants.FONT_SIZE, fontSize + tmp);
+		    cssDialog.setStyleForPreview();
+		}
+	    }
+	});
+
+	extFontSizeCombo.setLayoutData(new GridData(GridData.FILL,
+		GridData.CENTER, false, false));
+	for (int i = 0; i < Constants.extSizes.length; i++) {
+	    extFontSizeCombo.add(Constants.extSizes[i]);
+	}
+
+	fontSizeCombo.addModifyListener(new ModifyListener() {
+
+	    public void modifyText(ModifyEvent e) {
+		String currentText = fontSizeCombo.getText();
+
+		list = comboMap.get(CSSConstants.FONT_SIZE);
+		for (String str : list) {
+		    if (currentText.equals(str)) {
+			extFontSizeCombo.select(0);
+			extFontSizeCombo.setEnabled(false);
+			attributesMap.put(CSSConstants.FONT_SIZE, currentText);
+			cssDialog.setStyleForPreview();
+			return;
+		    }
+		}
+		extFontSizeCombo.setEnabled(true);
+
+		String tmp = fontSizeCombo.getText();
+
+		if (tmp != null) {
+		    if (tmp.trim().length() > 0) {
+			String extFont = extFontSizeCombo.getText().trim();
+			if (extFont != null)
+			    attributesMap.put(CSSConstants.FONT_SIZE, tmp
+				    + extFont);
+			else
+			    attributesMap.put(CSSConstants.FONT_SIZE, tmp);
+		    } else
+			attributesMap.remove(CSSConstants.FONT_SIZE);
+		} else
+		    attributesMap.remove(CSSConstants.FONT_SIZE);
+		cssDialog.setStyleForPreview();
+	    }
+	});
+
+	label = new Label(this, SWT.LEFT);
+	label.setLayoutData(new GridData(GridData.END, GridData.CENTER, false,
+		false));
+	label.setText(MessageUtil.getString("FONT_STYLE"));
+
+	fontStyleCombo = new Combo(this, SWT.BORDER);
+
+	fontStyleCombo.addModifyListener(new ModifyListener() {
+	    public void modifyText(ModifyEvent event) {
+		String tmp = fontStyleCombo.getText();
+		if (tmp != null) {
+		    if (tmp.trim().length() > 0)
+			attributesMap.put(CSSConstants.FONT_STYLE, tmp);
+		    else
+			attributesMap.remove(CSSConstants.FONT_STYLE);
+		}
+		cssDialog.setStyleForPreview();
+	    }
+	});
+
+	fontStyleCombo.setLayoutData(new GridData(GridData.FILL,
+		GridData.CENTER, false, false));
+
+	list = comboMap.get(CSSConstants.FONT_STYLE);
+	for (String str : list) {
+	    fontStyleCombo.add(str);
+	}
+
+	label = new Label(this, SWT.LEFT);
+	label.setLayoutData(new GridData(GridData.END, GridData.CENTER, false,
+		false));
+	label.setText(Constants.EMPTY_STRING);
+
+	label = new Label(this, SWT.LEFT);
+	label.setLayoutData(new GridData(GridData.END, GridData.CENTER, false,
+		false));
+	label.setText(MessageUtil.getString("FONT_WEIGHT"));
+
+	fontWeigthCombo = new Combo(this, SWT.BORDER);
+
+	fontWeigthCombo.addModifyListener(new ModifyListener() {
+	    public void modifyText(ModifyEvent event) {
+		String tmp = fontWeigthCombo.getText();
+		if (tmp != null) {
+		    if (tmp.trim().length() > 0)
+			attributesMap.put(CSSConstants.FONT_WEIGHT, tmp);
+		    else
+			attributesMap.remove(CSSConstants.FONT_WEIGHT);
+		}
+		cssDialog.setStyleForPreview();
+	    }
+	});
+
+	fontWeigthCombo.setLayoutData(new GridData(GridData.FILL,
+		GridData.CENTER, false, false));
+
+	list = comboMap.get(CSSConstants.FONT_WEIGHT);
+	for (String str : list) {
+	    fontWeigthCombo.add(str);
+	}
+
+	label = new Label(this, SWT.LEFT);
+	label.setLayoutData(new GridData(GridData.END, GridData.CENTER, false,
+		false));
+	label.setText(Constants.EMPTY_STRING);
+
+	label = new Label(this, SWT.LEFT);
+	label.setLayoutData(new GridData(GridData.END, GridData.CENTER, false,
+		false));
+	label.setText(MessageUtil.getString("TEXT_DECORATION"));
+
+	textDecorationCombo = new Combo(this, SWT.BORDER);
+
+	textDecorationCombo.addModifyListener(new ModifyListener() {
+	    public void modifyText(ModifyEvent event) {
+		String tmp = textDecorationCombo.getText();
+		if (tmp != null) {
+		    if (tmp.trim().length() > 0)
+			attributesMap.put(CSSConstants.TEXT_DECORATION, tmp);
+		    else
+			attributesMap.remove(CSSConstants.TEXT_DECORATION);
+		}
+		cssDialog.setStyleForPreview();
+	    }
+	});
+
+	textDecorationCombo.setLayoutData(new GridData(GridData.FILL,
+		GridData.CENTER, false, false));
+
+	list = comboMap.get(CSSConstants.TEXT_DECORATION);
+	for (String str : list) {
+	    textDecorationCombo.add(str);
+	}
+
+	label = new Label(this, SWT.LEFT);
+	label.setLayoutData(new GridData(GridData.END, GridData.CENTER, false,
+		false));
+	label.setText(Constants.EMPTY_STRING);
+
+	label = new Label(this, SWT.LEFT);
+	label.setLayoutData(new GridData(GridData.END, GridData.CENTER, false,
+		false));
+	label.setText(MessageUtil.getString("TEXT_ALIGN"));
+
+	textAlignCombo = new Combo(this, SWT.BORDER);
+
+	textAlignCombo.addModifyListener(new ModifyListener() {
+	    public void modifyText(ModifyEvent event) {
+		String tmp = textAlignCombo.getText();
+		if (tmp != null) {
+		    if (tmp.trim().length() > 0)
+			attributesMap.put(CSSConstants.TEXT_ALIGN, tmp);
+		    else
+			attributesMap.remove(CSSConstants.TEXT_ALIGN);
+		}
+		cssDialog.setStyleForPreview();
+	    }
+	});
+
+	textAlignCombo.setLayoutData(new GridData(GridData.FILL,
+		GridData.CENTER, false, false));
+
+	list = comboMap.get(CSSConstants.TEXT_ALIGN);
+	for (String str : list) {
+	    textAlignCombo.add(str);
+	}
+
+	label = new Label(this, SWT.LEFT);
+	label.setLayoutData(new GridData(GridData.END, GridData.CENTER, false,
+		false));
+	label.setText(Constants.EMPTY_STRING);
+
+    }
+
+    /**
+     * Method for get data in controls (if param equal true ), or set data (if
+     * param equal false).
+     * 
+     * @param param
+     */
+    public void updateData(boolean param) {
+	String tmp;
+	//TODO Evgeny Zheleznyakov remove block comment
+	/*if (param) {
+	    tmp = fontFamilyText.getText();
+	    if (tmp != null) {
+		if (tmp.trim().length() > 0)
+		    attributesMap.put(CSSConstants.FONT_FAMILY, tmp);
+		else
+		    attributesMap.remove(CSSConstants.FONT_FAMILY);
+	    }
+	    tmp = colorCombo.getText();
+	    if (tmp != null) {
+		if (tmp.trim().length() > 0)
+		    attributesMap.put(CSSConstants.COLOR, tmp);
+		else
+		    attributesMap.remove(CSSConstants.COLOR);
+	    }
+	    tmp = fontSizeCombo.getText();
+	    if (tmp != null) {
+		if (tmp.trim().length() > 0)
+		    attributesMap
+			    .put(
+				    CSSConstants.FONT_SIZE,
+				    tmp
+					    + (extFontSizeCombo.getText() == null ? Constants.EMPTY_STRING
+						    : extFontSizeCombo
+							    .getText()));
+		else
+		    attributesMap.remove(CSSConstants.FONT_SIZE);
+	    }
+	    tmp = textDecorationCombo.getText();
+	    if (tmp != null) {
+		if (tmp.trim().length() > 0)
+		    attributesMap.put(CSSConstants.TEXT_DECORATION, tmp);
+		else
+		    attributesMap.remove(CSSConstants.TEXT_DECORATION);
+	    }
+	    tmp = fontStyleCombo.getText();
+	    if (tmp != null) {
+		if (tmp.trim().length() > 0)
+		    attributesMap.put(CSSConstants.FONT_STYLE, tmp);
+		else
+		    attributesMap.remove(CSSConstants.FONT_STYLE);
+	    }
+	    tmp = fontWeigthCombo.getText();
+	    if (tmp != null) {
+		if (tmp.trim().length() > 0)
+		    attributesMap.put(CSSConstants.FONT_WEIGHT, tmp);
+		else
+		    attributesMap.remove(CSSConstants.FONT_WEIGHT);
+	    }
+	    tmp = textAlignCombo.getText();
+	    if (tmp != null) {
+		if (tmp.trim().length() > 0)
+		    attributesMap.put(CSSConstants.TEXT_ALIGN, tmp);
+		else
+		    attributesMap.remove(CSSConstants.TEXT_ALIGN);
+	    }
+	} else {*/
+	    if ((tmp = attributesMap.get(CSSConstants.FONT_FAMILY)) != null)
+		fontFamilyText.setText(tmp);
+	    else
+		fontFamilyText.setText(Constants.EMPTY_STRING);
+	    if ((tmp = attributesMap.get(CSSConstants.COLOR)) != null)
+		colorCombo.setText(tmp);
+	    else
+		colorCombo.setText(Constants.EMPTY_STRING);
+	    if ((tmp = attributesMap.get(CSSConstants.FONT_SIZE)) != null) {
+		String[] str = Util.convertExtString(tmp);
+		fontSizeCombo.setText(str[0]);
+		if (extFontSizeCombo.indexOf(str[1]) != -1) {
+		    extFontSizeCombo.setText(str[1]);
+		    extFontSizeCombo.select(extFontSizeCombo.indexOf(str[1]));
+		} else
+		    extFontSizeCombo.select(0);
+	    } else {
+		fontSizeCombo.setText(Constants.EMPTY_STRING);
+		extFontSizeCombo.select(0);
+	    }
+	    if ((tmp = attributesMap.get(CSSConstants.TEXT_DECORATION)) != null)
+		textDecorationCombo.setText(tmp);
+	    else
+		textDecorationCombo.setText(Constants.EMPTY_STRING);
+	    if ((tmp = attributesMap.get(CSSConstants.FONT_STYLE)) != null)
+		fontStyleCombo.setText(tmp);
+	    else
+		fontStyleCombo.setText(Constants.EMPTY_STRING);
+	    if ((tmp = attributesMap.get(CSSConstants.FONT_WEIGHT)) != null)
+		fontWeigthCombo.setText(tmp);
+	    else
+		fontWeigthCombo.setText(Constants.EMPTY_STRING);
+	    if ((tmp = attributesMap.get(CSSConstants.TEXT_ALIGN)) != null)
+		textAlignCombo.setText(tmp);
+	    else
+		textAlignCombo.setText(Constants.EMPTY_STRING);
+    }
+}
\ No newline at end of file




More information about the jbosstools-commits mailing list